1st version that works

This commit is contained in:
2022-03-14 11:53:00 +02:00
parent ee2884b2ff
commit 3806d2c80d
617 changed files with 17293 additions and 4470 deletions

View File

@ -0,0 +1,42 @@
package com.safemobile.lib;
import java.util.ArrayList;
public class LastPosmsg extends TCPmsg {
public ArrayList<LastPos> PosList;
public static int count=0;
public LastPosmsg(TCPmsg tcp) {
super(tcp);
PosList = new ArrayList<LastPos>();
String date4parsing = super.data;
//SM.Debug("SMS date4parsing:"+date4parsing);
String[] tempArr = date4parsing.split(";");
//SM.Debug("SMS tempArr.length:" +tempArr.length);
for(int i =0; i<tempArr.length;i++)
{
String[] tempVeh = tempArr[i].split("&");
if(tempVeh.length<6)
continue;
LastPos tmpLast = new LastPos();
tmpLast.imei = Long.parseLong(tempVeh[0]);
tmpLast.lat = Double.parseDouble(tempVeh[1]);
tmpLast.lng = Double.parseDouble(tempVeh[2]);
tmpLast.speed = Integer.parseInt(tempVeh[3]);
if (Integer.parseInt(tempVeh[4])==0) tmpLast.isON =true;
else tmpLast.isON = false;
tmpLast.timeGMT = Long.parseLong(tempVeh[5]);
//tmpLast.Address = tempVeh[6];
tmpLast.Address = "";
PosList.add(tmpLast);
//SM.Debug("duda",tmpLast.toString());
}
count +=this.PosList.size();
SM.Debug("duda","LastList size:" +this.PosList.size() + " total:" +count);
}
}