Ignore:
Timestamp:
04/07/10 15:26:04 (15 years ago)
Author:
pinwc4
Message:

Begun adding checksum and database logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/mainWindow.rbfrm

    r9 r10  
    26302630 
    26312631#tag WindowCode 
    2632         #tag Method, Flags = &h0 
    2633                 Sub disableControls() 
     2632        #tag Method, Flags = &h21 
     2633                Private Sub disableControls() 
    26342634                  select case ICSSerialPort1.carType 
    26352635                     
     
    26782678        #tag EndMethod 
    26792679 
    2680         #tag Method, Flags = &h0 
    2681                 Sub updateCarScreen() 
     2680        #tag Method, Flags = &h21 
     2681                Private Sub updateCarScreen() 
    26822682                  //Use this method to update the car screen 
    26832683                   
     
    28572857        #tag EndMethod 
    28582858 
    2859         #tag Method, Flags = &h0 
    2860                 Sub updateAdvancedScreen() 
     2859        #tag Method, Flags = &h21 
     2860                Private Sub updateAdvancedScreen() 
    28612861                  //Update the fields on the advanced screen to match current values 
    28622862                  EditField_Byte1.Text = str(asc(ICSSerialPort1.byte01)) 
     
    28802880                End Sub 
    28812881        #tag EndMethod 
     2882 
     2883        #tag Method, Flags = &h21 
     2884                Private Sub readPreferences() 
     2885                  dim filePreference as FolderItem = GetFolderItem("icspref.xml") 
     2886                  dim xdoc as XmlDocument 
     2887                  dim root as XmlNode 
     2888                  dim i as Integer 
     2889                  dim count as integer 
     2890                  dim item as string 
     2891                   
     2892                  //Read the settings from the preferences file 
     2893                  if filePreference <> Nil then 
     2894                    xdoc = New XmlDocument(filePreference) 
     2895                     
     2896                    count = xdoc.DocumentElement.ChildCount 
     2897                     
     2898                    for i = 0 to count - 1 
     2899                      root = xdoc.DocumentElement.Child(i) 
     2900                       
     2901                      item = root.FirstChild.Value 
     2902                       
     2903                      select case root.Name 
     2904                      case "comPort" 
     2905                        comPort = item 
     2906                      end select 
     2907                    next 
     2908                     
     2909                  else 
     2910                    //Do nothing 
     2911                     
     2912                  end if 
     2913                End Sub 
     2914        #tag EndMethod 
     2915 
     2916        #tag Method, Flags = &h21 
     2917                Private Sub savePreferences() 
     2918                  dim xml as XmlDocument 
     2919                  dim root as XMLNode 
     2920                  dim comPortXML as XmlNode 
     2921                  dim f as FolderItem 
     2922                   
     2923                  //Save the preferences 
     2924                   
     2925                  f = GetFolderItem("icspref.xml") 
     2926                   
     2927                  if f <> Nil then 
     2928                    //Create a new XML document 
     2929                    xml = New XmlDocument 
     2930                    root = xml.AppendChild(xml.CreateElement("icspref")) 
     2931                     
     2932                    //Add elements 
     2933                    comPortXML = root.AppendChild(xml.CreateElement("comPort")) 
     2934                    comPortXML.AppendChild(xml.CreateTextNode(comPort)) 
     2935                     
     2936                    //Save the output 
     2937                    xml.SaveXml(f) 
     2938                  end if 
     2939                   
     2940                End Sub 
     2941        #tag EndMethod 
     2942 
     2943 
     2944        #tag Property, Flags = &h0 
     2945                comPort As string 
     2946        #tag EndProperty 
    28822947 
    28832948 
Note: See TracChangeset for help on using the changeset viewer.