aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorLeandro Silva Ferreira <leandrosilvaferreira@gmail.com>2012-08-15 08:58:26 -0400
committerLeandro Silva Ferreira <leandrosilvaferreira@gmail.com>2012-08-15 08:58:26 -0400
commita946618d649cde478d8750bb6b84cb521b68c87c (patch)
tree1d6bf20b088439d71ee54e6beb6bc33e1ca1ad8a /src/org/traccar/model
parentf91125ae896c83b9b47fd73a47c2a7af15af77c4 (diff)
downloadtrackermap-server-a946618d649cde478d8750bb6b84cb521b68c87c.tar.gz
trackermap-server-a946618d649cde478d8750bb6b84cb521b68c87c.tar.bz2
trackermap-server-a946618d649cde478d8750bb6b84cb521b68c87c.zip
Corrections of wrong "git fetch upstream"
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/DatabaseDataManager.java2
-rw-r--r--src/org/traccar/model/Position.java19
2 files changed, 21 insertions, 0 deletions
diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java
index 384d87828..2207d272b 100644
--- a/src/org/traccar/model/DatabaseDataManager.java
+++ b/src/org/traccar/model/DatabaseDataManager.java
@@ -210,6 +210,7 @@ public class DatabaseDataManager implements DataManager {
position.setSpeed(result.getDouble("speed"));
position.setCourse(result.getDouble("course"));
position.setPower(result.getDouble("power"));
+ position.setMode(result.getInt("mode"));
positionList.add(position);
}
@@ -229,6 +230,7 @@ public class DatabaseDataManager implements DataManager {
queryAddPosition.setDouble("speed", position.getSpeed());
queryAddPosition.setDouble("course", position.getCourse());
queryAddPosition.setDouble("power", position.getPower());
+ queryAddPosition.setInt("mode", position.getMode());
queryAddPosition.setString("address", position.getAddress());
queryAddPosition.setString("extended_info", position.getExtendedInfo());
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index b408dbbf2..e6ac46de1 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -15,6 +15,7 @@
*/
package org.traccar.model;
+import java.text.SimpleDateFormat;
import java.util.Date;
/**
@@ -56,6 +57,12 @@ public class Position {
public Date getTime() {
return time;
}
+
+ public String getTimeFormated(){
+ SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
+ df.setLenient(false);
+ return df.format(time);
+ }
public void setTime(Date time) {
this.time = time;
@@ -151,6 +158,18 @@ public class Position {
public void setPower(Double power) {
this.power = power;
}
+ /**
+ * Mode / 1 - Parking | 2 - Driving
+ */
+ private int mode;
+
+ public int getMode() {
+ return mode;
+ }
+
+ public void setMode(int mode) {
+ this.mode = mode;
+ }
/**
* Address