- Timestamp:
- 04/10/10 20:13:04 (14 years ago)
- Location:
- trunk/desktop
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/desktop/FlipSideICS.rbvcp
r24 r29 1 1 Type=Desktop 2 RBProjectVersion=20 09.012 RBProjectVersion=2010.01 3 3 Class=FlipSideICS;FlipSideICS.rbbas;&h321864E;&h0;false 4 4 Window=mainWindow;mainWindow.rbfrm;&hDF8AE23;&h0;false … … 35 35 OSXBundleID= 36 36 DebuggerCommandLine= 37 UseGDIPlus=False 38 UseBuildsFolder=True -
trunk/desktop/mainWindow.rbfrm
r28 r29 49 49 TextFont = "System" 50 50 TextSize = 0 51 TextUnit = 0 51 52 Top = 388 52 53 Underline = "" … … 78 79 TextFont = "System" 79 80 TextSize = 0 81 TextUnit = 0 80 82 Top = 388 81 83 Underline = "" … … 107 109 TextFont = "System" 108 110 TextSize = 0 111 TextUnit = 0 109 112 Top = 388 110 113 Underline = "" … … 136 139 TextFont = "System" 137 140 TextSize = 0 141 TextUnit = 0 138 142 Top = 0 139 143 Underline = "" … … 179 183 TextFont = "System" 180 184 TextSize = 0 185 TextUnit = 0 181 186 Top = 58 182 187 Underline = "" … … 223 228 TextFont = "System" 224 229 TextSize = 0 230 TextUnit = 0 225 231 Top = 331 226 232 Underline = "" … … 267 273 TextFont = "System" 268 274 TextSize = 0 275 TextUnit = 0 269 276 Top = 296 270 277 Underline = "" … … 311 318 TextFont = "System" 312 319 TextSize = 0 320 TextUnit = 0 313 321 Top = 262 314 322 Underline = "" … … 355 363 TextFont = "System" 356 364 TextSize = 0 365 TextUnit = 0 357 366 Top = 228 358 367 Underline = "" … … 399 408 TextFont = "System" 400 409 TextSize = 0 410 TextUnit = 0 401 411 Top = 195 402 412 Underline = "" … … 443 453 TextFont = "System" 444 454 TextSize = 0 455 TextUnit = 0 445 456 Top = 161 446 457 Underline = "" … … 487 498 TextFont = "System" 488 499 TextSize = 0 500 TextUnit = 0 489 501 Top = 126 490 502 Underline = "" … … 531 543 TextFont = "System" 532 544 TextSize = 0 545 TextUnit = 0 533 546 Top = 92 534 547 Underline = "" … … 563 576 TextFont = "System" 564 577 TextSize = 0 578 TextUnit = 0 565 579 Top = 58 566 580 Underline = "" … … 594 608 TextFont = "System" 595 609 TextSize = 0 610 TextUnit = 0 596 611 Top = 228 597 612 Underline = "" … … 625 640 TextFont = "System" 626 641 TextSize = 0 642 TextUnit = 0 627 643 Top = 194 628 644 Underline = "" … … 656 672 TextFont = "System" 657 673 TextSize = 0 674 TextUnit = 0 658 675 Top = 162 659 676 Underline = "" … … 687 704 TextFont = "System" 688 705 TextSize = 0 706 TextUnit = 0 689 707 Top = 126 690 708 Underline = "" … … 718 736 TextFont = "System" 719 737 TextSize = 0 738 TextUnit = 0 720 739 Top = 92 721 740 Underline = "" … … 749 768 TextFont = "System" 750 769 TextSize = 0 770 TextUnit = 0 751 771 Top = 264 752 772 Underline = "" … … 780 800 TextFont = "System" 781 801 TextSize = 0 802 TextUnit = 0 782 803 Top = 297 783 804 Underline = "" … … 811 832 TextFont = "System" 812 833 TextSize = 0 834 TextUnit = 0 813 835 Top = 333 814 836 Underline = "" … … 838 860 TabPanelIndex = 1 839 861 TabStop = True 862 TickStyle = 0 840 863 Top = 218 841 864 Value = 0 … … 881 904 TextFont = "System" 882 905 TextSize = 0 906 TextUnit = 0 883 907 Top = 218 884 908 Underline = "" … … 913 937 TextFont = "System" 914 938 TextSize = 0 939 TextUnit = 0 915 940 Top = 218 916 941 Underline = "" … … 940 965 TabPanelIndex = 1 941 966 TabStop = True 967 TickStyle = 0 942 968 Top = 186 943 969 Value = 0 … … 983 1009 TextFont = "System" 984 1010 TextSize = 0 1011 TextUnit = 0 985 1012 Top = 186 986 1013 Underline = "" … … 1015 1042 TextFont = "System" 1016 1043 TextSize = 0 1044 TextUnit = 0 1017 1045 Top = 186 1018 1046 Underline = "" … … 1045 1073 TextFont = "System" 1046 1074 TextSize = 0 1075 TextUnit = 0 1047 1076 Top = 154 1048 1077 Underline = "" … … 1076 1105 TextFont = "System" 1077 1106 TextSize = 0 1107 TextUnit = 0 1078 1108 Top = 154 1079 1109 Underline = "" … … 1106 1136 TextFont = "System" 1107 1137 TextSize = 0 1138 TextUnit = 0 1108 1139 Top = 122 1109 1140 Underline = "" … … 1137 1168 TextFont = "System" 1138 1169 TextSize = 0 1170 TextUnit = 0 1139 1171 Top = 122 1140 1172 Underline = "" … … 1167 1199 TextFont = "System" 1168 1200 TextSize = 0 1201 TextUnit = 0 1169 1202 Top = 90 1170 1203 Underline = "" … … 1198 1231 TextFont = "System" 1199 1232 TextSize = 0 1233 TextUnit = 0 1200 1234 Top = 90 1201 1235 Underline = "" … … 1228 1262 TextFont = "System" 1229 1263 TextSize = 0 1264 TextUnit = 0 1230 1265 Top = 58 1231 1266 Underline = "" … … 1259 1294 TextFont = "System" 1260 1295 TextSize = 0 1296 TextUnit = 0 1261 1297 Top = 58 1262 1298 Underline = "" … … 1289 1325 TextFont = "System" 1290 1326 TextSize = 0 1327 TextUnit = 0 1291 1328 Top = 218 1292 1329 Underline = "" … … 1320 1357 TextFont = "System" 1321 1358 TextSize = 0 1359 TextUnit = 0 1322 1360 Top = 218 1323 1361 Underline = "" … … 1350 1388 TextFont = "System" 1351 1389 TextSize = 0 1390 TextUnit = 0 1352 1391 Top = 186 1353 1392 Underline = "" … … 1381 1420 TextFont = "System" 1382 1421 TextSize = 0 1422 TextUnit = 0 1383 1423 Top = 182 1384 1424 Underline = "" … … 1408 1448 TabPanelIndex = 1 1409 1449 TabStop = True 1450 TickStyle = 0 1410 1451 Top = 154 1411 1452 Value = 0 … … 1451 1492 TextFont = "System" 1452 1493 TextSize = 0 1494 TextUnit = 0 1453 1495 Top = 153 1454 1496 Underline = "" … … 1483 1525 TextFont = "System" 1484 1526 TextSize = 0 1527 TextUnit = 0 1485 1528 Top = 153 1486 1529 Underline = "" … … 1513 1556 TextFont = "System" 1514 1557 TextSize = 0 1558 TextUnit = 0 1515 1559 Top = 122 1516 1560 Underline = "" … … 1544 1588 TextFont = "System" 1545 1589 TextSize = 0 1590 TextUnit = 0 1546 1591 Top = 122 1547 1592 Underline = "" … … 1574 1619 TextFont = "System" 1575 1620 TextSize = 0 1621 TextUnit = 0 1576 1622 Top = 90 1577 1623 Underline = "" … … 1605 1651 TextFont = "System" 1606 1652 TextSize = 0 1653 TextUnit = 0 1607 1654 Top = 91 1608 1655 Underline = "" … … 1636 1683 TextFont = "System" 1637 1684 TextSize = 0 1685 TextUnit = 0 1638 1686 Top = 58 1639 1687 Underline = "" … … 1666 1714 TextFont = "System" 1667 1715 TextSize = 0 1716 TextUnit = 0 1668 1717 Top = 58 1669 1718 Underline = "" … … 1709 1758 TextFont = "System" 1710 1759 TextSize = 0 1760 TextUnit = 0 1711 1761 Top = 126 1712 1762 Underline = "" … … 1753 1803 TextFont = "System" 1754 1804 TextSize = 0 1805 TextUnit = 0 1755 1806 Top = 92 1756 1807 Underline = "" … … 1797 1848 TextFont = "System" 1798 1849 TextSize = 0 1850 TextUnit = 0 1799 1851 Top = 58 1800 1852 Underline = "" … … 1829 1881 TextFont = "System" 1830 1882 TextSize = 0 1883 TextUnit = 0 1831 1884 Top = 60 1832 1885 Underline = "" … … 1860 1913 TextFont = "System" 1861 1914 TextSize = 0 1915 TextUnit = 0 1862 1916 Top = 93 1863 1917 Underline = "" … … 1891 1945 TextFont = "System" 1892 1946 TextSize = 0 1947 TextUnit = 0 1893 1948 Top = 126 1894 1949 Underline = "" … … 1934 1989 TextFont = "System" 1935 1990 TextSize = 0 1991 TextUnit = 0 1936 1992 Top = 329 1937 1993 Underline = "" … … 1978 2034 TextFont = "System" 1979 2035 TextSize = 0 2036 TextUnit = 0 1980 2037 Top = 295 1981 2038 Underline = "" … … 2022 2079 TextFont = "System" 2023 2080 TextSize = 0 2081 TextUnit = 0 2024 2082 Top = 261 2025 2083 Underline = "" … … 2066 2124 TextFont = "System" 2067 2125 TextSize = 0 2126 TextUnit = 0 2068 2127 Top = 227 2069 2128 Underline = "" … … 2110 2169 TextFont = "System" 2111 2170 TextSize = 0 2171 TextUnit = 0 2112 2172 Top = 193 2113 2173 Underline = "" … … 2154 2214 TextFont = "System" 2155 2215 TextSize = 0 2216 TextUnit = 0 2156 2217 Top = 158 2157 2218 Underline = "" … … 2186 2247 TextFont = "System" 2187 2248 TextSize = 0 2249 TextUnit = 0 2188 2250 Top = 160 2189 2251 Underline = "" … … 2217 2279 TextFont = "System" 2218 2280 TextSize = 0 2281 TextUnit = 0 2219 2282 Top = 194 2220 2283 Underline = "" … … 2248 2311 TextFont = "System" 2249 2312 TextSize = 0 2313 TextUnit = 0 2250 2314 Top = 228 2251 2315 Underline = "" … … 2279 2343 TextFont = "System" 2280 2344 TextSize = 0 2345 TextUnit = 0 2281 2346 Top = 262 2282 2347 Underline = "" … … 2310 2375 TextFont = "System" 2311 2376 TextSize = 0 2377 TextUnit = 0 2312 2378 Top = 296 2313 2379 Underline = "" … … 2341 2407 TextFont = "System" 2342 2408 TextSize = 0 2409 TextUnit = 0 2343 2410 Top = 330 2344 2411 Underline = "" … … 2372 2439 TextFont = "System" 2373 2440 TextSize = 22 2441 TextUnit = 0 2374 2442 Top = 57 2375 2443 Underline = True … … 2403 2471 TextFont = "System" 2404 2472 TextSize = 0 2473 TextUnit = 0 2405 2474 Top = 93 2406 2475 Underline = "" … … 2453 2522 TextFont = "System" 2454 2523 TextSize = 0 2524 TextUnit = 0 2455 2525 Top = 388 2456 2526 Underline = "" … … 2484 2554 TextFont = "System" 2485 2555 TextSize = 0 2556 TextUnit = 0 2486 2557 Top = 58 2487 2558 Underline = "" … … 2514 2585 TextFont = "System" 2515 2586 TextSize = 0 2587 TextUnit = 0 2516 2588 Top = 90 2517 2589 Underline = "" … … 2545 2617 TextFont = "System" 2546 2618 TextSize = 0 2619 TextUnit = 0 2547 2620 Top = 388 2548 2621 Underline = "" … … 2576 2649 TextFont = "System" 2577 2650 TextSize = 0 2651 TextUnit = 0 2578 2652 Top = 122 2579 2653 Underline = "" … … 2606 2680 TextFont = "System" 2607 2681 TextSize = 0 2682 TextUnit = 0 2608 2683 Top = 154 2609 2684 Underline = "" … … 2635 2710 TextFont = "System" 2636 2711 TextSize = 0 2712 TextUnit = 0 2637 2713 Top = 250 2638 2714 Underline = "" … … 2664 2740 TextFont = "System" 2665 2741 TextSize = 0 2742 TextUnit = 0 2666 2743 Top = 282 2667 2744 Underline = "" … … 2693 2770 TextFont = "System" 2694 2771 TextSize = 0 2772 TextUnit = 0 2695 2773 Top = 186 2696 2774 Underline = "" … … 2722 2800 TextFont = "System" 2723 2801 TextSize = 0 2802 TextUnit = 0 2724 2803 Top = 218 2725 2804 Underline = "" … … 2751 2830 TextFont = "System" 2752 2831 TextSize = 0 2832 TextUnit = 0 2753 2833 Top = 314 2754 2834 Underline = "" … … 2899 2979 2900 2980 #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 3005 3006 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 3079 3037 End Sub 3080 3038 #tag EndMethod … … 3105 3063 3106 3064 #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 3132 3169 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)) 3163 3243 End Sub 3164 3244 #tag EndMethod … … 3182 3262 You should have received a copy of the GNU General Public License 3183 3263 along with Flip Side ICS Software. If not, see <http://www.gnu.org/licenses/>. 3184 3185 3264 #tag EndNote 3186 3265 … … 3395 3474 ICSSerialPort1.Byte16 = chrb(me.Value) 3396 3475 //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 3398 3477 //Causing the cursor to move to the begginning of the editfield 3399 3478 if EditField_STGain.Text <> str(me.Value) then … … 3805 3884 count = System.SerialPortCount 3806 3885 3807 if comPort <> "" then3886 if PopupMenu_SerialPort.Text <> "" then 3808 3887 //We can try opening the com port and set the popup menu to that port 3809 3888
Note: See TracChangeset
for help on using the changeset viewer.