14.03.2023 Smart Package Robot Update Notice: "GPX-Files and Timestamps"

Started by Theo Gottwald, January 01, 2023, 07:58:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

The last Update to the SPR has been uploaded to the Server.
Besides many other changes and Improvements, the Program now includes the new "GPX-Korrektor" which can be used to manually correct GPX-Files, for example for use with Google-Street View publishing.

Generally the Smart Package Robot has a large Set of XML-Commands, that is helpful with GPX-Files.
But then there were some shortcomings to deal with Timestamps like: HH:MM:SS:ddd.
I needed to calculate the Timedifference between Timestamps and do not want to use a bunch of String-Operations.

So there is the new TCA. (Timestamp& Time Calculation) Command.

It can do all sorts of things with such Timestamps.
Add, Subtract or divide them, find the Timestamp between two timestamps, and you can even define a LOOP from a Timestamp to another Timestamp. Which is exactly what i need here in my Task.

The Timestamp-Loop is sort of

FOR.$$LOP=10:09:00.000 TO 10:10:00.000 STEP 00:00:00.010
(Do something here with $$LOP)
NEXT


Command. For the SPR i have realized it using MACROS.
This example will also be in the Helpfile as a Macro-Sample.

'Macro-Example:
' These Macros will implement a Time-FOR-Loop using Macros
' Please note the use of 'EIF- and 'EIF+ in the Macro for the Editor Formatting.
' This Loop will Loop from 08:09:59.000 to 08:10:01.000

$$TIA=08:09:59.000
$$TIB=08:10:01.000
$$INC=00:00:00.010

%FOT $$TIA|$$TIB|$$INC
PRT.Looping: $$LOP
%NXT

MBX.$$LOP
ENR.

'----------------------------------
'  The two Macros that implement a Time-Loop
'----------------------------------
: %FOT 3
$$FOA=§§§01
$$FOB=§§§02
$$FOC=§§§03
$$LOP=$$FOA
DOL. 
'EIF-
END%   
'----------------------------------
: %NXT
TCA.Add|$$LOP|$$INC|$$LOP
IVS.$$LOP=$$TIB
  $$LOV=1
ELS.
  $$LOV=0
EIF.
OOP.$$LOV
'EIF+
END% 
'----------------------------------