Преглед изворни кода

some changes for a more reliable auto programming

Wilfried Klaas пре 3 година
родитељ
комит
57280f2565
5 измењених фајлова са 21 додато и 9 уклоњено
  1. 1 1
      SPS_EMU.000
  2. 5 5
      SPS_Emu.lpi
  3. 1 0
      SPS_Emu.lpr
  4. BIN
      SPS_Emu.lsu
  5. 14 3
      ugui.pas

+ 1 - 1
SPS_EMU.000

@@ -3,7 +3,7 @@ LSUTextFile=1
 Copyrigth=MCS Media Computer Software
 [LSUInfo]
 CompileDate=03.06.2021
-CompileTime=15:00:30
+CompileTime=17:09:53
 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.

+ 5 - 5
SPS_Emu.lpi

@@ -7,11 +7,11 @@
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
       <Title Value="SPS_Emu"/>
+      <Scaled Value="True"/>
       <ResourceType Value="res"/>
       <UseXPManifest Value="True"/>
       <XPManifest>
-        <DpiAware Value="True/PM"/>
-        <ExecutionLevel Value="highestAvailable"/>
+        <DpiAware Value="True"/>
       </XPManifest>
       <Icon Value="0"/>
     </General>
@@ -23,7 +23,7 @@
       <AutoIncrementBuild Value="True"/>
       <MinorVersionNr Value="2"/>
       <RevisionNr Value="1"/>
-      <BuildNr Value="93"/>
+      <BuildNr Value="95"/>
       <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>
@@ -36,7 +36,7 @@
     </PublishOptions>
     <RunParams>
       <local>
-        <CommandLineParams Value="beispiele/tone.tps"/>
+        <CommandLineParams Value="beispiele/servos.tps"/>
       </local>
       <environment>
         <UserOverrides Count="1">
@@ -47,7 +47,7 @@
       <Modes Count="1">
         <Mode0 Name="default">
           <local>
-            <CommandLineParams Value="beispiele/tone.tps"/>
+            <CommandLineParams Value="beispiele/servos.tps"/>
           </local>
           <environment>
             <UserOverrides Count="1">

+ 1 - 0
SPS_Emu.lpr

@@ -16,6 +16,7 @@ var path : string;
 begin
   path := ParamStr(0);
   RequireDerivedFormResource := True;
+  Application.Scaled:=True;
   Application.Initialize;
   MCSLSU.LSUSetDebug(false);
   MCSLSU.LSUInit(path, NOR_Mode, GetLNGCode);


+ 14 - 3
ugui.pas

@@ -1016,6 +1016,7 @@ var
   TimeOut: integer;
   error: boolean;
   filename: string;
+  retries: integer;
 
 begin
   error := False;
@@ -1062,10 +1063,20 @@ begin
         SdpoSerial1.Device := comService;
         SdpoSerial1.Active := True;
 
-        SdpoSerial1.WriteData('p');
-        if (not readString(line)) then
+        error := true;
+        while retries < 10 do
         begin
-          error := True;
+             SdpoSerial1.WriteData('p');
+             if (readString(line)) then
+             begin
+               if (pos('command', line) > 0) then
+               begin
+                 retries := 10;
+                 error := false;
+               end;
+             end;
+             SdpoSerial1.WriteData('h');
+             inc(retries);
         end;
         if (not error) then
         begin