dep
wangsr 12 months ago
commit 70e2b1403e

@ -421,14 +421,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
private void Time(int deviceNo, int statu) private void Time(int deviceNo, int statu)
{ {
//OpenDoorService.Insert(new OpenDoorEntity()
//{
// DeviceId = deviceNo,
// OpenTime = DateTime.Now,
// CreateTime = DateTime.Now,
// Status = statu
//});
if (WetStatus.ContainsKey(deviceNo) == false) if (WetStatus.ContainsKey(deviceNo) == false)
{ {
WetStatus.Add(deviceNo, statu); WetStatus.Add(deviceNo, statu);
@ -444,23 +437,26 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
private void DonwloadWetState(int deviceNo, int statu) private void DonwloadWetState(int deviceNo, int statu)
{ {
TankIsDischargedSyncEntity tankIsDischargedSyncEntity = new TankIsDischargedSyncEntity() string userName= string.IsNullOrWhiteSpace(UserInfo.Instance.UserName) ? "Edit" : UserInfo.Instance.UserName;
{ if (userName.Length > 0 && userName != "Edit")
reqCode = System.Guid.NewGuid().ToString(), {
reqTime = DateTime.Now, //即使网络不同 也不会影响上位机的使用
deviceNo = deviceNo.ToString(), ThreadPool.QueueUserWorkItem(delegate
state = statu.ToString(), {
}; TankIsDischargedSyncEntity tankIsDischargedSyncEntity = new TankIsDischargedSyncEntity()
{
//即使网络不同 也不会影响上位机的使用 reqCode = System.Guid.NewGuid().ToString(),
ThreadPool.QueueUserWorkItem(delegate reqTime = DateTime.Now,
{ deviceNo = deviceNo.ToString(),
HttpResponse httpResponse = new HttpResponse(); state = statu.ToString(),
// MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}下发请求"); };
string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity); HttpResponse httpResponse = new HttpResponse();
// LjManualLog.ManualLogControl($"湿混机{deviceNo}返回数据 " + returnTest); MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}下发请求:{statu}");
MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest); string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity);
}); // LjManualLog.ManualLogControl($"湿混机{deviceNo}返回数据 " + returnTest);
MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest);
});
}
} }
#endregion #endregion

@ -105,20 +105,7 @@ namespace MCRun
{ {
AppConfigHandler.Instance.InitCustomerMenuAndToolStrip(WorkbenchSingleton.Workbench.TopMenu, WorkbenchSingleton.Workbench.ToolStrip); //初始化自定义系统菜单和工具栏 AppConfigHandler.Instance.InitCustomerMenuAndToolStrip(WorkbenchSingleton.Workbench.TopMenu, WorkbenchSingleton.Workbench.ToolStrip); //初始化自定义系统菜单和工具栏
try
{
var instance = Mesnac.Equips.Factory.Instance.ConfigFile;
XmlDocument doc = new XmlDocument();
doc.Load(instance);
var nodes = doc.ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes[4].ChildNodes[0];
var ip = nodes.Attributes["value"].Value;
//初始化HslCommunication 11.0.6.0
// PlcBusiness.Instance.InitPlcConnect(PlcType.SiemensPlc,ip, 102);
}
catch (Exception exception)
{
ICSharpCode.Core.LoggingService<Program>.Debug("HSLPlc读取失败");
}
//初始化连接报警器 //初始化连接报警器
// DoControl.Instance.ComOn(); // DoControl.Instance.ComOn();

Loading…
Cancel
Save