fix(fixture): 配置页面距离/容差值跟随单位 cm→mm 转换
- fillFormFromParam: DB值(cm) ×10 显示(mm) - getFormParams: 表单值(mm) ÷10 存回(cm) - HTML max: 255→2550 (适配mm) - 0x4B下发/0x4C回读均正确:前端处理转换,协议仍用cm
This commit is contained in:
@@ -197,8 +197,8 @@ async function loadFixtureParam() {
|
||||
function fillFormFromParam(param) {
|
||||
document.getElementById("param-addr").value = param.Addr || 1;
|
||||
document.getElementById("param-test-mode").value = param.TestMode || 0;
|
||||
document.getElementById("param-reset-dis").value = param.RestDis || 0;
|
||||
document.getElementById("param-minus-dis").value = param.MinusDis || 0;
|
||||
document.getElementById("param-reset-dis").value = (param.RestDis || 0) * 10;
|
||||
document.getElementById("param-minus-dis").value = (param.MinusDis || 0) * 10;
|
||||
document.getElementById("param-dev-type").value = param.DevType || 0;
|
||||
document.getElementById("param-sens-min").value = param.SensMin || 0;
|
||||
document.getElementById("param-sens-max").value = param.SensMax || 0;
|
||||
@@ -206,9 +206,9 @@ function fillFormFromParam(param) {
|
||||
document.getElementById("param-fre-max").value = param.FreMax || 0;
|
||||
document.getElementById("param-peak-min").value = param.PeakMin || 0;
|
||||
document.getElementById("param-peak-max").value = param.PeakMax || 0;
|
||||
document.getElementById("param-far-tol").value = param.FarTol || 0;
|
||||
document.getElementById("param-near-tol").value = param.NearTol || 0;
|
||||
document.getElementById("param-step-tol").value = param.StepTol || 0;
|
||||
document.getElementById("param-far-tol").value = (param.FarTol || 0) * 10;
|
||||
document.getElementById("param-near-tol").value = (param.NearTol || 0) * 10;
|
||||
document.getElementById("param-step-tol").value = (param.StepTol || 0) * 10;
|
||||
document.getElementById("param-back-forth").value = param.BackForth || 0;
|
||||
document.getElementById("param-near-stay").value = param.NearStay || 0;
|
||||
document.getElementById("param-far-stay").value = param.FarStay || 0;
|
||||
@@ -295,17 +295,17 @@ function getFormParams() {
|
||||
addr: parseInt(document.getElementById("param-addr").value) || 1,
|
||||
dev_type: parseInt(document.getElementById("param-dev-type").value) || 0,
|
||||
test_mode: parseInt(document.getElementById("param-test-mode").value) || 0,
|
||||
reset_dis: parseInt(document.getElementById("param-reset-dis").value) || 0,
|
||||
minus_dis: parseInt(document.getElementById("param-minus-dis").value) || 0,
|
||||
reset_dis: Math.round((parseInt(document.getElementById("param-reset-dis").value) || 0) / 10),
|
||||
minus_dis: Math.round((parseInt(document.getElementById("param-minus-dis").value) || 0) / 10),
|
||||
sens_min: parseInt(document.getElementById("param-sens-min").value) || 0,
|
||||
sens_max: parseInt(document.getElementById("param-sens-max").value) || 0,
|
||||
fre_min: parseInt(document.getElementById("param-fre-min").value) || 0,
|
||||
fre_max: parseInt(document.getElementById("param-fre-max").value) || 0,
|
||||
peak_min: parseInt(document.getElementById("param-peak-min").value) || 0,
|
||||
peak_max: parseInt(document.getElementById("param-peak-max").value) || 0,
|
||||
far_tol: parseInt(document.getElementById("param-far-tol").value) || 0,
|
||||
near_tol: parseInt(document.getElementById("param-near-tol").value) || 0,
|
||||
step_tol: parseInt(document.getElementById("param-step-tol").value) || 0,
|
||||
far_tol: Math.round((parseInt(document.getElementById("param-far-tol").value) || 0) / 10),
|
||||
near_tol: Math.round((parseInt(document.getElementById("param-near-tol").value) || 0) / 10),
|
||||
step_tol: Math.round((parseInt(document.getElementById("param-step-tol").value) || 0) / 10),
|
||||
back_forth: parseInt(document.getElementById("param-back-forth").value) || 0,
|
||||
near_stay: parseInt(document.getElementById("param-near-stay").value) || 0,
|
||||
far_stay: parseInt(document.getElementById("param-far-stay").value) || 0,
|
||||
|
||||
Reference in New Issue
Block a user