Klaas, Wilfried 6 years ago
parent
commit
93f9404da0
7 changed files with 173 additions and 62 deletions
  1. 12 9
      Beispiele/SimpleServo.tps
  2. 7 0
      Beispiele/blink.tps
  3. 12 0
      Beispiele/examples.json
  4. 12 0
      Beispiele/servo.tps
  5. 0 9
      Beispiele/simple_blink.tps
  6. 36 20
      ugui.lfm
  7. 94 24
      ugui.pas

+ 12 - 9
Beispiele/SimpleServo.tps

@@ -1,9 +1,12 @@
-#TPS:Willies SPS Arduino
-0x00,1,F,""
-0x01,2,8,""
-0x02,1,0,""
-0x03,2,7,""
-0x04,3,4,""
-0x05,0,0,""
-0x06,0,0,""
-0x07,0,0,""
+#TPS:Willies SPS Arduino 
+0x00,4,4,"" 
+0x01,5,1,"" 
+0x02,4,F,"" 
+0x03,7,C,"" 
+0x04,F,8,"" 
+0x05,4,0,"" 
+0x06,F,8,"" 
+0x07,2,0,"" 
+0x08,3,6,"" 
+0x09,F,F,"" 
+0x0A,0,,"" 

+ 7 - 0
Beispiele/blink.tps

@@ -0,0 +1,7 @@
+#TPS:Willies SPS Arduino
+0x00,1,5,""
+0x01,2,8,""
+0x02,1,A,""
+0x03,2,8,""
+0x04,3,4,""
+0x05,0,0,""

+ 12 - 0
Beispiele/examples.json

@@ -0,0 +1,12 @@
+{
+	"examples": [{
+			"name": "Blink",
+			"index": 1,
+			"file": "blink.tps"
+		}, {
+			"name": "Servo",
+			"index": 2,
+			"file": "servo.tps"
+		}
+	]
+}

+ 12 - 0
Beispiele/servo.tps

@@ -0,0 +1,12 @@
+#TPS:Willies SPS Arduino 
+0x00,4,4,"" 
+0x01,5,1,"" 
+0x02,4,F,"" 
+0x03,7,C,"" 
+0x04,F,8,"" 
+0x05,4,0,"" 
+0x06,F,8,"" 
+0x07,2,0,"" 
+0x08,3,6,"" 
+0x09,F,F,"" 
+0x0A,0,,"" 

+ 0 - 9
Beispiele/simple_blink.tps

@@ -1,9 +0,0 @@
-#TPS:Willies SPS Arduino
-0x00,4,0,""
-0x01,1,5,""
-0x02,2,8,""
-0x03,1,A,""
-0x04,2,8,""
-0x05,3,4,""
-0x06,0,0,""
-0x07,0,0,""

+ 36 - 20
ugui.lfm

@@ -720,43 +720,43 @@ object Form1: TForm1
       ShowHint = True
       ShowHint = True
     end
     end
     object ToolButton2: TToolButton
     object ToolButton2: TToolButton
-      Left = 49
+      Left = 71
       Top = 2
       Top = 2
       Action = acFileOpen
       Action = acFileOpen
     end
     end
     object ToolButton3: TToolButton
     object ToolButton3: TToolButton
-      Left = 73
+      Left = 95
       Top = 2
       Top = 2
       Action = acFileSave
       Action = acFileSave
       Caption = 'ID_SAVE'
       Caption = 'ID_SAVE'
     end
     end
     object ToolButton4: TToolButton
     object ToolButton4: TToolButton
-      Left = 233
+      Left = 255
       Height = 22
       Height = 22
       Top = 2
       Top = 2
       Caption = 'ToolButton4'
       Caption = 'ToolButton4'
       Style = tbsSeparator
       Style = tbsSeparator
     end
     end
     object ToolButton6: TToolButton
     object ToolButton6: TToolButton
-      Left = 265
+      Left = 287
       Top = 2
       Top = 2
       Action = acNextStep
       Action = acNextStep
       Caption = 'ID_EXEC_NEXT'
       Caption = 'ID_EXEC_NEXT'
     end
     end
     object ToolButton7: TToolButton
     object ToolButton7: TToolButton
