diff --git a/WCS.BLL/HardWare/IShelfBase.cs b/WCS.BLL/HardWare/IShelfBase.cs
index af7a266..0751c22 100644
--- a/WCS.BLL/HardWare/IShelfBase.cs
+++ b/WCS.BLL/HardWare/IShelfBase.cs
@@ -124,6 +124,11 @@ namespace WCS.BLL.HardWare
///
public void Reset();
+ ///
+ /// 板子与货架状态不一致的复位(未响应的复位)
+ ///
+ public void NoResponseReset();
+
///
/// 货架自检
///
diff --git a/WCS.BLL/HardWare/SingleLightShelf.cs b/WCS.BLL/HardWare/SingleLightShelf.cs
index ae8ea0e..c94f5ca 100644
--- a/WCS.BLL/HardWare/SingleLightShelf.cs
+++ b/WCS.BLL/HardWare/SingleLightShelf.cs
@@ -95,6 +95,11 @@ namespace WCS.BLL.HardWare
return;
}
+ public void NoResponseReset()
+ {
+ return;
+ }
+
public void SetCurrentMode(Mode mode)
{
diff --git a/WCS.BLL/HardWare/SmartShelf.cs b/WCS.BLL/HardWare/SmartShelf.cs
index 9b64871..a494eee 100644
--- a/WCS.BLL/HardWare/SmartShelf.cs
+++ b/WCS.BLL/HardWare/SmartShelf.cs
@@ -923,6 +923,31 @@ namespace WCS.BLL.HardWare
SetCurrentMode(Mode.待机模式);
}
+ ///
+ /// 板子与货架状态不一致的复位(未响应的复位)
+ ///
+ public void NoResponseReset()
+ {
+ //不是待机模式不发送指令
+ if (CurrentMode != Mode.待机模式)
+ {
+ return;
+ }
+ //获取状态不一致的板子
+ var modules = Modules.Where(t => t.IsEnable && t.CurrentMode != Mode.待机模式)
+ .ToList();
+ if (modules != null && modules.Count > 0)
+ {
+ modules.ForEach(t =>
+ {
+ //复位状态不一致的板子
+ Logs.Write($"复位模组【{t.ModuleCode}({t.CurrentMode})】发送指令成功!");
+ t.Reset(TcpCleint);
+ });
+ }
+
+ }
+
public void QueryVoltage(int moduleId)
{
var moudle = Modules.Where(t => t.ModuleId == moduleId).First();
diff --git a/WCS.WebApi/Controllers/HomeController.cs b/WCS.WebApi/Controllers/HomeController.cs
index 7d74fb0..ffece0d 100644
--- a/WCS.WebApi/Controllers/HomeController.cs
+++ b/WCS.WebApi/Controllers/HomeController.cs
@@ -239,6 +239,42 @@ namespace WCS.WebApi.Controllers
}
}
+ ///
+ /// 重置货架的状态 使其回到待机模式
+ ///
+ ///
+ ///
+ [Route("noResponseReset")]
+ [HttpPost(Name = "noResponseReset")]
+ public async Task noResponseReset(RequestBase request)
+ {
+ try
+ {
+ var shelfs = new List();
+ shelfs = ShelfManager.Shelves
+ .Where(t => t.CurrentMode == Mode.待机模式)
+ .ToList();
+
+ foreach (var shelf in shelfs)
+ {
+ shelf.NoResponseReset();
+ }
+ return new ResponseBase()
+ {
+ Code = 200,
+ Message = "success",
+ };
+
+ }
+ catch (Exception ex)
+ {
+ return new ResponseBase()
+ {
+ Code = 300,
+ Message = ex.Message,
+ };
+ }
+ }
///
diff --git a/货架标准上位机/ViewModels/DeviceViewModel.cs b/货架标准上位机/ViewModels/DeviceViewModel.cs
index f683fb2..1aaf136 100644
--- a/货架标准上位机/ViewModels/DeviceViewModel.cs
+++ b/货架标准上位机/ViewModels/DeviceViewModel.cs
@@ -61,6 +61,37 @@ namespace 智能仓储WCS管理系统.ViewModel
Growl.Error("打开文件夹失败。");
}
}
+
+ public ICommand NoResponseResetCommand { get => new DelegateCommand(NoResponseReset); }
+ ///
+ /// 打开用户
+ ///
+ public void NoResponseReset()
+ {
+ var result = HandyControl.Controls.MessageBox.Show("此功能用于“未成功退出入库、出库”等异常提示\r\n建议所有货架都处于待机模式时使用,继续复位请点击[确定]", "提示", MessageBoxButton.OKCancel);
+ if (result == MessageBoxResult.Cancel)
+ return;
+ #region 调用接口 请求重置所有货架的状态
+ var body = new RequestBase()
+ {
+ UserName = LocalStatic.CurrentUser,
+ DeviceType = LocalFile.Config.DeviceType,
+ };
+ var Result = ApiHelp.GetDataFromHttp(LocalFile.Config.ApiIpHost + "home/noResponseReset", body, "POST");
+ if (Result != null && Result.Code == 200)
+ {
+ Growl.Warning("已给状态不一致的板子发送复位指令,建议点击第一个按钮[货架状态初始化]重置所有货架状态!");
+ }
+ else if (Result != null)
+ {
+ Growl.Warning(Result.Message);
+ }
+ else
+ {
+ Growl.Warning("调用接口失败!");
+ }
+ #endregion
+ }
}
public class DeviceReadModel : BindableBase
diff --git a/货架标准上位机/Views/Controls/DeviceView.xaml b/货架标准上位机/Views/Controls/DeviceView.xaml
index 9587c0d..5028f85 100644
--- a/货架标准上位机/Views/Controls/DeviceView.xaml
+++ b/货架标准上位机/Views/Controls/DeviceView.xaml
@@ -18,6 +18,11 @@
+
+