| | |
| | | private static readonly object OLock = new object(); |
| | | |
| | | private static readonly ISqlSugarClient _db = SqlSugarSetup.ITenant.GetConnectionScope(SqlSugarConst.MainConfigId); |
| | | private static decimal weight94 = 0; |
| | | private static decimal weight160 = 0; |
| | | private static decimal weight155 = 0; |
| | | |
| | | public static void OnChangeEvent(object sender, EventArgs e) |
| | | { |
| | |
| | | { |
| | | return; |
| | | } |
| | | |
| | | #region#实时显示重量到LED屏幕 |
| | | var modPosPalletWeightIng = modDevice.listStation.FirstOrDefault(m => m.Text == "实际重量"); |
| | | var (resPalletWeightIng, palletWeightValIng) = plcConn.GetPlcDBValue(modPosPalletWeightIng.PosType, modDevice.DbNumber, modPosPalletWeightIng.PlcPos); |
| | | switch (modDevice.StationNum) |
| | | { |
| | | case "094": |
| | | { |
| | | if (Convert.ToDecimal(palletWeightValIng) != weight94) |
| | | { |
| | | LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}"); |
| | | weight94 = Convert.ToDecimal(palletWeightValIng); |
| | | } |
| | | } |
| | | break; |
| | | case "160": |
| | | { |
| | | if (Convert.ToDecimal(palletWeightValIng) != weight160) |
| | | { |
| | | LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}"); |
| | | weight160 = Convert.ToDecimal(palletWeightValIng); |
| | | } |
| | | } |
| | | break; |
| | | case "155": |
| | | { |
| | | if (Convert.ToDecimal(palletWeightValIng) != weight155) |
| | | { |
| | | LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}"); |
| | | weight155 = Convert.ToDecimal(palletWeightValIng); |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | var ledText = ""; |
| | | switch (modDevice.Value.ToString()) |
| | | { |