-      Left = 289
+      Left = 311
       Top = 2
       Top = 2
       Action = acStop
       Action = acStop
       Caption = 'ID_EXEC_STOP'
       Caption = 'ID_EXEC_STOP'
     end
     end
     object ToolButton5: TToolButton
     object ToolButton5: TToolButton
-      Left = 313
+      Left = 335
       Top = 2
       Top = 2
       Action = acDebug
       Action = acDebug
       Caption = 'ID_EXEC_DEBUG'
       Caption = 'ID_EXEC_DEBUG'
     end
     end
     object cbTPSVersion: TComboBox
     object cbTPSVersion: TComboBox
-      Left = 433
+      Left = 455
       Height = 23
       Height = 23
       Top = 2
       Top = 2
       Width = 125
       Width = 125
@@ -772,7 +772,7 @@ object Form1: TForm1
       TabOrder = 0
       TabOrder = 0
     end
     end
     object Label3: TLabel
     object Label3: TLabel
-      Left = 345
+      Left = 367
       Height = 15
       Height = 15
       Top = 2
       Top = 2
       Width = 88
       Width = 88
@@ -782,33 +782,33 @@ object Form1: TForm1
       ParentColor = False
       ParentColor = False
     end
     end
     object ToolButton8: TToolButton
     object ToolButton8: TToolButton
-      Left = 337
+      Left = 359
       Height = 22
       Height = 22
       Top = 2
       Top = 2
       Caption = 'ToolButton8'
       Caption = 'ToolButton8'
       Style = tbsSeparator
       Style = tbsSeparator
     end
     end
     object ToolButton9: TToolButton
     object ToolButton9: TToolButton
-      Left = 241
+      Left = 263
       Top = 2
       Top = 2
       Action = acThisStep
       Action = acThisStep
       Caption = 'ID_EXEC_STATEMENT'
       Caption = 'ID_EXEC_STATEMENT'
     end
     end
     object ToolButton10: TToolButton
     object ToolButton10: TToolButton
-      Left = 161
+      Left = 183
       Top = 2
       Top = 2
       Action = acShowHexFile
       Action = acShowHexFile
       Caption = 'ID_PRGFILE'
       Caption = 'ID_PRGFILE'
     end
     end
     object ToolButton11: TToolButton
     object ToolButton11: TToolButton
-      Left = 153
+      Left = 175
       Height = 22
       Height = 22
       Top = 2
       Top = 2
       Caption = 'ToolButton11'
       Caption = 'ToolButton11'
       Style = tbsSeparator
       Style = tbsSeparator
     end
     end
     object ToolButton12: TToolButton
     object ToolButton12: TToolButton
-      Left = 185
+      Left = 207
       Top = 2
       Top = 2
       Action = acUpload
       Action = acUpload
       Caption = 'ID_PRGULOAD'
       Caption = 'ID_PRGULOAD'
@@ -819,38 +819,38 @@ object Form1: TForm1
       Action = acNew
       Action = acNew
     end
     end
     object ToolButton14: TToolButton
     object ToolButton14: TToolButton
-      Left = 97
+      Left = 119
       Height = 22
       Height = 22
       Top = 2
       Top = 2
       Caption = 'ToolButton14'
       Caption = 'ToolButton14'
       Style = tbsSeparator
       Style = tbsSeparator
     end
     end
     object ToolButton15: TToolButton
     object ToolButton15: TToolButton
-      Left = 105
+      Left = 127
       Top = 2
       Top = 2
       Action = acNewRow
       Action = acNewRow
       Caption = 'ID_NEWLINE'
       Caption = 'ID_NEWLINE'
     end
     end
     object ToolButton16: TToolButton
     object ToolButton16: TToolButton
-      Left = 129
+      Left = 151
       Top = 2
       Top = 2
       Action = acDeleteRow
       Action = acDeleteRow
       Caption = 'ID_DELLINE'
       Caption = 'ID_DELLINE'
     end
     end
     object ToolButton17: TToolButton
     object ToolButton17: TToolButton
