% % install locaters in map % "markmaps" *trakpreh % % get this trackers physical user device data % empty !Sim.PartImei "Status" !Sim.Track *trakstan "0x17C" !Sim.Engine % % flag no valid reading yet % empty !Sim.Valid 0.0 !Sim.Vlat 0.0 !Sim.Vlon _Sim.PartImei isnull) { "Imei_" _Sim.UniqueName %%% 2 right Str.PostDig & text*conn "PartImei " &_Sim.UniqueName &" " &_Sim.PartImei log# } if % % process data points, keeping an hour of data % "LOD_" &_Sim.PartImei anytext !wilder "setwilder" log)( 0 !counter % % tag as first cycle % true !fircyc 40 !Limiter % % forces next value of latitude and longitude to be counted % 0.0 !Sim.Lat 0.0 !Sim.Lon % % cycle LOD's for this tracker from most recent back % false !needed conn empty { % % stack: path seed % -Limiter negative ? prevfile ? _fircyc "firstcyc" log)( { % % do not process new map if no new data point % is there a current map file % "tracker" *trakings "vehicle" *trakings or "fence" *trakings or { true } { "map" &_Sim.Sid conntext dup exists "mapexist" log)( { % % prior map file exists, check times against most recent data record % stamp second ^4 stamp "s" Time.Diff positive % % positive difference means new data point % } { % % we need new map file, none exists % pop true } ifelse } ifelse "setneeded" log)( !needed false !fircyc } if _needed "ckneeded" log)( { dup !Sim.File % % next downward in time locater data point file % reading % % stack: path seed seed-content % _Sim.Lat _Sim.Lon rot execstr _Sim.DataValid "A" eq$ { % % convert raw latitude and longitude % %%% "3427.8993N" !Sim.RawLat %%% "08427.1379W" !Sim.RawLon % % stack: path seed prior-lat prior-lon % 0.0 !Sim.Lat 0.0 !Sim.Lon _Sim.RawLat length 10 eq { dup 1 right !Sim.LatPol *trakrawc _Sim.LatPol < |S -1.0 mul > pop !Sim.Lat _Sim.RawLon dup 1 right !Sim.LonPol *trakrawd _Sim.LonPol < |W -1.0 mul > pop !Sim.Lon } { % % problem with latitude and longitude % pop } ifelse _Sim.Lat 0.0 eq _Sim.Lon 0.0 eq or { % % did not get a proper calculation % } { _Sim.Msec !Sim.Valid _Sim.Lat !Sim.Vlat _Sim.Lon !Sim.Vlon % % observe deltas in lat and lon % _Sim.Lon sub abs exch _Sim.Lat sub abs add dup !Loc.Diff _Sim.Choke gt { +:counter % % valid previous history point with enough departure % _sumr second *trakfutc *traklalo !sumr } { % % not significant enough departure from original lat and lon % } ifelse } ifelse } { % % not a new valid reading of location in history % pop2 } ifelse % % don't process any more files if new map not needed % false } { true } ifelse ? } loop filing) _Sim.Valid isnull) _needed not or "simneeded" log)( { % % no significant content for a map file % _Time.Thours 60 mul 60 mul !Time.Barrier "LOD_" &_Sim.PartImei &"_" &"" textwild *trakpush } { % % valid map basis, get engine battery and user info inserts % empty !Sim.License empty !Sim.Vehicle _Sim.UniqueName "Vimages" conntext lookin pop % % insert the user id info attached to tracker % _sumr *trakfall !sumr % % replace history points with repeat of earliest valid point % { +counter _Sim.Marks gt ? _sumr _Sim.File *trakfutc *traklalo !sumr } loop % % new map file with valid data point % _sumr *trakmapi "map" &_Sim.Sid conn!text } ifelse