diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..b1da742
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,25 @@
+.vs/
+**/.vs/
+
+bin/
+obj/
+**/bin/
+**/obj/
+
+_codex_build/
+**/_codex_build/
+WC_GKJ_OIL_EXE/
+**/WC_GKJ_OIL_EXE/
+
+packages/
+**/packages/
+
+*.user
+*.suo
+*.wsuo
+*.pdb
+*.db
+*.sqlite
+*.cache
+*.tmp
+~$*
diff --git a/SCADA/Funtion/B_DB_Opera.cs b/SCADA/Funtion/B_DB_Opera.cs
index fcdccc0..d2b3dde 100644
--- a/SCADA/Funtion/B_DB_Opera.cs
+++ b/SCADA/Funtion/B_DB_Opera.cs
@@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
-using System.Linq;
using System.Threading.Tasks;
namespace MesWork
@@ -431,17 +430,17 @@ namespace MesWork
// ====================================================================
///
- /// 创建曲线段记录(工件到位时调用)
+ /// 创建紧凑曲线记录,点位值在保存时一次性写入。
///
- /// 段ID,失败返回-1
- public static long Curve_StartSegment(string opName, string engineNo, string modelNo)
+ public static long CurveRecord_Start(string opName, string productNo, string modelNo, int sampleIntervalMs)
{
var sqlParameter = new SqlParameter[] {
new SqlParameter("@工位号", opName),
- new SqlParameter("@发动机号", engineNo),
- new SqlParameter("@机型号", modelNo ?? (object)DBNull.Value)
+ new SqlParameter("@产品编号", productNo),
+ new SqlParameter("@机型号", modelNo ?? (object)DBNull.Value),
+ new SqlParameter("@采样间隔ms", sampleIntervalMs)
};
- SqlOperation.ExecuteStoredProcedure("称重曲线_开始段", sqlParameter, out DataTable dt, out string err);
+ SqlOperation.ExecuteStoredProcedure("称重曲线记录_开始", sqlParameter, out DataTable dt, out string err);
if (dt != null && dt.Rows.Count > 0 && dt.Rows[0]["result"].ToString() == "1")
{
return Convert.ToInt64(dt.Rows[0]["ID"]);
@@ -450,46 +449,43 @@ namespace MesWork
}
///
- /// 批量写入曲线采样点(采集线程每攒够N条调用一次)
+ /// 保存紧凑曲线点位字符串,并关联最终称重记录。
///
- /// 段ID
- /// 采样点列表
- /// 写入条数,失败返回0
- public static int Curve_WritePoints(long segmentId, List points)
+ public static bool CurveRecord_Save(long curveId, long weighingRecordId, int sampleCount, string pointValues,
+ decimal? finalWeight, int? finalStartSeq, int? finalEndSeq)
{
- if (points == null || points.Count == 0) return 0;
-
- // 用 JSON 序列化避免小数区域格式和字符串拼接转义问题。
- var json = JsonConvert.SerializeObject(points.Select(p => new
- {
- seq = p.SeqNo,
- time = p.SampleTime.ToString("yyyy-MM-ddTHH:mm:ss.fff"),
- weight = p.Weight
- }));
-
var sqlParameter = new SqlParameter[] {
- new SqlParameter("@段ID", segmentId),
- new SqlParameter("@采样数据", json)
+ new SqlParameter("@ID", curveId),
+ new SqlParameter("@称重记录ID", weighingRecordId > 0 ? (object)weighingRecordId : DBNull.Value),
+ new SqlParameter("@采样点数", sampleCount),
+ new SqlParameter("@点位值", string.IsNullOrEmpty(pointValues) ? (object)DBNull.Value : pointValues),
+ new SqlParameter("@最终重量", finalWeight.HasValue ? (object)finalWeight.Value : DBNull.Value),
+ new SqlParameter("@最终取点开始序号", finalStartSeq.HasValue ? (object)finalStartSeq.Value : DBNull.Value),
+ new SqlParameter("@最终取点结束序号", finalEndSeq.HasValue ? (object)finalEndSeq.Value : DBNull.Value)
};
- SqlOperation.ExecuteStoredProcedure("称重曲线_批量写入", sqlParameter, out DataTable dt, out string err);
- if (dt != null && dt.Rows.Count > 0 && dt.Rows[0]["result"].ToString() == "1")
- {
- return Convert.ToInt32(dt.Rows[0]["count"]);
- }
- return 0;
+ SqlOperation.ExecuteStoredProcedure("称重曲线记录_保存", sqlParameter, out DataTable dt, out string err);
+ return dt != null && dt.Rows.Count > 0 && dt.Rows[0]["result"].ToString() == "1";
}
///
- /// 结束曲线段(请求保存时调用,关联称重记录ID)
+ /// 查询指定产品最新紧凑曲线记录。
///
- public static bool Curve_EndSegment(long segmentId, long weighingRecordId)
+ public static bool CurveRecord_QueryLatest(string opName, string productNo, out string pointValues, out decimal finalWeight)
{
+ pointValues = "";
+ finalWeight = 0;
var sqlParameter = new SqlParameter[] {
- new SqlParameter("@段ID", segmentId),
- new SqlParameter("@称重记录ID", weighingRecordId > 0 ? (object)weighingRecordId : DBNull.Value)
+ new SqlParameter("@工位号", opName),
+ new SqlParameter("@产品编号", productNo)
};
- SqlOperation.ExecuteStoredProcedure("称重曲线_结束段", sqlParameter, out DataTable dt, out string err);
- return dt != null && dt.Rows.Count > 0 && dt.Rows[0]["result"].ToString() == "1";
+ SqlOperation.ExecuteStoredProcedure("称重曲线记录_查询最新", sqlParameter, out DataTable dt, out string err);
+ if (dt != null && dt.Rows.Count > 0 && dt.Rows[0]["result"].ToString() == "1")
+ {
+ pointValues = dt.Rows[0]["点位值"]?.ToString() ?? "";
+ decimal.TryParse(dt.Rows[0]["最终重量"]?.ToString(), out finalWeight);
+ return true;
+ }
+ return false;
}
}
diff --git a/SCADA/Funtion/MIS_CurveCollector.cs b/SCADA/Funtion/MIS_CurveCollector.cs
new file mode 100644
index 0000000..5d9166d
--- /dev/null
+++ b/SCADA/Funtion/MIS_CurveCollector.cs
@@ -0,0 +1,281 @@
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Threading;
+
+namespace MesWork
+{
+ public partial class MesWorkForm
+ {
+ private class CurveCollectorState
+ {
+ public string OpName;
+ public long CurveId;
+ public string ProductNo;
+ public Thread WorkerThread;
+ public volatile bool IsRunning;
+ public bool IsSegmentEnded;
+ public bool IsPointValuesSaved;
+ public int SeqNo;
+ public readonly object BufferLock = new object();
+ public readonly List Buffer = new List();
+ public decimal? StableWeight;
+ public int? StableStartSeq;
+ public int? StableEndSeq;
+ }
+
+ private static readonly ConcurrentDictionary _curveCollectors
+ = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase);
+
+ private const int CurveCollectorSampleIntervalMs = 200;
+ private const int CurveStableWindowSize = 20;
+
+ ///
+ /// 允许工作后启动曲线采集,每个工位同一时间只保留一个采集段。
+ ///
+ private void CurveCollector_Start(string opName, string productNo, string modelNo)
+ {
+ try
+ {
+ if (_curveCollectors.TryGetValue(opName, out CurveCollectorState oldState) && !oldState.IsSegmentEnded)
+ {
+ if (oldState.IsRunning) return;
+ CurveCollector_EndSegment(opName, 0); // 清理上一次未正常结束的曲线
+ }
+
+ long curveId = B_DB_Opera.CurveRecord_Start(opName, productNo, modelNo, CurveCollectorSampleIntervalMs); // 先建曲线主记录
+ if (curveId <= 0)
+ {
+ WeighingPage?.AppendLog($"[{opName}] 曲线记录创建失败,未启动采集");
+ return;
+ }
+
+ var state = new CurveCollectorState
+ {
+ OpName = opName,
+ CurveId = curveId,
+ ProductNo = productNo,
+ IsRunning = true
+ };
+ state.WorkerThread = new Thread(() => CurveCollector_Work(state))
+ {
+ IsBackground = true,
+ Name = $"CurveCollector_{opName}"
+ };
+
+ _curveCollectors[opName] = state;
+ state.WorkerThread.Start();
+ WeighingPage?.AppendLog($"[{opName}] 实时重量曲线采集启动,记录ID={curveId}");
+ }
+ catch (Exception err)
+ {
+ WeighingPage?.AppendLog($"[{opName}] 曲线采集启动异常:{err.Message}");
+ }
+ }
+
+ ///
+ /// 采集线程:200ms读取一次实时重量,只缓存到内存,保存时一次性写库。
+ ///
+ private void CurveCollector_Work(CurveCollectorState state)
+ {
+ while (state.IsRunning)
+ {
+ try
+ {
+ decimal weight = Convert.ToDecimal(ReadPLC(100220, state.OpName)); // 实时重量点位
+ lock (state.BufferLock)
+ {
+ state.Buffer.Add(new CurveSamplePoint
+ {
+ SeqNo = ++state.SeqNo, // 序号用于追溯最终取点区间
+ SampleTime = DateTime.Now,
+ Weight = weight
+ });
+ }
+ }
+ catch (Exception err)
+ {
+ WeighingPage?.AppendLog($"[{state.OpName}] 曲线采样异常:{err.Message}");
+ }
+ Thread.Sleep(CurveCollectorSampleIntervalMs);
+ }
+ }
+
+ ///
+ /// 停止采样线程,但暂不关闭曲线记录,便于保存流程先计算最终重量。
+ ///
+ private void CurveCollector_StopSampling(string opName, bool waitingSave = false)
+ {
+ if (!_curveCollectors.TryGetValue(opName, out CurveCollectorState state)) return;
+
+ state.IsRunning = false;
+ if (state.WorkerThread != null && state.WorkerThread.IsAlive)
+ {
+ state.WorkerThread.Join(2000);
+ }
+ if (waitingSave)
+ {
+ CurveCollector_SavePointValues(state, 0, null); // 保存前先把点位字符串落库,供算法读取
+ }
+ }
+
+ ///
+ /// 保存完成后关闭曲线记录,并关联称重记录ID。
+ ///
+ private void CurveCollector_EndSegment(string opName, long weighingRecordId)
+ {
+ if (!_curveCollectors.TryGetValue(opName, out CurveCollectorState state)) return;
+
+ CurveCollector_StopSampling(opName);
+ if (!state.IsSegmentEnded)
+ {
+ CurveCollector_SavePointValues(state, weighingRecordId, state.StableWeight, state.StableStartSeq, state.StableEndSeq); // 补写称重记录ID和算法依据
+ state.IsSegmentEnded = true;
+ WeighingPage?.AppendLog($"[{opName}] 实时重量曲线采集结束,记录ID={state.CurveId},点数={state.SeqNo}");
+ }
+ _curveCollectors.TryRemove(opName, out _);
+ }
+
+ ///
+ /// 优先用曲线点计算稳定重量;失败时调用方继续使用PLC锁定重量。
+ ///
+ private bool CurveCollector_TryGetStableWeight(string opName, out decimal weight, out int pointCount, out string msg)
+ {
+ weight = 0;
+ pointCount = 0;
+ msg = "未启动曲线采集";
+
+ if (!_curveCollectors.TryGetValue(opName, out CurveCollectorState state))
+ {
+ return false;
+ }
+
+ CurveCollector_SavePointValues(state, 0, null); // 确保数据库已有当前点位字符串
+ if (!B_DB_Opera.CurveRecord_QueryLatest(opName, state.ProductNo, out string pointValues, out _))
+ {
+ msg = "未查询到当前产品曲线记录";
+ return false;
+ }
+
+ List weights = CurveCollector_ParsePointValues(pointValues); // 从数据库点位字符串还原曲线
+ pointCount = weights.Count;
+ if (CurveCollector_CalculateStableWeight(weights, out weight, out int startSeq, out int endSeq))
+ {
+ state.StableWeight = weight;
+ state.StableStartSeq = startSeq; // 记录最终采用窗口起点
+ state.StableEndSeq = endSeq; // 记录最终采用窗口终点
+ msg = "";
+ return true;
+ }
+
+ msg = $"曲线点数不足或无法计算,当前点数={pointCount}";
+ return false;
+ }
+
+ private List CurveCollector_GetPoints(CurveCollectorState state)
+ {
+ lock (state.BufferLock)
+ {
+ return state.Buffer.OrderBy(p => p.SeqNo).ToList();
+ }
+ }
+
+ private string CurveCollector_BuildPointValues(List points)
+ {
+ return string.Join("|", points.Select(p => p.Weight.ToString("F3", CultureInfo.InvariantCulture)));
+ }
+
+ private void CurveCollector_SavePointValues(CurveCollectorState state, long weighingRecordId, decimal? finalWeight)
+ {
+ CurveCollector_SavePointValues(state, weighingRecordId, finalWeight, null, null);
+ }
+
+ private void CurveCollector_SavePointValues(CurveCollectorState state, long weighingRecordId,
+ decimal? finalWeight, int? finalStartSeq, int? finalEndSeq)
+ {
+ if (state.IsPointValuesSaved && weighingRecordId <= 0 && !finalWeight.HasValue) return;
+
+ List points = CurveCollector_GetPoints(state);
+ string pointValues = CurveCollector_BuildPointValues(points); // 例:50.120|50.115|50.118
+ B_DB_Opera.CurveRecord_Save(state.CurveId, weighingRecordId, points.Count, pointValues, finalWeight, finalStartSeq, finalEndSeq);
+ state.IsPointValuesSaved = true;
+ }
+
+ private List CurveCollector_ParsePointValues(string pointValues)
+ {
+ var result = new List();
+ if (string.IsNullOrWhiteSpace(pointValues)) return result;
+
+ foreach (string item in pointValues.Split('|'))
+ {
+ if (decimal.TryParse(item, NumberStyles.Number, CultureInfo.InvariantCulture, out decimal value))
+ {
+ result.Add(value);
+ }
+ }
+ return result;
+ }
+
+ ///
+ /// 找连续20点中极差最小的一段,去掉一个最大值和一个最小值后取平均。
+ ///
+ private bool CurveCollector_CalculateStableWeight(List weights, out decimal stableWeight, out int startSeq, out int endSeq)
+ {
+ stableWeight = 0;
+ startSeq = 0;
+ endSeq = 0;
+ if (weights == null || weights.Count < CurveStableWindowSize) return false;
+
+ int bestStart = 0; // 0-based窗口起点,保存时转成1-based序号
+ decimal bestRange = decimal.MaxValue;
+ for (int i = 0; i <= weights.Count - CurveStableWindowSize; i++)
+ {
+ decimal min = weights[i];
+ decimal max = weights[i];
+ for (int j = i + 1; j < i + CurveStableWindowSize; j++)
+ {
+ if (weights[j] < min) min = weights[j];
+ if (weights[j] > max) max = weights[j];
+ }
+
+ decimal range = max - min;
+ if (range <= bestRange)
+ {
+ bestRange = range;
+ bestStart = i; // 极差相同时取靠后窗口,更接近保存时刻
+ }
+ }
+
+ List window = weights.Skip(bestStart).Take(CurveStableWindowSize).ToList();
+ decimal windowMin = window.Min();
+ decimal windowMax = window.Max();
+ bool removedMin = false;
+ bool removedMax = false;
+ decimal sum = 0;
+ int count = 0;
+ foreach (decimal value in window)
+ {
+ if (!removedMin && value == windowMin)
+ {
+ removedMin = true;
+ continue;
+ }
+ if (!removedMax && value == windowMax)
+ {
+ removedMax = true; // 只剔除一个最大值,避免过度过滤
+ continue;
+ }
+ sum += value;
+ count++;
+ }
+
+ if (count <= 0) return false;
+ stableWeight = Math.Round(sum / count, 3, MidpointRounding.AwayFromZero); // 剩余18点平均值
+ startSeq = bestStart + 1; // 转为数据库可读的1-based序号
+ endSeq = bestStart + CurveStableWindowSize;
+ return true;
+ }
+ }
+}
diff --git a/SCADA/Funtion/MIS_Funtion.cs b/SCADA/Funtion/MIS_Funtion.cs
index e0d6562..8a25cf4 100644
--- a/SCADA/Funtion/MIS_Funtion.cs
+++ b/SCADA/Funtion/MIS_Funtion.cs
@@ -1,509 +1,383 @@
-using ExternalDataSync;
-using System;
-using System.Collections.Concurrent;
-using System.Collections.Generic;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Threading;
-using DC_A95;
-///
-///
-///
-namespace MesWork
-{
- ///
- /// 处理MIS逻辑
- ///
- public partial class MesWorkForm
- {
- ///
- /// PLC信号变化处理入口
- /// 当Bool型信号值变化时由框架自动触发
- ///
- ///
- private void MIS_Funtion(object e)
- {
- try
- {
- var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
- if (msgEvent.TagValue == null) return;
- var tagID = msgEvent.TagID.ToString();
- var opName = msgEvent.OpName.ToString();
- var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
- var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
- var isFirstValue = msgEvent.IsFirstValue.ToString().ToLower();
- var alarmLevel = msgEvent.ShaftID.ToString();
- var alarmMsg = msgEvent.ItemName.ToString();
- string tagValue;
- switch (tagTypeID)
- {
- case EnumTagTypeID.BOOL:
- tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
- break;
- default:
- tagValue = msgEvent.TagValue.ToString();
- break;
- }
- // ── 报警处理(编码900~2000)──
- if (tagTypeCodeID >= 900 & tagTypeCodeID < 2000)
- {
- if (ValueT(isFirstValue))
- {
- //不处理第一次变化的值
- return;
- }
- var opNameNew = opName.Replace("_Alarm", "");
- if (tagValue == "1")
- {
- B_DB_Opera.Event_Alarm_Start(opNameNew, tagTypeCodeID, alarmMsg, alarmLevel, tagID);
- }
- else
- {
- B_DB_Opera.Event_Alarm_End(opNameNew, tagTypeCodeID, alarmMsg, alarmLevel, tagID);
- }
- }
- // ── 信号分发 ──
- switch (tagTypeCodeID)
- {
- case 2: // 工件到位 → 启动/停止实时重量曲线采集
- if (tagValue == "1")
- {
- WeighingPage?.AppendLog($"[{opName}] 工件到位信号触发");
- CurveCollector_Start(opName);
- }
- else
- {
- CurveCollector_Stop(opName);
- }
- break;
- case 14: // PLC心跳 → 回写PC心跳
- WritePLC_IF(15, opName, tagValue);
- break;
- case 44: // 请求工作
- if (ValueT(isFirstValue)) return;
- if (tagValue == "1")
- {
- WeighingPage?.AppendLog($"[{opName}] PLC请求工作,开始处理...");
- Weighing_HandleRequestWork(opName, tagID);
- }
- else
- {
- WritePLC_IF(66, opName, false); //允许工作
- }
- break;
- case 19: // 请求保存
- if (ValueT(isFirstValue)) return;
- if (tagValue == "1")
- {
- CurveCollector_StopSampling(opName, true); // 先停止采样,保存完成后再关联称重记录ID
- WeighingPage?.AppendLog($"[{opName}] PLC请求保存数据...");
- Weighing_HandleRequestSave(opName, tagID);
- }
- else
- {
- WritePLC_IF(20, opName, false); //保存完成
- WritePLC_IF(21, opName, false); //合格标志
- }
- break;
- case 203: // 设备状态
- B_DB_Opera.Event_DeviceStatus_Change(opName, tagValue);
- break;
- default:
- break;
- }
- }
- catch (Exception err)
- { }
- }
- // ====================================================================
- // 称重交互核心方法
- // ====================================================================
- ///
- /// 获取称重类型:地面/放油前/放油后
- /// Ground模式:统一返回"地面"
- /// Hanging模式:OP10=放油前,OP20=放油后
- ///
- private string GetWeighingType(string opName)
- {
- if (WeighingType == "Ground")
- return "地面";
- // Hanging模式
- return opName == "OP10" ? "放油前" : "放油后";
- }
- ///
- /// 处理请求工作信号 (tagTypeCodeID=44)
- /// 流程:读取工件信息 → 查询参数 → 写过站记录 → 按类型处理称重记录 → 回写允许工作
- ///
- private void Weighing_HandleRequestWork(string opName, string tagID)
- {
- B_DB_Opera.SaveLog_Request(opName, Log_Type.ZK_MesHandler, "MIS_Function",
- Log_FromAndTo.ZK, Log_FromAndTo.ZK, $"触发信号【44-请求工作】", out long AID);
- try
- {
- // 1. 读取PLC工件信息
- string engineNo = PLC_R.GetString_CleanGarbled(ReadPLC(10, opName)); // 总成编号
- string modelNo = PLC_R.GetString_CleanGarbled(ReadPLC(11, opName)); // 机型号
- string orderNo = PLC_R.GetString_CleanGarbled(ReadPLC(39, opName)); // 工单号
- string palletNo = PLC_R.GetString_CleanGarbled(ReadPLC(80, opName)); // 托盘号
- B_DB_Opera.SaveLog_Response($"【{opName}】读取工件:发动机={engineNo},机型={modelNo},工单={orderNo},托盘={palletNo}", AID);
- // 推送工件信息到称重UI
- int stIdx = WeighingPage?.GetStationIndex(opName) ?? 1;
- WeighingPage?.UpdateStationInfo(stIdx, engineNo, modelNo, orderNo);
- WeighingPage?.AppendLog($"[{opName}] 读取工件:{engineNo},机型={modelNo}");
- // 2. 查询工件管理参数(加油量/抽油量/密度/残油量上下限)
- if (!B_DB_Opera.QueryWorkpieceByModel(modelNo, out decimal addOilQty, out decimal extractOilQty, out decimal density,
- out decimal residualOilUpperLimit, out decimal residualOilLowerLimit))
- {
- WritePLC_IF(112, opName, 3); // 报警代码=3,机型错误
- B_DB_Opera.SaveLog_Response($"【{opName}】工件管理中未找到机型[{modelNo}]的参数,发动机={engineNo}", AID);
- WeighingPage?.AppendLog($"[{opName}] 机型[{modelNo}]未找到配置参数");
- return;
- }
- // 3. 推送工件参数到UI
- WeighingPage?.UpdateOilInfo(stIdx, addOilQty, extractOilQty, density, 0, 0);
- // 4. 确定称重类型和工位名称
- string weighType = GetWeighingType(opName); // 地面/放油前/放油后
- string stationName = weighType; // 工位名称直接用称重类型名
- // 4. 写过站记录(所有类型统一:INSERT一条,到达时间=NOW)
- B_DB_Opera.InsertStationRecord(engineNo, modelNo, orderNo, palletNo,
- opName, stationName, addOilQty, extractOilQty, density, Curr_UserName);
- // 5. 按类型处理称重记录
- if (weighType == "放油后")
- {
- // 空中放油后:查找最新放油前记录(无论是否完成,支持多次测量)
- if (!B_DB_Opera.QueryWeighingBeforeOil(engineNo, out _, out decimal preWeight, out _, out _, out _))
- {
- // 写报警代码=3(发动机号错误),阻断流程
- WritePLC_IF(112, opName, 3);
- B_DB_Opera.SaveLog_Response($"【{opName}】未找到发动机[{engineNo}]的空中称重记录", AID);
- WeighingPage?.AppendLog($"[{opName}] 未找到[{engineNo}]放油前记录,进站失败");
- return;
- }
- else
- {
- B_DB_Opera.SaveLog_Response($"【{opName}】空中放油后准备完成,发动机={engineNo},机型={modelNo},放油前重量={preWeight}kg", AID);
- }
- }
- else
- {
- // 地面 或 空中放油前:每次都新建称重记录(支持同一产品多次测量取最新)
- string recordType = weighType == "地面" ? "地面" : "空中";
- B_DB_Opera.InsertWeighingRecord(opName, recordType, engineNo, modelNo, orderNo, palletNo,
- 0, 0, addOilQty, extractOilQty, density, residualOilUpperLimit, residualOilLowerLimit, 0, 0, 0, 0,
- opName, Curr_UserName, isComplete: 0);
- B_DB_Opera.SaveLog_Response($"【{opName}】{weighType}准备完成,发动机={engineNo},机型={modelNo},残油量范围={residualOilLowerLimit:F4}-{residualOilUpperLimit:F4}L", AID);
- }
- // 6. 回写允许工作
- WritePLC_IF(66, opName, true);
- }
- catch (Exception err)
- {
- WritePLC_IF(112, opName, 1); // 报警代码=1,获取数据失败
- B_DB_Opera.SaveLog_Response($"【{opName}】请求工作处理失败:{err.Message}", AID);
- }
- }
- ///
- /// 处理请求保存信号 (tagTypeCodeID=19)
- /// 流程:读取称重数据 → 更新过站记录 → 按类型处理称重记录 → 回写保存完成
- ///
- private void Weighing_HandleRequestSave(string opName, string tagID)
- {
- B_DB_Opera.SaveLog_Request(opName, Log_Type.ZK_MesHandler, "MIS_Function",
- Log_FromAndTo.ZK, Log_FromAndTo.ZK, $"触发信号【19-请求保存】", out long AID);
- try
- {
- // 1. 读取PLC数据
- decimal weight = Convert.ToDecimal(ReadPLC(100140, opName)); // 重量
- decimal waterContent = Convert.ToDecimal(ReadPLC(100180, opName)); // 水含量
- string engineNo = PLC_R.GetString_CleanGarbled(ReadPLC(10, opName)); // 产品编号
- long curveWeighingRecordId = 0;
- // 2. 更新过站记录(离开时间+称重重量)
- B_DB_Opera.UpdateStationComplete(engineNo, opName, weight);
- // 3. 确定类型并处理
- string weighType = GetWeighingType(opName);
- decimal oilReleaseQty = 0;
- decimal residualOilQty = 0;
- int finalQualityFlag = 1;
- string qualityMsg = "";
- if (weighType == "地面")
- {
- // 地面:查最新记录 → 放油量=重量/密度 → 标记完成
- B_DB_Opera.QueryLatestRecord(opName, engineNo,
- out long recordId, out _, out decimal addOil, out decimal extractOil, out decimal dens);
- curveWeighingRecordId = recordId;
- oilReleaseQty = dens > 0 ? weight / dens : 0;
- residualOilQty = addOil - extractOil - oilReleaseQty;
- B_DB_Opera.UpdateWeighingComplete(recordId, "地面", opName,
- weight, oilReleaseQty, residualOilQty, waterContent, out finalQualityFlag, out qualityMsg);
- B_DB_Opera.SaveLog_Response(
- $"【{opName}】地面保存完成:发动机={engineNo},重量={weight}kg,放油量={oilReleaseQty:F4}L,残油量={residualOilQty:F4}L,合格标志={finalQualityFlag},{qualityMsg}", AID);
- WeighingPage?.UpdateOilResult(WeighingPage?.GetStationIndex(opName) ?? 1, oilReleaseQty, residualOilQty);
- WeighingPage?.AppendLog($"[{opName}] 保存完成:{engineNo},重量={weight:F2}kg,放油量={oilReleaseQty:F4}L");
- }
- else if (weighType == "放油前")
- {
- // 空中放油前:查最新记录 → 仅写入进站重量,不标记完成
- B_DB_Opera.QueryLatestRecord(opName, engineNo,
- out long recordId, out _, out _, out _, out _);
- curveWeighingRecordId = recordId;
- B_DB_Opera.UpdateWeighingComplete(recordId, "空中放油前", opName,
- weight, 0, 0, waterContent, out finalQualityFlag, out qualityMsg);
- B_DB_Opera.SaveLog_Response(
- $"【{opName}】空中放油前保存完成:发动机={engineNo},进站重量={weight}kg,合格标志={finalQualityFlag},{qualityMsg}", AID);
- WeighingPage?.AppendLog($"[{opName}] 放油前保存:{engineNo},重量={weight:F2}kg");
- }
- else // 放油后
- {
- // 空中放油后:查最新放油前记录(无论是否完成),计算放油量更新到该记录
- if (B_DB_Opera.QueryWeighingBeforeOil(engineNo, out long recordId, out decimal preWeight,
- out decimal addOil, out decimal extractOil, out decimal dens))
- {
- curveWeighingRecordId = recordId;
- oilReleaseQty = dens > 0 ? (preWeight - weight) / dens : 0;
- residualOilQty = addOil - extractOil - oilReleaseQty;
- B_DB_Opera.UpdateWeighingComplete(recordId, "空中放油后", opName,
- weight, oilReleaseQty, residualOilQty, waterContent, out finalQualityFlag, out qualityMsg);
- B_DB_Opera.SaveLog_Response(
- $"【{opName}】空中放油后保存完成:发动机={engineNo},放油前={preWeight}kg,放油后={weight}kg,放油量={oilReleaseQty:F4}L,残油量={residualOilQty:F4}L,合格标志={finalQualityFlag},{qualityMsg}", AID);
- WeighingPage?.UpdateOilResult(WeighingPage?.GetStationIndex(opName) ?? 1, oilReleaseQty, residualOilQty);
- WeighingPage?.AppendLog($"[{opName}] 放油后保存:{engineNo},放油量={oilReleaseQty:F4}L,残油量={residualOilQty:F4}L");
- }
- else
- {
- // 找不到放油前记录(可能直接进OP20):创建一条放油后记录并标记完成
- curveWeighingRecordId = B_DB_Opera.InsertWeighingRecord(opName, "空中放油后", engineNo, "", "", "",
- 0, weight, 0, 0, 0, 0, 0, 0, 0, 2, waterContent,
- opName, Curr_UserName, isComplete: 1);
- finalQualityFlag = 2;
- qualityMsg = "未找到放油前记录";
- B_DB_Opera.SaveLog_Response(
- $"【{opName}】放油后保存(无放油前记录):发动机={engineNo},放油后重量={weight}kg", AID);
- WeighingPage?.AppendLog($"[{opName}] ⚠️ 放油后保存:{engineNo}(无放油前记录,已新建)");
- }
- }
- CurveCollector_EndSegment(opName, curveWeighingRecordId);
- // TODO: MES接口数据上传(接口对接后实现)
- if (finalQualityFlag == 2 && !string.IsNullOrWhiteSpace(qualityMsg))
- {
- WeighingPage?.AppendLog($"[{opName}] 判定不合格:{qualityMsg}");
- }
- // 4. 先回写上位机判定的合格标志,再回写保存完成
- WritePLC_IF(21, opName, finalQualityFlag);
- WritePLC_IF(20, opName, true);
- }
- catch (Exception err)
- {
- CurveCollector_EndSegment(opName, 0);
- WritePLC_IF(112, opName, 2); // 报警代码=2,保存失败
- B_DB_Opera.SaveLog_Response($"【{opName}】保存处理失败:{err.Message}", AID);
- WeighingPage?.AppendLog($"[{opName}] ❌ 保存异常:{err.Message}");
- }
- }
- // ====================================================================
- // 扫码枪业务处理
- // ====================================================================
- ///
- /// 扫码枪扫码完成后的业务处理
- /// 将码值写入PLC地址102500,触发完成信号100016=1,1秒后复位
- ///
- /// 工位号(OP10/OP20),由COM口绑定决定
- /// 扫到的条码值
- public void Barcode_HandleScan(string opName, string barcode)
- {
- B_DB_Opera.SaveLog_Request(opName, Log_Type.ZK_MesHandler, "MIS_Function",
- Log_FromAndTo.ZK, Log_FromAndTo.ZK, $"扫码枪触发【{opName}】码值={barcode}", out long AID);
- try
- {
- // 1. 写入码值到 PLC 地址 102500(PLC_PC_扫码枪值)
- WritePLC_IF(102500, opName, barcode);
- // 2. 写入扫码完成信号 100016 = 1(PC_PLC_扫码枪扫码完成)
- WritePLC_IF(100016, opName, true);
- // 3. 日志
- B_DB_Opera.SaveLog_Response($"【{opName}】扫码完成:码值={barcode}", AID);
- WeighingPage?.AppendLog($"[{opName}] 触发扫码 码值:{barcode}");
- // 4. 1秒后复位 100016 = 0
- System.Threading.Tasks.Task.Delay(1000).ContinueWith(_ =>
- {
- try { WritePLC_IF(100016, opName, false); }
- catch { }
- });
- }
- catch (Exception err)
- {
- B_DB_Opera.SaveLog_Response($"【{opName}】扫码处理失败:{err.Message}", AID);
- WeighingPage?.AppendLog($"[{opName}] ❌ 扫码处理异常:{err.Message}");
- }
- }
-
- private class CurveCollectorState
- {
- public string OpName;
- public long SegmentId;
- public Thread WorkerThread;
- public volatile bool IsRunning;
- public bool IsSegmentEnded;
- public bool IsWaitingSave;
- public int SeqNo;
- public readonly object BufferLock = new object();
- public readonly List Buffer = new List();
- }
-
- private static readonly ConcurrentDictionary _curveCollectors
- = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase);
-
- ///
- /// 工件到位后启动实时重量曲线采集。
- ///
- private void CurveCollector_Start(string opName)
- {
- try
- {
- if (_curveCollectors.TryGetValue(opName, out CurveCollectorState oldState) && !oldState.IsSegmentEnded)
- {
- if (oldState.IsRunning) return;
- CurveCollector_EndSegment(opName, 0);
- }
-
- string engineNo = PLC_R.GetString_CleanGarbled(ReadPLC(10, opName));
- string modelNo = PLC_R.GetString_CleanGarbled(ReadPLC(11, opName));
- long segmentId = B_DB_Opera.Curve_StartSegment(opName, engineNo, modelNo);
- if (segmentId <= 0)
- {
- WeighingPage?.AppendLog($"[{opName}] 曲线段创建失败,未启动采集");
- return;
- }
-
- var state = new CurveCollectorState
- {
- OpName = opName,
- SegmentId = segmentId,
- IsRunning = true
- };
- state.WorkerThread = new Thread(() => CurveCollector_Work(state))
- {
- IsBackground = true,
- Name = $"CurveCollector_{opName}"
- };
-
- _curveCollectors[opName] = state;
- state.WorkerThread.Start();
- WeighingPage?.AppendLog($"[{opName}] 实时重量曲线采集启动,段ID={segmentId}");
- }
- catch (Exception err)
- {
- WeighingPage?.AppendLog($"[{opName}] 曲线采集启动异常:{err.Message}");
- }
- }
-
- ///
- /// 采集线程:200ms读取一次实时重量,满10条批量写库。
- ///
- private void CurveCollector_Work(CurveCollectorState state)
- {
- while (state.IsRunning)
- {
- try
- {
- decimal weight = Convert.ToDecimal(ReadPLC(100220, state.OpName));
- List writePoints = null;
- lock (state.BufferLock)
- {
- state.Buffer.Add(new CurveSamplePoint
- {
- SeqNo = ++state.SeqNo,
- SampleTime = DateTime.Now,
- Weight = weight
- });
- if (state.Buffer.Count >= 10)
- {
- writePoints = new List(state.Buffer);
- state.Buffer.Clear();
- }
- }
-
- if (writePoints != null)
- {
- B_DB_Opera.Curve_WritePoints(state.SegmentId, writePoints);
- }
- }
- catch (Exception err)
- {
- WeighingPage?.AppendLog($"[{state.OpName}] 曲线采样异常:{err.Message}");
- }
- Thread.Sleep(200);
- }
-
- CurveCollector_Flush(state);
- }
-
- ///
- /// 停止采样线程并刷出剩余点,但暂不关闭曲线段。
- ///
- private void CurveCollector_StopSampling(string opName, bool waitingSave = false)
- {
- if (!_curveCollectors.TryGetValue(opName, out CurveCollectorState state)) return;
-
- if (waitingSave)
- {
- state.IsWaitingSave = true;
- }
- state.IsRunning = false;
- if (state.WorkerThread != null && state.WorkerThread.IsAlive)
- {
- state.WorkerThread.Join(2000);
- }
- CurveCollector_Flush(state);
- }
-
- ///
- /// 工件离开时停止采集并关闭曲线段。
- ///
- private void CurveCollector_Stop(string opName)
- {
- if (_curveCollectors.TryGetValue(opName, out CurveCollectorState state) && state.IsWaitingSave)
- {
- return;
- }
- CurveCollector_EndSegment(opName, 0);
- }
-
- ///
- /// 保存完成后关闭曲线段,并关联称重记录ID。
- ///
- private void CurveCollector_EndSegment(string opName, long weighingRecordId)
- {
- if (!_curveCollectors.TryGetValue(opName, out CurveCollectorState state)) return;
-
- CurveCollector_StopSampling(opName);
- if (!state.IsSegmentEnded)
- {
- B_DB_Opera.Curve_EndSegment(state.SegmentId, weighingRecordId);
- state.IsSegmentEnded = true;
- WeighingPage?.AppendLog($"[{opName}] 实时重量曲线采集结束,段ID={state.SegmentId}");
- }
- _curveCollectors.TryRemove(opName, out _);
- }
-
- ///
- /// 将采集缓冲区剩余点写入数据库。
- ///
- private void CurveCollector_Flush(CurveCollectorState state)
- {
- List writePoints = null;
- lock (state.BufferLock)
- {
- if (state.Buffer.Count > 0)
- {
- writePoints = new List(state.Buffer);
- state.Buffer.Clear();
- }
- }
-
- if (writePoints != null)
- {
- B_DB_Opera.Curve_WritePoints(state.SegmentId, writePoints);
- }
- }
- }
-}
+using ExternalDataSync;
+using System;
+using DC_A95;
+///
+///
+///
+namespace MesWork
+{
+ ///
+ /// 处理MIS逻辑
+ ///
+ public partial class MesWorkForm
+ {
+ ///
+ /// PLC信号变化处理入口
+ /// 当Bool型信号值变化时由框架自动触发
+ ///
+ ///
+ private void MIS_Funtion(object e)
+ {
+ try
+ {
+ var msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
+ if (msgEvent.TagValue == null) return;
+ var tagID = msgEvent.TagID.ToString();
+ var opName = msgEvent.OpName.ToString();
+ var tagTypeCodeID = (int)msgEvent.TagTypeCodeID;
+ var tagTypeID = (EnumTagTypeID)msgEvent.TagTypeID;
+ var isFirstValue = msgEvent.IsFirstValue.ToString().ToLower();
+ var alarmLevel = msgEvent.ShaftID.ToString();
+ var alarmMsg = msgEvent.ItemName.ToString();
+ string tagValue;
+ switch (tagTypeID)
+ {
+ case EnumTagTypeID.BOOL:
+ tagValue = (Convert.ToInt32(msgEvent.TagValue)).ToString();
+ break;
+ default:
+ tagValue = msgEvent.TagValue.ToString();
+ break;
+ }
+ // ── 报警处理(编码900~2000)──
+ if (tagTypeCodeID >= 900 & tagTypeCodeID < 2000)
+ {
+ if (ValueT(isFirstValue))
+ {
+ //不处理第一次变化的值
+ return;
+ }
+ var opNameNew = opName.Replace("_Alarm", "");
+ if (tagValue == "1")
+ {
+ B_DB_Opera.Event_Alarm_Start(opNameNew, tagTypeCodeID, alarmMsg, alarmLevel, tagID);
+ }
+ else
+ {
+ B_DB_Opera.Event_Alarm_End(opNameNew, tagTypeCodeID, alarmMsg, alarmLevel, tagID);
+ }
+ }
+ // ── 信号分发 ──
+ switch (tagTypeCodeID)
+ {
+ case 2: // 工件到位/离开
+ WritePLC_IF(112, opName, 0); // 报警代码清空
+ break;
+ case 14: // PLC心跳 → 回写PC心跳
+ WritePLC_IF(15, opName, tagValue);
+ break;
+ case 44: // 请求工作
+ if (ValueT(isFirstValue)) return;
+ if (tagValue == "1")
+ {
+ WeighingPage?.AppendLog($"[{opName}] PLC请求工作,开始处理...");
+ Weighing_HandleRequestWork(opName, tagID);
+ }
+ else
+ {
+ WritePLC_IF(66, opName, false); //允许工作
+ }
+ break;
+ case 19: // 请求保存
+ if (ValueT(isFirstValue)) return;
+ if (tagValue == "1")
+ {
+ CurveCollector_StopSampling(opName, true); // 先停止采样,保存完成后再关联称重记录ID
+ WeighingPage?.AppendLog($"[{opName}] PLC请求保存数据...");
+ Weighing_HandleRequestSave(opName, tagID);
+ }
+ else
+ {
+ WritePLC_IF(20, opName, false); //保存完成
+ WritePLC_IF(21, opName, false); //合格标志
+ }
+ break;
+ case 203: // 设备状态
+ B_DB_Opera.Event_DeviceStatus_Change(opName, tagValue);
+ break;
+ default:
+ break;
+ }
+ }
+ catch (Exception err)
+ {
+ string errMsg = $"PLC信号处理异常:{err.Message}";
+ B_DB_Opera.SaveLog_Request("", Log_Type.ZK_MesHandler, "MIS_Function",
+ Log_FromAndTo.ZK, Log_FromAndTo.ZK, errMsg, out long AID);
+ B_DB_Opera.SaveLog_Response(errMsg, AID);
+ WeighingPage?.AppendLog(errMsg);
+ }
+ }
+ // ====================================================================
+ // 称重交互核心方法
+ // ====================================================================
+ ///
+ /// 获取称重类型:地面/放油前/放油后
+ /// Ground模式:统一返回"地面"
+ /// Hanging模式:OP10=放油前,OP20=放油后
+ ///
+ private string GetWeighingType(string opName)
+ {
+ if (WeighingType == "Ground")
+ return "地面";
+ // Hanging模式
+ return opName == "OP10" ? "放油前" : "放油后";
+ }
+ ///
+ /// 码块数据转换:将产品编号统一转大写,并拆分出订货号与产品编号
+ /// 支持格式:
+ /// 0/DHN2.5Q0219-36/D426E016767
+ /// DHH02K0014-400/B726E00584555
+ ///
+ private bool TryConvertCodeBlockData(string codeBlock, out string orderNo, out string productNo)
+ {
+ orderNo = "";
+ productNo = "";
+ if (string.IsNullOrWhiteSpace(codeBlock))
+ {
+ return false;
+ }
+
+ string normalizedCode = codeBlock.Trim().ToUpperInvariant();
+ string[] parts = normalizedCode.Split('/');
+ if (parts.Length >= 2)
+ {
+ orderNo = parts[parts.Length - 2].Trim();
+ productNo = parts[parts.Length - 1].Trim();
+ }
+ else
+ {
+ productNo = normalizedCode;
+ }
+
+ return !string.IsNullOrWhiteSpace(productNo);
+ }
+ ///
+ /// 处理请求工作信号 (tagTypeCodeID=44)
+ /// 流程:读取工件信息 → 查询参数 → 写过站记录 → 按类型处理称重记录 → 回写允许工作
+ ///
+ private void Weighing_HandleRequestWork(string opName, string tagID)
+ {
+ B_DB_Opera.SaveLog_Request(opName, Log_Type.ZK_MesHandler, "MIS_Function",
+ Log_FromAndTo.ZK, Log_FromAndTo.ZK, $"触发信号【44-请求工作】", out long AID);
+ try
+ {
+ string engineNo = PLC_R.GetString_CleanGarbled(ReadPLC(10, opName)); // 原始代码串 0/dhn2.5q0219-36/d426e016767
+ string modelNo = PLC_R.GetString_CleanGarbled(ReadPLC(11, opName)); // 机型号
+ string orderNo = PLC_R.GetString_CleanGarbled(ReadPLC(39, opName)); // 工单号
+ string palletNo = PLC_R.GetString_CleanGarbled(ReadPLC(80, opName)); // 托盘号
+ modelNo = "WP7";
+ // 解析代码串格式: 0/DHN2.5Q0219-36/D426E016767 或 DHH02K0014-400/B726E00584555
+ if (TryConvertCodeBlockData(engineNo, out string parsedOrderNo, out string parsedProductNo))
+ {
+ if (!string.IsNullOrWhiteSpace(parsedOrderNo))
+ {
+ orderNo = parsedOrderNo;
+ }
+ engineNo = parsedProductNo;
+
+ B_DB_Opera.SaveLog_Response($"【{opName}】读取工件:发动机={engineNo},机型={modelNo},工单={orderNo},托盘={palletNo}", AID);
+ int stIdx = WeighingPage?.GetStationIndex(opName) ?? 1;
+ WeighingPage?.UpdateStationInfo(stIdx, engineNo, modelNo, orderNo);
+ WeighingPage?.AppendLog($"[{opName}] 读取工件:{engineNo},机型={modelNo}");
+ if (!B_DB_Opera.QueryWorkpieceByModel(modelNo, out decimal addOilQty, out decimal extractOilQty, out decimal density,
+ out decimal residualOilUpperLimit, out decimal residualOilLowerLimit))
+ {
+ WritePLC_IF(112, opName, 3); // 报警代码=3,机型错误
+ B_DB_Opera.SaveLog_Response($"【{opName}】工件管理中未找到机型[{modelNo}]的参数,发动机={engineNo}", AID);
+ WeighingPage?.AppendLog($"[{opName}] 机型[{modelNo}]未找到配置参数");
+ return;
+ }
+ WeighingPage?.UpdateOilInfo(stIdx, addOilQty, extractOilQty, density, 0, 0);
+ string weighType = GetWeighingType(opName); // 地面/放油前/放油后
+ string stationName = weighType; // 工位名称直接用称重类型名
+ B_DB_Opera.InsertStationRecord(engineNo, modelNo, orderNo, palletNo,
+ opName, stationName, addOilQty, extractOilQty, density, Curr_UserName); // 请求工作成功先写到站记录
+ if (weighType == "放油后")
+ {
+ // 空中放油后:查找最新放油前记录(无论是否完成,支持多次测量)
+ if (!B_DB_Opera.QueryWeighingBeforeOil(engineNo, out _, out decimal preWeight, out _, out _, out _))
+ {
+ WritePLC_IF(112, opName, 3);
+ B_DB_Opera.SaveLog_Response($"【{opName}】未找到发动机[{engineNo}]的空中称重记录", AID);
+ WeighingPage?.AppendLog($"[{opName}] 未找到[{engineNo}]放油前记录,进站失败");
+ return;
+ }
+ else
+ {
+ B_DB_Opera.SaveLog_Response($"【{opName}】空中放油后准备完成,发动机={engineNo},机型={modelNo},放油前重量={preWeight}kg", AID);
+ }
+ }
+ else
+ {
+ // 地面 或 空中放油前:每次都新建称重记录(支持同一产品多次测量取最新)
+ string recordType = weighType == "地面" ? "地面" : "空中";
+ B_DB_Opera.InsertWeighingRecord(opName, recordType, engineNo, modelNo, orderNo, palletNo,
+ 0, 0, addOilQty, extractOilQty, density, residualOilUpperLimit, residualOilLowerLimit, 0, 0, 0, 0,
+ opName, Curr_UserName, isComplete: 0); // 放油前/地面先占位,保存时回填重量结果
+ B_DB_Opera.SaveLog_Response($"【{opName}】{weighType}准备完成,发动机={engineNo},机型={modelNo},残油量范围={residualOilLowerLimit:F4}-{residualOilUpperLimit:F4}L", AID);
+ }
+ WritePLC_IF(66, opName, true);
+ CurveCollector_Start(opName, engineNo, modelNo); // 允许工作后开始记录本次曲线
+ }
+ else
+ {
+ WritePLC_IF(112, opName, 1); // 报警代码=1,获取数据失败
+ B_DB_Opera.SaveLog_Response($"【{opName}】码块数据转换失败:原始码值=[{engineNo}]", AID);
+ WeighingPage?.AppendLog($"[{opName}] 码块数据转换失败:{engineNo}");
+ }
+ }
+ catch (Exception err)
+ {
+ WritePLC_IF(112, opName, 1); // 报警代码=1,获取数据失败
+ B_DB_Opera.SaveLog_Response($"【{opName}】请求工作处理失败:{err.Message}", AID);
+ }
+ }
+ ///
+ /// 处理请求保存信号 (tagTypeCodeID=19)
+ /// 流程:读取称重数据 → 更新过站记录 → 按类型处理称重记录 → 回写保存完成
+ ///
+ private void Weighing_HandleRequestSave(string opName, string tagID)
+ {
+ B_DB_Opera.SaveLog_Request(opName, Log_Type.ZK_MesHandler, "MIS_Function",
+ Log_FromAndTo.ZK, Log_FromAndTo.ZK, $"触发信号【19-请求保存】", out long AID);
+ try
+ {
+ decimal plcWeight = Convert.ToDecimal(ReadPLC(100140, opName)); // PLC锁定重量,曲线无效时兜底使用
+ decimal weight = plcWeight; // 默认使用PLC锁定重量,曲线算法成功后覆盖
+ decimal waterContent = Convert.ToDecimal(ReadPLC(100180, opName)); // 水含量
+ string engineNo = PLC_R.GetString_CleanGarbled(ReadPLC(10, opName)); // 产品编号
+ if (TryConvertCodeBlockData(engineNo, out _, out string parsedProductNo))
+ {
+ engineNo = parsedProductNo;
+ }
+
+ if (CurveCollector_TryGetStableWeight(opName, out decimal curveWeight, out int curvePointCount, out string curveMsg))
+ {
+ weight = curveWeight; // 优先使用曲线稳定段计算重量
+ B_DB_Opera.SaveLog_Response($"【{opName}】曲线重量={curveWeight:F3}kg,PLC重量={plcWeight:F3}kg,差值={(curveWeight - plcWeight):F3}kg,点数={curvePointCount}", AID);
+ }
+ else
+ {
+ B_DB_Opera.SaveLog_Response($"【{opName}】曲线重量不可用,使用PLC锁定重量={plcWeight:F3}kg,原因={curveMsg}", AID);
+ }
+
+ long curveWeighingRecordId = 0;
+ B_DB_Opera.UpdateStationComplete(engineNo, opName, weight); // 过站记录保存最终采用重量
+ string weighType = GetWeighingType(opName);
+ decimal oilReleaseQty = 0;
+ decimal residualOilQty = 0;
+ int finalQualityFlag = 1;
+ string qualityMsg = "";
+ if (weighType == "地面")
+ {
+ // 地面:查最新记录 → 放油量=重量/密度 → 标记完成
+ B_DB_Opera.QueryLatestRecord(opName, engineNo,
+ out long recordId, out _, out decimal addOil, out decimal extractOil, out decimal dens);
+ curveWeighingRecordId = recordId; // 曲线记录最终关联这条称重记录
+ oilReleaseQty = dens > 0 ? weight / dens : 0; // 地面:油桶重量/密度=放油量
+ residualOilQty = addOil - extractOil - oilReleaseQty; // 残油=加油-抽油-放油
+ B_DB_Opera.UpdateWeighingComplete(recordId, "地面", opName,
+ weight, oilReleaseQty, residualOilQty, waterContent, out finalQualityFlag, out qualityMsg);
+ B_DB_Opera.SaveLog_Response(
+ $"【{opName}】地面保存完成:发动机={engineNo},重量={weight}kg,放油量={oilReleaseQty:F4}L,残油量={residualOilQty:F4}L,合格标志={finalQualityFlag},{qualityMsg}", AID);
+ WeighingPage?.UpdateOilResult(WeighingPage?.GetStationIndex(opName) ?? 1, oilReleaseQty, residualOilQty);
+ WeighingPage?.AppendLog($"[{opName}] 保存完成:{engineNo},重量={weight:F2}kg,放油量={oilReleaseQty:F4}L");
+ }
+ else if (weighType == "放油前")
+ {
+ // 空中放油前:查最新记录 → 仅写入进站重量,不标记完成
+ B_DB_Opera.QueryLatestRecord(opName, engineNo,
+ out long recordId, out _, out _, out _, out _);
+ curveWeighingRecordId = recordId; // 放油前曲线也关联同一条称重记录
+ B_DB_Opera.UpdateWeighingComplete(recordId, "空中放油前", opName,
+ weight, 0, 0, waterContent, out finalQualityFlag, out qualityMsg);
+ B_DB_Opera.SaveLog_Response(
+ $"【{opName}】空中放油前保存完成:发动机={engineNo},进站重量={weight}kg,合格标志={finalQualityFlag},{qualityMsg}", AID);
+ WeighingPage?.AppendLog($"[{opName}] 放油前保存:{engineNo},重量={weight:F2}kg");
+ }
+ else // 放油后
+ {
+ // 空中放油后:查最新放油前记录(无论是否完成),计算放油量更新到该记录
+ if (B_DB_Opera.QueryWeighingBeforeOil(engineNo, out long recordId, out decimal preWeight,
+ out decimal addOil, out decimal extractOil, out decimal dens))
+ {
+ curveWeighingRecordId = recordId; // 放油后回填放油前创建的称重记录
+ oilReleaseQty = dens > 0 ? (preWeight - weight) / dens : 0; // 空中:前后重量差/密度=放油量
+ residualOilQty = addOil - extractOil - oilReleaseQty; // 残油=加油-抽油-放油
+ B_DB_Opera.UpdateWeighingComplete(recordId, "空中放油后", opName,
+ weight, oilReleaseQty, residualOilQty, waterContent, out finalQualityFlag, out qualityMsg);
+ B_DB_Opera.SaveLog_Response(
+ $"【{opName}】空中放油后保存完成:发动机={engineNo},放油前={preWeight}kg,放油后={weight}kg,放油量={oilReleaseQty:F4}L,残油量={residualOilQty:F4}L,合格标志={finalQualityFlag},{qualityMsg}", AID);
+ WeighingPage?.UpdateOilResult(WeighingPage?.GetStationIndex(opName) ?? 1, oilReleaseQty, residualOilQty);
+ WeighingPage?.AppendLog($"[{opName}] 放油后保存:{engineNo},放油量={oilReleaseQty:F4}L,残油量={residualOilQty:F4}L");
+ }
+ else
+ {
+ // 找不到放油前记录(可能直接进OP20):创建一条放油后记录并标记完成
+ curveWeighingRecordId = B_DB_Opera.InsertWeighingRecord(opName, "空中放油后", engineNo, "", "", "",
+ 0, weight, 0, 0, 0, 0, 0, 0, 0, 2, waterContent,
+ opName, Curr_UserName, isComplete: 1); // 异常兜底记录,质量直接判不合格
+ finalQualityFlag = 2;
+ qualityMsg = "未找到放油前记录";
+ B_DB_Opera.SaveLog_Response(
+ $"【{opName}】放油后保存(无放油前记录):发动机={engineNo},放油后重量={weight}kg", AID);
+ WeighingPage?.AppendLog($"[{opName}] ⚠️ 放油后保存:{engineNo}(无放油前记录,已新建)");
+ }
+ }
+ CurveCollector_EndSegment(opName, curveWeighingRecordId); // 保存点位、最终重量和取点区间
+ // TODO: MES接口数据上传(接口对接后实现)
+ if (finalQualityFlag == 2 && !string.IsNullOrWhiteSpace(qualityMsg))
+ {
+ WeighingPage?.AppendLog($"[{opName}] 判定不合格:{qualityMsg}");
+ }
+ // 4. 先回写上位机判定的合格标志,再回写保存完成
+ WritePLC_IF(21, opName, finalQualityFlag); // 合格标志
+ WritePLC_IF(20, opName, true); // 保存完成
+ }
+ catch (Exception err)
+ {
+ CurveCollector_EndSegment(opName, 0);
+ WritePLC_IF(112, opName, 2); // 报警代码=2,保存失败
+ B_DB_Opera.SaveLog_Response($"【{opName}】保存处理失败:{err.Message}", AID);
+ WeighingPage?.AppendLog($"[{opName}] ❌ 保存异常:{err.Message}");
+ }
+ }
+ // ====================================================================
+ // 扫码枪业务处理
+ // ====================================================================
+ ///
+ /// 扫码枪扫码完成后的业务处理
+ /// 将码值写入PLC地址102500,触发完成信号100016=1,1秒后复位
+ ///
+ /// 工位号(OP10/OP20),由COM口绑定决定
+ /// 扫到的条码值
+ public void Barcode_HandleScan(string opName, string barcode)
+ {
+ B_DB_Opera.SaveLog_Request(opName, Log_Type.ZK_MesHandler, "MIS_Function",
+ Log_FromAndTo.ZK, Log_FromAndTo.ZK, $"扫码枪触发【{opName}】码值={barcode}", out long AID);
+ try
+ {
+ // 1. 写入码值到 PLC 地址 102500(PLC_PC_扫码枪值)
+ WritePLC_IF(102500, opName, barcode);
+ // 2. 写入扫码完成信号 100016 = 1(PC_PLC_扫码枪扫码完成)
+ WritePLC_IF(100016, opName, true);
+ // 3. 日志
+ B_DB_Opera.SaveLog_Response($"【{opName}】扫码完成:码值={barcode}", AID);
+ WeighingPage?.AppendLog($"[{opName}] 触发扫码 码值:{barcode}");
+ // 4. 1秒后复位 100016 = 0
+ System.Threading.Tasks.Task.Delay(1000).ContinueWith(_ =>
+ {
+ try { WritePLC_IF(100016, opName, false); }
+ catch { }
+ });
+ }
+ catch (Exception err)
+ {
+ B_DB_Opera.SaveLog_Response($"【{opName}】扫码处理失败:{err.Message}", AID);
+ WeighingPage?.AppendLog($"[{opName}] ❌ 扫码处理异常:{err.Message}");
+ }
+ }
+
+ }
+}
diff --git a/SCADA/Pages/UC_LogRecord.Designer.cs b/SCADA/Pages/UC_LogRecord.Designer.cs
index 564dafa..3bd5389 100644
--- a/SCADA/Pages/UC_LogRecord.Designer.cs
+++ b/SCADA/Pages/UC_LogRecord.Designer.cs
@@ -15,233 +15,233 @@ namespace MesWork.Pages
private void InitializeComponent()
{
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
- this.pnl_Toolbar = new System.Windows.Forms.Panel();
- this.btn_Export = new System.Windows.Forms.Button();
- this.btn_Refresh = new System.Windows.Forms.Button();
- this.btn_Query = new System.Windows.Forms.Button();
- this.txt_Keyword = new System.Windows.Forms.TextBox();
- this.cmb_Type = new System.Windows.Forms.ComboBox();
- this.dtp_End = new System.Windows.Forms.DateTimePicker();
- this.lbl_To = new System.Windows.Forms.Label();
- this.dtp_Start = new System.Windows.Forms.DateTimePicker();
- this.dgv_Data = new System.Windows.Forms.DataGridView();
- this.pnl_Footer = new System.Windows.Forms.Panel();
- this.lbl_RecordCount = new System.Windows.Forms.Label();
- this.pnl_Toolbar.SuspendLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dgv_Data)).BeginInit();
- this.pnl_Footer.SuspendLayout();
- this.SuspendLayout();
- //
- // pnl_Toolbar
- //
- this.pnl_Toolbar.BackColor = System.Drawing.Color.White;
- this.pnl_Toolbar.Controls.Add(this.btn_Export);
- this.pnl_Toolbar.Controls.Add(this.btn_Refresh);
- this.pnl_Toolbar.Controls.Add(this.btn_Query);
- this.pnl_Toolbar.Controls.Add(this.txt_Keyword);
- this.pnl_Toolbar.Controls.Add(this.cmb_Type);
- this.pnl_Toolbar.Controls.Add(this.dtp_End);
- this.pnl_Toolbar.Controls.Add(this.lbl_To);
- this.pnl_Toolbar.Controls.Add(this.dtp_Start);
- this.pnl_Toolbar.Dock = System.Windows.Forms.DockStyle.Top;
- this.pnl_Toolbar.Location = new System.Drawing.Point(0, 0);
- this.pnl_Toolbar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.pnl_Toolbar.Name = "pnl_Toolbar";
- this.pnl_Toolbar.Padding = new System.Windows.Forms.Padding(18, 12, 18, 12);
- this.pnl_Toolbar.Size = new System.Drawing.Size(2730, 75);
- this.pnl_Toolbar.TabIndex = 2;
- //
- // btn_Export
- //
- this.btn_Export.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(150)))), ((int)(((byte)(105)))));
- this.btn_Export.Cursor = System.Windows.Forms.Cursors.Hand;
- this.btn_Export.FlatAppearance.BorderSize = 0;
- this.btn_Export.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btn_Export.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Bold);
- this.btn_Export.ForeColor = System.Drawing.Color.White;
- this.btn_Export.Location = new System.Drawing.Point(1305, 12);
- this.btn_Export.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.btn_Export.Name = "btn_Export";
- this.btn_Export.Size = new System.Drawing.Size(180, 48);
- this.btn_Export.TabIndex = 0;
- this.btn_Export.Text = "📥 导出Excel";
- this.btn_Export.UseVisualStyleBackColor = false;
- this.btn_Export.Click += new System.EventHandler(this.btn_Export_Click);
- //
- // btn_Refresh
- //
- this.btn_Refresh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(231)))), ((int)(((byte)(235)))));
- this.btn_Refresh.Cursor = System.Windows.Forms.Cursors.Hand;
- this.btn_Refresh.FlatAppearance.BorderSize = 0;
- this.btn_Refresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btn_Refresh.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.btn_Refresh.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(65)))), ((int)(((byte)(81)))));
- this.btn_Refresh.Location = new System.Drawing.Point(1170, 12);
- this.btn_Refresh.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.btn_Refresh.Name = "btn_Refresh";
- this.btn_Refresh.Size = new System.Drawing.Size(120, 48);
- this.btn_Refresh.TabIndex = 1;
- this.btn_Refresh.Text = "↻ 刷新";
- this.btn_Refresh.UseVisualStyleBackColor = false;
- this.btn_Refresh.Click += new System.EventHandler(this.btn_Refresh_Click);
- //
- // btn_Query
- //
- this.btn_Query.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(144)))), ((int)(((byte)(217)))));
- this.btn_Query.Cursor = System.Windows.Forms.Cursors.Hand;
- this.btn_Query.FlatAppearance.BorderSize = 0;
- this.btn_Query.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
- this.btn_Query.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.btn_Query.ForeColor = System.Drawing.Color.White;
- this.btn_Query.Location = new System.Drawing.Point(1035, 12);
- this.btn_Query.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.btn_Query.Name = "btn_Query";
- this.btn_Query.Size = new System.Drawing.Size(120, 48);
- this.btn_Query.TabIndex = 2;
- this.btn_Query.Text = "🔍 查询";
- this.btn_Query.UseVisualStyleBackColor = false;
- this.btn_Query.Click += new System.EventHandler(this.btn_Query_Click);
- //
- // txt_Keyword
- //
- this.txt_Keyword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
- this.txt_Keyword.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.txt_Keyword.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(163)))), ((int)(((byte)(175)))));
- this.txt_Keyword.Location = new System.Drawing.Point(712, 15);
- this.txt_Keyword.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.txt_Keyword.Name = "txt_Keyword";
- this.txt_Keyword.Size = new System.Drawing.Size(299, 34);
- this.txt_Keyword.TabIndex = 3;
- this.txt_Keyword.Text = "关键字搜索...";
- //
- // cmb_Type
- //
- this.cmb_Type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
- this.cmb_Type.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.cmb_Type.Location = new System.Drawing.Point(480, 15);
- this.cmb_Type.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.cmb_Type.Name = "cmb_Type";
- this.cmb_Type.Size = new System.Drawing.Size(208, 35);
- this.cmb_Type.TabIndex = 4;
- //
- // dtp_End
- //
- this.dtp_End.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.dtp_End.Format = System.Windows.Forms.DateTimePickerFormat.Short;
- this.dtp_End.Location = new System.Drawing.Point(262, 15);
- this.dtp_End.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.dtp_End.Name = "dtp_End";
- this.dtp_End.Size = new System.Drawing.Size(193, 34);
- this.dtp_End.TabIndex = 5;
- //
- // lbl_To
- //
- this.lbl_To.AutoSize = true;
- this.lbl_To.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.lbl_To.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(114)))), ((int)(((byte)(128)))));
- this.lbl_To.Location = new System.Drawing.Point(222, 21);
- this.lbl_To.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
- this.lbl_To.Name = "lbl_To";
- this.lbl_To.Size = new System.Drawing.Size(32, 27);
- this.lbl_To.TabIndex = 6;
- this.lbl_To.Text = "→";
- //
- // dtp_Start
- //
- this.dtp_Start.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.dtp_Start.Format = System.Windows.Forms.DateTimePickerFormat.Short;
- this.dtp_Start.Location = new System.Drawing.Point(18, 15);
- this.dtp_Start.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.dtp_Start.Name = "dtp_Start";
- this.dtp_Start.Size = new System.Drawing.Size(193, 34);
- this.dtp_Start.TabIndex = 7;
- //
- // dgv_Data
- //
- this.dgv_Data.AllowUserToAddRows = false;
- this.dgv_Data.AllowUserToDeleteRows = false;
- dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(250)))), ((int)(((byte)(252)))));
- this.dgv_Data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10;
- this.dgv_Data.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
- this.dgv_Data.BackgroundColor = System.Drawing.Color.White;
- this.dgv_Data.BorderStyle = System.Windows.Forms.BorderStyle.None;
- this.dgv_Data.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal;
- dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(237)))), ((int)(((byte)(242)))));
- dataGridViewCellStyle11.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Bold);
- dataGridViewCellStyle11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(65)))), ((int)(((byte)(81)))));
- dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(237)))), ((int)(((byte)(242)))));
- dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dgv_Data.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;
- this.dgv_Data.ColumnHeadersHeight = 36;
- dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
- dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window;
- dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 10F);
- dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText;
- dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(234)))), ((int)(((byte)(254)))));
- dataGridViewCellStyle12.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(58)))), ((int)(((byte)(95)))));
- dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
- this.dgv_Data.DefaultCellStyle = dataGridViewCellStyle12;
- this.dgv_Data.Dock = System.Windows.Forms.DockStyle.Fill;
- this.dgv_Data.EnableHeadersVisualStyles = false;
- this.dgv_Data.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.dgv_Data.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(237)))), ((int)(((byte)(242)))));
- this.dgv_Data.Location = new System.Drawing.Point(0, 75);
- this.dgv_Data.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.dgv_Data.Name = "dgv_Data";
- this.dgv_Data.ReadOnly = true;
- this.dgv_Data.RowHeadersVisible = false;
- this.dgv_Data.RowHeadersWidth = 62;
- this.dgv_Data.RowTemplate.Height = 32;
- this.dgv_Data.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dgv_Data.Size = new System.Drawing.Size(2730, 1371);
- this.dgv_Data.TabIndex = 0;
- //
- // pnl_Footer
- //
- this.pnl_Footer.BackColor = System.Drawing.Color.White;
- this.pnl_Footer.Controls.Add(this.lbl_RecordCount);
- this.pnl_Footer.Dock = System.Windows.Forms.DockStyle.Bottom;
- this.pnl_Footer.Location = new System.Drawing.Point(0, 1446);
- this.pnl_Footer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.pnl_Footer.Name = "pnl_Footer";
- this.pnl_Footer.Size = new System.Drawing.Size(2730, 54);
- this.pnl_Footer.TabIndex = 1;
- //
- // lbl_RecordCount
- //
- this.lbl_RecordCount.AutoSize = true;
- this.lbl_RecordCount.Font = new System.Drawing.Font("微软雅黑", 10F);
- this.lbl_RecordCount.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(114)))), ((int)(((byte)(128)))));
- this.lbl_RecordCount.Location = new System.Drawing.Point(18, 9);
- this.lbl_RecordCount.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
- this.lbl_RecordCount.Name = "lbl_RecordCount";
- this.lbl_RecordCount.Size = new System.Drawing.Size(116, 27);
- this.lbl_RecordCount.TabIndex = 0;
- this.lbl_RecordCount.Text = "共 0 条记录";
- //
- // UC_LogRecord
- //
- this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F);
- this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
- this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(247)))), ((int)(((byte)(250)))));
- this.Controls.Add(this.dgv_Data);
- this.Controls.Add(this.pnl_Footer);
- this.Controls.Add(this.pnl_Toolbar);
- this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
- this.Name = "UC_LogRecord";
- this.Size = new System.Drawing.Size(2730, 1500);
- this.pnl_Toolbar.ResumeLayout(false);
- this.pnl_Toolbar.PerformLayout();
- ((System.ComponentModel.ISupportInitialize)(this.dgv_Data)).EndInit();
- this.pnl_Footer.ResumeLayout(false);
- this.pnl_Footer.PerformLayout();
- this.ResumeLayout(false);
-
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
+ this.pnl_Toolbar = new System.Windows.Forms.Panel();
+ this.btn_Export = new System.Windows.Forms.Button();
+ this.btn_Refresh = new System.Windows.Forms.Button();
+ this.btn_Query = new System.Windows.Forms.Button();
+ this.txt_Keyword = new System.Windows.Forms.TextBox();
+ this.cmb_Type = new System.Windows.Forms.ComboBox();
+ this.dtp_End = new System.Windows.Forms.DateTimePicker();
+ this.lbl_To = new System.Windows.Forms.Label();
+ this.dtp_Start = new System.Windows.Forms.DateTimePicker();
+ this.dgv_Data = new System.Windows.Forms.DataGridView();
+ this.pnl_Footer = new System.Windows.Forms.Panel();
+ this.lbl_RecordCount = new System.Windows.Forms.Label();
+ this.pnl_Toolbar.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dgv_Data)).BeginInit();
+ this.pnl_Footer.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // pnl_Toolbar
+ //
+ this.pnl_Toolbar.BackColor = System.Drawing.Color.White;
+ this.pnl_Toolbar.Controls.Add(this.btn_Export);
+ this.pnl_Toolbar.Controls.Add(this.btn_Refresh);
+ this.pnl_Toolbar.Controls.Add(this.btn_Query);
+ this.pnl_Toolbar.Controls.Add(this.txt_Keyword);
+ this.pnl_Toolbar.Controls.Add(this.cmb_Type);
+ this.pnl_Toolbar.Controls.Add(this.dtp_End);
+ this.pnl_Toolbar.Controls.Add(this.lbl_To);
+ this.pnl_Toolbar.Controls.Add(this.dtp_Start);
+ this.pnl_Toolbar.Dock = System.Windows.Forms.DockStyle.Top;
+ this.pnl_Toolbar.Location = new System.Drawing.Point(0, 0);
+ this.pnl_Toolbar.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.pnl_Toolbar.Name = "pnl_Toolbar";
+ this.pnl_Toolbar.Padding = new System.Windows.Forms.Padding(18, 12, 18, 12);
+ this.pnl_Toolbar.Size = new System.Drawing.Size(2730, 75);
+ this.pnl_Toolbar.TabIndex = 2;
+ //
+ // btn_Export
+ //
+ this.btn_Export.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(5)))), ((int)(((byte)(150)))), ((int)(((byte)(105)))));
+ this.btn_Export.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btn_Export.FlatAppearance.BorderSize = 0;
+ this.btn_Export.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btn_Export.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Bold);
+ this.btn_Export.ForeColor = System.Drawing.Color.White;
+ this.btn_Export.Location = new System.Drawing.Point(1305, 12);
+ this.btn_Export.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btn_Export.Name = "btn_Export";
+ this.btn_Export.Size = new System.Drawing.Size(180, 48);
+ this.btn_Export.TabIndex = 0;
+ this.btn_Export.Text = "📥 导出Excel";
+ this.btn_Export.UseVisualStyleBackColor = false;
+ this.btn_Export.Click += new System.EventHandler(this.btn_Export_Click);
+ //
+ // btn_Refresh
+ //
+ this.btn_Refresh.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(229)))), ((int)(((byte)(231)))), ((int)(((byte)(235)))));
+ this.btn_Refresh.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btn_Refresh.FlatAppearance.BorderSize = 0;
+ this.btn_Refresh.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btn_Refresh.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.btn_Refresh.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(65)))), ((int)(((byte)(81)))));
+ this.btn_Refresh.Location = new System.Drawing.Point(1170, 12);
+ this.btn_Refresh.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btn_Refresh.Name = "btn_Refresh";
+ this.btn_Refresh.Size = new System.Drawing.Size(120, 48);
+ this.btn_Refresh.TabIndex = 1;
+ this.btn_Refresh.Text = "↻ 刷新";
+ this.btn_Refresh.UseVisualStyleBackColor = false;
+ this.btn_Refresh.Click += new System.EventHandler(this.btn_Refresh_Click);
+ //
+ // btn_Query
+ //
+ this.btn_Query.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(74)))), ((int)(((byte)(144)))), ((int)(((byte)(217)))));
+ this.btn_Query.Cursor = System.Windows.Forms.Cursors.Hand;
+ this.btn_Query.FlatAppearance.BorderSize = 0;
+ this.btn_Query.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+ this.btn_Query.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.btn_Query.ForeColor = System.Drawing.Color.White;
+ this.btn_Query.Location = new System.Drawing.Point(1035, 12);
+ this.btn_Query.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.btn_Query.Name = "btn_Query";
+ this.btn_Query.Size = new System.Drawing.Size(120, 48);
+ this.btn_Query.TabIndex = 2;
+ this.btn_Query.Text = "🔍 查询";
+ this.btn_Query.UseVisualStyleBackColor = false;
+ this.btn_Query.Click += new System.EventHandler(this.btn_Query_Click);
+ //
+ // txt_Keyword
+ //
+ this.txt_Keyword.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.txt_Keyword.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.txt_Keyword.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(156)))), ((int)(((byte)(163)))), ((int)(((byte)(175)))));
+ this.txt_Keyword.Location = new System.Drawing.Point(712, 15);
+ this.txt_Keyword.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.txt_Keyword.Name = "txt_Keyword";
+ this.txt_Keyword.Size = new System.Drawing.Size(299, 34);
+ this.txt_Keyword.TabIndex = 3;
+ this.txt_Keyword.Text = "关键字搜索...";
+ //
+ // cmb_Type
+ //
+ this.cmb_Type.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmb_Type.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.cmb_Type.Location = new System.Drawing.Point(480, 15);
+ this.cmb_Type.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.cmb_Type.Name = "cmb_Type";
+ this.cmb_Type.Size = new System.Drawing.Size(208, 35);
+ this.cmb_Type.TabIndex = 4;
+ //
+ // dtp_End
+ //
+ this.dtp_End.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.dtp_End.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+ this.dtp_End.Location = new System.Drawing.Point(262, 15);
+ this.dtp_End.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.dtp_End.Name = "dtp_End";
+ this.dtp_End.Size = new System.Drawing.Size(193, 34);
+ this.dtp_End.TabIndex = 5;
+ //
+ // lbl_To
+ //
+ this.lbl_To.AutoSize = true;
+ this.lbl_To.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.lbl_To.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(114)))), ((int)(((byte)(128)))));
+ this.lbl_To.Location = new System.Drawing.Point(222, 21);
+ this.lbl_To.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lbl_To.Name = "lbl_To";
+ this.lbl_To.Size = new System.Drawing.Size(32, 27);
+ this.lbl_To.TabIndex = 6;
+ this.lbl_To.Text = "→";
+ //
+ // dtp_Start
+ //
+ this.dtp_Start.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.dtp_Start.Format = System.Windows.Forms.DateTimePickerFormat.Short;
+ this.dtp_Start.Location = new System.Drawing.Point(18, 15);
+ this.dtp_Start.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.dtp_Start.Name = "dtp_Start";
+ this.dtp_Start.Size = new System.Drawing.Size(193, 34);
+ this.dtp_Start.TabIndex = 7;
+ //
+ // dgv_Data
+ //
+ this.dgv_Data.AllowUserToAddRows = false;
+ this.dgv_Data.AllowUserToDeleteRows = false;
+ dataGridViewCellStyle10.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(250)))), ((int)(((byte)(252)))));
+ this.dgv_Data.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle10;
+ this.dgv_Data.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
+ this.dgv_Data.BackgroundColor = System.Drawing.Color.White;
+ this.dgv_Data.BorderStyle = System.Windows.Forms.BorderStyle.None;
+ this.dgv_Data.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.SingleHorizontal;
+ dataGridViewCellStyle11.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+ dataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(237)))), ((int)(((byte)(242)))));
+ dataGridViewCellStyle11.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Bold);
+ dataGridViewCellStyle11.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(55)))), ((int)(((byte)(65)))), ((int)(((byte)(81)))));
+ dataGridViewCellStyle11.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(237)))), ((int)(((byte)(242)))));
+ dataGridViewCellStyle11.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.dgv_Data.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle11;
+ this.dgv_Data.ColumnHeadersHeight = 36;
+ dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+ dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Window;
+ dataGridViewCellStyle12.Font = new System.Drawing.Font("微软雅黑", 10F);
+ dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.ControlText;
+ dataGridViewCellStyle12.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(219)))), ((int)(((byte)(234)))), ((int)(((byte)(254)))));
+ dataGridViewCellStyle12.SelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(30)))), ((int)(((byte)(58)))), ((int)(((byte)(95)))));
+ dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+ this.dgv_Data.DefaultCellStyle = dataGridViewCellStyle12;
+ this.dgv_Data.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.dgv_Data.EnableHeadersVisualStyles = false;
+ this.dgv_Data.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.dgv_Data.GridColor = System.Drawing.Color.FromArgb(((int)(((byte)(232)))), ((int)(((byte)(237)))), ((int)(((byte)(242)))));
+ this.dgv_Data.Location = new System.Drawing.Point(0, 75);
+ this.dgv_Data.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.dgv_Data.Name = "dgv_Data";
+ this.dgv_Data.ReadOnly = true;
+ this.dgv_Data.RowHeadersVisible = false;
+ this.dgv_Data.RowHeadersWidth = 62;
+ this.dgv_Data.RowTemplate.Height = 32;
+ this.dgv_Data.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+ this.dgv_Data.Size = new System.Drawing.Size(2730, 1371);
+ this.dgv_Data.TabIndex = 0;
+ //
+ // pnl_Footer
+ //
+ this.pnl_Footer.BackColor = System.Drawing.Color.White;
+ this.pnl_Footer.Controls.Add(this.lbl_RecordCount);
+ this.pnl_Footer.Dock = System.Windows.Forms.DockStyle.Bottom;
+ this.pnl_Footer.Location = new System.Drawing.Point(0, 1446);
+ this.pnl_Footer.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.pnl_Footer.Name = "pnl_Footer";
+ this.pnl_Footer.Size = new System.Drawing.Size(2730, 54);
+ this.pnl_Footer.TabIndex = 1;
+ //
+ // lbl_RecordCount
+ //
+ this.lbl_RecordCount.AutoSize = true;
+ this.lbl_RecordCount.Font = new System.Drawing.Font("微软雅黑", 10F);
+ this.lbl_RecordCount.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(107)))), ((int)(((byte)(114)))), ((int)(((byte)(128)))));
+ this.lbl_RecordCount.Location = new System.Drawing.Point(18, 9);
+ this.lbl_RecordCount.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lbl_RecordCount.Name = "lbl_RecordCount";
+ this.lbl_RecordCount.Size = new System.Drawing.Size(116, 27);
+ this.lbl_RecordCount.TabIndex = 0;
+ this.lbl_RecordCount.Text = "共 0 条记录";
+ //
+ // UC_LogRecord
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+ this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(245)))), ((int)(((byte)(247)))), ((int)(((byte)(250)))));
+ this.Controls.Add(this.dgv_Data);
+ this.Controls.Add(this.pnl_Footer);
+ this.Controls.Add(this.pnl_Toolbar);
+ this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
+ this.Name = "UC_LogRecord";
+ this.Size = new System.Drawing.Size(2730, 1500);
+ this.pnl_Toolbar.ResumeLayout(false);
+ this.pnl_Toolbar.PerformLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.dgv_Data)).EndInit();
+ this.pnl_Footer.ResumeLayout(false);
+ this.pnl_Footer.PerformLayout();
+ this.ResumeLayout(false);
+
}
#endregion
diff --git a/SCADA/Pages/UC_Report.resx b/SCADA/Pages/UC_Report.resx
index 5236701..ca7c641 100644
--- a/SCADA/Pages/UC_Report.resx
+++ b/SCADA/Pages/UC_Report.resx
@@ -17,4 +17,4 @@
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
diff --git a/SCADA/Pages/UC_Statistics.resx b/SCADA/Pages/UC_Statistics.resx
index 5236701..ca7c641 100644
--- a/SCADA/Pages/UC_Statistics.resx
+++ b/SCADA/Pages/UC_Statistics.resx
@@ -17,4 +17,4 @@
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
diff --git a/SCADA/Pages/UC_ToolMgmt.resx b/SCADA/Pages/UC_ToolMgmt.resx
index 5236701..ca7c641 100644
--- a/SCADA/Pages/UC_ToolMgmt.resx
+++ b/SCADA/Pages/UC_ToolMgmt.resx
@@ -17,4 +17,4 @@
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
diff --git a/SCADA/Pages/UC_UserMgmt.resx b/SCADA/Pages/UC_UserMgmt.resx
index 5236701..ca7c641 100644
--- a/SCADA/Pages/UC_UserMgmt.resx
+++ b/SCADA/Pages/UC_UserMgmt.resx
@@ -17,4 +17,4 @@
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
diff --git a/SCADA/Pages/UC_Weighing.cs b/SCADA/Pages/UC_Weighing.cs
index 574cfe4..7b4ba09 100644
--- a/SCADA/Pages/UC_Weighing.cs
+++ b/SCADA/Pages/UC_Weighing.cs
@@ -740,7 +740,8 @@ namespace MesWork.Pages
var wv = PlcLinkForm.ReadPLC(100220, opName);
if (wv != null)
{
- string newTxt = Convert.ToDouble(wv).ToString("F2");
+ decimal weight = Convert.ToDecimal(wv);
+ string newTxt = Convert.ToDouble(weight).ToString("F2");
if (lblWeight.Text != newTxt) lblWeight.Text = newTxt;
}
}
diff --git a/SCADA/Pages/UC_WorkpieceMgmt.resx b/SCADA/Pages/UC_WorkpieceMgmt.resx
index 5236701..ca7c641 100644
--- a/SCADA/Pages/UC_WorkpieceMgmt.resx
+++ b/SCADA/Pages/UC_WorkpieceMgmt.resx
@@ -17,4 +17,4 @@
2.0
System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
+
diff --git a/SCADA/WC_GKJ_OIL.csproj b/SCADA/WC_GKJ_OIL.csproj
index faa290c..88658ca 100644
--- a/SCADA/WC_GKJ_OIL.csproj
+++ b/SCADA/WC_GKJ_OIL.csproj
@@ -1,363 +1,366 @@
-
-
-
-
- Debug
- AnyCPU
- {A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}
- WinExe
- WC_GKJ_OIL
- WC_GKJ_OIL
- v4.8
- 512
- true
- true
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
-
- AnyCPU
- true
- full
- false
- ..\WC_GKJ_OIL_EXE\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
- 任务管理.ico
-
-
-
- app.manifest
-
-
-
- ..\DLL\BasicData.dll
-
-
- ..\DLL\BouncyCastle.Crypto.dll
-
-
- ..\DLL\ConLink.dll
-
-
- ..\DLL\ConLink19.dll
-
-
- ..\DLL\DataLinkMesWork.dll
-
-
- ..\DLL\DynamicExpresso.Core.dll
-
-
- ..\DLL\ICSharpCode.SharpZipLib.dll
-
-
- ..\DLL\MesWork.DeviceDriver.dll
-
-
- ..\DLL\MesWork.MQTT.dll
-
-
- ..\DLL\MQTTnet.dll
-
-
- ..\DLL\MQTTnet.Extensions.ManagedClient.dll
-
-
- ..\DLL\Newtonsoft.Json.dll
-
-
- ..\DLL\NPOI.dll
-
-
- ..\DLL\NPOI.OOXML.dll
-
-
- ..\DLL\NPOI.OpenXml4Net.dll
-
-
- ..\DLL\NPOI.OpenXmlFormats.dll
-
-
- ..\DLL\Opc.Ua.Client.dll
-
-
- ..\DLL\Opc.Ua.Configuration.dll
-
-
- ..\DLL\Opc.Ua.Core.dll
-
-
- ..\DLL\OpcUaHelper.dll
-
-
- ..\DLL\Rhino3dm.dll
-
-
-
- False
- ..\DLL\System.Buffers.dll
-
-
-
-
-
-
-
-
- False
- ..\DLL\System.Net.Http.Formatting.dll
-
-
- False
- ..\DLL\System.Runtime.CompilerServices.Unsafe.dll
-
-
-
- ..\DLL\System.Web.Cors.dll
-
-
- ..\DLL\System.Web.Http.dll
-
-
- ..\DLL\System.Web.Http.Cors.dll
-
-
- ..\DLL\System.Web.Http.SelfHost.dll
-
-
-
-
-
- ..\DLL\Ubiety.Dns.Core.dll
-
-
- ..\DLL\WeifenLuo.WinFormsUI.Docking.dll
-
-
- ..\DLL\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll
-
-
-
-
-
- Form
-
-
- Frm_Login.cs
-
-
-
-
-
-
- Form
-
-
- Form
-
-
-
-
- Form
-
-
- Form
-
-
- LogRecord.cs
-
-
-
-
-
-
- Form
-
-
- MAIN_PAGE.cs
-
-
-
-
-
- UserControl
-
-
- UC_Weighing.cs
-
-
- UserControl
-
-
- UC_UserMgmt.cs
-
-
- UserControl
-
-
- UC_WorkpieceMgmt.cs
-
-
- UserControl
-
-
- UC_ToolMgmt.cs
-
-
- Component
-
-
- UserControl
-
-
- UC_Report.cs
-
-
- UserControl
-
-
- UC_StationRecord.cs
-
-
- UserControl
-
-
- UC_Statistics.cs
-
-
-
-
- UserControl
-
-
- UC_SystemSettings.cs
-
-
- UserControl
-
-
- UC_LogRecord.cs
-
-
- Frm_Login.cs
-
-
- LogRecord.cs
-
-
- MAIN_PAGE.cs
- Designer
-
-
- UC_Weighing.cs
-
-
- UC_UserMgmt.cs
-
-
- UC_WorkpieceMgmt.cs
-
-
- UC_ToolMgmt.cs
-
-
- UC_Report.cs
-
-
- UC_Statistics.cs
-
-
- UC_LogRecord.cs
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
- Designer
-
-
- True
- Resources.resx
- True
-
-
-
- PreserveNewest
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
- True
- Settings.settings
- True
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
-
-
- False
- Microsoft .NET Framework 4.6.1 %28x86 和 x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
-
-
- {1ac112c4-2400-4d03-a26d-2e3ace6fe6d4}
- 01_MW_Log
-
-
-
-
- 0.20.0
-
-
- 3.8.1.5
-
-
-
+
+
+
+
+ Debug
+ AnyCPU
+ {A8D0B4EF-E223-4B9A-B2D9-0156B7B8B073}
+ WinExe
+ WC_GKJ_OIL
+ WC_GKJ_OIL
+ v4.8
+ 512
+ true
+ true
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+
+ AnyCPU
+ true
+ full
+ false
+ ..\WC_GKJ_OIL_EXE\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ 任务管理.ico
+
+
+
+ app.manifest
+
+
+
+ ..\DLL\BasicData.dll
+
+
+ ..\DLL\BouncyCastle.Crypto.dll
+
+
+ ..\DLL\ConLink.dll
+
+
+ ..\DLL\ConLink19.dll
+
+
+ ..\DLL\DataLinkMesWork.dll
+
+
+ ..\DLL\DynamicExpresso.Core.dll
+
+
+ ..\DLL\ICSharpCode.SharpZipLib.dll
+
+
+ ..\DLL\MesWork.DeviceDriver.dll
+
+
+ ..\DLL\MesWork.MQTT.dll
+
+
+ ..\DLL\MQTTnet.dll
+
+
+ ..\DLL\MQTTnet.Extensions.ManagedClient.dll
+
+
+ ..\DLL\Newtonsoft.Json.dll
+
+
+ ..\DLL\NPOI.dll
+
+
+ ..\DLL\NPOI.OOXML.dll
+
+
+ ..\DLL\NPOI.OpenXml4Net.dll
+
+
+ ..\DLL\NPOI.OpenXmlFormats.dll
+
+
+ ..\DLL\Opc.Ua.Client.dll
+
+
+ ..\DLL\Opc.Ua.Configuration.dll
+
+
+ ..\DLL\Opc.Ua.Core.dll
+
+
+ ..\DLL\OpcUaHelper.dll
+
+
+ ..\DLL\Rhino3dm.dll
+
+
+
+ False
+ ..\DLL\System.Buffers.dll
+
+
+
+
+
+
+
+
+ False
+ ..\DLL\System.Net.Http.Formatting.dll
+
+
+ False
+ ..\DLL\System.Runtime.CompilerServices.Unsafe.dll
+
+
+
+ ..\DLL\System.Web.Cors.dll
+
+
+ ..\DLL\System.Web.Http.dll
+
+
+ ..\DLL\System.Web.Http.Cors.dll
+
+
+ ..\DLL\System.Web.Http.SelfHost.dll
+
+
+
+
+
+ ..\DLL\Ubiety.Dns.Core.dll
+
+
+ ..\DLL\WeifenLuo.WinFormsUI.Docking.dll
+
+
+ ..\DLL\WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll
+
+
+
+
+
+ Form
+
+
+ Frm_Login.cs
+
+
+
+
+
+
+ Form
+
+
+ Form
+
+
+
+
+ Form
+
+
+ Form
+
+
+ Form
+
+
+ LogRecord.cs
+
+
+
+
+
+
+ Form
+
+
+ MAIN_PAGE.cs
+
+
+
+
+
+ UserControl
+
+
+ UC_Weighing.cs
+
+
+ UserControl
+
+
+ UC_UserMgmt.cs
+
+
+ UserControl
+
+
+ UC_WorkpieceMgmt.cs
+
+
+ UserControl
+
+
+ UC_ToolMgmt.cs
+
+
+ Component
+
+
+ UserControl
+
+
+ UC_Report.cs
+
+
+ UserControl
+
+
+ UC_StationRecord.cs
+
+
+ UserControl
+
+
+ UC_Statistics.cs
+
+
+
+
+ UserControl
+
+
+ UC_SystemSettings.cs
+
+
+ UserControl
+
+
+ UC_LogRecord.cs
+
+
+ Frm_Login.cs
+
+
+ LogRecord.cs
+
+
+ MAIN_PAGE.cs
+ Designer
+
+
+ UC_Weighing.cs
+
+
+ UC_UserMgmt.cs
+
+
+ UC_WorkpieceMgmt.cs
+
+
+ UC_ToolMgmt.cs
+
+
+ UC_Report.cs
+
+
+ UC_Statistics.cs
+
+
+ UC_LogRecord.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+
+ PreserveNewest
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+
+
+
+
+
+ False
+ Microsoft .NET Framework 4.6.1 %28x86 和 x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
+ {1ac112c4-2400-4d03-a26d-2e3ace6fe6d4}
+ 01_MW_Log
+
+
+
+
+ 0.20.0
+
+
+ 3.8.1.5
+
+
+
\ No newline at end of file
diff --git a/SCADA/_codex_verify/BasicData.dll b/SCADA/_codex_verify/BasicData.dll
deleted file mode 100644
index 5008ace..0000000
Binary files a/SCADA/_codex_verify/BasicData.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/BouncyCastle.Crypto.dll b/SCADA/_codex_verify/BouncyCastle.Crypto.dll
deleted file mode 100644
index 0310983..0000000
Binary files a/SCADA/_codex_verify/BouncyCastle.Crypto.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/ConLink.dll b/SCADA/_codex_verify/ConLink.dll
deleted file mode 100644
index fa95f29..0000000
Binary files a/SCADA/_codex_verify/ConLink.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/ConLink19.dll b/SCADA/_codex_verify/ConLink19.dll
deleted file mode 100644
index 05a03cc..0000000
Binary files a/SCADA/_codex_verify/ConLink19.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/DataLinkMesWork.dll b/SCADA/_codex_verify/DataLinkMesWork.dll
deleted file mode 100644
index 57fcd25..0000000
Binary files a/SCADA/_codex_verify/DataLinkMesWork.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/DynamicExpresso.Core.dll b/SCADA/_codex_verify/DynamicExpresso.Core.dll
deleted file mode 100644
index e150894..0000000
Binary files a/SCADA/_codex_verify/DynamicExpresso.Core.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/ICSharpCode.SharpZipLib.dll b/SCADA/_codex_verify/ICSharpCode.SharpZipLib.dll
deleted file mode 100644
index 84e8c68..0000000
Binary files a/SCADA/_codex_verify/ICSharpCode.SharpZipLib.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/MQTTnet.Extensions.ManagedClient.dll b/SCADA/_codex_verify/MQTTnet.Extensions.ManagedClient.dll
deleted file mode 100644
index 99035f6..0000000
Binary files a/SCADA/_codex_verify/MQTTnet.Extensions.ManagedClient.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/MQTTnet.dll b/SCADA/_codex_verify/MQTTnet.dll
deleted file mode 100644
index 2951433..0000000
Binary files a/SCADA/_codex_verify/MQTTnet.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/MW_Log.dll b/SCADA/_codex_verify/MW_Log.dll
deleted file mode 100644
index cb2a7e0..0000000
Binary files a/SCADA/_codex_verify/MW_Log.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/MesWork.DeviceDriver.dll b/SCADA/_codex_verify/MesWork.DeviceDriver.dll
deleted file mode 100644
index 730f828..0000000
Binary files a/SCADA/_codex_verify/MesWork.DeviceDriver.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/NPOI.OOXML.dll b/SCADA/_codex_verify/NPOI.OOXML.dll
deleted file mode 100644
index 031d41d..0000000
Binary files a/SCADA/_codex_verify/NPOI.OOXML.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/NPOI.OpenXml4Net.dll b/SCADA/_codex_verify/NPOI.OpenXml4Net.dll
deleted file mode 100644
index 8da4ac2..0000000
Binary files a/SCADA/_codex_verify/NPOI.OpenXml4Net.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/NPOI.OpenXmlFormats.dll b/SCADA/_codex_verify/NPOI.OpenXmlFormats.dll
deleted file mode 100644
index 4a8f87b..0000000
Binary files a/SCADA/_codex_verify/NPOI.OpenXmlFormats.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/NPOI.dll b/SCADA/_codex_verify/NPOI.dll
deleted file mode 100644
index 1a500e9..0000000
Binary files a/SCADA/_codex_verify/NPOI.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/Newtonsoft.Json.dll b/SCADA/_codex_verify/Newtonsoft.Json.dll
deleted file mode 100644
index 7af125a..0000000
Binary files a/SCADA/_codex_verify/Newtonsoft.Json.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/Opc.Ua.Client.dll b/SCADA/_codex_verify/Opc.Ua.Client.dll
deleted file mode 100644
index 8874d8f..0000000
Binary files a/SCADA/_codex_verify/Opc.Ua.Client.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/Opc.Ua.Configuration.dll b/SCADA/_codex_verify/Opc.Ua.Configuration.dll
deleted file mode 100644
index b3f3970..0000000
Binary files a/SCADA/_codex_verify/Opc.Ua.Configuration.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/Opc.Ua.Core.dll b/SCADA/_codex_verify/Opc.Ua.Core.dll
deleted file mode 100644
index ee01d0d..0000000
Binary files a/SCADA/_codex_verify/Opc.Ua.Core.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/OpcUaHelper.dll b/SCADA/_codex_verify/OpcUaHelper.dll
deleted file mode 100644
index 1409de0..0000000
Binary files a/SCADA/_codex_verify/OpcUaHelper.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/ReaLTaiizor.dll b/SCADA/_codex_verify/ReaLTaiizor.dll
deleted file mode 100644
index f465c26..0000000
Binary files a/SCADA/_codex_verify/ReaLTaiizor.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/Resources/login_bg.png b/SCADA/_codex_verify/Resources/login_bg.png
deleted file mode 100644
index feec865..0000000
Binary files a/SCADA/_codex_verify/Resources/login_bg.png and /dev/null differ
diff --git a/SCADA/_codex_verify/Rhino3dm.dll b/SCADA/_codex_verify/Rhino3dm.dll
deleted file mode 100644
index 76d1cb8..0000000
Binary files a/SCADA/_codex_verify/Rhino3dm.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/S7.Net.dll b/SCADA/_codex_verify/S7.Net.dll
deleted file mode 100644
index b4211db..0000000
Binary files a/SCADA/_codex_verify/S7.Net.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Buffers.dll b/SCADA/_codex_verify/System.Buffers.dll
deleted file mode 100644
index f2d83c5..0000000
Binary files a/SCADA/_codex_verify/System.Buffers.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Memory.dll b/SCADA/_codex_verify/System.Memory.dll
deleted file mode 100644
index 4617199..0000000
Binary files a/SCADA/_codex_verify/System.Memory.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Net.Http.Formatting.dll b/SCADA/_codex_verify/System.Net.Http.Formatting.dll
deleted file mode 100644
index e9e80be..0000000
Binary files a/SCADA/_codex_verify/System.Net.Http.Formatting.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Numerics.Vectors.dll b/SCADA/_codex_verify/System.Numerics.Vectors.dll
deleted file mode 100644
index 0865972..0000000
Binary files a/SCADA/_codex_verify/System.Numerics.Vectors.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Runtime.CompilerServices.Unsafe.dll b/SCADA/_codex_verify/System.Runtime.CompilerServices.Unsafe.dll
deleted file mode 100644
index de9e124..0000000
Binary files a/SCADA/_codex_verify/System.Runtime.CompilerServices.Unsafe.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Web.Cors.dll b/SCADA/_codex_verify/System.Web.Cors.dll
deleted file mode 100644
index 6f3da24..0000000
Binary files a/SCADA/_codex_verify/System.Web.Cors.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Web.Http.Cors.dll b/SCADA/_codex_verify/System.Web.Http.Cors.dll
deleted file mode 100644
index fd0b539..0000000
Binary files a/SCADA/_codex_verify/System.Web.Http.Cors.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Web.Http.SelfHost.dll b/SCADA/_codex_verify/System.Web.Http.SelfHost.dll
deleted file mode 100644
index 852728e..0000000
Binary files a/SCADA/_codex_verify/System.Web.Http.SelfHost.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/System.Web.Http.dll b/SCADA/_codex_verify/System.Web.Http.dll
deleted file mode 100644
index 7e3bd30..0000000
Binary files a/SCADA/_codex_verify/System.Web.Http.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/Ubiety.Dns.Core.dll b/SCADA/_codex_verify/Ubiety.Dns.Core.dll
deleted file mode 100644
index 2f0c84e..0000000
Binary files a/SCADA/_codex_verify/Ubiety.Dns.Core.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/WC_GKJ_OIL.exe b/SCADA/_codex_verify/WC_GKJ_OIL.exe
deleted file mode 100644
index edf6e02..0000000
Binary files a/SCADA/_codex_verify/WC_GKJ_OIL.exe and /dev/null differ
diff --git a/SCADA/_codex_verify/WC_GKJ_OIL.exe.config b/SCADA/_codex_verify/WC_GKJ_OIL.exe.config
deleted file mode 100644
index 6195a88..0000000
--- a/SCADA/_codex_verify/WC_GKJ_OIL.exe.config
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SCADA/_codex_verify/WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll b/SCADA/_codex_verify/WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll
deleted file mode 100644
index 0dbf5f4..0000000
Binary files a/SCADA/_codex_verify/WeifenLuo.WinFormsUI.Docking.ThemeVS2015.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/WeifenLuo.WinFormsUI.Docking.dll b/SCADA/_codex_verify/WeifenLuo.WinFormsUI.Docking.dll
deleted file mode 100644
index e4b2787..0000000
Binary files a/SCADA/_codex_verify/WeifenLuo.WinFormsUI.Docking.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/log4net.config b/SCADA/_codex_verify/log4net.config
deleted file mode 100644
index d164c22..0000000
--- a/SCADA/_codex_verify/log4net.config
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/SCADA/_codex_verify/log4net.dll b/SCADA/_codex_verify/log4net.dll
deleted file mode 100644
index 8646b6f..0000000
Binary files a/SCADA/_codex_verify/log4net.dll and /dev/null differ
diff --git a/SCADA/_codex_verify/任务管理.ico b/SCADA/_codex_verify/任务管理.ico
deleted file mode 100644
index 1ad3c11..0000000
Binary files a/SCADA/_codex_verify/任务管理.ico and /dev/null differ