-      Left = 558
+      Left = 580
       Height = 22
       Height = 22
       Top = 2
       Top = 2
       Caption = 'ToolButton17'
       Caption = 'ToolButton17'
       Style = tbsDivider
       Style = tbsDivider
     end
     end
     object ToolButton18: TToolButton
     object ToolButton18: TToolButton
-      Left = 563
+      Left = 585
       Top = 2
       Top = 2
       Action = acHelpAbout
       Action = acHelpAbout
     end
     end
     object MCSLabel: TLabel
     object MCSLabel: TLabel
-      Left = 587
+      Left = 609
       Height = 22
       Height = 22
       Top = 2
       Top = 2
       Width = 20
       Width = 20
@@ -861,11 +861,18 @@ object Form1: TForm1
       OnClick = MCSLabelClick
       OnClick = MCSLabelClick
     end
     end
     object ToolButton19: TToolButton
     object ToolButton19: TToolButton
-      Left = 209
+      Left = 231
       Top = 2
       Top = 2
       Action = acHexFile
       Action = acHexFile
       Caption = 'ID_HEXFILE'
       Caption = 'ID_HEXFILE'
     end
     end
+    object ToolButton20: TToolButton
+      Left = 49
+      Top = 2
+      Caption = 'ToolButton20'
+      DropdownMenu = pmExamples
+      ImageIndex = 75
+    end
   end
   end
   object StatusBar1: TStatusBar
   object StatusBar1: TStatusBar
     Left = 0
     Left = 0
@@ -51922,4 +51929,13 @@ object Form1: TForm1
     left = 656
     left = 656
     top = 496
     top = 496
   end
   end
+  object pmExamples: TPopupMenu
+    OnPopup = pmExamplesPopup
+    left = 432
+    top = 528
+    object MenuItem1: TMenuItem
+      Caption = '01-Blink'
+      OnClick = MenuItem1Click
+    end
+  end
 end
 end

+ 94 - 24
ugui.pas

@@ -9,7 +9,8 @@ interface
 uses
 uses
   Windows, Classes, SysUtils, FileUtil, SdpoSerial, Forms, Controls, Graphics, Dialogs,
   Windows, Classes, SysUtils, FileUtil, SdpoSerial, Forms, Controls, Graphics, Dialogs,
   Grids, ExtCtrls, Menus, ComCtrls, ActnList, StdActns, LCLProc, StdCtrls, Spin,
   Grids, ExtCtrls, Menus, ComCtrls, ActnList, StdActns, LCLProc, StdCtrls, Spin,
-  XMLPropStorage, uSPS, LCLType, Buttons, types, MCSWINAPI, Math, fpjson, jsonparser, Midi;
+  XMLPropStorage, uSPS, LCLType, Buttons, types, MCSWINAPI, Math,
+  fpjson, jsonparser, Midi;
 
 
 type
 type
 
 
@@ -49,6 +50,8 @@ type
     Label5: TLabel;
     Label5: TLabel;
     lbStack: TListBox;
     lbStack: TListBox;
     MCSLabel: TLabel;
     MCSLabel: TLabel;
+    MenuItem1: TMenuItem;
+    pmExamples: TPopupMenu;
     RC1: TSpinEdit;
     RC1: TSpinEdit;
     RC2: TSpinEdit;
     RC2: TSpinEdit;
     cbCommand: TComboBox;
     cbCommand: TComboBox;
@@ -127,6 +130,7 @@ type
     tbPreset6: TToolButton;
     tbPreset6: TToolButton;
     tbPreset7: TToolButton;
     tbPreset7: TToolButton;
     tbPreset8: TToolButton;
     tbPreset8: TToolButton;
+    ToolButton20: TToolButton;
     ToolButton3: TToolButton;
     ToolButton3: TToolButton;
     ToolButton4: TToolButton;
     ToolButton4: TToolButton;
     ToolButton5: TToolButton;
     ToolButton5: TToolButton;
@@ -163,13 +167,16 @@ type
     procedure FormCreate(Sender: TObject);
     procedure FormCreate(Sender: TObject);
     procedure FormDropFiles(Sender: TObject; const FileNames: array of string);
     procedure FormDropFiles(Sender: TObject; const FileNames: array of string);
     procedure MCSLabelClick(Sender: TObject);
     procedure MCSLabelClick(Sender: TObject);
