Browse Source

#2 fully implemented

Wilfried Klaas 3 years ago
parent
commit
20a72b2685
8 changed files with 32 additions and 7 deletions
  1. 1 1
      SPS_EMU.000
  2. 3 1
      SPS_EMU.001
  3. 2 1
      SPS_EMU.044
  4. 1 0
      SPS_EMU.049
  5. 1 1
      SPS_Emu.lpi
  6. BIN
      SPS_Emu.lsu
  7. 18 3
      ugui.pas
  8. 6 0
      usps.pas

+ 1 - 1
SPS_EMU.000

@@ -3,7 +3,7 @@ LSUTextFile=1
 Copyrigth=MCS Media Computer Software
 [LSUInfo]
 CompileDate=02.06.2021
-CompileTime=16:16:04
+CompileTime=16:54:13
 Name=Wilfried Klaas
 LSUBinFile=C:\e-platte\daten\git-sourcen\SPS_Emulator\SPS_Emu.lsu
 LSUTextFile=C:\e-platte\daten\git-sourcen\SPS_Emulator\SPS_Emu.

+ 3 - 1
SPS_EMU.001

@@ -175,7 +175,9 @@ ID_MB_QUESTIONT=Question
 ID_MB_INFOT=Information
 SAVE_CHANGESM=The program has been changed. Do you want to save the changes?
 ID_UPLOAD_OKM=Pogram uploaded.
-ID_NOT_READYM=Arduino not responding. Maybe not connected, SEL not pressed oder wrong firmware version^?
+ID_NOT_READYM=Arduino not responding. Maybe not connected, SEL not pressed oder wrong firmware version?
+ID_PRG_TO_LONGM=The program is to long for the selected hardware.
+
 
 [frmSelectComCaptions]
 ID_COMPORT=Port

+ 2 - 1
SPS_EMU.044

@@ -175,7 +175,8 @@ ID_MB_QUESTIONT=Question
 ID_MB_INFOT=Information
 SAVE_CHANGESM=The program has been changed. Do you want to save the changes?
 ID_UPLOAD_OKM=Pogram uploaded.
-ID_NOT_READYM=Arduino not responding. Maybe not connected, SEL not pressed oder wrong firmware version^?
+ID_NOT_READYM=Arduino not responding. Maybe not connected, SEL not pressed oder wrong firmware version?
+ID_PRG_TO_LONGM=The program is to long for the selected hardware.
 
 [frmSelectComCaptions]
 ID_COMPORT=Port

+ 1 - 0
SPS_EMU.049

@@ -177,6 +177,7 @@ ID_MB_INFOT=Information
 SAVE_CHANGESM=Die Datei wurde geändert. Wollen Sie die Änderungen speichern?
 ID_UPLOAD_OKM=Pogramm übertragen.
 ID_NOT_READYM=Arduino antwortet nicht. Evtl. Arduino nicht angeschlossen, SEL nicht gedrückt oder falsche Firmware?
+ID_PRG_TO_LONGM=Das Program ist zu lang für die selektierte Hardware.
 
 [frmSelectComCaptions]
 ID_COMPORT=Schnittstelle

+ 1 - 1
SPS_Emu.lpi

@@ -22,7 +22,7 @@
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="2"/>
       <RevisionNr Value="1"/>
-      <BuildNr Value="88"/>
+      <BuildNr Value="91"/>
       <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"/>
     </VersionInfo>

BIN
SPS_Emu.lsu


+ 18 - 3
ugui.pas

@@ -716,6 +716,12 @@ var
   eot: boolean;
 begin
   eot := False;
+  i := StringGrid1.RowCount-1;
+  if (i >= (sps.getE2E())) then
+  begin
+    LSUAutoMsgBox('Messages', 'ID_PRG_TO_LONG', MB_OK + MB_ICONERROR);
+    exit;
+  end;
   myPos := StringGrid1.Row;
   if (myPos = StringGrid1.RowCount - 1) then
     eot := True;
@@ -740,7 +746,14 @@ end;
 procedure TForm1.acNextInsertExecute(Sender: TObject);
 var
   myPos: integer;
+  i : integer;
 begin
+  i := StringGrid1.RowCount-1;
+  if (i >= (sps.getE2E())) then
+  begin
+    LSUAutoMsgBox('Messages', 'ID_PRG_TO_LONG', MB_OK + MB_ICONERROR);
+    exit;
+  end;
   myPos := StringGrid1.Row;
   if (myPos = StringGrid1.RowCount - 1) then
     acNewRow.Execute;
@@ -1503,9 +1516,11 @@ begin
     Value := trim(Value);
     if (Value <> '') then
     begin
-      setDirty(True);
-      StringGrid1.RowCount := StringGrid1.RowCount + 1;
-      renumberGrid();
+      if StringGrid1.RowCount <= sps.getE2E() then begin
+        setDirty(True);
+        StringGrid1.RowCount := StringGrid1.RowCount + 1;
+        renumberGrid();
+      end;
     end;
   end
   else

+ 6 - 0
usps.pas

@@ -275,6 +275,7 @@ type
     function getLastError():string;
 
     procedure writeEEProm(adr: word; Data: byte);
+    function getE2E():word;
 
     function isActive(): boolean;
     function isDelayActive(): boolean;
@@ -638,6 +639,11 @@ begin
   eeprom[adr] := Data;
 end;
 
+function TSPS.getE2E(): word;
+begin
+   Result := e2e;
+end;
+
 function TSPS.isActive(): boolean;
 begin
   Result := active;