diff --git a/DM_Weight/App.config b/DM_Weight/App.config
index f7ff196..101fcb9 100644
--- a/DM_Weight/App.config
+++ b/DM_Weight/App.config
@@ -37,7 +37,7 @@
-
+
@@ -64,7 +64,7 @@
-
+
diff --git a/DM_Weight/Port/PortUtil.cs b/DM_Weight/Port/PortUtil.cs
index 5d4250c..a482be6 100644
--- a/DM_Weight/Port/PortUtil.cs
+++ b/DM_Weight/Port/PortUtil.cs
@@ -29,6 +29,7 @@ using DM_Weight.Common;
using System.Net;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
+using OracleInternal.SqlAndPlsqlParser.RuleProcessors;
namespace DM_Weight.Port
{
@@ -1887,6 +1888,50 @@ namespace DM_Weight.Port
#region 新冰箱抽屉获取温度
+ ///
+ /// 查询冰箱继电器状态
+ ///
+ ///
+ ///
+ public async Task GetFridgeState(int iIndex)
+ {
+ int frodgeState = 0;
+ try
+ {
+ fridgeSerial.DiscardInBuffer();
+ byte bAddress;
+ if( iIndex == 1)
+ {
+ bAddress = 0x01;
+ }
+ else
+ {
+ bAddress = 0x02;
+ }
+ byte[] buffer = new byte[] { bAddress, 0x03, 0x00, 0x00, 0x00, 0x01 };
+ //获取数组CRC校验码
+ byte[] byteDate = CRC16MODBUS.CrcModBus(buffer);
+ int dataLength = buffer.Length;
+ Array.Resize(ref buffer, dataLength + byteDate.Length);
+ for (int i = 0; i < byteDate.Length; i++)
+ {
+ buffer[dataLength + i] = byteDate[i];
+ }
+ logger.Info($"获取冰箱继电器状态【{Convert.ToHexString(buffer)}】");
+ fridgeSerial.Write(buffer, 0, 8);
+ byte[] retByte = await GetBufferByPort(fridgeSerial, 7);
+ logger.Info($"获取冰箱继电器状态返回【{Convert.ToHexString(retByte)}】");
+ if (retByte != null && retByte.Length >= 7)
+ {
+ frodgeState = Convert.ToInt32(retByte[4]);
+ }
+ }
+ catch (Exception ex)
+ {
+ logger.Info($"检测冰箱继电器状态发生异常:ex:{ex.Message}");
+ }
+ return frodgeState;
+ }
///
/// 获取冰箱温度
@@ -1907,7 +1952,7 @@ namespace DM_Weight.Port
{
bAddress = 0x02;
}
- byte[] buffer = new byte[] { bAddress, 0x03, 0x00, 0x03, 0x02 };
+ byte[] buffer = new byte[] { bAddress, 0x03, 0x00, 0x03, 0x00, 0x01 };
//获取数组CRC校验码
byte[] byteDate = CRC16MODBUS.CrcModBus(buffer);
@@ -1943,209 +1988,15 @@ namespace DM_Weight.Port
return temperature;
}
///
- /// 冰箱使能
+ /// 冰箱温度设定最低温与最高温
///
///
- public async Task FridegOpenForNew(int iIndex)
- {
- try
- {
- fridgeSerial.DiscardInBuffer();
- byte bAddress;
- if (iIndex == 1)
- {
- bAddress = 0x01;
- }
- else
- {
- bAddress = 0x02;
- }
- //byte[] buffer = new byte[] { bAddress, 0x06, 0x10, 0xD4, 0x00, 0x01, 0x0C, 0xF2 };
- byte[] buffer = new byte[] { 0x01, 0x06, 0x00, 0x10,0x00, 0x01 };
- //获取数组CRC校验码
- byte[] byteDate = CRC16MODBUS.CrcModBus(buffer);
- //Array.Reverse(byteDate);
- int dataLength = buffer.Length;
- Array.Resize(ref buffer, dataLength + byteDate.Length);
- for (int i = 0; i < byteDate.Length; i++)
- {
- buffer[dataLength + i] = byteDate[i];
- }
- logger.Info($"冰箱使能【{Convert.ToHexString(buffer)}】");
- fridgeSerial.Write(buffer, 0, 8);
- await Task.Delay(80);
- }
- catch (Exception ex)
- {
- logger.Info($"冰箱使能发生异常:ex:{ex.Message}");
- }
- FridgeOperate = false;
- }
- ///
- /// 冰箱失能
- ///
- ///
- public async Task FridgeOffForNew(int iIndex)
- {
- try
- {
- fridgeSerial.DiscardInBuffer();
- byte bAddress;
- if (iIndex == 1)
- {
- bAddress = 0x01;
- }
- else
- {
- bAddress = 0x02;
- }
- //byte[] buffer = new byte[] { bAddress, 0x06, 0x10, 0xD4, 0x00, 0x00, 0xCD, 0x32 };
- byte[] buffer = new byte[] { 0x01, 0x06, 0x00, 0x11, 0x00, 0x02 };
- //获取数组CRC校验码
- byte[] byteDate = CRC16MODBUS.CrcModBus(buffer);
- //Array.Reverse(byteDate);
- int dataLength = buffer.Length;
- Array.Resize(ref buffer, dataLength + byteDate.Length);
- for (int i = 0; i < byteDate.Length; i++)
- {
- buffer[dataLength + i] = byteDate[i];
- }
- logger.Info($"冰箱失能【{Convert.ToHexString(buffer)}】");
- fridgeSerial.Write(buffer, 0, 8);
- await Task.Delay(80);
- }
- catch (Exception ex)
- {
- logger.Info($"冰箱失能发生异常:ex:{ex.Message}");
- }
- FridgeOperate = false;
- } ///
- /// 冰箱报警使能
- ///
- ///
- public async Task FridgeAlarmOnForNew(int iIndex)
- {
- try
- {
- fridgeSerial.DiscardInBuffer();
- byte bAddress;
- if (iIndex == 1)
- {
- bAddress = 0x01;
- }
- else
- {
- bAddress = 0x02;
- }
- //byte[] buffer = new byte[] { bAddress, 0x06, 0x10, 0xD5, 0x00, 0x01, 0x5D, 0x32 };
- byte[] buffer = new byte[] { 0x01, 0x10, 0x00, 0x0E, 0x00, 0x02,0x04,0x00,0x00 };
- //获取数组CRC校验码
- byte[] byteDate = CRC16MODBUS.CrcModBus(buffer);
- //Array.Reverse(byteDate);
- int dataLength = buffer.Length;
- Array.Resize(ref buffer, dataLength + byteDate.Length);
- for (int i = 0; i < byteDate.Length; i++)
- {
- buffer[dataLength + i] = byteDate[i];
- }
- logger.Info($"冰箱报警使能【{Convert.ToHexString(buffer)}】");
- fridgeSerial.Write(buffer, 0, 8);
- await Task.Delay(80);
- }
- catch (Exception ex)
- {
- logger.Info($"冰箱报警使能发生异常:ex:{ex.Message}");
- }
- FridgeOperate = false;
-
- }
-
- ///
- /// 冰箱报警失能
- ///
- ///
- public async Task FridgeAlarmOffForNew(int iIndex)
- {
- try
- {
- fridgeSerial.DiscardInBuffer();
- byte bAddress;
- if (iIndex == 1)
- {
- bAddress = 0x01;
- }
- else
- {
- bAddress = 0x02;
- }
- //byte[] buffer = new byte[] { bAddress, 0x06, 0x10, 0xD5, 0x00, 0x00, 0x9C, 0xF2 };
- byte[] buffer = new byte[] { 0x01, 0x10, 0x00, 0x0E, 0x00, 0x02, 0x04, 0x00, 0x00 };
- //获取数组CRC校验码
- byte[] byteDate = CRC16MODBUS.CrcModBus(buffer);
- //Array.Reverse(byteDate);
- int dataLength = buffer.Length;
- Array.Resize(ref buffer, dataLength + byteDate.Length);
- for (int i = 0; i < byteDate.Length; i++)
- {
- buffer[dataLength + i] = byteDate[i];
- }
- logger.Info($"冰箱报警失能【{Convert.ToHexString(buffer)}】");
- fridgeSerial.Write(buffer, 0, 8);
- await Task.Delay(80);
- }
- catch (Exception ex)
- {
- logger.Info($"冰箱报警失能发生异常:ex:{ex.Message}");
- }
- FridgeOperate = false;
- }
- ///
- /// 冰箱温度设定最小
- ///
- ///
- public async Task FridgeMinSettingForNew(float min, int iIndex)
+ public async Task SetFridgeLowHeightForNew(float min,float max, int iIndex)
{
try
{
int iMix = Convert.ToInt32(min * 10);
- fridgeSerial.DiscardInBuffer();
- //byte[] bufferMin = new byte[] { 0x01, 0x06, 0x10, 0xC9, 0x00, 0x15, 0x9C, 0xFB };
- byte bAddress;
- if (iIndex == 1)
- {
- bAddress = 0x01;
- }
- else
- {
- bAddress = 0x02;
- }
- byte[] bufferMin = new byte[] { bAddress, 0x06, 0x10, 0xC9, 0x00, (byte)(iMix & 0xff) };
- //获取数组CRC校验码
- byte[] byteDate = CRC16MODBUS.CrcModBus(bufferMin);
- //Array.Reverse(byteDate);
- int dataLength = bufferMin.Length;
- Array.Resize(ref bufferMin, dataLength + byteDate.Length);
- for (int i = 0; i < byteDate.Length; i++)
- {
- bufferMin[dataLength + i] = byteDate[i];
- }
- logger.Info($"冰箱温度设定Min:【{Convert.ToHexString(bufferMin)}】");
- fridgeSerial.Write(bufferMin, 0, 8);
- }
- catch (Exception ex)
- {
- logger.Info($"获取冰箱温度发生异常:ex:{ex.Message}");
- }
- }
- ///
- /// 冰箱温度设定最大
- ///
- ///
- public async Task FridgeMaxSettingForNew(float max, int iIndex)
- {
- try
- {
int iMax = Convert.ToInt32(max * 10);
fridgeSerial.DiscardInBuffer();
//byte[] bufferMin = new byte[] { 0x01, 0x06, 0x10, 0xC9, 0x00, 0x15, 0x9C, 0xFB };
@@ -2158,18 +2009,18 @@ namespace DM_Weight.Port
{
bAddress = 0x02;
}
- byte[] bufferMax = new byte[] { bAddress, 0x06, 0x10, 0xC8, 0x00, (byte)(iMax & 0xff) };
+ byte[] bufferMin = new byte[] { bAddress, 0x10, 0x00, 0x06, 0x00,0x02,0x04, (byte)(iMix >>8), (byte)(iMix & 0xff), (byte)(iMax >>8), (byte)(iMax & 0xff) };
//获取数组CRC校验码
- byte[] byteDate = CRC16MODBUS.CrcModBus(bufferMax);
+ byte[] byteDate = CRC16MODBUS.CrcModBus(bufferMin);
//Array.Reverse(byteDate);
- int dataLength = bufferMax.Length;
- Array.Resize(ref bufferMax, dataLength + byteDate.Length);
+ int dataLength = bufferMin.Length;
+ Array.Resize(ref bufferMin, dataLength + byteDate.Length);
for (int i = 0; i < byteDate.Length; i++)
{
- bufferMax[dataLength + i] = byteDate[i];
+ bufferMin[dataLength + i] = byteDate[i];
}
- logger.Info($"冰箱温度设定Max:【{Convert.ToHexString(bufferMax)}】");
- fridgeSerial.Write(bufferMax, 0, 8);
+ logger.Info($"冰箱温度设定Min:【{Convert.ToHexString(bufferMin)}】");
+ fridgeSerial.Write(bufferMin, 0, 13);
}
catch (Exception ex)
{
diff --git a/DM_Weight/ViewModels/FridgeOnlyWindowViewModel.cs b/DM_Weight/ViewModels/FridgeOnlyWindowViewModel.cs
index 3260ece..9fb7696 100644
--- a/DM_Weight/ViewModels/FridgeOnlyWindowViewModel.cs
+++ b/DM_Weight/ViewModels/FridgeOnlyWindowViewModel.cs
@@ -117,51 +117,51 @@ namespace DM_Weight.ViewModels
//{
// ConfigurationManager.RefreshSection("FridgeState");
//发送冰箱使能/失能指令
- if (FridgeState)
- {
- await _portUtil.FridgeOff(1);
- Thread.Sleep(100);
- CommonClass.SaveAppSetting("FridgeState", "1");
+ //if (FridgeState)
+ //{
+ // await _portUtil.FridgeOff(1);
+ // Thread.Sleep(100);
+ // CommonClass.SaveAppSetting("FridgeState", "1");
- //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- //_configuration.AppSettings.Settings["FridgeState"].Value = "1";
- //_configuration.Save();
- //ConfigurationManager.RefreshSection("FridgeState");
- }
- else
- {
- await _portUtil.FridegOpen(1);
- Thread.Sleep(100);
- CommonClass.SaveAppSetting("FridgeState", "0");
- //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- //_configuration.AppSettings.Settings["FridgeState"].Value = "0";
- //_configuration.Save();
- //ConfigurationManager.RefreshSection("FridgeState");
- //冰箱打开定时获取冰箱温度
- _eventAggregator.GetEvent().Publish();
- }
- //发送警报使能/失能指令
- if (AlarmState)
- {
- await _portUtil.FridgeAlarmOff(1);
- Thread.Sleep(100);
- CommonClass.SaveAppSetting("AlarmState", "1");
- //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- //_configuration.AppSettings.Settings["AlarmState"].Value = "1";
- //_configuration.Save();
- //ConfigurationManager.RefreshSection("AlarmState");
- }
- else
- {
- await _portUtil.FridgeAlarmOn(1);
- Thread.Sleep(100);
- CommonClass.SaveAppSetting("AlarmState", "0");
+ // //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ // //_configuration.AppSettings.Settings["FridgeState"].Value = "1";
+ // //_configuration.Save();
+ // //ConfigurationManager.RefreshSection("FridgeState");
+ //}
+ //else
+ //{
+ // await _portUtil.FridegOpen(1);
+ // Thread.Sleep(100);
+ // CommonClass.SaveAppSetting("FridgeState", "0");
+ // //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ // //_configuration.AppSettings.Settings["FridgeState"].Value = "0";
+ // //_configuration.Save();
+ // //ConfigurationManager.RefreshSection("FridgeState");
+ // //冰箱打开定时获取冰箱温度
+ // _eventAggregator.GetEvent().Publish();
+ //}
+ ////发送警报使能/失能指令
+ //if (AlarmState)
+ //{
+ // await _portUtil.FridgeAlarmOff(1);
+ // Thread.Sleep(100);
+ // CommonClass.SaveAppSetting("AlarmState", "1");
+ // //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ // //_configuration.AppSettings.Settings["AlarmState"].Value = "1";
+ // //_configuration.Save();
+ // //ConfigurationManager.RefreshSection("AlarmState");
+ //}
+ //else
+ //{
+ // await _portUtil.FridgeAlarmOn(1);
+ // Thread.Sleep(100);
+ // CommonClass.SaveAppSetting("AlarmState", "0");
- //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- //_configuration.AppSettings.Settings["AlarmState"].Value = "0";
- //_configuration.Save();
- //ConfigurationManager.RefreshSection("AlarmState");
- }
+ // //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ // //_configuration.AppSettings.Settings["AlarmState"].Value = "0";
+ // //_configuration.Save();
+ // //ConfigurationManager.RefreshSection("AlarmState");
+ //}
//设定冰箱1温度区间
//string[] range = ConfigurationManager.AppSettings["temperatureRange"].Split('-');
string[] newRange = TemperatureRange.Split('-');
@@ -170,37 +170,34 @@ namespace DM_Weight.ViewModels
bool bMix = float.TryParse(newRange[0], out float Min);
bool bMax = float.TryParse(newRange[1], out float Max);
- if (bMix && bMax)
- {
- if (Min != Convert.ToSingle(newRange[0]))
- {
- //设定冰箱温度最小值
- await _portUtil.FridgeMinSetting(Convert.ToSingle(newRange[0]),1);
- Thread.Sleep(100);
- }
- if (Max != Convert.ToSingle(newRange[1]))
- {
- Thread.Sleep(100);
- //设定冰箱温度最大值
- await _portUtil.FridgeMaxSetting(Convert.ToSingle(newRange[1]), 1);
- Thread.Sleep(100);
- }
- }
- //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- //_configuration.AppSettings.Settings["TemperatureRange"].Value = c;
- //_configuration.Save();
- //ConfigurationManager.RefreshSection("TemperatureRange");
+ //if (bMix && bMax)
+ //{
+ // if (Min != Convert.ToSingle(newRange[0]))
+ // {
+ // //设定冰箱温度最小值
+ // await _portUtil.FridgeMinSetting(Convert.ToSingle(newRange[0]),1);
+ // Thread.Sleep(100);
+ // }
+ // if (Max != Convert.ToSingle(newRange[1]))
+ // {
+ // Thread.Sleep(100);
+ // //设定冰箱温度最大值
+ // await _portUtil.FridgeMaxSetting(Convert.ToSingle(newRange[1]), 1);
+ // Thread.Sleep(100);
+ // }
+ //}
+ await _portUtil.SetFridgeLowHeightForNew(Convert.ToSingle(newRange[0]), Convert.ToSingle(newRange[1]), 1);
CommonClass.SaveAppSetting("TemperatureRange", TemperatureRange);
}
- //超时时间
- if (OutRangeTime != null)
- {
- //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
- //_configuration.AppSettings.Settings["OutRangeTime"].Value = OutRangeTime;
- //_configuration.Save();
- //ConfigurationManager.RefreshSection("OutRangeTime");
- CommonClass.SaveAppSetting("OutRangeTime", OutRangeTime);
- }
+ ////超时时间
+ //if (OutRangeTime != null)
+ //{
+ // //Configuration _configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
+ // //_configuration.AppSettings.Settings["OutRangeTime"].Value = OutRangeTime;
+ // //_configuration.Save();
+ // //ConfigurationManager.RefreshSection("OutRangeTime");
+ // CommonClass.SaveAppSetting("OutRangeTime", OutRangeTime);
+ //}
_portUtil.FridgeOperate = false;
diff --git a/DM_Weight/ViewModels/HomeWindowViewModel.cs b/DM_Weight/ViewModels/HomeWindowViewModel.cs
index 230225a..0b19367 100644
--- a/DM_Weight/ViewModels/HomeWindowViewModel.cs
+++ b/DM_Weight/ViewModels/HomeWindowViewModel.cs
@@ -64,8 +64,8 @@ namespace DM_Weight.ViewModels
public DateTime? FridgeTime { get; set; }
//冰箱是否异常状态:0正常,1异常
//public string FridgeWorkingState = ConfigurationManager.AppSettings["FridgeworkingState"].ToString();
- //冰箱开关状态:0开,1关
- public string FridgeState = ConfigurationManager.AppSettings["FridgeState"].ToString();
+ //冰箱开关状态:1开,0关
+ public int FridgeState =0;
//冰箱渡不在区间超时时间
private string _outRangeTime = ConfigurationManager.AppSettings["OutRangeTime"].ToString();
public string OutRangeTime { get => _outRangeTime; set => SetProperty(ref _outRangeTime, value); }
@@ -447,7 +447,7 @@ namespace DM_Weight.ViewModels
{
string retStr = string.Empty;
byte[] data = null;
- float retT = await _portUtil.GetFridgeTemperature(1);
+ float retT = await _portUtil.GetFridgeTemperatureForNew(1);
Thread.Sleep(80);
WD = $"恒温冷藏抽屉当前温度:{Math.Round((retT), 2)}℃";
}
@@ -455,7 +455,10 @@ namespace DM_Weight.ViewModels
private async void GetWD()
{
- if (!_portUtil.FridgeOperate && FridgeState.Equals("0"))
+ //查询冰箱继电器状态
+ FridgeState =await _portUtil.GetFridgeState(1);
+
+ if (!_portUtil.FridgeOperate && FridgeState.Equals(1))
{
string retStr = string.Empty;
byte[] data = null;
@@ -532,7 +535,7 @@ namespace DM_Weight.ViewModels
//接收导航传过来的参数
public void OnNavigatedTo(NavigationContext navigationContext)
{
- _portUtil.dateTime = DateTime.Now;
+ _portUtil.dateTime = DateTime.Now;
//取出user
UserList = navigationContext.Parameters.GetValue("operator");
Operator = UserList;
@@ -700,9 +703,10 @@ namespace DM_Weight.ViewModels
new PromiseUtil().taskAsyncLoop(10000, 0, async (options, next, stop) =>
{
try
- {
- FridgeState = CommonClass.ReadAppSetting("FridgeState");
- if (!_portUtil.FridgeOperate && FridgeState.Equals("0"))
+ {
+ //查询冰箱继电器状态
+ FridgeState = await _portUtil.GetFridgeState(1);
+ if (!_portUtil.FridgeOperate && FridgeState.Equals(1))
{
string retStr = string.Empty;
byte[] data = null;
@@ -713,114 +717,7 @@ namespace DM_Weight.ViewModels
logger.Info(WD);
if (tempRange != null && tempRange.Count() >= 2)
{
- if (retT < Convert.ToSingle(tempRange[0]) || retT > Convert.ToSingle(tempRange[1]))
- {
- //查询制冷片温度
- float retT2 = await _portUtil.GetFridgeTemperature2();
- if (retT2 > 65)
- {
- if (!FridgeState.Equals("1"))
- {
- //停掉冰箱
- await _portUtil.FridgeOff(1);
- CommonClass.SaveAppSetting("FridgeState", "1");
- //AlertMsg alertMsg = new AlertMsg
- //{
- // Message = $"冰箱制冷片温度超过65度,已关闭冰箱制冷功能!!!",
- // Type = MsgType.ERROR
- //};
- //_eventAggregator.GetEvent().Publish(alertMsg);
-
- System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
- {
- DialogParameters dialogParameters = new DialogParameters();
- dialogParameters.Add("warnMessage", "冰箱制冷片温度超过65度,已关闭冰箱制冷功能!!!");
- DialogServiceExtensions.ShowDialogHost(_dialogService, "WarnDialog", dialogParameters, DoDialogResult, "RootDialog");
-
- }));
- }
- logger.Info($"制冷片温度超过65度");
- Thread.Sleep(100);
- //给出提示
- WD += "冰箱温度异常,已关闭冰箱制冷功能";
- AlertColor = Brushes.Red;
- FridgeTime = null;
- stop();
- }
- else
- {
- if (FridgeTime == null)
- {
- FridgeTime = DateTime.Now;
- //温度不在范围,但没有超过时间
- if (IsLeave)
- {
- FridgeTime = null;
- stop();
- }
- else
- {
- next();
- }
- }
- else
- {
- if ((DateTime.Now - FridgeTime.Value).TotalMinutes > Convert.ToInt32(OutRangeTime))
- {
- logger.Info($"冰箱温度不在范围内,超过{OutRangeTime}分钟");
- //停掉冰箱
- await _portUtil.FridgeOff(1);
- Thread.Sleep(100);
- CommonClass.SaveAppSetting("FridgeState", "0");
- //给出提示
- WD += "冰箱温度异常,已关闭冰箱制冷功能;";
- AlertColor = Brushes.Red;
- FridgeState = "1";
- CommonClass.SaveAppSetting("FridgeState", "1");
- //AlertMsg alertMsg = new AlertMsg
- //{
- // Message = $"冰箱温度异常,已关闭冰箱制冷功能!!!",
- // Type = MsgType.ERROR
- //};
- //_eventAggregator.GetEvent().Publish(alertMsg);
- System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
- {
- DialogParameters dialogParameters = new DialogParameters();
- dialogParameters.Add("warnMessage", "冰箱温度异常,已关闭冰箱制冷功能!!!");
- DialogServiceExtensions.ShowDialogHost(_dialogService, "WarnDialog", dialogParameters, DoDialogResult, "RootDialog");
-
- }));
- FridgeTime = null;
- stop();
- }
- else
- {
- //温度不在范围,但没有超过时间
- if (IsLeave)
- {
- FridgeTime = null;
- stop();
- }
- else
- {
- next();
- }
- }
- }
- }
- }
- else
- {
- if (IsLeave)
- {
- FridgeTime = null;
- stop();
- }
- else
- {
- next();
- }
- }
+ next();
}
else
{
diff --git a/DM_Weight/Views/FridgeOnlyWindow.xaml b/DM_Weight/Views/FridgeOnlyWindow.xaml
index 323ae58..f5b8399 100644
--- a/DM_Weight/Views/FridgeOnlyWindow.xaml
+++ b/DM_Weight/Views/FridgeOnlyWindow.xaml
@@ -42,7 +42,7 @@
-
+
+