Klaas, Wilfried 4 years ago
parent
commit
31611048d3
5 changed files with 104 additions and 4620 deletions
  1. 2 2
      SPS_EMU.000
  2. 1 1
      SPS_Emu.lpi
  3. BIN
      SPS_Emu.lsu
  4. 65 4573
      ugui.lfm
  5. 36 44
      ugui.pas

+ 2 - 2
SPS_EMU.000

@@ -2,8 +2,8 @@
 LSUTextFile=1
 LSUTextFile=1
 Copyrigth=MCS Media Computer Software
 Copyrigth=MCS Media Computer Software
 [LSUInfo]
 [LSUInfo]
-CompileDate=26.10.2020
-CompileTime=13:40:45
+CompileDate=30.10.2020
+CompileTime=13:54:37
 Name=Wilfried Klaas
 Name=Wilfried Klaas
 LSUBinFile=H:\privat\git-sourcen\SPS_Emulator\SPS_Emu.lsu
 LSUBinFile=H:\privat\git-sourcen\SPS_Emulator\SPS_Emu.lsu
 LSUTextFile=H:\privat\git-sourcen\SPS_Emulator\SPS_Emu.
 LSUTextFile=H:\privat\git-sourcen\SPS_Emulator\SPS_Emu.

+ 1 - 1
SPS_Emu.lpi

@@ -22,7 +22,7 @@
       <AutoIncrementBuild Value="True"/>
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="2"/>
       <MinorVersionNr Value="2"/>
       <RevisionNr Value="1"/>
       <RevisionNr Value="1"/>
-      <BuildNr Value="65"/>
+      <BuildNr Value="67"/>
       <Language Value="0407"/>
       <Language Value="0407"/>
       <StringTable CompanyName="MCS" FileDescription="TPS/SPS Emulator" InternalName="SPS_EMU" LegalCopyright="MCS (C) Wilfried Klaas" OriginalFilename="SPS_EMU.exe" ProductName="TPS/SPS Emulator" ProductVersion="0.2"/>
       <StringTable CompanyName="MCS" FileDescription="TPS/SPS Emulator" InternalName="SPS_EMU" LegalCopyright="MCS (C) Wilfried Klaas" OriginalFilename="SPS_EMU.exe" ProductName="TPS/SPS Emulator" ProductVersion="0.2"/>
     </VersionInfo>
     </VersionInfo>

BIN
SPS_Emu.lsu


File diff suppressed because it is too large
+ 65 - 4573
ugui.lfm


+ 36 - 44
ugui.pas

@@ -45,6 +45,7 @@ type
     acPresetSave: TFileSaveAs;
     acPresetSave: TFileSaveAs;
     GBControl: TGroupBox;
     GBControl: TGroupBox;
     ImageList2: TImageList;
     ImageList2: TImageList;
+    ImageList3: TImageList;
     Label3: TLabel;
     Label3: TLabel;
     Label4: TLabel;
     Label4: TLabel;
     Label5: TLabel;
     Label5: TLabel;
@@ -63,7 +64,6 @@ type
     GBOutput: TGroupBox;
     GBOutput: TGroupBox;
     GBInput: TGroupBox;
     GBInput: TGroupBox;
     GBInternal: TGroupBox;
     GBInternal: TGroupBox;
-    ImageList1: TImageList;
     Label1: TLabel;
     Label1: TLabel;
     Label10: TLabel;
     Label10: TLabel;
     Label11: TLabel;
     Label11: TLabel;
@@ -398,12 +398,15 @@ end;
 
 
 procedure TForm1.pmExamplesPopup(Sender: TObject);
 procedure TForm1.pmExamplesPopup(Sender: TObject);
 var
 var
-  i, j, pos, index: integer;
+  x, i, j, pos, index: integer;
   myName: string;
   myName: string;
   myMenu, my2Menu: TMenuItem;
   myMenu, my2Menu: TMenuItem;
   jsonString: string;
   jsonString: string;
+  JsonObject: TJsonObject;
   Data, JArray: TJSONData;
   Data, JArray: TJSONData;
   JItem: TJSONData;
   JItem: TJSONData;
+  subMenuName: string;
+  subMenu: TMenuItem;
 begin
 begin
   for i := pmExamples.Items.Count - 1 downto 0 do
   for i := pmExamples.Items.Count - 1 downto 0 do
   begin
   begin
@@ -425,50 +428,38 @@ begin
   try
   try
     jsonString := DownloadFile('http://wkla.no-ip.biz/down/tps_examples/examples.json');
     jsonString := DownloadFile('http://wkla.no-ip.biz/down/tps_examples/examples.json');
     Data := StringToJSONData(jsonString);
     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', '');
