mirror of
https://github.com/traccar/traccar.git
synced 2025-01-08 11:47:49 +08:00
changes Anton asked me
This commit is contained in:
parent
d045c1e217
commit
0e7cb81693
13
debug.xml
13
debug.xml
@ -65,15 +65,10 @@
|
||||
<!-- DATABASE CONFIG -->
|
||||
|
||||
<!--<entry key='database.driverFile'>hsqldb.jar</entry>-->
|
||||
<!--<entry key='database.driver'>org.h2.Driver</entry>
|
||||
<entry key='database.driver'>org.h2.Driver</entry>
|
||||
<entry key='database.url'>jdbc:h2:./target/database</entry>
|
||||
<entry key='database.user'>sa</entry>
|
||||
<entry key='database.password'></entry>-->
|
||||
|
||||
<entry key='database.driver'>com.mysql.jdbc.Driver</entry>
|
||||
<entry key='database.url'>jdbc:mysql://127.0.0.1:3306/traccar?allowMultiQueries=true&autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8&sessionVariables=sql_mode=ANSI_QUOTES</entry>
|
||||
<entry key='database.user'>traccar</entry>
|
||||
<entry key='database.password'>###########</entry>
|
||||
<entry key='database.password'></entry>
|
||||
|
||||
<entry key='database.ignoreUnknown'>true</entry>
|
||||
|
||||
@ -320,6 +315,10 @@
|
||||
DELETE FROM notifications WHERE id = :id;
|
||||
</entry>
|
||||
|
||||
<entry key='database.clearPositionsHistory'>
|
||||
DELETE FROM positions WHERE deviceid = :deviceId and servertime < :serverTime;
|
||||
</entry>
|
||||
|
||||
<!-- PROTOCOL CONFIG -->
|
||||
|
||||
<entry key='gps103.port'>5001</entry>
|
||||
|
35
schema/changelog-3.7.xml
Normal file
35
schema/changelog-3.7.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"
|
||||
logicalFilePath="changelog-3.7">
|
||||
|
||||
<changeSet author="author" id="changelog-3.7">
|
||||
|
||||
<update tableName="devices">
|
||||
<column name="groupid"/>
|
||||
<where>groupid NOT IN (SELECT id FROM groups)</where>
|
||||
</update>
|
||||
|
||||
<addForeignKeyConstraint baseColumnNames="groupid" baseTableName="devices" constraintName="fk_device_group_groupid" onDelete="SET NULL" onUpdate="RESTRICT" referencedColumnNames="id" referencedTableName="groups"/>
|
||||
|
||||
<update tableName="groups">
|
||||
<column name="groupid"/>
|
||||
<where>groupid NOT IN (SELECT id FROM (SELECT id FROM groups) AS groups_ids)</where>
|
||||
</update>
|
||||
|
||||
</changeSet>
|
||||
|
||||
<changeSet author="author" id="changelog-3.7-notmssql">
|
||||
|
||||
<preConditions onFail="MARK_RAN">
|
||||
<not>
|
||||
<dbms type="mssql" />
|
||||
</not>
|
||||
</preConditions>
|
||||
<addForeignKeyConstraint baseColumnNames="groupid" baseTableName="groups" constraintName="fk_group_group_groupid" onDelete="SET NULL" onUpdate="RESTRICT" referencedColumnNames="id" referencedTableName="groups"/>
|
||||
|
||||
</changeSet>
|
||||
</databaseChangeLog>
|
@ -8,4 +8,5 @@
|
||||
<include file="changelog-3.3.xml" relativeToChangelogFile="true" />
|
||||
<include file="changelog-3.5.xml" relativeToChangelogFile="true" />
|
||||
<include file="changelog-3.6.xml" relativeToChangelogFile="true" />
|
||||
<include file="changelog-3.7.xml" relativeToChangelogFile="true" />
|
||||
</databaseChangeLog>
|
||||
|
@ -33,6 +33,7 @@ public abstract class BaseProtocol implements Protocol {
|
||||
|
||||
public BaseProtocol(String name) {
|
||||
this.name = name;
|
||||
supportedCommands.add(Command.TYPE_CUSTOM);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,7 +43,6 @@ public abstract class BaseProtocol implements Protocol {
|
||||
|
||||
public void setSupportedCommands(String... commands) {
|
||||
supportedCommands.addAll(Arrays.asList(commands));
|
||||
supportedCommands.add(Command.TYPE_CUSTOM);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -21,6 +21,8 @@ import java.util.TimerTask;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class Main {
|
||||
static final long cleanDelay = 10*1000; //10 sec
|
||||
static final long cleanPeriod = 24*60*60*1000; //24 hr
|
||||
|
||||
private Main() {
|
||||
}
|
||||
@ -36,19 +38,18 @@ public final class Main {
|
||||
Context.getWebServer().start();
|
||||
}
|
||||
|
||||
//added by Erez
|
||||
Timer timer = new Timer();
|
||||
timer.scheduleAtFixedRate(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
// Clean positions history every day
|
||||
// Clean positions history
|
||||
try {
|
||||
Context.getDataManager().clearPositionsHistory();
|
||||
} catch (Exception error) {
|
||||
Log.warning(error);
|
||||
}
|
||||
}
|
||||
}, 10*1000, 24*60*60*1000);
|
||||
}, cleanDelay, cleanPeriod);
|
||||
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
@Override
|
||||
|
@ -521,22 +521,24 @@ public class DataManager implements IdentityManager {
|
||||
.executeQuery(Position.class);
|
||||
}
|
||||
|
||||
//added by Erez
|
||||
public void clearPositionsHistory() throws SQLException {
|
||||
//SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
|
||||
String histDays = config.getString("database.positionsHistoryDays");
|
||||
if (histDays == null) {
|
||||
histDays = "7";
|
||||
int histDays = config.getInteger("database.positionsHistoryDays");
|
||||
if (histDays == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
String sql = getQuery("database.clearPositionsHistory");
|
||||
if (sql == null) {
|
||||
return;
|
||||
}
|
||||
int n = Integer.parseInt(histDays);
|
||||
|
||||
for (Device device : getAllDevices()) {
|
||||
Date lastUpdate = device.getLastUpdate();
|
||||
if(lastUpdate != null){
|
||||
|
||||
Date dateBefore = new Date(lastUpdate.getTime() - n * 24 * 3600 * 1000 ); //Subtract n days
|
||||
Date dateBefore = new Date(lastUpdate.getTime() - histDays * 24 * 3600 * 1000 ); //Subtract histDays days
|
||||
//String dt = s.format(dateBefore);
|
||||
String sql = "DELETE FROM positions WHERE deviceid=:deviceId and servertime<:serverTime";
|
||||
|
||||
QueryBuilder.create(dataSource, sql)
|
||||
.setLong("deviceId", device.getId())
|
||||
|
@ -28,7 +28,7 @@ public class Position extends Message {
|
||||
public static final String KEY_GPS = "gps";
|
||||
public static final String KEY_EVENT = "event";
|
||||
public static final String KEY_ALARM = "alarm";
|
||||
public static final String KEY_ALARM_TYPE = "alarm-type"; //added by Erez
|
||||
public static final String KEY_ALARM_TYPE = "alarm-type";
|
||||
public static final String KEY_STATUS = "status";
|
||||
public static final String KEY_ODOMETER = "odometer";
|
||||
public static final String KEY_HOURS = "hours";
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class AquilaProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new AquilaProtocolDecoder(AquilaProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class Ardi01Protocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new Ardi01ProtocolDecoder(Ardi01Protocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class ArknavProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '\r'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new ArknavProtocolDecoder(ArknavProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class ArnaviProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new ArnaviProtocolDecoder(ArnaviProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class AuroProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new AuroProtocolDecoder(AuroProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class CarTrackProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "##"));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new CarTrackProtocolDecoder(CarTrackProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class DishaProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new DishaProtocolDecoder(DishaProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class EasyTrackProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new EasyTrackProtocolDecoder(EasyTrackProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class FoxProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "</fox>"));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new FoxProtocolDecoder(FoxProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class FreedomProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new FreedomProtocolDecoder(FreedomProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class GnxProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\n\r"));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new GnxProtocolDecoder(GnxProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class GotopProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new GotopProtocolDecoder(GotopProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class GpsMarkerProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r"));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new GpsMarkerProtocolDecoder(GpsMarkerProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -64,19 +64,19 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder {
|
||||
|
||||
private void processStatus(Position position, long status) {
|
||||
if (!BitUtil.check(status, 0) || !BitUtil.check(status, 1)
|
||||
|| !BitUtil.check(status, 3) || !BitUtil.check(status, 4) || !BitUtil.check(status, 7)) {//added by Erez
|
||||
|| !BitUtil.check(status, 3) || !BitUtil.check(status, 4) || !BitUtil.check(status, 7)) {
|
||||
position.set(Position.KEY_ALARM, true);
|
||||
|
||||
if (!BitUtil.check(status, 0)){//added by Erez
|
||||
position.set(Position.KEY_ALARM_TYPE, "theft alarm");
|
||||
if (!BitUtil.check(status, 0)){
|
||||
position.set(Position.KEY_ALARM_TYPE, "theft");
|
||||
} else if (!BitUtil.check(status, 1)){
|
||||
position.set(Position.KEY_ALARM_TYPE, "robbery alarm");
|
||||
position.set(Position.KEY_ALARM_TYPE, "robbery");
|
||||
} else if (!BitUtil.check(status, 3)){
|
||||
position.set(Position.KEY_ALARM_TYPE, "illegal ignition alarm");
|
||||
position.set(Position.KEY_ALARM_TYPE, "illegal ignition");
|
||||
} else if (!BitUtil.check(status, 4)){
|
||||
position.set(Position.KEY_ALARM_TYPE, "entering alarm");
|
||||
position.set(Position.KEY_ALARM_TYPE, "entering");
|
||||
} else if (!BitUtil.check(status, 7)){
|
||||
position.set(Position.KEY_ALARM_TYPE, "out alarm");
|
||||
position.set(Position.KEY_ALARM_TYPE, "out");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class HaicomProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '*'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new HaicomProtocolDecoder(HaicomProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -35,6 +36,7 @@ public class HomtecsProtocol extends BaseProtocol {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new HomtecsProtocolDecoder(HomtecsProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -38,6 +39,7 @@ public class KenjiProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new KenjiProtocolDecoder(KenjiProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class SanavProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '*'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new SanavProtocolDecoder(SanavProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -36,6 +37,7 @@ public class Stl060Protocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new Stl060FrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new Stl060ProtocolDecoder(Stl060Protocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class SupermateProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "#"));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new SupermateProtocolDecoder(SupermateProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -38,16 +38,16 @@ public class T55Protocol extends BaseProtocol {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new T55ProtocolDecoder(T55Protocol.this));
|
||||
}
|
||||
});
|
||||
serverList.add(new TrackerServer(new ConnectionlessBootstrap(), this.getName()) {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new T55ProtocolDecoder(T55Protocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -38,16 +38,16 @@ public class TaipProtocol extends BaseProtocol {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '<'));
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this, true));
|
||||
}
|
||||
});
|
||||
serverList.add(new TrackerServer(new ConnectionlessBootstrap(), this.getName()) {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new TaipProtocolDecoder(TaipProtocol.this, false));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class TelicProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new TelicFrameDecoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new TelicProtocolDecoder(TelicProtocol.this));
|
||||
}
|
||||
};
|
||||
|
@ -38,16 +38,16 @@ public class Tk103Protocol extends BaseProtocol {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ')'));
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this));
|
||||
}
|
||||
});
|
||||
serverList.add(new TrackerServer(new ConnectionlessBootstrap(), this.getName()) {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new Tk103ProtocolDecoder(Tk103Protocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -37,8 +37,8 @@ public class Tlt2hProtocol extends BaseProtocol {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(32 * 1024, "##\r\n"));
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new Tlt2hProtocolDecoder(Tlt2hProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class TopflytechProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, ')'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new TopflytechProtocolDecoder(TopflytechProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class Tt8850Protocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "$"));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new Tt8850ProtocolDecoder(Tt8850Protocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class UproProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new UproProtocolDecoder(UproProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -38,6 +39,7 @@ public class V680Protocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "##"));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new V680ProtocolDecoder(V680Protocol.this));
|
||||
}
|
||||
});
|
||||
@ -45,6 +47,7 @@ public class V680Protocol extends BaseProtocol {
|
||||
@Override
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new V680ProtocolDecoder(V680Protocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -18,6 +18,7 @@ package org.traccar.protocol;
|
||||
import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.CharacterDelimiterFrameDecoder;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -37,6 +38,7 @@ public class VisiontekProtocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, '#'));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new VisiontekProtocolDecoder(VisiontekProtocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.Context;
|
||||
import org.traccar.TrackerServer;
|
||||
@ -43,6 +44,7 @@ public class XexunProtocol extends BaseProtocol {
|
||||
pipeline.addLast("frameDecoder", new XexunFrameDecoder());
|
||||
}
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new XexunProtocolDecoder(XexunProtocol.this, full));
|
||||
}
|
||||
});
|
||||
|
@ -19,6 +19,7 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
|
||||
import org.jboss.netty.channel.ChannelPipeline;
|
||||
import org.jboss.netty.handler.codec.frame.LineBasedFrameDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringDecoder;
|
||||
import org.jboss.netty.handler.codec.string.StringEncoder;
|
||||
import org.traccar.BaseProtocol;
|
||||
import org.traccar.TrackerServer;
|
||||
|
||||
@ -37,6 +38,7 @@ public class Xt013Protocol extends BaseProtocol {
|
||||
protected void addSpecificHandlers(ChannelPipeline pipeline) {
|
||||
pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024));
|
||||
pipeline.addLast("stringDecoder", new StringDecoder());
|
||||
pipeline.addLast("stringEncoder", new StringEncoder());
|
||||
pipeline.addLast("objectDecoder", new Xt013ProtocolDecoder(Xt013Protocol.this));
|
||||
}
|
||||
});
|
||||
|
@ -118,13 +118,9 @@ public class WebServer {
|
||||
resourceHandler.setResourceBase(config.getString("web.path"));
|
||||
if (config.getBoolean("web.debug")) {
|
||||
resourceHandler.setWelcomeFiles(new String[] {"debug.html"});
|
||||
//Troubleshooting Locked Files on Windows (changed by Erez)
|
||||
//Troubleshooting Locked UI Files on Windows while app is running (like html, js, css, etc...),
|
||||
//you can make changes to the UI Files and refresh the page in the browser without stopping the app first
|
||||
resourceHandler.setMinMemoryMappedContentLength(-1);
|
||||
|
||||
/*DefaultServlet defaultServlet = new DefaultServlet();
|
||||
ServletHolder holder = new ServletHolder(defaultServlet);
|
||||
holder.setInitParameter("useFileMappedBuffer", "false");
|
||||
handler.addServlet(holder, "/");*/
|
||||
} else {
|
||||
resourceHandler.setWelcomeFiles(new String[] {"release.html", "index.html"});
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
@echo off
|
||||
cd C:\Users\Erez\Documents\traccar\web
|
||||
set SDK=C:\inetpub\wwwroot\ext-6.0.0
|
||||
cd C:\[traccar path]\traccar\web
|
||||
set SDK=C:\[sencha path]\ext-6.0.0
|
||||
|
||||
sencha -sdk %SDK% compile -classpath=app.js,app,%SDK%\packages\core\src,%SDK%\packages\core\overrides,%SDK%\classic\classic\src,%SDK%\classic\classic\overrides exclude -all and include -recursive -file app.js and exclude -namespace=Ext and concatenate -closure app.min.js
|
||||
|
@ -32,7 +32,6 @@ for i in range(0, len(waypoints)):
|
||||
lon = lon1 + (lon2 - lon1) * j / count
|
||||
points.append((lat, lon))
|
||||
|
||||
#changed by Erez
|
||||
def send(lat, lon, course, alarm):
|
||||
params = (('id', id), ('timestamp', int(time.time())), ('lat', lat), ('lon', lon), ('bearing', course))
|
||||
if alarm:
|
||||
@ -53,7 +52,7 @@ index = 0
|
||||
while True:
|
||||
(lat1, lon1) = points[index % len(points)]
|
||||
(lat2, lon2) = points[(index + 1) % len(points)]
|
||||
alarm = ((index % 10) == 0)#added by Erez
|
||||
alarm = False #((index % 10) == 0)
|
||||
send(lat1, lon1, course(lat1, lon1, lat2, lon2), alarm)
|
||||
time.sleep(period)
|
||||
index += 1
|
||||
|
@ -34,7 +34,6 @@ Ext.define('Traccar.AttributeFormatter', {
|
||||
return Ext.getStore('DistanceUnits').formatValue(value, Traccar.app.getPreference('distanceUnit'));
|
||||
},
|
||||
|
||||
//added by Erez
|
||||
alarmFormatter: function (attributes) {
|
||||
if (attributes instanceof Object) {
|
||||
if (attributes.hasOwnProperty('alarm')){
|
||||
@ -48,7 +47,6 @@ Ext.define('Traccar.AttributeFormatter', {
|
||||
return '';
|
||||
},
|
||||
|
||||
//added by Erez
|
||||
alarmTypeFormatter: function (attributes) {
|
||||
var alatmType = '';
|
||||
if (attributes instanceof Object) {
|
||||
@ -86,9 +84,9 @@ Ext.define('Traccar.AttributeFormatter', {
|
||||
return this.courseFormatter;
|
||||
} else if (key === 'distance' || key === 'odometer') {
|
||||
return this.distanceFormatter;
|
||||
} else if (key === 'alarm') {//added by Erez
|
||||
} else if (key === 'alarm') {
|
||||
return this.alarmFormatter;
|
||||
} else if (key === 'alarm-type') {//added by Erez
|
||||
} else if (key === 'alarm-type') {
|
||||
return this.alarmTypeFormatter;
|
||||
} else {
|
||||
return this.defaultFormatter;
|
||||
|
@ -58,7 +58,7 @@ Ext.define('Traccar.view.Devices', {
|
||||
}, {
|
||||
xtype: 'tbfill'
|
||||
},{
|
||||
id: 'showAlarmButton',//added by Erez
|
||||
id: 'showAlarmButton',
|
||||
glyph: 'xf0a2@FontAwesome',
|
||||
tooltip: 'Show Alarms',
|
||||
tooltipType: 'title',
|
||||
|
@ -116,12 +116,12 @@ Ext.define('Traccar.view.Report', {
|
||||
flex: 1,
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('address')
|
||||
}, {
|
||||
text: 'Alarm',//added by Erez
|
||||
text: 'Alarm',
|
||||
dataIndex: 'attributes',
|
||||
flex: 1,
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('alarm')
|
||||
}, {
|
||||
text: 'Alarm Type',//added by Erez
|
||||
text: 'Alarm Type',
|
||||
dataIndex: 'attributes',
|
||||
flex: 1,
|
||||
renderer: Traccar.AttributeFormatter.getFormatter('alarm-type')
|
||||
|
@ -62,7 +62,7 @@ Ext.define('Traccar.view.StateController', {
|
||||
if (this.deviceId === data[i].get('deviceId')) {
|
||||
this.updatePosition(data[i]);
|
||||
}
|
||||
var position = data[i]; //added by Erez
|
||||
var position = data[i];
|
||||
var attributes = position.get('attributes');
|
||||
if (attributes instanceof Object){
|
||||
if (attributes.hasOwnProperty('alarm') && this.showAlarmSelected()) this.onAlarm(position.get('deviceId'), attributes);
|
||||
@ -109,11 +109,11 @@ Ext.define('Traccar.view.StateController', {
|
||||
}
|
||||
},
|
||||
|
||||
showAlarmSelected: function () {//added by Erez
|
||||
showAlarmSelected: function () {
|
||||
return Ext.getCmp('showAlarmButton') && Ext.getCmp('showAlarmButton').pressed;
|
||||
},
|
||||
|
||||
onAlarm: function(deviceId, attributes){//added by Erez
|
||||
onAlarm: function(deviceId, attributes){
|
||||
var alatmType = '';
|
||||
for (key in attributes) {
|
||||
if (attributes.hasOwnProperty(key) && key.toLowerCase()=='alarm-type') {
|
||||
@ -130,7 +130,7 @@ Ext.define('Traccar.view.StateController', {
|
||||
}
|
||||
},
|
||||
|
||||
showAlarmMsg: function(msg){//added by Erez
|
||||
showAlarmMsg: function(msg){
|
||||
this.beep();
|
||||
var alarmMsg = Ext.Msg.show({
|
||||
title:'Alarm',
|
||||
@ -146,7 +146,7 @@ Ext.define('Traccar.view.StateController', {
|
||||
|
||||
},
|
||||
|
||||
beep: function() {//added by Erez
|
||||
beep: function() {
|
||||
if(this.snd == null){
|
||||
this.snd = new Audio("data:audio/wav;base64,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qJrx4KOQjahZxWbcZgztj2c49nKmkId44S71j0c8eV9yDK6uPRzx5X18eDvjvQ6yKo9ZSS6l//8elePK/Lf//IInrOF/FvDoADYAGBMGb7FtErm5MXMlmPAJQVgWta7Zx2go+8xJ0UiCb8LHHdftWyLJE0QIAIsI+UbXu67dZMjmgDGCGl1H+vpF4NSDckSIkk7Vd+sxEhBQMRU8j/12UIRhzSaUdQ+rQU5kGeFxm+hb1oh6pWWmv3uvmReDl0UnvtapVaIzo1jZbf/pD6ElLqSX+rUmOQNpJFa/r+sa4e/pBlAABoAAAAA3CUgShLdGIxsY7AUABPRrgCABdDuQ5GC7DqPQCgbbJUAoRSUj+NIEig0YfyWUho1VBBBA//uQZB4ABZx5zfMakeAAAAmwAAAAF5F3P0w9GtAAACfAAAAAwLhMDmAYWMgVEG1U0FIGCBgXBXAtfMH10000EEEEEECUBYln03TTTdNBDZopopYvrTTdNa325mImNg3TTPV9q3pmY0xoO6bv3r00y+IDGid/9aaaZTGMuj9mpu9Mpio1dXrr5HERTZSmqU36A3CumzN/9Robv/Xx4v9ijkSRSNLQhAWumap82WRSBUqXStV/YcS+XVLnSS+WLDroqArFkMEsAS+eWmrUzrO0oEmE40RlMZ5+ODIkAyKAGUwZ3mVKmcamcJnMW26MRPgUw6j+LkhyHGVGYjSUUKNpuJUQoOIAyDvEyG8S5yfK6dhZc0Tx1KI/gviKL6qvvFs1+bWtaz58uUNnryq6kt5RzOCkPWlVqVX2a/EEBUdU1KrXLf40GoiiFXK///qpoiDXrOgqDR38JB0bw7SoL+ZB9o1RCkQjQ2CBYZKd/+VJxZRRZlqSkKiws0WFxUyCwsKiMy7hUVFhIaCrNQsKkTIsLivwKKigsj8XYlwt/WKi2N4d//uQRCSAAjURNIHpMZBGYiaQPSYyAAABLAAAAAAAACWAAAAApUF/Mg+0aohSIRobBAsMlO//Kk4soosy1JSFRYWaLC4qZBYWFRGZdwqKiwkNBVmoWFSJkWFxX4FFRQWR+LsS4W/rFRb/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////VEFHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAU291bmRib3kuZGUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMjAwNGh0dHA6Ly93d3cuc291bmRib3kuZGUAAAAAAAAAACU=");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user