feat(interface): extend interface type handling to include 'RNodeIPInterface' and set default values for new interface properties
This commit is contained in:
@@ -310,7 +310,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- interface Frequency -->
|
<!-- interface Frequency -->
|
||||||
<div v-if="newInterfaceType === 'RNodeInterface'" class="mb-2">
|
<div v-if="['RNodeInterface', 'RNodeIPInterface'].includes(newInterfaceType)" class="mb-2">
|
||||||
<FormLabel class="mb-1">
|
<FormLabel class="mb-1">
|
||||||
<span>Frequency</span><span v-if="formattedFrequency">: {{ formattedFrequency }}</span>
|
<span>Frequency</span><span v-if="formattedFrequency">: {{ formattedFrequency }}</span>
|
||||||
</FormLabel>
|
</FormLabel>
|
||||||
@@ -349,7 +349,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- interface bandwidth -->
|
<!-- interface bandwidth -->
|
||||||
<div v-if="newInterfaceType === 'RNodeInterface'" class="mb-2">
|
<div v-if="['RNodeInterface', 'RNodeIPInterface'].includes(newInterfaceType)" class="mb-2">
|
||||||
<FormLabel class="mb-1">Bandwidth</FormLabel>
|
<FormLabel class="mb-1">Bandwidth</FormLabel>
|
||||||
<select
|
<select
|
||||||
v-model="newInterfaceBandwidth"
|
v-model="newInterfaceBandwidth"
|
||||||
@@ -366,7 +366,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- interface txpower -->
|
<!-- interface txpower -->
|
||||||
<div v-if="newInterfaceType === 'RNodeInterface'" class="mb-2">
|
<div v-if="['RNodeInterface', 'RNodeIPInterface'].includes(newInterfaceType)" class="mb-2">
|
||||||
<FormLabel class="mb-1">Transmit Power (dBm)</FormLabel>
|
<FormLabel class="mb-1">Transmit Power (dBm)</FormLabel>
|
||||||
<input
|
<input
|
||||||
v-model="newInterfaceTxpower"
|
v-model="newInterfaceTxpower"
|
||||||
@@ -375,13 +375,13 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="newInterfaceType === 'RNodeInterface'" class="mb-2 flex flex-wrap items-start gap-4">
|
<div v-if="['RNodeInterface', 'RNodeIPInterface'].includes(newInterfaceType)" class="mb-2 flex flex-wrap items-start gap-4">
|
||||||
<!-- interface spreading factor -->
|
<!-- interface spreading factor -->
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
<FormLabel class="mb-1">Spreading Factor</FormLabel>
|
<FormLabel class="mb-1">Spreading Factor</FormLabel>
|
||||||
<select
|
<select
|
||||||
v-model="newInterfaceSpreadingFactor"
|
v-model="newInterfaceSpreadingFactor"
|
||||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white dark:focus:ring-blue-600 dark:focus:border-blue-600"
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white dark:focus:ring-blue-600 dark:focus:border-blue-500"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
v-for="spreadingfactor in RNodeInterfaceDefaults.spreadingfactors"
|
v-for="spreadingfactor in RNodeInterfaceDefaults.spreadingfactors"
|
||||||
@@ -398,7 +398,7 @@
|
|||||||
<FormLabel class="mb-1">Coding Rate</FormLabel>
|
<FormLabel class="mb-1">Coding Rate</FormLabel>
|
||||||
<select
|
<select
|
||||||
v-model="newInterfaceCodingRate"
|
v-model="newInterfaceCodingRate"
|
||||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white dark:focus:ring-blue-600 dark:focus:border-blue-600"
|
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-zinc-900 dark:border-zinc-600 dark:text-white dark:focus:ring-blue-600 dark:focus:border-blue-500"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
v-for="codingrate in RNodeInterfaceDefaults.codingrates"
|
v-for="codingrate in RNodeInterfaceDefaults.codingrates"
|
||||||
@@ -1164,10 +1164,10 @@ export default {
|
|||||||
RNodeMHzValue: 0,
|
RNodeMHzValue: 0,
|
||||||
RNodekHzValue: 0,
|
RNodekHzValue: 0,
|
||||||
newInterfaceFrequency: null,
|
newInterfaceFrequency: null,
|
||||||
newInterfaceBandwidth: null,
|
newInterfaceBandwidth: 125000,
|
||||||
newInterfaceTxpower: null,
|
newInterfaceTxpower: 7,
|
||||||
newInterfaceSpreadingFactor: null,
|
newInterfaceSpreadingFactor: 12,
|
||||||
newInterfaceCodingRate: null,
|
newInterfaceCodingRate: 5,
|
||||||
|
|
||||||
// Serial, KISS, and AX25KISS options
|
// Serial, KISS, and AX25KISS options
|
||||||
newInterfaceSpeed: null,
|
newInterfaceSpeed: null,
|
||||||
@@ -1503,9 +1503,9 @@ export default {
|
|||||||
airtime_limit_long: this.newInterfaceAirtimeLimitLong,
|
airtime_limit_long: this.newInterfaceAirtimeLimitLong,
|
||||||
airtime_limit_short: this.newInterfaceAirtimeLimitShort,
|
airtime_limit_short: this.newInterfaceAirtimeLimitShort,
|
||||||
|
|
||||||
// settings that can be added to any interface type
|
// settings that can be added to any interface type
|
||||||
mode: this.sharedInterfaceSettings.mode,
|
mode: this.sharedInterfaceSettings.mode || "full",
|
||||||
bitrate: this.sharedInterfaceSettings.bitrate,
|
bitrate: this.sharedInterfaceSettings.bitrate,
|
||||||
network_name: this.sharedInterfaceSettings.network_name,
|
network_name: this.sharedInterfaceSettings.network_name,
|
||||||
passphrase: this.sharedInterfaceSettings.passphrase,
|
passphrase: this.sharedInterfaceSettings.passphrase,
|
||||||
ifac_size: this.sharedInterfaceSettings.ifac_size,
|
ifac_size: this.sharedInterfaceSettings.ifac_size,
|
||||||
@@ -1550,6 +1550,13 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
calculateRNodeParameters(bandwidth, spreadingFactor, codingRate, noiseFloor, antennaGain, transmitPower) {
|
calculateRNodeParameters(bandwidth, spreadingFactor, codingRate, noiseFloor, antennaGain, transmitPower) {
|
||||||
|
if (!bandwidth || !spreadingFactor || !codingRate) {
|
||||||
|
this.RNodeInterfaceLoRaParameters.dataRate = "0 bps";
|
||||||
|
this.RNodeInterfaceLoRaParameters.sensitivity = "??? dBm";
|
||||||
|
this.RNodeInterfaceLoRaParameters.linkBudget = "??? dB";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// https://unsigned.io/understanding-lora-parameters/
|
// https://unsigned.io/understanding-lora-parameters/
|
||||||
// "SX1272/3/6/7/8 LoRa Modem Design Guide" https://www.openhacks.com/uploadsproductos/loradesignguide_std.pdf
|
// "SX1272/3/6/7/8 LoRa Modem Design Guide" https://www.openhacks.com/uploadsproductos/loradesignguide_std.pdf
|
||||||
// 4:5 - 4:8
|
// 4:5 - 4:8
|
||||||
|
|||||||
Reference in New Issue
Block a user