1st version that works
This commit is contained in:
47
libSafeMobile/src/main/java/com/safemobile/lib/Alarm.java
Normal file
47
libSafeMobile/src/main/java/com/safemobile/lib/Alarm.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.safemobile.lib;
|
||||
|
||||
public class Alarm {
|
||||
public int idx;
|
||||
public String unitName;
|
||||
public int type;
|
||||
public String typestr;
|
||||
public String description;
|
||||
public long timeGMT;
|
||||
public int ack;
|
||||
public long sc_id;
|
||||
|
||||
public Alarm()
|
||||
{
|
||||
}
|
||||
|
||||
public Alarm(int idx, int type, String description, int timeGMT, int ack, int sc_id)
|
||||
{
|
||||
this.idx = idx;
|
||||
this.sc_id = sc_id;
|
||||
this.type = type;
|
||||
this.description = description;
|
||||
this.timeGMT = timeGMT;
|
||||
this.ack = ack;
|
||||
switch (this.type)
|
||||
{
|
||||
case 0: typestr = "emergency";
|
||||
break;
|
||||
case 1: typestr = "landmark";
|
||||
break;
|
||||
case 2: typestr = "zone";
|
||||
break;
|
||||
case 3: typestr = "speed";
|
||||
break;
|
||||
case 4: typestr = "telemetry";
|
||||
break;
|
||||
default:
|
||||
typestr = "emergency";
|
||||
}
|
||||
this.unitName = "Empty";
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "idx: " + idx + " | sc_id: " + sc_id + " | type: " + type + " | description: " + description + " | timeGMT: " + timeGMT + " | ack:" + ack + " | typestr:" + typestr+" | unitName:" + unitName;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user