|
|
@ -57,6 +57,14 @@ |
|
|
<div id="ssid-list"></div> |
|
|
<div id="ssid-list"></div> |
|
|
<button id="add-ssid" class="icon-button" title="add SSID">➕</button> |
|
|
<button id="add-ssid" class="icon-button" title="add SSID">➕</button> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<div class="card separate-setting-card"> |
|
|
|
|
|
<h3>Region</h3> |
|
|
|
|
|
<div class="ssid-country-code"> |
|
|
|
|
|
<label for="wifi_country_code">Country Code</label> |
|
|
|
|
|
<input id="wifi_country_code" maxlength="2" placeholder="KR" /> |
|
|
|
|
|
<span class="field-hint">2-letter code such as KR, EU, JP, US</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
<div class="actions"> |
|
|
<div class="actions"> |
|
|
<div class="file-upload-wrapper-device" |
|
|
<div class="file-upload-wrapper-device" |
|
|
data-file-type="device" |
|
|
data-file-type="device" |
|
|
@ -184,7 +192,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
<!-- CAN --> |
|
|
<!-- CAN --> |
|
|
<div class="io-group"> |
|
|
<div class="io-group"> |
|
|
<h4>CAN / IMU Re-map</h4> |
|
|
<h4>CAN</h4> |
|
|
<div class="io-fieldset"> |
|
|
<div class="io-fieldset"> |
|
|
<div class="io-row"><span class="label-inline">Can Type</span><span class="colon">:</span> |
|
|
<div class="io-row"><span class="label-inline">Can Type</span><span class="colon">:</span> |
|
|
<select id="can_bus_type"> |
|
|
<select id="can_bus_type"> |
|
|
@ -203,38 +211,6 @@ |
|
|
<option value="10000">1M/s</option> |
|
|
<option value="10000">1M/s</option> |
|
|
</select> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
<div class="io-row"><span class="label-inline">imu re-map x</span><span class="colon">:</span> |
|
|
|
|
|
<select id="imu_remap_x"> |
|
|
|
|
|
<option value="">NONE</option> |
|
|
|
|
|
<option value="x">x</option> |
|
|
|
|
|
<option value="y">y</option> |
|
|
|
|
|
<option value="z">z</option> |
|
|
|
|
|
<option value="-x">-x</option> |
|
|
|
|
|
<option value="-y">-y</option> |
|
|
|
|
|
<option value="-z">-z</option> |
|
|
|
|
|
</select> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="io-row"><span class="label-inline">imu re-map y</span><span |
|
|
|
|
|
class="colon">:</span><select id="imu_remap_y"> |
|
|
|
|
|
<option value="">NONE</option> |
|
|
|
|
|
<option value="x">x</option> |
|
|
|
|
|
<option value="y">y</option> |
|
|
|
|
|
<option value="z">z</option> |
|
|
|
|
|
<option value="-x">-x</option> |
|
|
|
|
|
<option value="-y">-y</option> |
|
|
|
|
|
<option value="-z">-z</option> |
|
|
|
|
|
</select></div> |
|
|
|
|
|
<div class="io-row"><span class="label-inline">imu re-map z</span><span |
|
|
|
|
|
class="colon">:</span><select id="imu_remap_z"> |
|
|
|
|
|
<option value="">NONE</option> |
|
|
|
|
|
<option value="x">x</option> |
|
|
|
|
|
<option value="y">y</option> |
|
|
|
|
|
<option value="z">z</option> |
|
|
|
|
|
<option value="-x">-x</option> |
|
|
|
|
|
<option value="-y">-y</option> |
|
|
|
|
|
<option value="-z">-z</option> |
|
|
|
|
|
</select></div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -317,20 +293,6 @@ |
|
|
<option value="OPC_UA">OPC_UA</option> |
|
|
<option value="OPC_UA">OPC_UA</option> |
|
|
</select> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
<div class="io-row"><span class="label">heading_on</span> |
|
|
|
|
|
<select id="reg_heading_on"> |
|
|
|
|
|
<option selected disabled hidden="hidden"></option> |
|
|
|
|
|
<option value="on">on</option> |
|
|
|
|
|
<option value="off">off</option> |
|
|
|
|
|
</select> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="io-row"><span class="label">heading_imu_on</span> |
|
|
|
|
|
<select id="reg_heading_imu_on"> |
|
|
|
|
|
<option selected disabled hidden="hidden"></option> |
|
|
|
|
|
<option value="on">on</option> |
|
|
|
|
|
<option value="off">off</option> |
|
|
|
|
|
</select> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="io-fieldset"> |
|
|
<div class="io-fieldset"> |
|
|
<div class="io-row"><span class="label">DR On/Off</span> |
|
|
<div class="io-row"><span class="label">DR On/Off</span> |
|
|
@ -370,13 +332,6 @@ |
|
|
<option value="off">off</option> |
|
|
<option value="off">off</option> |
|
|
</select> |
|
|
</select> |
|
|
</div> |
|
|
</div> |
|
|
<div class="io-row"><span class="label">fixmode_on</span> |
|
|
|
|
|
<select id="reg_fixmode_on"> |
|
|
|
|
|
<option selected disabled hidden="hidden"></option> |
|
|
|
|
|
<option value="on">on</option> |
|
|
|
|
|
<option value="off">off</option> |
|
|
|
|
|
</select> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="io-row"><span class="label">Analog Input Level</span> |
|
|
<div class="io-row"><span class="label">Analog Input Level</span> |
|
|
<select id="reg_analog_input_level"> |
|
|
<select id="reg_analog_input_level"> |
|
|
<option selected disabled hidden="hidden"></option> |
|
|
<option selected disabled hidden="hidden"></option> |
|
|
@ -392,12 +347,6 @@ |
|
|
<label class="checkbox-with-text"> |
|
|
<label class="checkbox-with-text"> |
|
|
<input type="checkbox" id="ai1"/>AI1 |
|
|
<input type="checkbox" id="ai1"/>AI1 |
|
|
</label> |
|
|
</label> |
|
|
<label class="checkbox-with-text"> |
|
|
|
|
|
<input type="checkbox" id="ai2"/>AI2 |
|
|
|
|
|
</label> |
|
|
|
|
|
<label class="checkbox-with-text"> |
|
|
|
|
|
<input type="checkbox" id="ai3"/>AI3 |
|
|
|
|
|
</label> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="io-row checkbox-group"> |
|
|
<div class="io-row checkbox-group"> |
|
|
<label class="checkbox-with-text"> |
|
|
<label class="checkbox-with-text"> |
|
|
@ -406,12 +355,6 @@ |
|
|
<label class="checkbox-with-text"> |
|
|
<label class="checkbox-with-text"> |
|
|
<input type="checkbox" id="di1"/>DI1 |
|
|
<input type="checkbox" id="di1"/>DI1 |
|
|
</label> |
|
|
</label> |
|
|
<label class="checkbox-with-text"> |
|
|
|
|
|
<input type="checkbox" id="di2"/>DI2 |
|
|
|
|
|
</label> |
|
|
|
|
|
<label class="checkbox-with-text"> |
|
|
|
|
|
<input type="checkbox" id="di3"/>DI3 |
|
|
|
|
|
</label> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -437,9 +380,7 @@ |
|
|
<td><span class="idt-display"></span></td> |
|
|
<td><span class="idt-display"></span></td> |
|
|
<td><span class="odt-display"></span></td> |
|
|
<td><span class="odt-display"></span></td> |
|
|
<td><span class="dv-display"></span></td> |
|
|
<td><span class="dv-display"></span></td> |
|
|
<td><span class="shift-display"></span></td> |
|
|
|
|
|
<td><span class="expr-display"></span></td> |
|
|
<td><span class="expr-display"></span></td> |
|
|
<td><span class="mask-display"></span></td> |
|
|
|
|
|
</tr> |
|
|
</tr> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -455,9 +396,7 @@ |
|
|
<th>IDT</th> |
|
|
<th>IDT</th> |
|
|
<th>ODT</th> |
|
|
<th>ODT</th> |
|
|
<th>Default Value</th> |
|
|
<th>Default Value</th> |
|
|
<th>Shift</th> |
|
|
|
|
|
<th>Expression</th> |
|
|
<th>Expression</th> |
|
|
<th>Mask</th> |
|
|
|
|
|
</tr> |
|
|
</tr> |
|
|
</thead> |
|
|
</thead> |
|
|
<tbody id="modbus-field-list"> |
|
|
<tbody id="modbus-field-list"> |
|
|
@ -472,7 +411,7 @@ |
|
|
<select id="modbus_idt_input"> |
|
|
<select id="modbus_idt_input"> |
|
|
<option selected disabled hidden="hidden"></option> |
|
|
<option selected disabled hidden="hidden"></option> |
|
|
<option value="integer">integer</option> |
|
|
<option value="integer">integer</option> |
|
|
<option value="float64">float64</option> |
|
|
<option value="float">float</option> |
|
|
<option value="boolean">boolean</option> |
|
|
<option value="boolean">boolean</option> |
|
|
<option value="unsignedInteger">unsignedInteger</option> |
|
|
<option value="unsignedInteger">unsignedInteger</option> |
|
|
<option value="short">short</option> |
|
|
<option value="short">short</option> |
|
|
@ -488,14 +427,10 @@ |
|
|
<option value="boolean">boolean</option> |
|
|
<option value="boolean">boolean</option> |
|
|
<option value="string">string</option> |
|
|
<option value="string">string</option> |
|
|
</select> |
|
|
</select> |
|
|
<label>shift</label> |
|
|
|
|
|
<input type="text" id="modbus_shift_input" placeholder="Enter shift value"> |
|
|
|
|
|
<label class="nowrap">dv</label> |
|
|
<label class="nowrap">dv</label> |
|
|
<input type="text" id="modbus_dv_input" placeholder="Enter default value"> |
|
|
<input type="text" id="modbus_dv_input" placeholder="Enter default value"> |
|
|
<label>expr</label> |
|
|
<label>expr</label> |
|
|
<input type="text" id="modbus_expr_input" placeholder="Enter expression"> |
|
|
<input type="text" id="modbus_expr_input" placeholder="Enter expression"> |
|
|
<label class="nowrap">mask</label> |
|
|
|
|
|
<input type="text" id="modbus_mask_input" placeholder="Enter mask"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="modbus-actions"> |
|
|
<div class="modbus-actions"> |
|
|
@ -526,9 +461,7 @@ |
|
|
<td><span class="opcua-ns-display"></span></td> |
|
|
<td><span class="opcua-ns-display"></span></td> |
|
|
<td><span class="opcua-odt-display"></span></td> |
|
|
<td><span class="opcua-odt-display"></span></td> |
|
|
<td><span class="opcua-dv-display"></span></td> |
|
|
<td><span class="opcua-dv-display"></span></td> |
|
|
<td><span class="opcua-shift-display"></span></td> |
|
|
|
|
|
<td><span class="opcua-expr-display"></span></td> |
|
|
<td><span class="opcua-expr-display"></span></td> |
|
|
<td><span class="opcua-mask-display"></span></td> |
|
|
|
|
|
</tr> |
|
|
</tr> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
@ -544,9 +477,7 @@ |
|
|
<th>NS</th> |
|
|
<th>NS</th> |
|
|
<th>ODT</th> |
|
|
<th>ODT</th> |
|
|
<th>Default Value</th> |
|
|
<th>Default Value</th> |
|
|
<th>Shift</th> |
|
|
|
|
|
<th>Expression</th> |
|
|
<th>Expression</th> |
|
|
<th>Mask</th> |
|
|
|
|
|
</tr> |
|
|
</tr> |
|
|
</thead> |
|
|
</thead> |
|
|
<tbody id="opcua-field-list"> |
|
|
<tbody id="opcua-field-list"> |
|
|
@ -569,14 +500,10 @@ |
|
|
<option value="boolean">boolean</option> |
|
|
<option value="boolean">boolean</option> |
|
|
<option value="string">string</option> |
|
|
<option value="string">string</option> |
|
|
</select> |
|
|
</select> |
|
|
<label>shift</label> |
|
|
|
|
|
<input type="text" id="opcua_shift_input" placeholder="Enter shift value"> |
|
|
|
|
|
<label class="nowrap">dv(Default Value)</label> |
|
|
<label class="nowrap">dv(Default Value)</label> |
|
|
<input type="text" id="opcua_dv_input" placeholder="Enter default value"> |
|
|
<input type="text" id="opcua_dv_input" placeholder="Enter default value"> |
|
|
<label>expr</label> |
|
|
<label>expr</label> |
|
|
<input type="text" id="opcua_expr_input" placeholder="Enter expression"> |
|
|
<input type="text" id="opcua_expr_input" placeholder="Enter expression"> |
|
|
<label class="nowrap">mask</label> |
|
|
|
|
|
<input type="text" id="opcua_mask_input" placeholder="Enter mask"> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="opcua-actions"> |
|
|
<div class="opcua-actions"> |
|
|
@ -686,9 +613,11 @@ |
|
|
|
|
|
|
|
|
const ssidList = document.getElementById('ssid-list'); |
|
|
const ssidList = document.getElementById('ssid-list'); |
|
|
const ssidTmpl = document.getElementById('ssid-template'); |
|
|
const ssidTmpl = document.getElementById('ssid-template'); |
|
|
|
|
|
const countryCodeInput = document.getElementById('wifi_country_code'); |
|
|
const data = { |
|
|
const data = { |
|
|
/* Wi-Fi */ |
|
|
/* Wi-Fi */ |
|
|
wifi_static: '', wifi_ip: '', wifi_netmask: '', wifi_gateway: '', wifi_dns1: '', wifi_dns2: '', |
|
|
wifi_static: '', wifi_ip: '', wifi_netmask: '', wifi_gateway: '', wifi_dns1: '', wifi_dns2: '', |
|
|
|
|
|
wifi_country_code: '', |
|
|
|
|
|
|
|
|
/* Ethernet */ |
|
|
/* Ethernet */ |
|
|
eth_ip: '', eth_netmask: '', eth_gateway: '', |
|
|
eth_ip: '', eth_netmask: '', eth_gateway: '', |
|
|
@ -711,10 +640,6 @@ |
|
|
rs485_mode: '', rs485_baudrate: null, rs485_databits: null, |
|
|
rs485_mode: '', rs485_baudrate: null, rs485_databits: null, |
|
|
rs485_parity: '', rs485_stopbits: null, |
|
|
rs485_parity: '', rs485_stopbits: null, |
|
|
|
|
|
|
|
|
/* IMU (축 + 부호) */ |
|
|
|
|
|
imu_remap_x: '', imu_remap_y: '', imu_remap_z: '', |
|
|
|
|
|
imu_remap_x_sign: '', imu_remap_y_sign: '', imu_remap_z_sign: '', |
|
|
|
|
|
|
|
|
|
|
|
/* LTE 설정 */ |
|
|
/* LTE 설정 */ |
|
|
lte_ip: '', lte_netmask: '', lte_gateway: '', lte_port: null, |
|
|
lte_ip: '', lte_netmask: '', lte_gateway: '', lte_port: null, |
|
|
|
|
|
|
|
|
@ -729,12 +654,8 @@ |
|
|
'reg_analog_input_level': 'analog_input_level', |
|
|
'reg_analog_input_level': 'analog_input_level', |
|
|
'ai0': 'ai0', |
|
|
'ai0': 'ai0', |
|
|
'ai1': 'ai1', |
|
|
'ai1': 'ai1', |
|
|
'ai2': 'ai2', |
|
|
|
|
|
'ai3': 'ai3', |
|
|
|
|
|
'di0': 'di0', |
|
|
'di0': 'di0', |
|
|
'di1': 'di1', |
|
|
'di1': 'di1', |
|
|
'di2': 'di2', |
|
|
|
|
|
'di3': 'di3', |
|
|
|
|
|
'reg_can_input': 'can_input', |
|
|
'reg_can_input': 'can_input', |
|
|
'reg_device_type': 'dev_type', |
|
|
'reg_device_type': 'dev_type', |
|
|
'reg_dr_on_off': 'dr_on', |
|
|
'reg_dr_on_off': 'dr_on', |
|
|
@ -746,9 +667,6 @@ |
|
|
'reg_version': 'version', |
|
|
'reg_version': 'version', |
|
|
'reg_equipment_id': 'equipment_id', |
|
|
'reg_equipment_id': 'equipment_id', |
|
|
'reg_meid': 'MEID', |
|
|
'reg_meid': 'MEID', |
|
|
'reg_heading_on': 'heading_on', |
|
|
|
|
|
'reg_heading_imu_on': 'heading_imu_on', |
|
|
|
|
|
'reg_fixmode_on': 'fix_mode_on' |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
let lastLoadedRegisterData = {}; |
|
|
let lastLoadedRegisterData = {}; |
|
|
@ -963,9 +881,7 @@ |
|
|
document.getElementById('modbus_idt_input').value = tr.querySelector('.idt-display').textContent; |
|
|
document.getElementById('modbus_idt_input').value = tr.querySelector('.idt-display').textContent; |
|
|
document.getElementById('modbus_odt_input').value = tr.querySelector('.odt-display').textContent; |
|
|
document.getElementById('modbus_odt_input').value = tr.querySelector('.odt-display').textContent; |
|
|
document.getElementById('modbus_dv_input').value = tr.querySelector('.dv-display').textContent; |
|
|
document.getElementById('modbus_dv_input').value = tr.querySelector('.dv-display').textContent; |
|
|
document.getElementById('modbus_shift_input').value = tr.querySelector('.shift-display').textContent; |
|
|
|
|
|
document.getElementById('modbus_expr_input').value = tr.querySelector('.expr-display').textContent; |
|
|
document.getElementById('modbus_expr_input').value = tr.querySelector('.expr-display').textContent; |
|
|
document.getElementById('modbus_mask_input').value = tr.querySelector('.mask-display').textContent; |
|
|
|
|
|
}); |
|
|
}); |
|
|
// 처음에 행이 없으면 빈 행을 하나 추가 |
|
|
// 처음에 행이 없으면 빈 행을 하나 추가 |
|
|
if (modbusList.children.length === 0) { |
|
|
if (modbusList.children.length === 0) { |
|
|
@ -992,9 +908,7 @@ |
|
|
document.getElementById('opcua_ns_input').value = tr.querySelector('.opcua-ns-display').textContent; |
|
|
document.getElementById('opcua_ns_input').value = tr.querySelector('.opcua-ns-display').textContent; |
|
|
document.getElementById('opcua_odt_input').value = tr.querySelector('.opcua-odt-display').textContent; |
|
|
document.getElementById('opcua_odt_input').value = tr.querySelector('.opcua-odt-display').textContent; |
|
|
document.getElementById('opcua_dv_input').value = tr.querySelector('.opcua-dv-display').textContent; |
|
|
document.getElementById('opcua_dv_input').value = tr.querySelector('.opcua-dv-display').textContent; |
|
|
document.getElementById('opcua_shift_input').value = tr.querySelector('.opcua-shift-display').textContent; |
|
|
|
|
|
document.getElementById('opcua_expr_input').value = tr.querySelector('.opcua-expr-display').textContent; |
|
|
document.getElementById('opcua_expr_input').value = tr.querySelector('.opcua-expr-display').textContent; |
|
|
document.getElementById('opcua_mask_input').value = tr.querySelector('.opcua-mask-display').textContent; |
|
|
|
|
|
}); |
|
|
}); |
|
|
// 처음에 행이 없으면 빈 행을 하나 추가 |
|
|
// 처음에 행이 없으면 빈 행을 하나 추가 |
|
|
if (opcUaList.children.length === 0) { |
|
|
if (opcUaList.children.length === 0) { |
|
|
@ -1037,9 +951,7 @@ |
|
|
const idt = document.getElementById('modbus_idt_input').value; |
|
|
const idt = document.getElementById('modbus_idt_input').value; |
|
|
const odt = document.getElementById('modbus_odt_input').value; |
|
|
const odt = document.getElementById('modbus_odt_input').value; |
|
|
const defaultValue = document.getElementById('modbus_dv_input').value; |
|
|
const defaultValue = document.getElementById('modbus_dv_input').value; |
|
|
const shift = document.getElementById('modbus_shift_input').value; |
|
|
|
|
|
const expr = document.getElementById('modbus_expr_input').value; |
|
|
const expr = document.getElementById('modbus_expr_input').value; |
|
|
const mask = document.getElementById('modbus_mask_input').value; |
|
|
|
|
|
|
|
|
|
|
|
const firstRow = modbusFieldList.querySelector('tr'); |
|
|
const firstRow = modbusFieldList.querySelector('tr'); |
|
|
|
|
|
|
|
|
@ -1050,9 +962,7 @@ |
|
|
firstRow.querySelector('.idt-display').textContent = idt; |
|
|
firstRow.querySelector('.idt-display').textContent = idt; |
|
|
firstRow.querySelector('.odt-display').textContent = odt; |
|
|
firstRow.querySelector('.odt-display').textContent = odt; |
|
|
firstRow.querySelector('.dv-display').textContent = defaultValue; |
|
|
firstRow.querySelector('.dv-display').textContent = defaultValue; |
|
|
firstRow.querySelector('.shift-display').textContent = shift; |
|
|
|
|
|
firstRow.querySelector('.expr-display').textContent = expr; |
|
|
firstRow.querySelector('.expr-display').textContent = expr; |
|
|
firstRow.querySelector('.mask-display').textContent = mask; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// 새로운 행을 추가 |
|
|
// 새로운 행을 추가 |
|
|
const newRow = modbusRowTemplate.content.cloneNode(true); |
|
|
const newRow = modbusRowTemplate.content.cloneNode(true); |
|
|
@ -1061,9 +971,7 @@ |
|
|
newRow.querySelector('.idt-display').textContent = idt; |
|
|
newRow.querySelector('.idt-display').textContent = idt; |
|
|
newRow.querySelector('.odt-display').textContent = odt; |
|
|
newRow.querySelector('.odt-display').textContent = odt; |
|
|
newRow.querySelector('.dv-display').textContent = defaultValue; |
|
|
newRow.querySelector('.dv-display').textContent = defaultValue; |
|
|
newRow.querySelector('.shift-display').textContent = shift; |
|
|
|
|
|
newRow.querySelector('.expr-display').textContent = expr; |
|
|
newRow.querySelector('.expr-display').textContent = expr; |
|
|
newRow.querySelector('.mask-display').textContent = mask; |
|
|
|
|
|
|
|
|
|
|
|
modbusFieldList.appendChild(newRow); |
|
|
modbusFieldList.appendChild(newRow); |
|
|
} |
|
|
} |
|
|
@ -1074,9 +982,7 @@ |
|
|
document.getElementById('modbus_idt_input').value = ''; |
|
|
document.getElementById('modbus_idt_input').value = ''; |
|
|
document.getElementById('modbus_odt_input').value = ''; |
|
|
document.getElementById('modbus_odt_input').value = ''; |
|
|
document.getElementById('modbus_dv_input').value = ''; |
|
|
document.getElementById('modbus_dv_input').value = ''; |
|
|
document.getElementById('modbus_shift_input').value = ''; |
|
|
|
|
|
document.getElementById('modbus_expr_input').value = ''; |
|
|
document.getElementById('modbus_expr_input').value = ''; |
|
|
document.getElementById('modbus_mask_input').value = ''; |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1087,9 +993,7 @@ |
|
|
selectedRow.querySelector('.idt-display').textContent = document.getElementById('modbus_idt_input').value; |
|
|
selectedRow.querySelector('.idt-display').textContent = document.getElementById('modbus_idt_input').value; |
|
|
selectedRow.querySelector('.odt-display').textContent = document.getElementById('modbus_odt_input').value; |
|
|
selectedRow.querySelector('.odt-display').textContent = document.getElementById('modbus_odt_input').value; |
|
|
selectedRow.querySelector('.dv-display').textContent = document.getElementById('modbus_dv_input').value; |
|
|
selectedRow.querySelector('.dv-display').textContent = document.getElementById('modbus_dv_input').value; |
|
|
selectedRow.querySelector('.shift-display').textContent = document.getElementById('modbus_shift_input').value; |
|
|
|
|
|
selectedRow.querySelector('.expr-display').textContent = document.getElementById('modbus_expr_input').value; |
|
|
selectedRow.querySelector('.expr-display').textContent = document.getElementById('modbus_expr_input').value; |
|
|
selectedRow.querySelector('.mask-display').textContent = document.getElementById('modbus_mask_input').value; |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 삭제 버튼 |
|
|
// 삭제 버튼 |
|
|
@ -1107,9 +1011,7 @@ |
|
|
const ns = document.getElementById('opcua_ns_input').value; |
|
|
const ns = document.getElementById('opcua_ns_input').value; |
|
|
const odt = document.getElementById('opcua_odt_input').value; |
|
|
const odt = document.getElementById('opcua_odt_input').value; |
|
|
const defaultValue = document.getElementById('opcua_dv_input').value; |
|
|
const defaultValue = document.getElementById('opcua_dv_input').value; |
|
|
const shift = document.getElementById('opcua_shift_input').value; |
|
|
|
|
|
const expr = document.getElementById('opcua_expr_input').value; |
|
|
const expr = document.getElementById('opcua_expr_input').value; |
|
|
const mask = document.getElementById('opcua_mask_input').value; |
|
|
|
|
|
|
|
|
|
|
|
const firstRow = opcUaFieldList.querySelector('tr'); |
|
|
const firstRow = opcUaFieldList.querySelector('tr'); |
|
|
|
|
|
|
|
|
@ -1120,9 +1022,7 @@ |
|
|
firstRow.querySelector('.opcua-ns-display').textContent = ns; |
|
|
firstRow.querySelector('.opcua-ns-display').textContent = ns; |
|
|
firstRow.querySelector('.opcua-odt-display').textContent = odt; |
|
|
firstRow.querySelector('.opcua-odt-display').textContent = odt; |
|
|
firstRow.querySelector('.opcua-dv-display').textContent = defaultValue; |
|
|
firstRow.querySelector('.opcua-dv-display').textContent = defaultValue; |
|
|
firstRow.querySelector('.opcua-shift-display').textContent = shift; |
|
|
|
|
|
firstRow.querySelector('.opcua-expr-display').textContent = expr; |
|
|
firstRow.querySelector('.opcua-expr-display').textContent = expr; |
|
|
firstRow.querySelector('.opcua-mask-display').textContent = mask; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
// 새로운 행을 추가 |
|
|
// 새로운 행을 추가 |
|
|
const newRow = opcUaRowTemplate.content.cloneNode(true); |
|
|
const newRow = opcUaRowTemplate.content.cloneNode(true); |
|
|
@ -1131,9 +1031,7 @@ |
|
|
newRow.querySelector('.opcua-ns-display').textContent = ns; |
|
|
newRow.querySelector('.opcua-ns-display').textContent = ns; |
|
|
newRow.querySelector('.opcua-odt-display').textContent = odt; |
|
|
newRow.querySelector('.opcua-odt-display').textContent = odt; |
|
|
newRow.querySelector('.opcua-dv-display').textContent = defaultValue; |
|
|
newRow.querySelector('.opcua-dv-display').textContent = defaultValue; |
|
|
newRow.querySelector('.opcua-shift-display').textContent = shift; |
|
|
|
|
|
newRow.querySelector('.opcua-expr-display').textContent = expr; |
|
|
newRow.querySelector('.opcua-expr-display').textContent = expr; |
|
|
newRow.querySelector('.opcua-mask-display').textContent = mask; |
|
|
|
|
|
|
|
|
|
|
|
opcUaFieldList.appendChild(newRow); |
|
|
opcUaFieldList.appendChild(newRow); |
|
|
} |
|
|
} |
|
|
@ -1144,9 +1042,7 @@ |
|
|
document.getElementById('opcua_ns_input').value = ''; |
|
|
document.getElementById('opcua_ns_input').value = ''; |
|
|
document.getElementById('opcua_odt_input').value = ''; |
|
|
document.getElementById('opcua_odt_input').value = ''; |
|
|
document.getElementById('opcua_dv_input').value = ''; |
|
|
document.getElementById('opcua_dv_input').value = ''; |
|
|
document.getElementById('opcua_shift_input').value = ''; |
|
|
|
|
|
document.getElementById('opcua_expr_input').value = ''; |
|
|
document.getElementById('opcua_expr_input').value = ''; |
|
|
document.getElementById('opcua_mask_input').value = ''; |
|
|
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1158,9 +1054,7 @@ |
|
|
selectedRow.querySelector('.opcua-ns-display').textContent = document.getElementById('opcua_ns_input').value; |
|
|
selectedRow.querySelector('.opcua-ns-display').textContent = document.getElementById('opcua_ns_input').value; |
|
|
selectedRow.querySelector('.opcua-odt-display').textContent = document.getElementById('opcua_odt_input').value; |
|
|
selectedRow.querySelector('.opcua-odt-display').textContent = document.getElementById('opcua_odt_input').value; |
|
|
selectedRow.querySelector('.opcua-dv-display').textContent = document.getElementById('opcua_dv_input').value; |
|
|
selectedRow.querySelector('.opcua-dv-display').textContent = document.getElementById('opcua_dv_input').value; |
|
|
selectedRow.querySelector('.opcua-shift-display').textContent = document.getElementById('opcua_shift_input').value; |
|
|
|
|
|
selectedRow.querySelector('.opcua-expr-display').textContent = document.getElementById('opcua_expr_input').value; |
|
|
selectedRow.querySelector('.opcua-expr-display').textContent = document.getElementById('opcua_expr_input').value; |
|
|
selectedRow.querySelector('.opcua-mask-display').textContent = document.getElementById('opcua_mask_input').value; |
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 삭제 버튼 |
|
|
// 삭제 버튼 |
|
|
@ -1257,7 +1151,7 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/*----서버로 데이터 전송하는 함수----*/ |
|
|
/*----서버로 데이터 전송하는 함수----*/ |
|
|
function saveToConfig() { |
|
|
async function saveToConfig() { |
|
|
const deviceData = collectDeviceData(); |
|
|
const deviceData = collectDeviceData(); |
|
|
const protocolData = collectProtocolData(); |
|
|
const protocolData = collectProtocolData(); |
|
|
const normalizedProtocol = normalizeRegisterForPost(protocolData); |
|
|
const normalizedProtocol = normalizeRegisterForPost(protocolData); |
|
|
@ -1265,34 +1159,34 @@ |
|
|
alert("Register settings are currently invalid. Cannot be saved."); |
|
|
alert("Register settings are currently invalid. Cannot be saved."); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
//device |
|
|
try { |
|
|
const deviceReq = fetch('/setting/device', { |
|
|
const deviceRes = await fetch('/setting/device', { |
|
|
method: 'POST', |
|
|
method: 'POST', |
|
|
headers: { 'Content-Type': 'application/json' }, |
|
|
headers: { 'Content-Type': 'application/json' }, |
|
|
body: JSON.stringify(deviceData) |
|
|
body: JSON.stringify(deviceData) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
//protocol |
|
|
const protocolRes = await fetch('/setting/protocol', { |
|
|
const protocolReq = fetch('/setting/protocol', { |
|
|
|
|
|
method: 'POST', |
|
|
method: 'POST', |
|
|
headers: { 'Content-Type': 'application/json' }, |
|
|
headers: { 'Content-Type': 'application/json' }, |
|
|
body: JSON.stringify(normalizedProtocol) |
|
|
body: JSON.stringify(normalizedProtocol) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// 모든 요청이 성공하면 성공 알림 |
|
|
if (deviceRes.ok && protocolRes.ok) { |
|
|
Promise.all([deviceReq, protocolReq]) |
|
|
|
|
|
.then(([res1, res2]) => { |
|
|
|
|
|
if (res1.ok && res2.ok) { |
|
|
|
|
|
alert('saved successfully'); |
|
|
alert('saved successfully'); |
|
|
} else { |
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const protocolErrorText = protocolRes.ok ? '' : await protocolRes.text(); |
|
|
alert('save failure'); |
|
|
alert('save failure'); |
|
|
console.error('device response:', res1.status, 'protocol response:', res2.status); |
|
|
console.error('device response:', deviceRes.status, 'protocol response:', protocolRes.status); |
|
|
|
|
|
if (protocolErrorText) { |
|
|
|
|
|
console.error('protocol error body:', protocolErrorText); |
|
|
} |
|
|
} |
|
|
}) |
|
|
} catch (err) { |
|
|
.catch(err => { |
|
|
|
|
|
console.error('Error during transfer:', err); |
|
|
console.error('Error during transfer:', err); |
|
|
alert('save failure'); |
|
|
alert('save failure'); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -1305,6 +1199,9 @@ |
|
|
|
|
|
|
|
|
//ssid 행 추가 버튼 |
|
|
//ssid 행 추가 버튼 |
|
|
document.getElementById('add-ssid').addEventListener('click', addSsidRow); |
|
|
document.getElementById('add-ssid').addEventListener('click', addSsidRow); |
|
|
|
|
|
countryCodeInput?.addEventListener('input', () => { |
|
|
|
|
|
countryCodeInput.value = countryCodeInput.value.replace(/[^a-zA-Z]/g, '').slice(0, 2).toUpperCase(); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
// function clearAllInputs() { |
|
|
// function clearAllInputs() { |
|
|
// // 모든 input[type="text"], [type="number"], [type="password"] 등 초기화 |
|
|
// // 모든 input[type="text"], [type="number"], [type="password"] 등 초기화 |
|
|
@ -1343,8 +1240,6 @@ |
|
|
// can_bus_type: '', can_baudrate: null, |
|
|
// can_bus_type: '', can_baudrate: null, |
|
|
// rs485_mode: '', rs485_baudrate: null, rs485_data_bits: null, |
|
|
// rs485_mode: '', rs485_baudrate: null, rs485_data_bits: null, |
|
|
// rs485_parity: '', rs485_stop_bits: null, |
|
|
// rs485_parity: '', rs485_stop_bits: null, |
|
|
// imu_remap_x: '', imu_remap_y: '', imu_remap_z: '', |
|
|
|
|
|
// imu_remap_x_sign: '', imu_remap_y_sign: '', imu_remap_z_sign: '', |
|
|
|
|
|
// lte_ip: '', lte_netmask: '', lte_gateway: '', lte_port: null, |
|
|
// lte_ip: '', lte_netmask: '', lte_gateway: '', lte_port: null, |
|
|
// WIFI_SSID: [{wifi_ssid: '', wifi_password: '', wifi_security: 'none'}], |
|
|
// WIFI_SSID: [{wifi_ssid: '', wifi_password: '', wifi_security: 'none'}], |
|
|
// }; |
|
|
// }; |
|
|
@ -1368,13 +1263,10 @@ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
//x,y,z,부호 처리 |
|
|
//x,y,z,부호 처리 |
|
|
['x', 'y', 'z'].forEach(a => { |
|
|
|
|
|
const { axis, sign } = axisValueToPair(document.getElementById(`imu_remap_${a}`).value); |
|
|
|
|
|
res[`imu_remap_${a}`] = axis; |
|
|
|
|
|
res[`imu_remap_${a}_sign`] = sign; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
res.WIFI_SSID = gatherSsidRows(); |
|
|
res.WIFI_SSID = gatherSsidRows(); |
|
|
|
|
|
if (typeof res.wifi_country_code === 'string') { |
|
|
|
|
|
res.wifi_country_code = res.wifi_country_code.trim().toUpperCase(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
//null, 공백 없이 데이터 전처리 |
|
|
//null, 공백 없이 데이터 전처리 |
|
|
const filtered = {}; |
|
|
const filtered = {}; |
|
|
@ -1427,16 +1319,12 @@ |
|
|
const idt = row.querySelector('.idt-display')?.textContent.trim(); |
|
|
const idt = row.querySelector('.idt-display')?.textContent.trim(); |
|
|
const odt = row.querySelector('.odt-display')?.textContent.trim(); |
|
|
const odt = row.querySelector('.odt-display')?.textContent.trim(); |
|
|
const dv = row.querySelector('.dv-display')?.textContent.trim(); |
|
|
const dv = row.querySelector('.dv-display')?.textContent.trim(); |
|
|
const shift = row.querySelector('.shift-display')?.textContent.trim(); |
|
|
|
|
|
const expr = row.querySelector('.expr-display')?.textContent.trim(); |
|
|
const expr = row.querySelector('.expr-display')?.textContent.trim(); |
|
|
const mask = row.querySelector('.mask-display')?.textContent.trim(); |
|
|
|
|
|
if (addr) obj.addr = addr; |
|
|
if (addr) obj.addr = addr; |
|
|
if (idt) obj.idt = idt; |
|
|
if (idt) obj.idt = idt; |
|
|
if (odt) obj.odt = odt; |
|
|
if (odt) obj.odt = odt; |
|
|
if (dv) obj.dv = dv; |
|
|
if (dv) obj.dv = dv; |
|
|
if (shift) obj.shift = shift; |
|
|
|
|
|
if (expr) obj.expr = expr; |
|
|
if (expr) obj.expr = expr; |
|
|
if (mask) obj.mask = mask; |
|
|
|
|
|
collectedRegister.MODBUS.push(obj); |
|
|
collectedRegister.MODBUS.push(obj); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -1453,16 +1341,12 @@ |
|
|
const ns = row.querySelector('.opcua-ns-display')?.textContent.trim(); |
|
|
const ns = row.querySelector('.opcua-ns-display')?.textContent.trim(); |
|
|
const odt = row.querySelector('.opcua-odt-display')?.textContent.trim(); |
|
|
const odt = row.querySelector('.opcua-odt-display')?.textContent.trim(); |
|
|
const dv = row.querySelector('.opcua-dv-display')?.textContent.trim(); |
|
|
const dv = row.querySelector('.opcua-dv-display')?.textContent.trim(); |
|
|
const shift = row.querySelector('.opcua-shift-display')?.textContent.trim(); |
|
|
|
|
|
const expr = row.querySelector('.opcua-expr-display')?.textContent.trim(); |
|
|
const expr = row.querySelector('.opcua-expr-display')?.textContent.trim(); |
|
|
const mask = row.querySelector('.opcua-mask-display')?.textContent.trim(); |
|
|
|
|
|
if (addr) obj.addr = addr; |
|
|
if (addr) obj.addr = addr; |
|
|
if (ns) obj.ns = ns; |
|
|
if (ns) obj.ns = ns; |
|
|
if (odt) obj.odt = odt; |
|
|
if (odt) obj.odt = odt; |
|
|
if (dv) obj.dv = dv; |
|
|
if (dv) obj.dv = dv; |
|
|
if (shift) obj.shift = shift; |
|
|
|
|
|
if (expr) obj.expr = expr; |
|
|
if (expr) obj.expr = expr; |
|
|
if (mask) obj.mask = mask; |
|
|
|
|
|
collectedRegister.OPC_UA.push(obj); |
|
|
collectedRegister.OPC_UA.push(obj); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
@ -1673,9 +1557,6 @@ |
|
|
'version', |
|
|
'version', |
|
|
'equipment_id', |
|
|
'equipment_id', |
|
|
'MEID', |
|
|
'MEID', |
|
|
'heading_on', |
|
|
|
|
|
'heading_imu_on', |
|
|
|
|
|
'fix_mode_on' |
|
|
|
|
|
|
|
|
|
|
|
]; |
|
|
]; |
|
|
|
|
|
|
|
|
@ -1818,16 +1699,6 @@ |
|
|
/*-----------------------------------------------------*/ |
|
|
/*-----------------------------------------------------*/ |
|
|
|
|
|
|
|
|
/*-------imu-remap 정수와 부호 분리 함수-------------*/ |
|
|
/*-------imu-remap 정수와 부호 분리 함수-------------*/ |
|
|
function axisValueToPair(val) { |
|
|
|
|
|
if (!val || val === '') return { axis: '', sign: '' }; |
|
|
|
|
|
return val.startsWith('-') |
|
|
|
|
|
? { axis: val.slice(1), sign: 'minus' } |
|
|
|
|
|
: { axis: val, sign: 'plus' }; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function pairToAxisValue(axis, sign) { |
|
|
|
|
|
return sign === 'minus' ? `-${axis}` : axis; |
|
|
|
|
|
} |
|
|
|
|
|
/*-----------------------------------------------------*/ |
|
|
/*-----------------------------------------------------*/ |
|
|
|
|
|
|
|
|
/*--------초기 랜더링 화면 함수------------*/ |
|
|
/*--------초기 랜더링 화면 함수------------*/ |
|
|
@ -1849,12 +1720,6 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* IMU select 값 재구성 */ |
|
|
/* IMU select 값 재구성 */ |
|
|
['x', 'y', 'z'].forEach(a => { |
|
|
|
|
|
const axis = obj[`imu_remap_${a}`] || ''; |
|
|
|
|
|
const sign = obj[`imu_remap_${a}_sign`] || ''; |
|
|
|
|
|
document.getElementById(`imu_remap_${a}`).value = pairToAxisValue(axis, sign); |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/* SSID */ |
|
|
/* SSID */ |
|
|
ssidList.innerHTML = ''; |
|
|
ssidList.innerHTML = ''; |
|
|
(obj.WIFI_SSID || []).forEach(o => ssidList.appendChild(createSsidRow(o))); |
|
|
(obj.WIFI_SSID || []).forEach(o => ssidList.appendChild(createSsidRow(o))); |
|
|
@ -1957,9 +1822,7 @@ |
|
|
newRow.querySelector('.idt-display').textContent = field.idt ?? ''; |
|
|
newRow.querySelector('.idt-display').textContent = field.idt ?? ''; |
|
|
newRow.querySelector('.odt-display').textContent = field.odt ?? ''; |
|
|
newRow.querySelector('.odt-display').textContent = field.odt ?? ''; |
|
|
newRow.querySelector('.dv-display').textContent = field.dv ?? ''; |
|
|
newRow.querySelector('.dv-display').textContent = field.dv ?? ''; |
|
|
newRow.querySelector('.shift-display').textContent = field.shift ?? ''; |
|
|
|
|
|
newRow.querySelector('.expr-display').textContent = field.expr ?? ''; |
|
|
newRow.querySelector('.expr-display').textContent = field.expr ?? ''; |
|
|
newRow.querySelector('.mask-display').textContent = field.mask ?? ''; |
|
|
|
|
|
modbusFieldList.appendChild(newRow); |
|
|
modbusFieldList.appendChild(newRow); |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
@ -1984,9 +1847,7 @@ |
|
|
newRow.querySelector('.opcua-ns-display').textContent = field.ns ?? ''; |
|
|
newRow.querySelector('.opcua-ns-display').textContent = field.ns ?? ''; |
|
|
newRow.querySelector('.opcua-odt-display').textContent = field.odt ?? ''; |
|
|
newRow.querySelector('.opcua-odt-display').textContent = field.odt ?? ''; |
|
|
newRow.querySelector('.opcua-dv-display').textContent = field.dv ?? ''; |
|
|
newRow.querySelector('.opcua-dv-display').textContent = field.dv ?? ''; |
|
|
newRow.querySelector('.opcua-shift-display').textContent = field.shift ?? ''; |
|
|
|
|
|
newRow.querySelector('.opcua-expr-display').textContent = field.expr ?? ''; |
|
|
newRow.querySelector('.opcua-expr-display').textContent = field.expr ?? ''; |
|
|
newRow.querySelector('.opcua-mask-display').textContent = field.mask ?? ''; |
|
|
|
|
|
opcUaFieldList.appendChild(newRow); |
|
|
opcUaFieldList.appendChild(newRow); |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
|