+    procedure MenuItem1Click(Sender: TObject);
     procedure mnSaveClick(Sender: TObject);
     procedure mnSaveClick(Sender: TObject);
+    procedure pmExamplesPopup(Sender: TObject);
     procedure Shape1Paint(Sender: TObject);
     procedure Shape1Paint(Sender: TObject);
     procedure Shape2Paint(Sender: TObject);
     procedure Shape2Paint(Sender: TObject);
     procedure StringGrid1EditingDone(Sender: TObject);
     procedure StringGrid1EditingDone(Sender: TObject);
     procedure StringGrid1Selection(Sender: TObject; aCol, aRow: integer);
     procedure StringGrid1Selection(Sender: TObject; aCol, aRow: integer);
     procedure tbPreset1Click(Sender: TObject);
     procedure tbPreset1Click(Sender: TObject);
-    procedure tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: boolean);
+    procedure tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint;
+      var Handled: boolean);
     procedure tbResetClick(Sender: TObject);
     procedure tbResetClick(Sender: TObject);
     procedure Timer1Timer(Sender: TObject);
     procedure Timer1Timer(Sender: TObject);
   private
   private
@@ -179,6 +186,7 @@ type
     activeFile: string;
     activeFile: string;
     dirty: boolean;
     dirty: boolean;
     lastNote: byte;
     lastNote: byte;
+    Examples : TStringList;
     procedure initMidi;
     procedure initMidi;
     procedure playNote(note: byte);
     procedure playNote(note: byte);
     function readString(var line: string): boolean;
     function readString(var line: string): boolean;
@@ -214,7 +222,7 @@ var
 implementation
 implementation
 
 
 uses MCSAbout, uTextUi, uSelectCom, MCSTools, MCSStrings, synaser,
 uses MCSAbout, uTextUi, uSelectCom, MCSTools, MCSStrings, synaser,
-  MCSIO, mcsintelhex, MCSLSU, MCSIniFiles;
+  MCSIO, mcsintelhex, MCSLSU, MCSIniFiles, MCSWinHttp, luijsonutils;
 
 
 {$R *.lfm}
 {$R *.lfm}
 
 
@@ -259,6 +267,7 @@ begin
   Timer1.Enabled := True;
   Timer1.Enabled := True;
   MCSLSU.MakeForm('form1', 'ID_', form1);
   MCSLSU.MakeForm('form1', 'ID_', form1);
   initMidi;
   initMidi;
+  Examples := TStringList.Create;
 end;
 end;
 
 
 procedure TForm1.initMidi;
 procedure TForm1.initMidi;
@@ -306,11 +315,57 @@ begin
   ShExec2(self.Handle, InfoBox.AppURL);
   ShExec2(self.Handle, InfoBox.AppURL);
 end;
 end;
 
 
+procedure TForm1.MenuItem1Click(Sender: TObject);
+var i : integer;
+begin
+  // todo
+  if (Sender is TMenuItem) then begin
+    i := TMenuItem(Sender).Tag;
+  end;
+end;
+
 procedure TForm1.mnSaveClick(Sender: TObject);
 procedure TForm1.mnSaveClick(Sender: TObject);
 begin
 begin
   Statusbar1.SimpleText := Sender.ClassName;
   Statusbar1.SimpleText := Sender.ClassName;
 end;
 end;
 
 
