LAPI-298: Update settings in default.toml
This commit is contained in:
parent
ea2e0168d3
commit
12619dcd67
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
node_modules
|
||||
.vscode
|
||||
.vscode
|
||||
logs/*
|
||||
!logs
|
@ -14,7 +14,9 @@ accept_untrusted_certs = true
|
||||
[settings]
|
||||
send_voice = true
|
||||
send_gps = false
|
||||
gps_report_interval = 1000 # The interval in which the GPS is sent
|
||||
gps_report_interval = 4000 # The interval in which the GPS is sent
|
||||
gps_lat_start_point = 46.217802
|
||||
gps_lng_start_point = 24.776126
|
||||
|
||||
[assets]
|
||||
# ids = [1947]
|
||||
|
@ -426,12 +426,11 @@ class Asset {
|
||||
}
|
||||
|
||||
_sendGPS(callback) {
|
||||
console.log('_sendGPS')
|
||||
let hub = this.hub;
|
||||
if (hub && hub.connected) {
|
||||
|
||||
let lat = 46.217802;
|
||||
let lng = 24.776126;
|
||||
let lat = this.configs.settings.gps_lat_start_point;
|
||||
let lng = this.configs.settings.gps_lng_start_point;
|
||||
|
||||
setInterval(() => {
|
||||
var new_lat = this._randomCoordinates(lat);
|
||||
@ -453,7 +452,6 @@ class Asset {
|
||||
lat = new_lat;
|
||||
lng = new_lng;
|
||||
|
||||
console.log('_sendGPS | lat:', lat, ' | lng:', lng)
|
||||
}, this.configs.settings.gps_report_interval);
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ const moment = require('moment');
|
||||
|
||||
module.exports.writeLog = async (value) => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
await fs.writeFile('./logs/simulator-log', `[${moment().format('YYYY-MM-DD HH:mm:ss')}] ${value}\n`, {'flag':'a'}, function(err) {
|
||||
await fs.writeFile('./logs/simulator-log', `[${moment().format('YYYY-MM-DD HH:mm:ss')}] ${value}\n`, {'flag':'a'}, (err) => {
|
||||
if (err) { reject(err); }
|
||||
else { resolve(); }
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user