% % decode and record location points % "c:\inetpub\wwwroot\" !Sim.Base "http://localhost/" !Sim.Local "Up\" ^_Sim.Base !Sim.Net % % process remote data collections, % every 10 seconds nodejs TkApp generates a new time-stamped file for log append % do every file existing of wildard, tkapp works with other file % them renames it when it switches to a new name (time interval) % "IMEIloc" !Trak.Method % %%% (087076885445BP00352887076885445HSOP5D) %%% (087076885445BR00181104A3759.4630N08542.4971W000.0153822000.00,00000000L00000000) % % run number, always 0 % % device partial (11 last characters of 15) imei: 352887076885445 received: 87076885445 % { empty "DevUp_*.dev" ^_Sim.Net File.NextOf isnull { pop true } { dup ^_Sim.Net !Dev.File !Dev.Froot _Dev.File ".txt" reextend read % % stack: incoming-data % { "(" Str.Right ")" slice exch isnull ? % % stack: remaining-data message-data % dup 1 left !Sim.Run -1 left dup 11 left !Sim.PartImei -11 left dup 4 left !Sim.Record -4 left _Sim.Record < |BP00 %%% 352887076885445HSOP5D % % up data handshake from device % dup 4 left !Sim.Device -4 left dup 11 left !Sim.PartImei2 -11 left dup 4 left !Sim.Operating -4 left dup 2 left !Sim.BatHex -2 left !Sim.Flags % % check battery percentage, report change % _Sim.PartImei ^"Bat." _ _Sim.BatHex eq$ { % % no change in battery percentage % } { % % battery percentage change % empty "Sim.PartImei" Str.CatValue "Sim.PartImei2" Str.CatValue "Sim.Run" Str.CatValue "Sim.Record" Str.CatValue "Sim.Operating" Str.CatValue "Sim.Device" Str.CatValue "Sim.BatHex" Str.CatValue "Sim.Flags" Str.CatValue _Sim.BatHex _Sim.PartImei ^"Bat." ! _Sim.PartImei ^"Bat_" &"_" *finsures 8 prezero & text ^_Sim.Net write } ifelse |BR00 % % data delivery from device % % 181104 A 3759.4630N 08542.4971W 000.0 153822 000.00 , 00000000L 00000000 % % GPS data acquisition time is Nov 4, 2018 % "A" shows the data is available % 37 degrees and 59.4630 minutes North latitude % 085 degrees and 42.4971 minutes West longitude % speed is 000.0km/h, % Universal time is 15:38:22 % the bearing angle is 000.00 degrees, from due north % ”L” means the sum of distance, unit is meter,mileage statistic % aux info is 00000000, two or more additional letters would show alarm status % dup 6 left dup 2 left ^"20" exch -2 left dup 2 left &"/" exch -2 left & &"/" ^ !Sim.Date -6 left dup 1 left !Sim.DataValid -1 left dup 10 left !Sim.RawLat -10 left dup 11 left !Sim.RawLon -11 left dup 5 left !Sim.Speed -5 left dup 6 left dup 2 left exch -2 left dup 2 left exch -2 left ^":" & ^":" & !Sim.Utc -6 left dup 6 left !Sim.Bearing -6 left dup 1 left !Sim.Comma -1 left dup 9 left !Sim.Distance -9 left dup 8 left !Sim.Aux -8 left !Sim.Flags _Sim.Date &" " &_Sim.Utc !Sim.DateTime _Sim.PartImei ^"Bat." _ !Sim.BatHex empty "Sim.DateTime" Str.CatValue "Sim.PartImei" Str.CatValue "Sim.Record" Str.CatValue "Sim.BatHex" Str.CatValue "Sim.DataValid" Str.CatValue "Sim.RawLat" Str.CatValue "Sim.RawLon" Str.CatValue "Sim.Speed" Str.CatValue "Sim.Bearing" Str.CatValue "Sim.Comma" Str.CatValue "Sim.Distance" Str.CatValue "Sim.Aux" Str.CatValue "Sim.Flags" Str.CatValue "LOD_" &_Sim.PartImei _Sim.DateTime Time.FullOrder & text ^_Sim.Net write > { } { pop } ifelse % % stack: remaining-data % } loop pop2 _Dev.File ".txt" reextend dup exists { dup ".xdx" reextend overwrite } { pop } ifelse _Dev.File del false } ifelse ? } loop