+procedure TForm1.pmExamplesPopup(Sender: TObject);
+var
+  i: integer;
+  myName: string;
+  myMenu: TMenuItem;
+  jsonString: string;
+  Data, JArray: TJSONData;
+  JItem: TJSONData;
+begin
+  for i := pmExamples.Items.Count - 1 downto 0 do
+  begin
+    myMenu := pmExamples.Items[i];
+    myMenu.Free;
+  end;
+  pmExamples.Items.Clear;
+  Examples.Clear;
+
+  try
+    jsonString := DownloadFile('http://wkla.no-ip.biz/down/examples.json');
+    Data := StringToJSONData(jsonString);
+    JArray := GetJSONProp(TJSONObject(Data), 'examples');
+    for i := 1 to TJSONArray(JArray).Count do
+    begin
+      JItem := TJSONArray(JArray).Items[i-1];
+      myName := GetJsonProp(TJSONObject(JItem), 'name', '');
+      myName := format('%.2d - %s', [i, myName]);
+      myMenu := TMenuItem.Create(pmExamples);
+      myMenu.Caption := myName;
+      myMenu.Tag := i;
+      myMenu.OnClick := @MenuItem1Click;
+      pmExamples.Items.Add(myMenu);
+      Examples.Add(GetJsonProp(TJSONObject(JItem), 'file', ''));
+    end;
+  except
+  end;
+end;
+
 procedure TForm1.Shape1Paint(Sender: TObject);
 procedure TForm1.Shape1Paint(Sender: TObject);
 var
 var
   radius: integer;
   radius: integer;
@@ -451,8 +506,8 @@ begin
     begin
     begin
       if (StringGrid1.Cells[1, x] <> '') then
       if (StringGrid1.Cells[1, x] <> '') then
       begin
       begin
-        line := StringGrid1.Cells[0, x] + ',' + StringGrid1.Cells[1, x] + ',' +
-          StringGrid1.Cells[2, x] + ',"' + StringGrid1.Cells[4, x] + '"';
+        line := StringGrid1.Cells[0, x] + ',' + StringGrid1.Cells[1, x] +
+          ',' + StringGrid1.Cells[2, x] + ',"' + StringGrid1.Cells[4, x] + '"';
         Writeln(f, line);
         Writeln(f, line);
       end;
       end;
     end;
     end;
@@ -720,7 +775,8 @@ begin
         tmp := tmp + '0';
         tmp := tmp + '0';
       line := line + tmp;
       line := line + tmp;
 
 
-      line := line + '      ' + StringGrid1.Cells[3, x] + '   ,"' + StringGrid1.Cells[4, x] + '"';
+      line := line + '      ' + StringGrid1.Cells[3, x] + '   ,"' +
+        StringGrid1.Cells[4, x] + '"';
       list.add(line);
       list.add(line);
     end;
     end;
   end;
   end;
@@ -873,7 +929,8 @@ begin
 
 
       if (error) then
       if (error) then
       begin
       begin
-        Application.MessageBox('Arduino antwortet nicht. Evtl. Arduino nicht angeschlossen oder falsche Firmware?',
+        Application.MessageBox(
+          'Arduino antwortet nicht. Evtl. Arduino nicht angeschlossen oder falsche Firmware?',
           'Keine Antwort',
           'Keine Antwort',
           MB_OK + MB_ICONEXCLAMATION);
           MB_OK + MB_ICONEXCLAMATION);
       end;
       end;
@@ -929,7 +986,8 @@ var
 begin
 begin
   if (dirty) then
   if (dirty) then
   begin
   begin
-    i := MCSLSU.LSUAutoMsgBox('Messages', 'SAVE_CHANGES', MB_ICONQUESTION or MB_YESNOCANCEL);
+    i := MCSLSU.LSUAutoMsgBox('Messages', 'SAVE_CHANGES', MB_ICONQUESTION or
+      MB_YESNOCANCEL);
     if (i = mrYes) then
     if (i = mrYes) then
     begin
     begin
       saveFile(activeFile);
       saveFile(activeFile);
@@ -1029,7 +1087,8 @@ begin
   end
   end
   else
   else
   begin
   begin
-    Caption := MCSLSU.GetLSUText('form1Captions', 'ID_CAPTION', lsuCode) + ':' + ExtractFileName(activeFile);
+    Caption := MCSLSU.GetLSUText('form1Captions', 'ID_CAPTION', lsuCode) +
+      ':' + ExtractFileName(activeFile);
   end;
   end;
 
 
 end;
 end;
@@ -1044,7 +1103,8 @@ begin
     StringGrid1.Columns[i].Title.Caption :=
     StringGrid1.Columns[i].Title.Caption :=
       MCSLSU.GetLSUText('form1Captions', StringGrid1.Columns[i].Title.Caption, lsuCode);
       MCSLSU.GetLSUText('form1Captions', StringGrid1.Columns[i].Title.Caption, lsuCode);
   end;
   end;
