fix(calibration): 优化电流显示和日志功能
- 修复了电流显示错误的问题,增加了对漏电流的特殊处理 - 扩大了设备日志窗口的大小,提高了可读性 - 优化了参数误差的计算和显示逻辑 - 增加了对方案列表获取逻辑的改进,确保选中方案与实际方案一致 - 提升了日志缓存的长度,从800增加到2000
This commit is contained in:
parent
b71aaf4ff7
commit
a08559f55f
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "calibration-pc",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.4",
|
||||
"description": "谷云开发部开发的断路器标定软件",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "example.com",
|
||||
|
|
|
@ -264,7 +264,8 @@
|
|||
</el-table-column>
|
||||
<el-table-column prop="current" align="center" label="电流Ib(%)">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.current" :min="0" :precision="1" />
|
||||
<el-input-number v-if="!scope.row.isILeak" v-model="scope.row.current" :min="0" :precision="1" />
|
||||
<span v-else>{{ currentScheme.configParam.format[5].value + currentScheme.configParam.format[5].unit }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="powerFactor" align="center" label="功率因数">
|
||||
|
@ -325,7 +326,7 @@
|
|||
</el-dialog>
|
||||
|
||||
<!-- 方案配置抽屉 -->
|
||||
<el-drawer v-model="logVisible" title="设备日志" size="80%" :destroy-on-close="true">
|
||||
<el-drawer v-model="logVisible" title="设备日志" size="90%" :destroy-on-close="true">
|
||||
<div class="scheme-drawer-content log-content">
|
||||
<div class="device-info">
|
||||
<div class="device-info-item">设备: {{ activeDeviceInfo.id || '-' }}</div>
|
||||
|
@ -362,14 +363,14 @@
|
|||
'源输出值: ' +
|
||||
(scope.row.paramMap[col.valueKey]?.outputValue ?? '') +
|
||||
'\n' +
|
||||
'读取值: ' +
|
||||
(scope.row.paramMap[col.valueKey]?.actualValue ?? '') +
|
||||
'\n' +
|
||||
'范围最小值: ' +
|
||||
(scope.row.paramMap[col.valueKey]?.ExpectedMin ?? '') +
|
||||
'\n' +
|
||||
'范围最大值: ' +
|
||||
(scope.row.paramMap[col.valueKey]?.expectedMax ?? '') +
|
||||
'\n' +
|
||||
'读取值: ' +
|
||||
(scope.row.paramMap[col.valueKey]?.actualValue ?? '')
|
||||
(scope.row.paramMap[col.valueKey]?.expectedMax ?? '')
|
||||
"
|
||||
placement="top"
|
||||
>
|
||||
|
@ -379,9 +380,9 @@
|
|||
? Number(scope.row.paramMap[col.valueKey].actualError.toFixed(6)).toString()
|
||||
: scope.row.paramMap[col.valueKey]?.actualError
|
||||
}}<span v-if="scope.row.paramMap[col.valueKey]">%</span>
|
||||
<template v-if="scope.row.paramMap[col.valueKey]">
|
||||
<el-icon v-if="scope.row.paramMap[col.valueKey].actualValue > scope.row.paramMap[col.valueKey].expectedMax" style="color: red"><Top /></el-icon>
|
||||
<el-icon v-else-if="scope.row.paramMap[col.valueKey].actualValue < scope.row.paramMap[col.valueKey].ExpectedMin" style="color: red"><Bottom /></el-icon>
|
||||
<template v-if="scope.row.paramMap[col.valueKey]" :style="{ color: scope.row.paramMap[col.valueKey]?.result === 1 ? 'green' : 'red' }">
|
||||
<el-icon v-if="scope.row.paramMap[col.valueKey].actualValue > scope.row.paramMap[col.valueKey].outputValue"><Top /></el-icon>
|
||||
<el-icon v-else-if="scope.row.paramMap[col.valueKey].actualValue < scope.row.paramMap[col.valueKey].outputValue"><Bottom /></el-icon>
|
||||
</template>
|
||||
</span>
|
||||
</el-tooltip>
|
||||
|
@ -471,7 +472,7 @@ const logList = ref([]);
|
|||
const logLoading = ref(false);
|
||||
|
||||
const logBoxRef = ref(null);
|
||||
const MAX_LOG_LENGTH = 800;
|
||||
const MAX_LOG_LENGTH = 2000;
|
||||
|
||||
const activeDeviceIndex = ref(0);
|
||||
|
||||
|
@ -654,7 +655,7 @@ const setDeviceInfo = msg => {
|
|||
};
|
||||
|
||||
const getSocketMeassage = message => {
|
||||
// message = {data:{"msgType":"calibrate_result","data":"{\"id\":1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"devicePort\":\"com3\",\"cpuId\":\"SN\",\"connectStatus\":1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"resultTxt\":\"\"}"}};
|
||||
// message = {data:{"msgType":"calibrate_result","data":"{\"id\":1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"switch\":0,\"result\":-1,\"resultTxt\":\"\"}"}};
|
||||
const msg = tryParseJSON(message.data);
|
||||
console.log('msg', msg);
|
||||
const newLog = {
|
||||
|
@ -820,9 +821,19 @@ const loadSchemes = async () => {
|
|||
const response = await axios.get(config.url + '/master/scheme/query');
|
||||
if (response.data.code === 0) {
|
||||
schemeList.value = response.data.data.schemes || [];
|
||||
if (!selectedScheme.value && schemeList.value.length > 0) {
|
||||
selectedScheme.value = schemeList.value[0].id;
|
||||
activeScheme.value = schemeList.value[0];
|
||||
// 新增同步逻辑,确保activeScheme与selectedScheme一致
|
||||
let found = null;
|
||||
if (selectedScheme.value) {
|
||||
found = schemeList.value.find(item => item.id === selectedScheme.value);
|
||||
}
|
||||
if (found) {
|
||||
activeScheme.value = found;
|
||||
} else if (schemeList.value.length > 0) {
|
||||
selectedScheme.value = schemeList.value[0].id;
|
||||
activeScheme.value = schemeList.value[0];
|
||||
} else {
|
||||
selectedScheme.value = '';
|
||||
activeScheme.value = {};
|
||||
}
|
||||
ElMessage.success('获取方案列表成功');
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue