From ef75346ebe57d56cec0c33ad5abd8b2aa218da95 Mon Sep 17 00:00:00 2001
From: C3204 <zhengyabo@lanpucloud.cn>
Date: 星期六, 18 四月 2026 12:29:32 +0800
Subject: [PATCH] 修改相机运动轴参数读取配置
---
LB_SmartVision/VisionForm.cs | 36 ++++++++++++++++++++++++++++++++++--
1 files changed, 34 insertions(+), 2 deletions(-)
diff --git a/LB_SmartVision/VisionForm.cs b/LB_SmartVision/VisionForm.cs
index c899473..99e15eb 100644
--- a/LB_SmartVision/VisionForm.cs
+++ b/LB_SmartVision/VisionForm.cs
@@ -821,11 +821,19 @@
}
if (LoadAllPLCSettings(GlobalVar.allPlcSettingsPath))
{
- LogInfo("PLC閫氳鍔犺浇鎴愬姛", LogInfoType.PASS);
+ LogInfo("PLC閫氳閰嶇疆鍔犺浇鎴愬姛", LogInfoType.PASS);
}
else
{
- LogInfo("PLC閫氳鍔犺浇澶辫触", LogInfoType.ERROR);
+ LogInfo("PLC閫氳閰嶇疆鍔犺浇澶辫触", LogInfoType.ERROR);
+ }
+ if (LoadAllMPlcDatas(GlobalVar.allMPlcDatasPath))
+ {
+ LogInfo("杩愬姩鎺у埗閰嶇疆鍔犺浇鎴愬姛", LogInfoType.PASS);
+ }
+ else
+ {
+ LogInfo("杩愬姩鎺у埗閰嶇疆鍔犺浇澶辫触", LogInfoType.ERROR);//LoadAllMPlcDatas
}
//鍔犺浇鐩告満
foreach (BaseCamera camera in GlobalVar.dicCameras.Values)
@@ -1022,6 +1030,7 @@
SaveSerialPorts();
SaveAllBarcodeReaders();
SaveAllPLCSettings();
+ SaveAllMPlcDatas();
}
@@ -1080,6 +1089,29 @@
return true;
}
+ public bool SaveAllMPlcDatas()
+ {
+ try
+ {
+ ConfigManager<Dictionary<string, Dictionary<string, PlcConfig>>>.SaveConfig<Dictionary<string, Dictionary<string, PlcConfig>>>(GlobalVar.dicMPlcDatas, GlobalVar.allMPlcDatasPath);
+ return true;
+ }
+ catch { return false; }
+ }
+
+ public bool LoadAllMPlcDatas(string allBarcodeReadersConnectionStringPath)
+ {
+ try
+ {
+ GlobalVar.dicMPlcDatas = ConfigManager<Dictionary<string, Dictionary<string, PlcConfig>>>.LoadConfig<Dictionary<string, Dictionary<string, PlcConfig>>>(allBarcodeReadersConnectionStringPath);
+ }
+ catch
+ {
+ return false;
+ }
+ return true;
+ }
+
public bool SaveAllBarcodeReaders()
{
try
--
Gitblit v1.9.3