-  StringGrid1.Cells[0, 0] := MCSLSU.GetLSUText('form1Captions', 'ID_GRID_STORAGE', lsuCode);
+  StringGrid1.Cells[0, 0] := MCSLSU.GetLSUText('form1Captions',
+    'ID_GRID_STORAGE', lsuCode);
   StringGrid1.Repaint;
   StringGrid1.Repaint;
 end;
 end;
 
 
@@ -1184,7 +1244,8 @@ begin
   begin
   begin
     x := StringGrid1.Row;
     x := StringGrid1.Row;
     StringGrid1.Cells[3, x] :=
     StringGrid1.Cells[3, x] :=
-      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]), HexToInt(StringGrid1.Cells[2, x]));
+      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]),
+      HexToInt(StringGrid1.Cells[2, x]));
     setDirty(True);
     setDirty(True);
   end;
   end;
 end;
 end;
@@ -1237,10 +1298,14 @@ begin
   WriteIniBool(key, 'set', XMLPropStorage1.ReadBoolean(key + '.set', False), filename);
   WriteIniBool(key, 'set', XMLPropStorage1.ReadBoolean(key + '.set', False), filename);
   WriteIniBool(key, 'prg', XMLPropStorage1.ReadBoolean(key + '.prg', False), filename);
   WriteIniBool(key, 'prg', XMLPropStorage1.ReadBoolean(key + '.prg', False), filename);
   WriteIniBool(key, 'sel', XMLPropStorage1.ReadBoolean(key + '.sel', False), filename);
   WriteIniBool(key, 'sel', XMLPropStorage1.ReadBoolean(key + '.sel', False), filename);
-  WriteIniBool(key, 'input1', XMLPropStorage1.ReadBoolean(key + '.input1', False), filename);
-  WriteIniBool(key, 'input2', XMLPropStorage1.ReadBoolean(key + '.input2', False), filename);
-  WriteIniBool(key, 'input3', XMLPropStorage1.ReadBoolean(key + '.input3', False), filename);
-  WriteIniBool(key, 'input4', XMLPropStorage1.ReadBoolean(key + '.input4', False), filename);
+  WriteIniBool(key, 'input1', XMLPropStorage1.ReadBoolean(key + '.input1', False),
+    filename);
+  WriteIniBool(key, 'input2', XMLPropStorage1.ReadBoolean(key + '.input2', False),
+    filename);
+  WriteIniBool(key, 'input3', XMLPropStorage1.ReadBoolean(key + '.input3', False),
+    filename);
+  WriteIniBool(key, 'input4', XMLPropStorage1.ReadBoolean(key + '.input4', False),
+    filename);
   WriteIniInteger(key, 'adc1', XMLPropStorage1.ReadInteger(key + '.adc1', 0), filename);
   WriteIniInteger(key, 'adc1', XMLPropStorage1.ReadInteger(key + '.adc1', 0), filename);
   WriteIniInteger(key, 'adc2', XMLPropStorage1.ReadInteger(key + '.adc2', 0), filename);
   WriteIniInteger(key, 'adc2', XMLPropStorage1.ReadInteger(key + '.adc2', 0), filename);
   WriteIniInteger(key, 'rc1', XMLPropStorage1.ReadInteger(key + '.rc1', 0), filename);
   WriteIniInteger(key, 'rc1', XMLPropStorage1.ReadInteger(key + '.rc1', 0), filename);
@@ -1252,10 +1317,14 @@ begin
   XMLPropStorage1.WriteBoolean(key + '.set', ReadIniBool(key, 'set', False, filename));
   XMLPropStorage1.WriteBoolean(key + '.set', ReadIniBool(key, 'set', False, filename));
   XMLPropStorage1.WriteBoolean(key + '.prg', ReadIniBool(key, 'prg', False, filename));
   XMLPropStorage1.WriteBoolean(key + '.prg', ReadIniBool(key, 'prg', False, filename));
   XMLPropStorage1.WriteBoolean(key + '.sel', ReadIniBool(key, 'sel', False, filename));
   XMLPropStorage1.WriteBoolean(key + '.sel', ReadIniBool(key, 'sel', False, filename));