-      pos := -1;
-      index := GetJsonProp(TJSONObject(JItem), 'index', -1);
-      if (index > -1) then
-      begin
-        pos := Examples.Add(GetJsonProp(TJSONObject(JItem), 'file', ''));
-        myName := format('%.2d - %s', [index, myName]);
-      end;
-      myMenu := TMenuItem.Create(pmExamples);
-      myMenu.Caption := myName;
-      myMenu.Tag := pos;
-      if (index > -1) then
-      begin
-        myMenu.OnClick := @MenuItem1Click;
-      end;
-      pmExamples.Items.Add(myMenu);
-    end;
+    JsonObject := TJSONObject(Data);
 
 
-    JArray := GetJSONProp(TJSONObject(Data), 'demo');
-    if (JArray <> nil) then
+    i := JsonObject.Count;
+    for x := 0 to JsonObject.Count - 1 do
     begin
     begin
-      for i := 1 to TJSONArray(JArray).Count do
+      subMenuName := JsonObject.Names[x];
+      JArray := GetJSONProp(TJSONObject(Data), subMenuName);
+      if (JArray <> nil) then
       begin
       begin
-        JItem := TJSONArray(JArray).Items[i - 1];
-        myName := GetJsonProp(TJSONObject(JItem), 'name', '');
-        pos := -1;
-        index := GetJsonProp(TJSONObject(JItem), 'index', -1);
-        if (index > -1) then
+        subMenu := TMenuItem.Create(pmExamples);
+        subMenu.Caption := subMenuName;
+        pmExamples.Items.Add(subMenu);
+        for i := 1 to TJSONArray(JArray).Count do
         begin
         begin
-          pos := Examples.Add(GetJsonProp(TJSONObject(JItem), 'file', ''));
-          myName := format('%s: %.2d - %s', ['demo', index, myName]);
-        end;
-        myMenu := TMenuItem.Create(pmExamples);
-        myMenu.Caption := myName;
-        myMenu.Tag := pos;
-        if (index > -1) then
-        begin
-          myMenu.OnClick := @MenuItem1Click;
+          JItem := TJSONArray(JArray).Items[i - 1];
+          myName := GetJsonProp(TJSONObject(JItem), 'name', '');
+          pos := -1;
+          index := GetJsonProp(TJSONObject(JItem), 'index', -1);
+          if (index > -1) then
+          begin
+            pos := Examples.Add(GetJsonProp(TJSONObject(JItem), 'file', ''));
+            myName := format('%.2d - %s', [index, myName]);
+          end;
+          myMenu := TMenuItem.Create(subMenu);
+          myMenu.Caption := myName;
+          myMenu.Tag := pos;
+          if (index > -1) then
+          begin
+            myMenu.OnClick := @MenuItem1Click;
+          end;
+          subMenu.Add(myMenu);
         end;
         end;
-        pmExamples.Items.Add(myMenu);
       end;
       end;
     end;
     end;
   except
   except
@@ -640,7 +631,7 @@ begin
   begin
   begin
     activateSps(True);
     activateSps(True);
     acDebug.Enabled := True;
     acDebug.Enabled := True;
-    acDebug.ImageIndex := 10;
+    acDebug.ImageIndex := 57;
     cbAdrActual.Enabled := True;
     cbAdrActual.Enabled := True;
     acNextStep.Enabled := False;
     acNextStep.Enabled := False;
     // sps programmieren
     // sps programmieren
@@ -904,7 +895,7 @@ begin
   begin
   begin
     stopit := True;
     stopit := True;
     sps.break();
     sps.break();
-    acDebug.ImageIndex := 18;
+    acDebug.ImageIndex := 40;
     //   repeat
     //   repeat
     //     Application.ProcessMessages;
     //     Application.ProcessMessages;
     //   until (not sps.isDelayActive());
     //   until (not sps.isDelayActive());
@@ -953,6 +944,7 @@ end;
 procedure TForm1.btnToneClick(Sender: TObject);
 procedure TForm1.btnToneClick(Sender: TObject);
 begin
 begin
   MidiOutput.SendAllSoundOff(0, 0);
   MidiOutput.SendAllSoundOff(0, 0);
+  ImageList2.GetBitmap(22, btnTone.Glyph);
 end;
 end;
 
 
 function TForm1.serialUpload: string;
 function TForm1.serialUpload: string;
@@ -1671,7 +1663,7 @@ begin
     begin
     begin
       playNote(0);
       playNote(0);
     end;
     end;
-    btntone.Enabled := False;
+    btntone.Enabled := true;
   end;
   end;
   List := TStringList.Create;
   List := TStringList.Create;
   try
   try

Some files were not shown because too many files changed in this diff