Changeset 29 for trunk


Ignore:
Timestamp:
04/10/10 20:13:04 (14 years ago)
Author:
pinwc4
Message:

Fixed bug preventing you from changing com ports

Location:
trunk/desktop
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/FlipSideICS.rbvcp

    r24 r29  
    11Type=Desktop 
    2 RBProjectVersion=2009.01 
     2RBProjectVersion=2010.01 
    33Class=FlipSideICS;FlipSideICS.rbbas;&h321864E;&h0;false 
    44Window=mainWindow;mainWindow.rbfrm;&hDF8AE23;&h0;false 
     
    3535OSXBundleID= 
    3636DebuggerCommandLine= 
     37UseGDIPlus=False 
     38UseBuildsFolder=True 
  • trunk/desktop/mainWindow.rbfrm

    r28 r29  
    4949      TextFont        =   "System" 
    5050      TextSize        =   0 
     51      TextUnit        =   0 
    5152      Top             =   388 
    5253      Underline       =   "" 
     
    7879      TextFont        =   "System" 
    7980      TextSize        =   0 
     81      TextUnit        =   0 
    8082      Top             =   388 
    8183      Underline       =   "" 
     
    107109      TextFont        =   "System" 
    108110      TextSize        =   0 
     111      TextUnit        =   0 
    109112      Top             =   388 
    110113      Underline       =   "" 
     
    136139      TextFont        =   "System" 
    137140      TextSize        =   0 
     141      TextUnit        =   0 
    138142      Top             =   0 
    139143      Underline       =   "" 
     
    179183         TextFont        =   "System" 
    180184         TextSize        =   0 
     185         TextUnit        =   0 
    181186         Top             =   58 
    182187         Underline       =   "" 
     
    223228         TextFont        =   "System" 
    224229         TextSize        =   0 
     230         TextUnit        =   0 
    225231         Top             =   331 
    226232         Underline       =   "" 
     
    267273         TextFont        =   "System" 
    268274         TextSize        =   0 
     275         TextUnit        =   0 
    269276         Top             =   296 
    270277         Underline       =   "" 
     
    311318         TextFont        =   "System" 
    312319         TextSize        =   0 
     320         TextUnit        =   0 
    313321         Top             =   262 
    314322         Underline       =   "" 
     
    355363         TextFont        =   "System" 
    356364         TextSize        =   0 
     365         TextUnit        =   0 
    357366         Top             =   228 
    358367         Underline       =   "" 
     
    399408         TextFont        =   "System" 
    400409         TextSize        =   0 
     410         TextUnit        =   0 
    401411         Top             =   195 
    402412         Underline       =   "" 
     
    443453         TextFont        =   "System" 
    444454         TextSize        =   0 
     455         TextUnit        =   0 
    445456         Top             =   161 
    446457         Underline       =   "" 
     
    487498         TextFont        =   "System" 
    488499         TextSize        =   0 
     500         TextUnit        =   0 
    489501         Top             =   126 
    490502         Underline       =   "" 
     
    531543         TextFont        =   "System" 
    532544         TextSize        =   0 
     545         TextUnit        =   0 
    533546         Top             =   92 
    534547         Underline       =   "" 
     
    563576         TextFont        =   "System" 
    564577         TextSize        =   0 
     578         TextUnit        =   0 
    565579         Top             =   58 
    566580         Underline       =   "" 
     
    594608         TextFont        =   "System" 
    595609         TextSize        =   0 
     610         TextUnit        =   0 
    596611         Top             =   228 
    597612         Underline       =   "" 
     
    625640         TextFont        =   "System" 
    626641         TextSize        =   0 
     642         TextUnit        =   0 
    627643         Top             =   194 
    628644         Underline       =   "" 
     
    656672         TextFont        =   "System" 
    657673         TextSize        =   0 
     674         TextUnit        =   0 
    658675         Top             =   162 
    659676         Underline       =   "" 
     
    687704         TextFont        =   "System" 
    688705         TextSize        =   0 
     706         TextUnit        =   0 
    689707         Top             =   126 
    690708         Underline       =   "" 
     
    718736         TextFont        =   "System" 
    719737         TextSize        =   0 
     738         TextUnit        =   0 
    720739         Top             =   92 
    721740         Underline       =   "" 
     
    749768         TextFont        =   "System" 
    750769         TextSize        =   0 
     770         TextUnit        =   0 
    751771         Top             =   264 
    752772         Underline       =   "" 
     
    780800         TextFont        =   "System" 
    781801         TextSize        =   0 
     802         TextUnit        =   0 
    782803         Top             =   297 
    783804         Underline       =   "" 
     
    811832         TextFont        =   "System" 
    812833         TextSize        =   0 
     834         TextUnit        =   0 
    813835         Top             =   333 
    814836         Underline       =   "" 
     
    838860         TabPanelIndex   =   1 
    839861         TabStop         =   True 
     862         TickStyle       =   0 
    840863         Top             =   218 
    841864         Value           =   0 
     
    881904         TextFont        =   "System" 
    882905         TextSize        =   0 
     906         TextUnit        =   0 
    883907         Top             =   218 
    884908         Underline       =   "" 
     
    913937         TextFont        =   "System" 
    914938         TextSize        =   0 
     939         TextUnit        =   0 
    915940         Top             =   218 
    916941         Underline       =   "" 
     
    940965         TabPanelIndex   =   1 
    941966         TabStop         =   True 
     967         TickStyle       =   0 
    942968         Top             =   186 
    943969         Value           =   0 
     
    9831009         TextFont        =   "System" 
    9841010         TextSize        =   0 
     1011         TextUnit        =   0 
    9851012         Top             =   186 
    9861013         Underline       =   "" 
     
    10151042         TextFont        =   "System" 
    10161043         TextSize        =   0 
     1044         TextUnit        =   0 
    10171045         Top             =   186 
    10181046         Underline       =   "" 
     
    10451073         TextFont        =   "System" 
    10461074         TextSize        =   0 
     1075         TextUnit        =   0 
    10471076         Top             =   154 
    10481077         Underline       =   "" 
     
    10761105         TextFont        =   "System" 
    10771106         TextSize        =   0 
     1107         TextUnit        =   0 
    10781108         Top             =   154 
    10791109         Underline       =   "" 
     
    11061136         TextFont        =   "System" 
    11071137         TextSize        =   0 
     1138         TextUnit        =   0 
    11081139         Top             =   122 
    11091140         Underline       =   "" 
     
    11371168         TextFont        =   "System" 
    11381169         TextSize        =   0 
     1170         TextUnit        =   0 
    11391171         Top             =   122 
    11401172         Underline       =   "" 
     
    11671199         TextFont        =   "System" 
    11681200         TextSize        =   0 
     1201         TextUnit        =   0 
    11691202         Top             =   90 
    11701203         Underline       =   "" 
     
    11981231         TextFont        =   "System" 
    11991232         TextSize        =   0 
     1233         TextUnit        =   0 
    12001234         Top             =   90 
    12011235         Underline       =   "" 
     
    12281262         TextFont        =   "System" 
    12291263         TextSize        =   0 
     1264         TextUnit        =   0 
    12301265         Top             =   58 
    12311266         Underline       =   "" 
     
    12591294         TextFont        =   "System" 
    12601295         TextSize        =   0 
     1296         TextUnit        =   0 
    12611297         Top             =   58 
    12621298         Underline       =   "" 
     
    12891325         TextFont        =   "System" 
    12901326         TextSize        =   0 
     1327         TextUnit        =   0 
    12911328         Top             =   218 
    12921329         Underline       =   "" 
     
    13201357         TextFont        =   "System" 
    13211358         TextSize        =   0 
     1359         TextUnit        =   0 
    13221360         Top             =   218 
    13231361         Underline       =   "" 
     
    13501388         TextFont        =   "System" 
    13511389         TextSize        =   0 
     1390         TextUnit        =   0 
    13521391         Top             =   186 
    13531392         Underline       =   "" 
     
    13811420         TextFont        =   "System" 
    13821421         TextSize        =   0 
     1422         TextUnit        =   0 
    13831423         Top             =   182 
    13841424         Underline       =   "" 
     
    14081448         TabPanelIndex   =   1 
    14091449         TabStop         =   True 
     1450         TickStyle       =   0 
    14101451         Top             =   154 
    14111452         Value           =   0 
     
    14511492         TextFont        =   "System" 
    14521493         TextSize        =   0 
     1494         TextUnit        =   0 
    14531495         Top             =   153 
    14541496         Underline       =   "" 
     
    14831525         TextFont        =   "System" 
    14841526         TextSize        =   0 
     1527         TextUnit        =   0 
    14851528         Top             =   153 
    14861529         Underline       =   "" 
     
    15131556         TextFont        =   "System" 
    15141557         TextSize        =   0 
     1558         TextUnit        =   0 
    15151559         Top             =   122 
    15161560         Underline       =   "" 
     
    15441588         TextFont        =   "System" 
    15451589         TextSize        =   0 
     1590         TextUnit        =   0 
    15461591         Top             =   122 
    15471592         Underline       =   "" 
     
    15741619         TextFont        =   "System" 
    15751620         TextSize        =   0 
     1621         TextUnit        =   0 
    15761622         Top             =   90 
    15771623         Underline       =   "" 
     
    16051651         TextFont        =   "System" 
    16061652         TextSize        =   0 
     1653         TextUnit        =   0 
    16071654         Top             =   91 
    16081655         Underline       =   "" 
     
    16361683         TextFont        =   "System" 
    16371684         TextSize        =   0 
     1685         TextUnit        =   0 
    16381686         Top             =   58 
    16391687         Underline       =   "" 
     
    16661714         TextFont        =   "System" 
    16671715         TextSize        =   0 
     1716         TextUnit        =   0 
    16681717         Top             =   58 
    16691718         Underline       =   "" 
     
    17091758         TextFont        =   "System" 
    17101759         TextSize        =   0 
     1760         TextUnit        =   0 
    17111761         Top             =   126 
    17121762         Underline       =   "" 
     
    17531803         TextFont        =   "System" 
    17541804         TextSize        =   0 
     1805         TextUnit        =   0 
    17551806         Top             =   92 
    17561807         Underline       =   "" 
     
    17971848         TextFont        =   "System" 
    17981849         TextSize        =   0 
     1850         TextUnit        =   0 
    17991851         Top             =   58 
    18001852         Underline       =   "" 
     
    18291881         TextFont        =   "System" 
    18301882         TextSize        =   0 
     1883         TextUnit        =   0 
    18311884         Top             =   60 
    18321885         Underline       =   "" 
     
    18601913         TextFont        =   "System" 
    18611914         TextSize        =   0 
     1915         TextUnit        =   0 
    18621916         Top             =   93 
    18631917         Underline       =   "" 
     
    18911945         TextFont        =   "System" 
    18921946         TextSize        =   0 
     1947         TextUnit        =   0 
    18931948         Top             =   126 
    18941949         Underline       =   "" 
     
    19341989         TextFont        =   "System" 
    19351990         TextSize        =   0 
     1991         TextUnit        =   0 
    19361992         Top             =   329 
    19371993         Underline       =   "" 
     
    19782034         TextFont        =   "System" 
    19792035         TextSize        =   0 
     2036         TextUnit        =   0 
    19802037         Top             =   295 
    19812038         Underline       =   "" 
     
    20222079         TextFont        =   "System" 
    20232080         TextSize        =   0 
     2081         TextUnit        =   0 
    20242082         Top             =   261 
    20252083         Underline       =   "" 
     
    20662124         TextFont        =   "System" 
    20672125         TextSize        =   0 
     2126         TextUnit        =   0 
    20682127         Top             =   227 
    20692128         Underline       =   "" 
     
    21102169         TextFont        =   "System" 
    21112170         TextSize        =   0 
     2171         TextUnit        =   0 
    21122172         Top             =   193 
    21132173         Underline       =   "" 
     
    21542214         TextFont        =   "System" 
    21552215         TextSize        =   0 
     2216         TextUnit        =   0 
    21562217         Top             =   158 
    21572218         Underline       =   "" 
     
    21862247         TextFont        =   "System" 
    21872248         TextSize        =   0 
     2249         TextUnit        =   0 
    21882250         Top             =   160 
    21892251         Underline       =   "" 
     
    22172279         TextFont        =   "System" 
    22182280         TextSize        =   0 
     2281         TextUnit        =   0 
    22192282         Top             =   194 
    22202283         Underline       =   "" 
     
    22482311         TextFont        =   "System" 
    22492312         TextSize        =   0 
     2313         TextUnit        =   0 
    22502314         Top             =   228 
    22512315         Underline       =   "" 
     
    22792343         TextFont        =   "System" 
    22802344         TextSize        =   0 
     2345         TextUnit        =   0 
    22812346         Top             =   262 
    22822347         Underline       =   "" 
     
    23102375         TextFont        =   "System" 
    23112376         TextSize        =   0 
     2377         TextUnit        =   0 
    23122378         Top             =   296 
    23132379         Underline       =   "" 
     
    23412407         TextFont        =   "System" 
    23422408         TextSize        =   0 
     2409         TextUnit        =   0 
    23432410         Top             =   330 
    23442411         Underline       =   "" 
     
    23722439         TextFont        =   "System" 
    23732440         TextSize        =   22 
     2441         TextUnit        =   0 
    23742442         Top             =   57 
    23752443         Underline       =   True 
     
    24032471         TextFont        =   "System" 
    24042472         TextSize        =   0 
     2473         TextUnit        =   0 
    24052474         Top             =   93 
    24062475         Underline       =   "" 
     
    24532522      TextFont        =   "System" 
    24542523      TextSize        =   0 
     2524      TextUnit        =   0 
    24552525      Top             =   388 
    24562526      Underline       =   "" 
     
    24842554      TextFont        =   "System" 
    24852555      TextSize        =   0 
     2556      TextUnit        =   0 
    24862557      Top             =   58 
    24872558      Underline       =   "" 
     
    25142585      TextFont        =   "System" 
    25152586      TextSize        =   0 
     2587      TextUnit        =   0 
    25162588      Top             =   90 
    25172589      Underline       =   "" 
     
    25452617      TextFont        =   "System" 
    25462618      TextSize        =   0 
     2619      TextUnit        =   0 
    25472620      Top             =   388 
    25482621      Underline       =   "" 
     
    25762649      TextFont        =   "System" 
    25772650      TextSize        =   0 
     2651      TextUnit        =   0 
    25782652      Top             =   122 
    25792653      Underline       =   "" 
     
    26062680      TextFont        =   "System" 
    26072681      TextSize        =   0 
     2682      TextUnit        =   0 
    26082683      Top             =   154 
    26092684      Underline       =   "" 
     
    26352710      TextFont        =   "System" 
    26362711      TextSize        =   0 
     2712      TextUnit        =   0 
    26372713      Top             =   250 
    26382714      Underline       =   "" 
     
    26642740      TextFont        =   "System" 
    26652741      TextSize        =   0 
     2742      TextUnit        =   0 
    26662743      Top             =   282 
    26672744      Underline       =   "" 
     
    26932770      TextFont        =   "System" 
    26942771      TextSize        =   0 
     2772      TextUnit        =   0 
    26952773      Top             =   186 
    26962774      Underline       =   "" 
     
    27222800      TextFont        =   "System" 
    27232801      TextSize        =   0 
     2802      TextUnit        =   0 
    27242803      Top             =   218 
    27252804      Underline       =   "" 
     
    27512830      TextFont        =   "System" 
    27522831      TextSize        =   0 
     2832      TextUnit        =   0 
    27532833      Top             =   314 
    27542834      Underline       =   "" 
     
    28992979 
    29002980        #tag Method, Flags = &h21 
    2901                 Private Sub updateCarScreen() 
    2902                   //Use this method to update the car screen 
    2903                    
    2904                   //Update Gain 
    2905                   Select Case ICSSerialPort1.byte03 
    2906                      
    2907                   Case chrb(&h32) 
    2908                     PopupMenu_Gain.ListIndex = 0 
    2909                      
    2910                   Case chrb(&h64) 
    2911                     PopupMenu_Gain.ListIndex = 1 
    2912                      
    2913                   Case chrb(&hFF) 
    2914                     PopupMenu_Gain.ListIndex = 2 
    2915                      
    2916                   Else 
    2917                     PopupMenu_Gain.ListIndex = 3 
    2918                      
    2919                   End Select 
    2920                    
    2921                   //Update Speed 
    2922                   Select Case ICSSerialPort1.Byte04 
    2923                      
    2924                   Case chrb(&h0A) 
    2925                     PopupMenu_Speed.ListIndex = 0 
    2926                      
    2927                   Case chrb(&h14) 
    2928                     PopupMenu_Speed.ListIndex = 1 
    2929                      
    2930                   Case chrb(&h1E) 
    2931                     PopupMenu_Speed.ListIndex = 2 
    2932                      
    2933                   Case chrb(&h28) 
    2934                     PopupMenu_Speed.ListIndex = 3 
    2935                      
    2936                   Case chrb(&hFF) 
    2937                     PopupMenu_Speed.ListIndex = 4 
    2938                      
    2939                   Else 
    2940                     PopupMenu_Speed.ListIndex = 5 
    2941                      
    2942                   End Select 
    2943                    
    2944                   //Update punch 
    2945                   Slider_Punch.Value = asc(ICSSerialPort1.Byte05) 
    2946                   EditField_Punch.Text = str(asc(ICSSerialPort1.Byte05)) 
    2947                    
    2948                   //Update DBAND 
    2949                   Select Case ICSSerialPort1.Byte06 
    2950                      
    2951                   Case chrb(&h01) 
    2952                     PopupMenu_DBand.ListIndex = 0 
    2953                      
    2954                   Case chrb(&h02) 
    2955                     PopupMenu_DBand.ListIndex = 1 
    2956                      
    2957                   Case chrb(&h03) 
    2958                     PopupMenu_DBand.ListIndex = 2 
    2959                      
    2960                   Else 
    2961                     PopupMenu_DBand.ListIndex = 3 
    2962                      
    2963                   End Select 
    2964                    
    2965                   //Update Dump 
    2966                   Select Case ICSSerialPort1.Byte07 
    2967                      
    2968                   Case chrb(&h01) 
    2969                     PopupMenu_Dump.ListIndex = 0 
    2970                      
    2971                   Case chrb(&h02) 
    2972                     PopupMenu_Dump.ListIndex = 1 
    2973                      
    2974                   Else 
    2975                     PopupMenu_Dump.ListIndex = 2 
    2976                      
    2977                   End Select 
    2978                    
    2979                   //Update DFREQ 
    2980                   Select Case ICSSerialPort1.Byte08 
    2981                      
    2982                   Case chrb(&h40) 
    2983                     PopupMenu_DFreq.ListIndex = 0 
    2984                      
    2985                   Case chrb(&h78) 
    2986                     PopupMenu_DFreq.ListIndex = 1 
    2987                      
    2988                   Case chrb(&hFF) 
    2989                     PopupMenu_DFreq.ListIndex = 2 
    2990                      
    2991                   Else 
    2992                     PopupMenu_DFreq.ListIndex = 3 
    2993                      
    2994                   End Select 
    2995                    
    2996                   //Update Nuetral 
    2997                   //Nuetral is defined by 2 bytes 
    2998                   Select Case ICSSerialPort1.Byte11 
    2999                      
    3000                   Case chrb(&h82) 
    3001                     if ICSSerialPort1.Byte12 = chrb(&h7C) then 
    3002                       PopupMenu_Nuetral.ListIndex = 0 
    3003                     else 
    3004                       PopupMenu_Nuetral.ListIndex = 3 
     2981                Private Sub readPreferences() 
     2982                  dim filePreference as FolderItem = GetFolderItem("icspref.xml") 
     2983                  dim xdoc as XmlDocument 
     2984                  dim root as XmlNode 
     2985                  dim i as Integer 
     2986                  dim count as integer 
     2987                  dim item as string 
     2988                   
     2989                  //Read the settings from the preferences file 
     2990                  if filePreference <> Nil then 
     2991                    if filePreference.Exists then 
     2992                      xdoc = New XmlDocument(filePreference) 
     2993                       
     2994                      count = xdoc.DocumentElement.ChildCount 
     2995                       
     2996                      for i = 0 to count - 1 
     2997                        root = xdoc.DocumentElement.Child(i) 
     2998                         
     2999                        item = root.FirstChild.Value 
     3000                         
     3001                        select case root.Name 
     3002                        case "comPort" 
     3003                          comPort = item 
     3004                        end select 
     3005                      next 
    30053006                    end if 
    3006                      
    3007                   Case chrb(&h88) 
    3008                     if ICSSerialPort1.Byte12 = chrb(&h78) then 
    3009                       PopupMenu_Nuetral.ListIndex = 1 
    3010                     else 
    3011                       PopupMenu_Nuetral.ListIndex = 3 
    3012                     end if 
    3013                      
    3014                   Case chrb(&h94) 
    3015                     if ICSSerialPort1.Byte12 = chrb(&h6C) then 
    3016                       PopupMenu_Nuetral.ListIndex = 2 
    3017                     else 
    3018                       PopupMenu_Nuetral.ListIndex = 3 
    3019                     end if 
    3020                      
    3021                   Else 
    3022                     PopupMenu_Nuetral.ListIndex = 3 
    3023                      
    3024                   End Select 
    3025                    
    3026                   //Update Vertial Intertia 
    3027                   Select Case ICSSerialPort1.Byte13 
    3028                      
    3029                   Case chrb(&h01) 
    3030                     PopupMenu_VerticalInteria.ListIndex = 0 
    3031                      
    3032                   Case chrb(&h02) 
    3033                     PopupMenu_VerticalInteria.ListIndex = 1 
    3034                      
    3035                   Case chrb(&h03) 
    3036                     PopupMenu_VerticalInteria.ListIndex = 2 
    3037                      
    3038                   Case chrb(&h04) 
    3039                     PopupMenu_VerticalInteria.ListIndex = 3 
    3040                      
    3041                   Case chrb(&hFF) 
    3042                     PopupMenu_VerticalInteria.ListIndex = 4 
    3043                      
    3044                   Else 
    3045                     PopupMenu_VerticalInteria.ListIndex = 5 
    3046                      
    3047                   End Select 
    3048                    
    3049                   //Update Back Timing 
    3050                   Select Case ICSSerialPort1.Byte15 
    3051                      
    3052                   Case chrb(&h01) 
    3053                     PopupMenu_BackTiming.ListIndex = 0 
    3054                      
    3055                   Case chrb(&h05) 
    3056                     PopupMenu_BackTiming.ListIndex = 1 
    3057                      
    3058                   Case chrb(&h0A) 
    3059                     PopupMenu_BackTiming.ListIndex = 2 
    3060                      
    3061                   Case chrb(&h14) 
    3062                     PopupMenu_BackTiming.ListIndex = 3 
    3063                      
    3064                   Case chrb(&h28) 
    3065                     PopupMenu_BackTiming.ListIndex = 4 
    3066                      
    3067                   Else 
    3068                     PopupMenu_BackTiming.ListIndex = 5 
    3069                      
    3070                   End Select 
    3071                    
    3072                   //Update Steering Gain 
    3073                   Slider_STGain.Value = asc(ICSSerialPort1.Byte16) 
    3074                   EditField_STGain.Text = str(asc(ICSSerialPort1.Byte16)) 
    3075                    
    3076                   //Update Throttle Gain 
    3077                   Slider_THGain.Value = asc(ICSSerialPort1.Byte17) 
    3078                   EditField_THGain.Text = str(asc(ICSSerialPort1.Byte17)) 
     3007                  end if 
     3008                   
     3009                   
     3010                End Sub 
     3011        #tag EndMethod 
     3012 
     3013        #tag Method, Flags = &h21 
     3014                Private Sub savePreferences() 
     3015                  dim xml as XmlDocument 
     3016                  dim root as XMLNode 
     3017                  dim comPortXML as XmlNode 
     3018                  dim f as FolderItem 
     3019                   
     3020                  //Save the preferences 
     3021                   
     3022                  f = GetFolderItem("icspref.xml") 
     3023                   
     3024                  if f <> Nil then 
     3025                    //Create a new XML document 
     3026                    xml = New XmlDocument 
     3027                    root = xml.AppendChild(xml.CreateElement("icspref")) 
     3028                     
     3029                    //Add elements 
     3030                    comPortXML = root.AppendChild(xml.CreateElement("comPort")) 
     3031                    comPortXML.AppendChild(xml.CreateTextNode(comPort)) 
     3032                     
     3033                    //Save the output 
     3034                    xml.SaveXml(f) 
     3035                  end if 
     3036                   
    30793037                End Sub 
    30803038        #tag EndMethod 
     
    31053063 
    31063064        #tag Method, Flags = &h21 
    3107                 Private Sub readPreferences() 
    3108                   dim filePreference as FolderItem = GetFolderItem("icspref.xml") 
    3109                   dim xdoc as XmlDocument 
    3110                   dim root as XmlNode 
    3111                   dim i as Integer 
    3112                   dim count as integer 
    3113                   dim item as string 
    3114                    
    3115                   //Read the settings from the preferences file 
    3116                   if filePreference <> Nil then 
    3117                     if filePreference.Exists then 
    3118                       xdoc = New XmlDocument(filePreference) 
    3119                        
    3120                       count = xdoc.DocumentElement.ChildCount 
    3121                        
    3122                       for i = 0 to count - 1 
    3123                         root = xdoc.DocumentElement.Child(i) 
    3124                          
    3125                         item = root.FirstChild.Value 
    3126                          
    3127                         select case root.Name 
    3128                         case "comPort" 
    3129                           comPort = item 
    3130                         end select 
    3131                       next 
     3065                Private Sub updateCarScreen() 
     3066                  //Use this method to update the car screen 
     3067                   
     3068                  //Update Gain 
     3069                  Select Case ICSSerialPort1.byte03 
     3070                     
     3071                  Case chrb(&h32) 
     3072                    PopupMenu_Gain.ListIndex = 0 
     3073                     
     3074                  Case chrb(&h64) 
     3075                    PopupMenu_Gain.ListIndex = 1 
     3076                     
     3077                  Case chrb(&hFF) 
     3078                    PopupMenu_Gain.ListIndex = 2 
     3079                     
     3080                  Else 
     3081                    PopupMenu_Gain.ListIndex = 3 
     3082                     
     3083                  End Select 
     3084                   
     3085                  //Update Speed 
     3086                  Select Case ICSSerialPort1.Byte04 
     3087                     
     3088                  Case chrb(&h0A) 
     3089                    PopupMenu_Speed.ListIndex = 0 
     3090                     
     3091                  Case chrb(&h14) 
     3092                    PopupMenu_Speed.ListIndex = 1 
     3093                     
     3094                  Case chrb(&h1E) 
     3095                    PopupMenu_Speed.ListIndex = 2 
     3096                     
     3097                  Case chrb(&h28) 
     3098                    PopupMenu_Speed.ListIndex = 3 
     3099                     
     3100                  Case chrb(&hFF) 
     3101                    PopupMenu_Speed.ListIndex = 4 
     3102                     
     3103                  Else 
     3104                    PopupMenu_Speed.ListIndex = 5 
     3105                     
     3106                  End Select 
     3107                   
     3108                  //Update punch 
     3109                  Slider_Punch.Value = asc(ICSSerialPort1.Byte05) 
     3110                  EditField_Punch.Text = str(asc(ICSSerialPort1.Byte05)) 
     3111                   
     3112                  //Update DBAND 
     3113                  Select Case ICSSerialPort1.Byte06 
     3114                     
     3115                  Case chrb(&h01) 
     3116                    PopupMenu_DBand.ListIndex = 0 
     3117                     
     3118                  Case chrb(&h02) 
     3119                    PopupMenu_DBand.ListIndex = 1 
     3120                     
     3121                  Case chrb(&h03) 
     3122                    PopupMenu_DBand.ListIndex = 2 
     3123                     
     3124                  Else 
     3125                    PopupMenu_DBand.ListIndex = 3 
     3126                     
     3127                  End Select 
     3128                   
     3129                  //Update Dump 
     3130                  Select Case ICSSerialPort1.Byte07 
     3131                     
     3132                  Case chrb(&h01) 
     3133                    PopupMenu_Dump.ListIndex = 0 
     3134                     
     3135                  Case chrb(&h02) 
     3136                    PopupMenu_Dump.ListIndex = 1 
     3137                     
     3138                  Else 
     3139                    PopupMenu_Dump.ListIndex = 2 
     3140                     
     3141                  End Select 
     3142                   
     3143                  //Update DFREQ 
     3144                  Select Case ICSSerialPort1.Byte08 
     3145                     
     3146                  Case chrb(&h40) 
     3147                    PopupMenu_DFreq.ListIndex = 0 
     3148                     
     3149                  Case chrb(&h78) 
     3150                    PopupMenu_DFreq.ListIndex = 1 
     3151                     
     3152                  Case chrb(&hFF) 
     3153                    PopupMenu_DFreq.ListIndex = 2 
     3154                     
     3155                  Else 
     3156                    PopupMenu_DFreq.ListIndex = 3 
     3157                     
     3158                  End Select 
     3159                   
     3160                  //Update Nuetral 
     3161                  //Nuetral is defined by 2 bytes 
     3162                  Select Case ICSSerialPort1.Byte11 
     3163                     
     3164                  Case chrb(&h82) 
     3165                    if ICSSerialPort1.Byte12 = chrb(&h7C) then 
     3166                      PopupMenu_Nuetral.ListIndex = 0 
     3167                    else 
     3168                      PopupMenu_Nuetral.ListIndex = 3 
    31323169                    end if 
    3133                   end if 
    3134                    
    3135                    
    3136                 End Sub 
    3137         #tag EndMethod 
    3138  
    3139         #tag Method, Flags = &h21 
    3140                 Private Sub savePreferences() 
    3141                   dim xml as XmlDocument 
    3142                   dim root as XMLNode 
    3143                   dim comPortXML as XmlNode 
    3144                   dim f as FolderItem 
    3145                    
    3146                   //Save the preferences 
    3147                    
    3148                   f = GetFolderItem("icspref.xml") 
    3149                    
    3150                   if f <> Nil then 
    3151                     //Create a new XML document 
    3152                     xml = New XmlDocument 
    3153                     root = xml.AppendChild(xml.CreateElement("icspref")) 
    3154                      
    3155                     //Add elements 
    3156                     comPortXML = root.AppendChild(xml.CreateElement("comPort")) 
    3157                     comPortXML.AppendChild(xml.CreateTextNode(comPort)) 
    3158                      
    3159                     //Save the output 
    3160                     xml.SaveXml(f) 
    3161                   end if 
    3162                    
     3170                     
     3171                  Case chrb(&h88) 
     3172                    if ICSSerialPort1.Byte12 = chrb(&h78) then 
     3173                      PopupMenu_Nuetral.ListIndex = 1 
     3174                    else 
     3175                      PopupMenu_Nuetral.ListIndex = 3 
     3176                    end if 
     3177                     
     3178                  Case chrb(&h94) 
     3179                    if ICSSerialPort1.Byte12 = chrb(&h6C) then 
     3180                      PopupMenu_Nuetral.ListIndex = 2 
     3181                    else 
     3182                      PopupMenu_Nuetral.ListIndex = 3 
     3183                    end if 
     3184                     
     3185                  Else 
     3186                    PopupMenu_Nuetral.ListIndex = 3 
     3187                     
     3188                  End Select 
     3189                   
     3190                  //Update Vertial Intertia 
     3191                  Select Case ICSSerialPort1.Byte13 
     3192                     
     3193                  Case chrb(&h01) 
     3194                    PopupMenu_VerticalInteria.ListIndex = 0 
     3195                     
     3196                  Case chrb(&h02) 
     3197                    PopupMenu_VerticalInteria.ListIndex = 1 
     3198                     
     3199                  Case chrb(&h03) 
     3200                    PopupMenu_VerticalInteria.ListIndex = 2 
     3201                     
     3202                  Case chrb(&h04) 
     3203                    PopupMenu_VerticalInteria.ListIndex = 3 
     3204                     
     3205                  Case chrb(&hFF) 
     3206                    PopupMenu_VerticalInteria.ListIndex = 4 
     3207                     
     3208                  Else 
     3209                    PopupMenu_VerticalInteria.ListIndex = 5 
     3210                     
     3211                  End Select 
     3212                   
     3213                  //Update Back Timing 
     3214                  Select Case ICSSerialPort1.Byte15 
     3215                     
     3216                  Case chrb(&h01) 
     3217                    PopupMenu_BackTiming.ListIndex = 0 
     3218                     
     3219                  Case chrb(&h05) 
     3220                    PopupMenu_BackTiming.ListIndex = 1 
     3221                     
     3222                  Case chrb(&h0A) 
     3223                    PopupMenu_BackTiming.ListIndex = 2 
     3224                     
     3225                  Case chrb(&h14) 
     3226                    PopupMenu_BackTiming.ListIndex = 3 
     3227                     
     3228                  Case chrb(&h28) 
     3229                    PopupMenu_BackTiming.ListIndex = 4 
     3230                     
     3231                  Else 
     3232                    PopupMenu_BackTiming.ListIndex = 5 
     3233                     
     3234                  End Select 
     3235                   
     3236                  //Update Steering Gain 
     3237                  Slider_STGain.Value = asc(ICSSerialPort1.Byte16) 
     3238                  EditField_STGain.Text = str(asc(ICSSerialPort1.Byte16)) 
     3239                   
     3240                  //Update Throttle Gain 
     3241                  Slider_THGain.Value = asc(ICSSerialPort1.Byte17) 
     3242                  EditField_THGain.Text = str(asc(ICSSerialPort1.Byte17)) 
    31633243                End Sub 
    31643244        #tag EndMethod 
     
    31823262                You should have received a copy of the GNU General Public License 
    31833263                along with Flip Side ICS Software.  If not, see <http://www.gnu.org/licenses/>. 
    3184                  
    31853264        #tag EndNote 
    31863265 
     
    33953474                  ICSSerialPort1.Byte16 = chrb(me.Value) 
    33963475                  //Check to see if we need to update the edit field 
    3397                   //This prevents the edit field from triggering this event that then updates the edit field again  
     3476                  //This prevents the edit field from triggering this event that then updates the edit field again 
    33983477                  //Causing the cursor to move to the begginning of the editfield 
    33993478                  if EditField_STGain.Text <> str(me.Value) then 
     
    38053884                  count = System.SerialPortCount 
    38063885                   
    3807                   if comPort <> "" then 
     3886                  if PopupMenu_SerialPort.Text <> "" then 
    38083887                    //We can try opening the com port and set the popup menu to that port 
    38093888                     
Note: See TracChangeset for help on using the changeset viewer.