-  XMLPropStorage1.WriteBoolean(key + '.input1', ReadIniBool(key, 'input1', False, filename));
-  XMLPropStorage1.WriteBoolean(key + '.input2', ReadIniBool(key, 'input2', False, filename));
-  XMLPropStorage1.WriteBoolean(key + '.input3', ReadIniBool(key, 'input3', False, filename));
-  XMLPropStorage1.WriteBoolean(key + '.input4', ReadIniBool(key, 'input4', False, filename));
+  XMLPropStorage1.WriteBoolean(key + '.input1', ReadIniBool(key,
+    'input1', False, filename));
+  XMLPropStorage1.WriteBoolean(key + '.input2', ReadIniBool(key,
+    'input2', False, filename));
+  XMLPropStorage1.WriteBoolean(key + '.input3', ReadIniBool(key,
+    'input3', False, filename));
+  XMLPropStorage1.WriteBoolean(key + '.input4', ReadIniBool(key,
+    'input4', False, filename));
   XMLPropStorage1.WriteInteger(key + '.adc1', ReadIniInteger(key, 'adc1', 0, filename));
   XMLPropStorage1.WriteInteger(key + '.adc1', ReadIniInteger(key, 'adc1', 0, filename));
   XMLPropStorage1.WriteInteger(key + '.adc2', ReadIniInteger(key, 'adc2', 0, filename));
   XMLPropStorage1.WriteInteger(key + '.adc2', ReadIniInteger(key, 'adc2', 0, filename));
   XMLPropStorage1.WriteInteger(key + '.rc1', ReadIniInteger(key, 'rc1', 0, filename));
   XMLPropStorage1.WriteInteger(key + '.rc1', ReadIniInteger(key, 'rc1', 0, filename));
@@ -1302,7 +1371,8 @@ begin
   RC2.Value := XMLPropStorage1.ReadInteger(key + '.rc2', RC2.Value);
   RC2.Value := XMLPropStorage1.ReadInteger(key + '.rc2', RC2.Value);
 end;
 end;
 
 
-procedure TForm1.tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint; var Handled: boolean);
+procedure TForm1.tbPreset1ContextPopup(Sender: TObject; MousePos: TPoint;
+  var Handled: boolean);
 var
 var
   key: string;
   key: string;
 begin
 begin
@@ -1372,13 +1442,12 @@ begin
   if (InfoBox.newVersion) then
   if (InfoBox.newVersion) then
   begin
   begin
     MCSLabel.Font.Color := clred;
     MCSLabel.Font.Color := clred;
-    MCSLabel.Hint := InfoBox.versionHint + chr($0a) + chr($0d) + MCSLSU.GetLSUText(
-      'form1Captions', 'ID_CLICK_HERE', lsuCode);
+    MCSLabel.Hint := InfoBox.versionHint + chr($0a) + chr($0d) +
+      MCSLSU.GetLSUText('form1Captions', 'ID_CLICK_HERE', lsuCode);
   end;
   end;
   MCSLabel.Caption := InfoBox.versionText;
   MCSLabel.Caption := InfoBox.versionText;
 end;
 end;
 
 
-
 procedure TForm1.renumberGrid;
 procedure TForm1.renumberGrid;
 var
 var
   x, i: integer;
   x, i: integer;
@@ -1392,7 +1461,8 @@ begin
     if (StringGrid1.Cells[2, x] = '') then
     if (StringGrid1.Cells[2, x] = '') then
       StringGrid1.Cells[2, x] := '0';
       StringGrid1.Cells[2, x] := '0';
     StringGrid1.Cells[3, x] :=
     StringGrid1.Cells[3, x] :=
-      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]), HexToInt(StringGrid1.Cells[2, x]));
+      sps.getCommandText(HexToInt(StringGrid1.Cells[1, x]),
+      HexToInt(StringGrid1.Cells[2, x]));
   end;
   end;
 end;
 end;