|
@@ -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
|