mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
added config related parts
This commit is contained in:
parent
25dedfde6c
commit
7a09f94767
5 changed files with 34 additions and 4 deletions
|
@ -5,9 +5,24 @@ import { setActivePinia } from "pinia";
|
||||||
import pinia from "../store/index";
|
import pinia from "../store/index";
|
||||||
setActivePinia(pinia);
|
setActivePinia(pinia);
|
||||||
|
|
||||||
import { settingsStore as settings } from "../store/settingsStore.js";
|
import { settingsStore as settings, onChange } from "../store/settingsStore.js";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<h5>...soon...</h5>
|
<div class="input-group input-group-sm mb-1">
|
||||||
|
<label class="input-group-text w-50">Enable message auto repeat</label>
|
||||||
|
<label class="input-group-text w-50">
|
||||||
|
<div class="form-check form-switch form-check-inline ms-2">
|
||||||
|
<input
|
||||||
|
class="form-check-input"
|
||||||
|
type="checkbox"
|
||||||
|
@change="onChange"
|
||||||
|
v-model="settings.remote.MESSAGES.enable_auto_repeat"
|
||||||
|
/>
|
||||||
|
<label class="form-check-label" for="enableMessagesAutoRepeatSwitch"
|
||||||
|
>Re-send message on beacon</label
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -98,6 +98,9 @@ const defaultConfig = {
|
||||||
tci_ip: "127.0.0.1",
|
tci_ip: "127.0.0.1",
|
||||||
tci_port: 0,
|
tci_port: 0,
|
||||||
},
|
},
|
||||||
|
MESSAGES: {
|
||||||
|
enable_auto_repeat: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,9 @@ class CONFIG:
|
||||||
'tx_delay': int,
|
'tx_delay': int,
|
||||||
'beacon_interval': int,
|
'beacon_interval': int,
|
||||||
},
|
},
|
||||||
|
'MESSAGES': {
|
||||||
|
'enable_auto_repeat': bool,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
default_values = {
|
default_values = {
|
||||||
|
@ -175,6 +178,7 @@ class CONFIG:
|
||||||
|
|
||||||
# Sets and writes config data from a dict containing data settings
|
# Sets and writes config data from a dict containing data settings
|
||||||
def write(self, data):
|
def write(self, data):
|
||||||
|
print(data)
|
||||||
# Validate config data before writing
|
# Validate config data before writing
|
||||||
self.validate_data(data)
|
self.validate_data(data)
|
||||||
|
|
||||||
|
|
|
@ -17,5 +17,6 @@ class BeaconFrameHandler(frame_handler.FrameHandler):
|
||||||
self.details['frame']["gridsquare"]
|
self.details['frame']["gridsquare"]
|
||||||
)
|
)
|
||||||
|
|
||||||
# set message to queued if beacon received
|
if self.config["MESSAGES"]["enable_auto_repeat"]:
|
||||||
DatabaseManagerMessages(self.event_manager).set_message_to_queued_for_callsign(self.details['frame']["origin"])
|
# set message to queued if beacon received
|
||||||
|
DatabaseManagerMessages(self.event_manager).set_message_to_queued_for_callsign(self.details['frame']["origin"])
|
||||||
|
|
|
@ -2,6 +2,9 @@ import frame_handler_ping
|
||||||
import helpers
|
import helpers
|
||||||
import data_frame_factory
|
import data_frame_factory
|
||||||
import frame_handler
|
import frame_handler
|
||||||
|
from message_system_db_messages import DatabaseManagerMessages
|
||||||
|
|
||||||
|
|
||||||
class CQFrameHandler(frame_handler_ping.PingFrameHandler):
|
class CQFrameHandler(frame_handler_ping.PingFrameHandler):
|
||||||
|
|
||||||
def should_respond(self):
|
def should_respond(self):
|
||||||
|
@ -14,3 +17,7 @@ class CQFrameHandler(frame_handler_ping.PingFrameHandler):
|
||||||
self.details['snr']
|
self.details['snr']
|
||||||
)
|
)
|
||||||
self.transmit(qrv_frame)
|
self.transmit(qrv_frame)
|
||||||
|
|
||||||
|
if self.config["MESSAGES"]["enable_auto_repeat"]:
|
||||||
|
# set message to queued if beacon received
|
||||||
|
DatabaseManagerMessages(self.event_manager).set_message_to_queued_for_callsign(self.details['frame']["origin"])
|
||||||
|
|
Loading…
Reference in a new issue