Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/desktop/ICSSerialPort.rbbas

    r30 r20  
    22Protected Class ICSSerialPort 
    33Inherits serial 
    4         #tag Event 
    5                 Sub DataAvailable() 
    6                   //Add to the buffer first 
    7                    
    8                   buffer = buffer + me.ReadAll 
    9                    
    10                   //Figure out if we need to do anything 
    11                    
    12                   select case mode 
    13                      
    14                   case "read" 
    15                     dim flagstart as integer 
    16                     dim datastart as integer 
    17                      
    18                     //We need to decode the packet to figure out the values 
    19                      
    20                     //First we need to make sure we have enough data 
    21                     //If not we need to wait for more 
    22                      
    23                     flagstart = InStrb(buffer, ChrB(&h5A)) 
    24                      
    25                     if flagstart = 0 then 
    26                       //We did not find a match so we can discard the data and wait for more 
    27                       buffer =  "" 
    28                       return 
    29                     ElseIf lenb(buffer) < 17 + flagStart - 1 then 
    30                       // we do not have a complete packet return and wait 
    31                       return 
    32                     end if 
    33                      
    34                     datastart = flagstart + 1 
    35                      
    36                     byte03 = midb(buffer, datastart, 1) 
    37                     byte04 = midb(buffer, datastart+1, 1) 
    38                     byte05 = midb(buffer, datastart+2, 1) 
    39                     byte06 = midb(buffer, datastart+3, 1) 
    40                     byte07 = midb(buffer, datastart+4, 1) 
    41                     byte08 = midb(buffer, datastart+5, 1) 
    42                     byte09 = midb(buffer, datastart+6, 1) 
    43                     byte10 = midb(buffer, datastart+7, 1) 
    44                     byte11 = midb(buffer, datastart+8, 1) 
    45                     byte12 = midb(buffer, datastart+9, 1) 
    46                     byte13 = midb(buffer, datastart+10, 1) 
    47                     byte14 = midb(buffer, datastart+11, 1) 
    48                     byte15 = midb(buffer, datastart+12, 1) 
    49                     byte16 = midb(buffer, datastart+13, 1) 
    50                     byte17 = midb(buffer, datastart+14, 1) 
    51                      
    52                     valuesChanged() 
     4        #tag Method, Flags = &h0 
     5                Sub resetCar() 
     6                  //This sends the command to reset the car back to a default configuration 
     7                  //Defaults are different for each car type 
     8                  setDefaultValues 
     9                   
     10                  //Send the default values to the car 
     11                  writeCar 
     12                End Sub 
     13        #tag EndMethod 
     14 
     15        #tag Method, Flags = &h0 
     16                Sub setDefaultValues() 
     17                  //Set the defaults for the bytes sent to a car 
     18                   
     19                  select case carType 
     20                     
     21                  case "MR-03" 
     22                    byte01 = chrb(&hD5) 
     23                    byte02 = chrb(&h5A) 
     24                    byte03 = chrb(&h64) 
     25                    byte04 = chrb(&hFF) 
     26                    byte05 = chrb(&h02) 
     27                    byte06 = chrb(&h02) 
     28                    byte07 = chrb(&h01) 
     29                    byte08 = chrb(&hFF) 
     30                    byte09 = chrb(&hBC) 
     31                    byte10 = chrb(&h44) 
     32                    byte11 = chrb(&h88) 
     33                    byte12 = chrb(&h78) 
     34                    byte13 = chrb(&hFF) 
     35                    byte14 = chrb(&h2C) 
     36                    byte15 = chrb(&h05) 
     37                    byte16 = chrb(&h5A) 
     38                    byte17 = chrb(&h3C) 
     39                    byte18 = chrb(&h87) 
     40                     
     41                  case "dNaNo" 
     42                    byte01 = chrb(&hD5) 
     43                    byte02 = chrb(&h5A) 
     44                    byte03 = chrb(&hFF) 
     45                    byte04 = chrb(&hFF) 
     46                    byte05 = chrb(&h0A) 
     47                    byte06 = chrb(&h03) 
     48                    byte07 = chrb(&h01) 
     49                    byte08 = chrb(&h40) 
     50                    byte09 = chrb(&hBC) 
     51                    byte10 = chrb(&h44) 
     52                    byte11 = chrb(&h88) 
     53                    byte12 = chrb(&h78) 
     54                    byte13 = chrb(&h03) 
     55                    byte14 = chrb(&hFF) 
     56                    byte15 = chrb(&hFF) 
     57                    byte16 = chrb(&h80) 
     58                    byte17 = chrb(&h80) 
     59                    byte18 = chrb(&hA7) 
     60                     
     61                  case "ASF" 
     62                    byte01 = chrb(&hD5) 
     63                    byte02 = chrb(&h5A) 
     64                    byte03 = chrb(&hFF) 
     65                    byte04 = chrb(&hFF) 
     66                    byte05 = chrb(&h0A) 
     67                    byte06 = chrb(&h03) 
     68                    byte07 = chrb(&h01) 
     69                    byte08 = chrb(&h78) 
     70                    byte09 = chrb(&hBC) 
     71                    byte10 = chrb(&h44) 
     72                    byte11 = chrb(&h88) 
     73                    byte12 = chrb(&h78) 
     74                    byte13 = chrb(&h03) 
     75                    byte14 = chrb(&hFF) 
     76                    byte15 = chrb(&hFF) 
     77                    byte16 = chrb(&hFF) 
     78                    byte17 = chrb(&hFF) 
     79                    byte18 = chrb(&hDD) 
    5380                     
    5481                  else 
    55                      
    56                     //We do not care about the data, discard it 
    57                     buffer = "" 
    58                      
     82                    //default thing to do 
     83                    MsgBox "Error invalid car type" 
     84                    return 
    5985                  end select 
    60                 End Sub 
    61         #tag EndEvent 
    62  
     86                   
     87                  //trigger the event definition so main program knows the values changed 
     88                  valuesChanged() 
     89                End Sub 
     90        #tag EndMethod 
     91 
     92        #tag Method, Flags = &h0 
     93                Sub setCarType(value as string) 
     94                  //When setting car type we must reconfigure the serial port 
     95                  //Some car types have a different baud rate 
     96                   
     97                  select case value 
     98                     
     99                  case "MR-03" 
     100                    carType = value 
     101                    byte15 = chrb(&h05) 
     102                    byte16 = chrb(&h5A) 
     103                    byte17 = chrb(&h3C) 
     104                  case "dNaNo" 
     105                    carType = value 
     106                    byte15 = chrb(&hFF) 
     107                    byte16 = chrb(&h80) 
     108                    byte17 = chrb(&h80) 
     109                  case "ASF" 
     110                    carType = value 
     111                    byte15 = chrb(&hFF) 
     112                    byte16 = chrb(&hFF) 
     113                    byte17 = chrb(&hFF) 
     114                     
     115                  else 
     116                    MsgBox "Error setting Car Type" 
     117                  end select 
     118                   
     119                  valuesChanged() 
     120                End Sub 
     121        #tag EndMethod 
     122 
     123        #tag Method, Flags = &h0 
     124                Sub writeCar() 
     125                  //Send set bytes to the car 
     126                  mode = "write" 
     127                   
     128                  dim sendstring as string 
     129                   
     130                  calculateChecksum() 
     131                   
     132                  sendstring = byte01 + byte02 + byte03 + byte04 + byte05 + byte06 + byte07 + byte08 + byte09 + byte10 + byte11 + byte12 + byte13 + byte14 + byte15 + byte16 + byte17 + byte18 
     133                   
     134                  me.Write(sendstring) 
     135                End Sub 
     136        #tag EndMethod 
    63137 
    64138        #tag Method, Flags = &h0 
     
    86160                   
    87161                  byte18 = chrb(i) 
     162                End Sub 
     163        #tag EndMethod 
     164 
     165        #tag Method, Flags = &h0 
     166                Sub readCar() 
     167                  //Read values from the currently attached car 
     168                   
     169                  mode = "read" 
    88170                End Sub 
    89171        #tag EndMethod 
     
    127209                  carType = "MR-03" 
    128210                End Sub 
     211        #tag EndMethod 
     212 
     213        #tag Method, Flags = &h21 
     214                Private Function prepareDB() As Boolean 
     215                  //Open the database file 
     216                  fsicsdb = new REALSQLDatabase 
     217                  dim f as FolderItem = GetFolderItem("fsicsdb") 
     218                  fsicsdb.DatabaseFile = f 
     219                   
     220                  return f.Exists 
     221                End Function 
    129222        #tag EndMethod 
    130223 
     
    234327 
    235328        #tag Method, Flags = &h0 
    236                 Sub exportProfile(theName as string) 
    237                   dim xml as XmlDocument 
    238                   dim root as XmlNode 
    239                   dim rootchild as XmlNode 
     329                Sub saveProfile(theName as String) 
    240330                  dim rs as RecordSet 
    241                   dim i as integer 
    242                   dim dlg as SaveAsDialog 
    243                   dim f as FolderItem 
    244                    
    245                   dlg = New SaveAsDialog 
    246                   dlg.Title = "Export your profile" 
    247                   #if TargetLinux 
    248                     dlg.InitialDirectory = SpecialFolder.Home 
    249                   #else 
    250                     dlg.InitialDirectory = SpecialFolder.Documents 
    251                   #endif 
    252                    
    253                   dlg.SuggestedFileName = "ics_"+theName+".xml" 
    254                   f = dlg.ShowModal() 
    255                    
    256                   if f <> Nil then 
    257                     //Nothing to see here, move along 
    258                   else 
    259                     MsgBox "You must choose a file" 
    260                     Return 
     331                  dim status as Boolean 
     332                   
     333                  //Find a record 
     334                  rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'") 
     335                   
     336                  //Make sure we got a record 
     337                  if rs <> nil then 
     338                    //delete the record before saving 
     339                    deleteProfile(theName) 
    261340                  end if 
    262341                   
    263                   //Find the record 
    264                   rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'") 
    265                    
    266                   if rs <> Nil then 
    267                     //We have a record, so do something 
    268                      
    269                     //Create the root element of the XML file 
    270                     xml = New XmlDocument 
    271                     root = xml.AppendChild(xml.CreateElement("icsprofile")) 
    272                      
    273                     //Itterate all available fields and write them to the xml document 
    274                     for i = 1 to rs.FieldCount 
    275                       if rs.IdxField(i).Name <> "" and rs.IdxField(i).StringValue<> "" then 
    276                          
    277                         rootchild = root.AppendChild(xml.CreateElement(rs.IdxField(i).Name)) 
    278                         rootchild.AppendChild(xml.CreateTextNode(rs.IdxField(i).StringValue)) 
    279                       end if 
    280                     next 
    281                      
    282                     //Write the document to a file 
    283                     xml.SaveXml(f) 
    284                   else 
    285                     MsgBox "No profile to export" 
    286                     Return 
    287                   end if 
    288                    
    289                 End Sub 
    290         #tag EndMethod 
    291  
    292         #tag Method, Flags = &h0 
    293                 Function importProfile() As Boolean 
    294                   dim success as boolean 
    295                   dim dlg as OpenDialog 
    296                   dim f as FolderItem 
    297                   dim xdoc as XmlDocument 
    298                   dim root as XmlNode 
    299                   dim i as integer 
    300                   dim count as Integer 
    301                   dim item as string 
    302                   dim rec as DatabaseRecord 
    303                   dim theName as string 
    304                    
    305                   rec = New DatabaseRecord 
    306                   success = False 
    307                    
    308                    
    309                   //Get the user to select a file 
    310                   dlg = New OpenDialog 
    311                   dlg.Title = "Select a profile to import" 
    312                   #if TargetLinux 
    313                     dlg.InitialDirectory = SpecialFolder.Home 
    314                   #else 
    315                     dlg.InitialDirectory = SpecialFolder.Documents 
    316                   #endif 
    317                   f = dlg.ShowModal() 
    318                    
    319                   //If we have a valid file we need to read it as an xml file to process it 
    320                   //Items are individually specified to prevent the program from trying to insert columns that do not exist 
    321                   //All column names should match the database table 
    322                    
    323                   if f <> nil then 
    324                      
    325                     //Read the XML file 
    326                     xdoc = New XmlDocument(f) 
    327                      
    328                     count = xdoc.DocumentElement.ChildCount 
    329                      
    330                     for i = 0 to count - 1 
    331                       root = xdoc.DocumentElement.Child(i) 
    332                        
    333                       item = root.FirstChild.Value 
    334                        
    335                       select case root.Name 
    336                          
    337                       case "name" 
    338                         theName = item 
    339                       case "cartype" 
    340                         carType = item 
    341                       case "byte01" 
    342                         byte01 = chrb(val(item)) 
    343                       case "byte02" 
    344                         byte02 = chrb(val(item)) 
    345                       case "byte03" 
    346                         byte03 = chrb(val(item)) 
    347                       case "byte04" 
    348                         byte04 = chrb(val(item)) 
    349                       case "byte05" 
    350                         byte05 = chrb(val(item)) 
    351                       case "byte06" 
    352                         byte06 = chrb(val(item)) 
    353                       case "byte07" 
    354                         byte07 = chrb(val(item)) 
    355                       case "byte08" 
    356                         byte08 = chrb(val(item)) 
    357                       case "byte09" 
    358                         byte09 = chrb(val(item)) 
    359                       case "byte10" 
    360                         byte10 = chrb(val(item)) 
    361                       case "byte11" 
    362                         byte11 = chrb(val(item)) 
    363                       case "byte12" 
    364                         byte12 = chrb(val(item)) 
    365                       case "byte13" 
    366                         byte13 = chrb(val(item)) 
    367                       case "byte14" 
    368                         byte14 = chrb(val(item)) 
    369                       case "byte15" 
    370                         byte15 = chrb(val(item)) 
    371                       case "byte16" 
    372                         byte16 = chrb(val(item)) 
    373                       case "byte17" 
    374                         byte17 = chrb(val(item)) 
    375                       case "byte18" 
    376                         byte18 = chrb(val(item)) 
    377                          
    378                       end select 
    379                        
    380                     next 
    381                      
    382                   else 
    383                     //File not select we can stop 
    384                     success = False 
    385                     return success 
    386                   end if 
    387                    
    388                   //Now check to make sure their is not an existing profile with this name 
    389                   dim rs as RecordSet 
    390                    
    391                   rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'") 
    392                    
    393                   if rs <> Nil then 
    394                      
    395                     if rs.RecordCount > 0 then 
    396                       //we have a duplicate record 
    397                       //we need to prompt the user about what to do 
    398                       dim d as New MessageDialog 
    399                       dim b as MessageDialogButton 
    400                       d.Icon = MessageDialog.GraphicCaution 
    401                       d.ActionButton.Caption = "Yes" 
    402                       d.CancelButton.Visible = True 
    403                       d.CancelButton.Caption = "No" 
    404                       d.Message = "A profile exists with this name, do you want to overwrite the existing profile?" 
    405                       b = d.ShowModal 
    406                        
    407                       //Now determine what the user chose 
    408                       Select Case b 
    409                       case d.ActionButton 
    410                         //The user wants to overwrite the record so we can just save what we have 
    411                         saveProfile(theName) 
    412                         success = True 
    413                         //Values changed because of the overwrite 
    414                         valuesChanged() 
    415                       case d.CancelButton 
    416                         //The user chose not to overwrite the record, we need to come up with a new name 
    417                         //We will increment the number until we find a name not used or we hit 32 just in case an infinite loop would occur 
    418                         dim tempString as string 
    419                         dim tempName as string 
    420                         i = 0 
    421                         while rs.RecordCount > 0 
    422                           i = i + 1 
    423                           tempString = str(i) 
    424                           tempName = theName + tempString 
    425                           //Check to make sure we are not in an infinite looooooooop 
    426                           //If we are something went wrong 
    427                           if i > 31 then 
    428                             exit While 
    429                           end if 
    430                           rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name = '"+tempName+"'") 
    431                            
    432                         wend 
    433                         //OK we have a unique name at this point 
    434                         theName = theName + tempString 
    435                         saveProfile(theName) 
    436                         success = True 
    437                         //new profile was imported 
    438                         profileImported(theName) 
    439                       end select 
    440                        
    441                     else 
    442                       //No duplicate exists so we can just insert the record 
    443                       saveProfile(theName) 
    444                       success = True 
    445                       //new profile was imported 
    446                       profileImported(theName) 
    447                     end if 
    448                     //Close our record 
    449                     rs.Close 
    450                      
    451                   end if 
    452                    
    453                   Return success 
    454                    
    455                 End Function 
     342                  rs.Close 
     343                   
     344                  status = createProfile(theName) 
     345                End Sub 
    456346        #tag EndMethod 
    457347 
     
    552442        #tag EndMethod 
    553443 
    554         #tag Method, Flags = &h21 
    555                 Private Function prepareDB() As Boolean 
    556                   //Open the database file 
    557                   fsicsdb = new REALSQLDatabase 
    558                   dim f as FolderItem = GetFolderItem("fsicsdb") 
    559                   fsicsdb.DatabaseFile = f 
    560                    
    561                   return f.Exists 
    562                 End Function 
    563         #tag EndMethod 
    564  
    565         #tag Method, Flags = &h0 
    566                 Sub readCar() 
    567                   //Read values from the currently attached car 
    568                   dim sendstring as string 
    569                    
    570                   mode = "read" 
    571                    
    572                   sendstring = chrb(&hC5) 
    573                    
    574                   me.Write(sendstring) 
    575                 End Sub 
    576         #tag EndMethod 
    577  
    578         #tag Method, Flags = &h0 
    579                 Sub resetCar() 
    580                   //This sends the command to reset the car back to a default configuration 
    581                   //Defaults are different for each car type 
    582                   setDefaultValues 
    583                    
    584                   //Send the default values to the car 
    585                   writeCar 
    586                 End Sub 
    587         #tag EndMethod 
    588  
    589         #tag Method, Flags = &h0 
    590                 Sub saveProfile(theName as String) 
    591                   if theName <> "" then 
    592                      
    593                     dim rs as RecordSet 
    594                     dim status as Boolean 
    595                      
    596                     //Find a record 
    597                     rs = fsicsdb.SQLSelect("SELECT * FROM carprofiles WHERE name= '"+theName+"'") 
    598                      
    599                     //Make sure we got a record 
    600                     if rs <> nil then 
    601                       //delete the record before saving 
    602                       deleteProfile(theName) 
    603                     end if 
    604                      
    605                     rs.Close 
    606                      
    607                     status = createProfile(theName) 
    608                      
    609                   else 
    610                      
    611                     MsgBox "Please select a profile to modify" 
    612                      
    613                   end if 
    614                 End Sub 
    615         #tag EndMethod 
    616  
    617         #tag Method, Flags = &h0 
    618                 Sub setCarType(value as string) 
    619                   //When setting car type we must reconfigure the serial port 
    620                   //Some car types have a different baud rate 
    621                    
    622                   select case value 
    623                      
    624                   case "MR-03" 
    625                     carType = value 
    626                     byte15 = chrb(&h05) 
    627                     byte16 = chrb(&h5A) 
    628                     byte17 = chrb(&h3C) 
    629                   case "dNaNo" 
    630                     carType = value 
    631                     byte15 = chrb(&hFF) 
    632                     byte16 = chrb(&h80) 
    633                     byte17 = chrb(&h80) 
    634                   case "ASF" 
    635                     carType = value 
    636                     byte15 = chrb(&hFF) 
    637                     byte16 = chrb(&hFF) 
    638                     byte17 = chrb(&hFF) 
    639                      
    640                   else 
    641                     MsgBox "Error setting Car Type" 
    642                   end select 
    643                    
    644                   valuesChanged() 
    645                 End Sub 
    646         #tag EndMethod 
    647  
    648         #tag Method, Flags = &h0 
    649                 Sub setDefaultValues() 
    650                   //Set the defaults for the bytes sent to a car 
    651                    
    652                   select case carType 
    653                      
    654                   case "MR-03" 
    655                     byte01 = chrb(&hD5) 
    656                     byte02 = chrb(&h5A) 
    657                     byte03 = chrb(&h64) 
    658                     byte04 = chrb(&hFF) 
    659                     byte05 = chrb(&h02) 
    660                     byte06 = chrb(&h02) 
    661                     byte07 = chrb(&h01) 
    662                     byte08 = chrb(&hFF) 
    663                     byte09 = chrb(&hBC) 
    664                     byte10 = chrb(&h44) 
    665                     byte11 = chrb(&h88) 
    666                     byte12 = chrb(&h78) 
    667                     byte13 = chrb(&hFF) 
    668                     byte14 = chrb(&h2C) 
    669                     byte15 = chrb(&h05) 
    670                     byte16 = chrb(&h5A) 
    671                     byte17 = chrb(&h3C) 
    672                     byte18 = chrb(&h87) 
    673                      
    674                   case "dNaNo" 
    675                     byte01 = chrb(&hD5) 
    676                     byte02 = chrb(&h5A) 
    677                     byte03 = chrb(&hFF) 
    678                     byte04 = chrb(&hFF) 
    679                     byte05 = chrb(&h0A) 
    680                     byte06 = chrb(&h03) 
    681                     byte07 = chrb(&h01) 
    682                     byte08 = chrb(&h40) 
    683                     byte09 = chrb(&hBC) 
    684                     byte10 = chrb(&h44) 
    685                     byte11 = chrb(&h88) 
    686                     byte12 = chrb(&h78) 
    687                     byte13 = chrb(&h03) 
    688                     byte14 = chrb(&hFF) 
    689                     byte15 = chrb(&hFF) 
    690                     byte16 = chrb(&h80) 
    691                     byte17 = chrb(&h80) 
    692                     byte18 = chrb(&hA7) 
    693                      
    694                   case "ASF" 
    695                     byte01 = chrb(&hD5) 
    696                     byte02 = chrb(&h5A) 
    697                     byte03 = chrb(&hFF) 
    698                     byte04 = chrb(&hFF) 
    699                     byte05 = chrb(&h0A) 
    700                     byte06 = chrb(&h03) 
    701                     byte07 = chrb(&h01) 
    702                     byte08 = chrb(&h78) 
    703                     byte09 = chrb(&hBC) 
    704                     byte10 = chrb(&h44) 
    705                     byte11 = chrb(&h88) 
    706                     byte12 = chrb(&h78) 
    707                     byte13 = chrb(&h03) 
    708                     byte14 = chrb(&hFF) 
    709                     byte15 = chrb(&hFF) 
    710                     byte16 = chrb(&hFF) 
    711                     byte17 = chrb(&hFF) 
    712                     byte18 = chrb(&hDD) 
    713                      
    714                   else 
    715                     //default thing to do 
    716                     MsgBox "Error invalid car type" 
    717                     return 
    718                   end select 
    719                    
    720                   //trigger the event definition so main program knows the values changed 
    721                   valuesChanged() 
    722                 End Sub 
    723         #tag EndMethod 
    724  
    725         #tag Method, Flags = &h0 
    726                 Sub writeCar() 
    727                   //Send set bytes to the car 
    728                   mode = "write" 
    729                    
    730                   dim sendstring as string 
    731                    
    732                   calculateChecksum() 
    733                    
    734                   sendstring = byte01 + byte02 + byte03 + byte04 + byte05 + byte06 + byte07 + byte08 + byte09 + byte10 + byte11 + byte12 + byte13 + byte14 + byte15 + byte16 + byte17 + byte18 
    735                    
    736                   me.Write(sendstring) 
    737                 End Sub 
    738         #tag EndMethod 
    739  
    740  
    741         #tag Hook, Flags = &h0 
    742                 Event profileImported(profileName as string) 
    743         #tag EndHook 
    744444 
    745445        #tag Hook, Flags = &h0 
     
    756456        #tag EndNote 
    757457 
    758         #tag Note, Name = License 
    759                 Copyright 2010 Jeremy Auten 
    760                  
    761                 This file is part of Flip Side ICS Software. 
    762                  
    763                 Flip Side ICS Software is free software: you can redistribute it and/or modify 
    764                 it under the terms of the GNU General Public License as published by 
    765                 the Free Software Foundation, either version 3 of the License, or 
    766                 (at your option) any later version. 
    767                  
    768                 Flip Side ICS Software is distributed in the hope that it will be useful, 
    769                 but WITHOUT ANY WARRANTY; without even the implied warranty of 
    770                 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    771                 GNU General Public License for more details. 
    772                  
    773                 You should have received a copy of the GNU General Public License 
    774                 along with Flip Side ICS Software.  If not, see <http://www.gnu.org/licenses/>. 
    775         #tag EndNote 
    776  
    777  
    778         #tag Property, Flags = &h21 
    779                 Private buffer As String 
    780         #tag EndProperty 
    781458 
    782459        #tag Property, Flags = &h0 
     
    785462 
    786463        #tag Property, Flags = &h0 
     464                byte11 As String 
     465        #tag EndProperty 
     466 
     467        #tag Property, Flags = &h0 
     468                byte12 As String 
     469        #tag EndProperty 
     470 
     471        #tag Property, Flags = &h0 
     472                byte13 As String 
     473        #tag EndProperty 
     474 
     475        #tag Property, Flags = &h0 
     476                byte14 As String 
     477        #tag EndProperty 
     478 
     479        #tag Property, Flags = &h0 
     480                byte15 As String 
     481        #tag EndProperty 
     482 
     483        #tag Property, Flags = &h0 
     484                byte16 As String 
     485        #tag EndProperty 
     486 
     487        #tag Property, Flags = &h0 
     488                byte17 As String 
     489        #tag EndProperty 
     490 
     491        #tag Property, Flags = &h0 
     492                byte18 As String 
     493        #tag EndProperty 
     494 
     495        #tag Property, Flags = &h0 
    787496                byte02 As String 
    788497        #tag EndProperty 
     
    821530 
    822531        #tag Property, Flags = &h0 
    823                 byte11 As String 
    824         #tag EndProperty 
    825  
    826         #tag Property, Flags = &h0 
    827                 byte12 As String 
    828         #tag EndProperty 
    829  
    830         #tag Property, Flags = &h0 
    831                 byte13 As String 
    832         #tag EndProperty 
    833  
    834         #tag Property, Flags = &h0 
    835                 byte14 As String 
    836         #tag EndProperty 
    837  
    838         #tag Property, Flags = &h0 
    839                 byte15 As String 
    840         #tag EndProperty 
    841  
    842         #tag Property, Flags = &h0 
    843                 byte16 As String 
    844         #tag EndProperty 
    845  
    846         #tag Property, Flags = &h0 
    847                 byte17 As String 
    848         #tag EndProperty 
    849  
    850         #tag Property, Flags = &h0 
    851                 byte18 As String 
    852         #tag EndProperty 
    853  
    854         #tag Property, Flags = &h21 
    855                 Private carType As String = "MR-03" 
     532                carType As String = "MR-03" 
    856533        #tag EndProperty 
    857534 
     
    860537        #tag EndProperty 
    861538 
    862         #tag Property, Flags = &h21 
    863                 Private mode As String = "none" 
     539        #tag Property, Flags = &h0 
     540                mode As String = "read" 
    864541        #tag EndProperty 
    865542 
    866543 
    867544        #tag ViewBehavior 
     545                #tag ViewProperty 
     546                        Name="Name" 
     547                        Visible=true 
     548                        Group="ID" 
     549                        InheritedFrom="serial" 
     550                #tag EndViewProperty 
     551                #tag ViewProperty 
     552                        Name="Index" 
     553                        Visible=true 
     554                        Group="ID" 
     555                        Type="Integer" 
     556                        InheritedFrom="serial" 
     557                #tag EndViewProperty 
     558                #tag ViewProperty 
     559                        Name="Super" 
     560                        Visible=true 
     561                        Group="ID" 
     562                        InheritedFrom="serial" 
     563                #tag EndViewProperty 
     564                #tag ViewProperty 
     565                        Name="Left" 
     566                        Visible=true 
     567                        Group="Position" 
     568                        InheritedFrom="serial" 
     569                #tag EndViewProperty 
     570                #tag ViewProperty 
     571                        Name="Top" 
     572                        Visible=true 
     573                        Group="Position" 
     574                        InheritedFrom="serial" 
     575                #tag EndViewProperty 
    868576                #tag ViewProperty 
    869577                        Name="Baud" 
     
    909617                #tag EndViewProperty 
    910618                #tag ViewProperty 
    911                         Name="byte01" 
    912                         Group="Behavior" 
    913                         InitialValue="&hFF" 
    914                         Type="String" 
    915                         EditorType="MultiLineEditor" 
    916                 #tag EndViewProperty 
    917                 #tag ViewProperty 
    918                         Name="byte02" 
    919                         Group="Behavior" 
    920                         Type="String" 
    921                         EditorType="MultiLineEditor" 
    922                 #tag EndViewProperty 
    923                 #tag ViewProperty 
    924                         Name="byte03" 
    925                         Group="Behavior" 
    926                         Type="String" 
    927                         EditorType="MultiLineEditor" 
    928                 #tag EndViewProperty 
    929                 #tag ViewProperty 
    930                         Name="byte04" 
    931                         Group="Behavior" 
    932                         Type="String" 
    933                         EditorType="MultiLineEditor" 
    934                 #tag EndViewProperty 
    935                 #tag ViewProperty 
    936                         Name="byte05" 
    937                         Group="Behavior" 
    938                         Type="String" 
    939                         EditorType="MultiLineEditor" 
    940                 #tag EndViewProperty 
    941                 #tag ViewProperty 
    942                         Name="byte06" 
    943                         Group="Behavior" 
    944                         Type="String" 
    945                         EditorType="MultiLineEditor" 
    946                 #tag EndViewProperty 
    947                 #tag ViewProperty 
    948                         Name="byte07" 
    949                         Group="Behavior" 
    950                         Type="String" 
    951                         EditorType="MultiLineEditor" 
    952                 #tag EndViewProperty 
    953                 #tag ViewProperty 
    954                         Name="byte08" 
    955                         Group="Behavior" 
    956                         Type="String" 
    957                         EditorType="MultiLineEditor" 
    958                 #tag EndViewProperty 
    959                 #tag ViewProperty 
    960                         Name="byte09" 
    961                         Group="Behavior" 
    962                         Type="String" 
    963                         EditorType="MultiLineEditor" 
    964                 #tag EndViewProperty 
    965                 #tag ViewProperty 
    966                         Name="byte10" 
    967                         Group="Behavior" 
    968                         Type="String" 
    969                         EditorType="MultiLineEditor" 
    970                 #tag EndViewProperty 
    971                 #tag ViewProperty 
    972                         Name="byte11" 
    973                         Group="Behavior" 
    974                         Type="String" 
    975                         EditorType="MultiLineEditor" 
    976                 #tag EndViewProperty 
    977                 #tag ViewProperty 
    978                         Name="byte12" 
    979                         Group="Behavior" 
    980                         Type="String" 
    981                         EditorType="MultiLineEditor" 
    982                 #tag EndViewProperty 
    983                 #tag ViewProperty 
    984                         Name="byte13" 
    985                         Group="Behavior" 
    986                         Type="String" 
    987                         EditorType="MultiLineEditor" 
    988                 #tag EndViewProperty 
    989                 #tag ViewProperty 
    990                         Name="byte14" 
    991                         Group="Behavior" 
    992                         Type="String" 
    993                         EditorType="MultiLineEditor" 
    994                 #tag EndViewProperty 
    995                 #tag ViewProperty 
    996                         Name="byte15" 
    997                         Group="Behavior" 
    998                         Type="String" 
    999                         EditorType="MultiLineEditor" 
    1000                 #tag EndViewProperty 
    1001                 #tag ViewProperty 
    1002                         Name="byte16" 
    1003                         Group="Behavior" 
    1004                         Type="String" 
    1005                         EditorType="MultiLineEditor" 
    1006                 #tag EndViewProperty 
    1007                 #tag ViewProperty 
    1008                         Name="byte17" 
    1009                         Group="Behavior" 
    1010                         Type="String" 
    1011                         EditorType="MultiLineEditor" 
    1012                 #tag EndViewProperty 
    1013                 #tag ViewProperty 
    1014                         Name="byte18" 
    1015                         Group="Behavior" 
    1016                         Type="String" 
    1017                         EditorType="MultiLineEditor" 
    1018                 #tag EndViewProperty 
    1019                 #tag ViewProperty 
    1020                         Name="carType" 
    1021                         Group="Behavior" 
    1022                         InitialValue="MR-03" 
    1023                         Type="String" 
    1024                         EditorType="MultiLineEditor" 
    1025                 #tag EndViewProperty 
    1026                 #tag ViewProperty 
    1027                         Name="CTS" 
    1028                         Visible=true 
    1029                         Group="Behavior" 
    1030                         Type="Boolean" 
    1031                         InheritedFrom="serial" 
    1032                 #tag EndViewProperty 
    1033                 #tag ViewProperty 
    1034                         Name="DTR" 
    1035                         Visible=true 
    1036                         Group="Behavior" 
    1037                         Type="Boolean" 
    1038                         InheritedFrom="serial" 
    1039                 #tag EndViewProperty 
    1040                 #tag ViewProperty 
    1041                         Name="Index" 
    1042                         Visible=true 
    1043                         Group="ID" 
    1044                         Type="Integer" 
    1045                         InheritedFrom="serial" 
    1046                 #tag EndViewProperty 
    1047                 #tag ViewProperty 
    1048                         Name="Left" 
    1049                         Visible=true 
    1050                         Group="Position" 
    1051                         InheritedFrom="serial" 
    1052                 #tag EndViewProperty 
    1053                 #tag ViewProperty 
    1054                         Name="mode" 
    1055                         Group="Behavior" 
    1056                         InitialValue="read" 
    1057                         Type="String" 
    1058                         EditorType="MultiLineEditor" 
    1059                 #tag EndViewProperty 
    1060                 #tag ViewProperty 
    1061                         Name="Name" 
    1062                         Visible=true 
    1063                         Group="ID" 
    1064                         InheritedFrom="serial" 
    1065                 #tag EndViewProperty 
    1066                 #tag ViewProperty 
    1067619                        Name="Parity" 
    1068620                        Visible=true 
     
    1093645                #tag EndViewProperty 
    1094646                #tag ViewProperty 
    1095                         Name="Super" 
    1096                         Visible=true 
    1097                         Group="ID" 
    1098                         InheritedFrom="serial" 
    1099                 #tag EndViewProperty 
    1100                 #tag ViewProperty 
    1101                         Name="Top" 
    1102                         Visible=true 
    1103                         Group="Position" 
    1104                         InheritedFrom="serial" 
    1105                 #tag EndViewProperty 
    1106                 #tag ViewProperty 
    1107647                        Name="XON" 
    1108648                        Visible=true 
     
    1110650                        Type="Boolean" 
    1111651                        InheritedFrom="serial" 
     652                #tag EndViewProperty 
     653                #tag ViewProperty 
     654                        Name="CTS" 
     655                        Visible=true 
     656                        Group="Behavior" 
     657                        Type="Boolean" 
     658                        InheritedFrom="serial" 
     659                #tag EndViewProperty 
     660                #tag ViewProperty 
     661                        Name="DTR" 
     662                        Visible=true 
     663                        Group="Behavior" 
     664                        Type="Boolean" 
     665                        InheritedFrom="serial" 
     666                #tag EndViewProperty 
     667                #tag ViewProperty 
     668                        Name="byte01" 
     669                        Group="Behavior" 
     670                        InitialValue="&hFF" 
     671                        Type="String" 
     672                        EditorType="MultiLineEditor" 
     673                #tag EndViewProperty 
     674                #tag ViewProperty 
     675                        Name="byte11" 
     676                        Group="Behavior" 
     677                        Type="String" 
     678                        EditorType="MultiLineEditor" 
     679                #tag EndViewProperty 
     680                #tag ViewProperty 
     681                        Name="byte12" 
     682                        Group="Behavior" 
     683                        Type="String" 
     684                        EditorType="MultiLineEditor" 
     685                #tag EndViewProperty 
     686                #tag ViewProperty 
     687                        Name="byte13" 
     688                        Group="Behavior" 
     689                        Type="String" 
     690                        EditorType="MultiLineEditor" 
     691                #tag EndViewProperty 
     692                #tag ViewProperty 
     693                        Name="byte14" 
     694                        Group="Behavior" 
     695                        Type="String" 
     696                        EditorType="MultiLineEditor" 
     697                #tag EndViewProperty 
     698                #tag ViewProperty 
     699                        Name="byte15" 
     700                        Group="Behavior" 
     701                        Type="String" 
     702                        EditorType="MultiLineEditor" 
     703                #tag EndViewProperty 
     704                #tag ViewProperty 
     705                        Name="byte16" 
     706                        Group="Behavior" 
     707                        Type="String" 
     708                        EditorType="MultiLineEditor" 
     709                #tag EndViewProperty 
     710                #tag ViewProperty 
     711                        Name="byte17" 
     712                        Group="Behavior" 
     713                        Type="String" 
     714                        EditorType="MultiLineEditor" 
     715                #tag EndViewProperty 
     716                #tag ViewProperty 
     717                        Name="byte18" 
     718                        Group="Behavior" 
     719                        Type="String" 
     720                        EditorType="MultiLineEditor" 
     721                #tag EndViewProperty 
     722                #tag ViewProperty 
     723                        Name="byte02" 
     724                        Group="Behavior" 
     725                        Type="String" 
     726                        EditorType="MultiLineEditor" 
     727                #tag EndViewProperty 
     728                #tag ViewProperty 
     729                        Name="byte03" 
     730                        Group="Behavior" 
     731                        Type="String" 
     732                        EditorType="MultiLineEditor" 
     733                #tag EndViewProperty 
     734                #tag ViewProperty 
     735                        Name="byte04" 
     736                        Group="Behavior" 
     737                        Type="String" 
     738                        EditorType="MultiLineEditor" 
     739                #tag EndViewProperty 
     740                #tag ViewProperty 
     741                        Name="byte05" 
     742                        Group="Behavior" 
     743                        Type="String" 
     744                        EditorType="MultiLineEditor" 
     745                #tag EndViewProperty 
     746                #tag ViewProperty 
     747                        Name="byte06" 
     748                        Group="Behavior" 
     749                        Type="String" 
     750                        EditorType="MultiLineEditor" 
     751                #tag EndViewProperty 
     752                #tag ViewProperty 
     753                        Name="byte07" 
     754                        Group="Behavior" 
     755                        Type="String" 
     756                        EditorType="MultiLineEditor" 
     757                #tag EndViewProperty 
     758                #tag ViewProperty 
     759                        Name="byte08" 
     760                        Group="Behavior" 
     761                        Type="String" 
     762                        EditorType="MultiLineEditor" 
     763                #tag EndViewProperty 
     764                #tag ViewProperty 
     765                        Name="byte09" 
     766                        Group="Behavior" 
     767                        Type="String" 
     768                        EditorType="MultiLineEditor" 
     769                #tag EndViewProperty 
     770                #tag ViewProperty 
     771                        Name="byte10" 
     772                        Group="Behavior" 
     773                        Type="String" 
     774                        EditorType="MultiLineEditor" 
     775                #tag EndViewProperty 
     776                #tag ViewProperty 
     777                        Name="carType" 
     778                        Group="Behavior" 
     779                        InitialValue="MR-03" 
     780                        Type="String" 
     781                #tag EndViewProperty 
     782                #tag ViewProperty 
     783                        Name="mode" 
     784                        Group="Behavior" 
     785                        InitialValue="read" 
     786                        Type="String" 
    1112787                #tag EndViewProperty 
    1113788        #tag EndViewBehavior 
Note: See TracChangeset for help on using the changeset viewer.