|
|
@ -26,6 +26,8 @@ using Mesnac.Action.ChemicalWeighing.MinAn;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.InterfaceDocking;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.InterfaceDocking;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Report;
|
|
|
|
using Mesnac.Action.ChemicalWeighing.Report;
|
|
|
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.InterfaceDocking.DockingEntity;
|
|
|
|
|
|
|
|
using Mesnac.Core.Service;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -46,6 +48,10 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
|
|
int LineKindFlag = 0;
|
|
|
|
int LineKindFlag = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int no = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dictionary<int, int> WetStatus = new Dictionary<int, int>();
|
|
|
|
|
|
|
|
|
|
|
|
//读取报表
|
|
|
|
//读取报表
|
|
|
|
ushort ReadFlag = 0;
|
|
|
|
ushort ReadFlag = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -268,6 +274,13 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
timer.Dispose();
|
|
|
|
timer.Dispose();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
no += 1;
|
|
|
|
|
|
|
|
if (no > 5)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
no = 0;
|
|
|
|
|
|
|
|
Timer1_Tick();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LineKindFlag += 1;
|
|
|
|
LineKindFlag += 1;
|
|
|
|
if (LineKindFlag >= 300)
|
|
|
|
if (LineKindFlag >= 300)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1814,7 +1827,85 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 返回数据读取
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Timer1_Tick()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok1 = PlcConnect.Instance.ReadBool("DB3000.0.0").Content;
|
|
|
|
|
|
|
|
Time(1, mixok1 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok2 = PlcConnect.Instance.ReadBool("DB3000.0.1").Content;
|
|
|
|
|
|
|
|
Time(2, mixok2 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok3 = PlcConnect.Instance.ReadBool("DB3000.0.2").Content;
|
|
|
|
|
|
|
|
Time(3, mixok3 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok4 = PlcConnect.Instance.ReadBool("DB3000.0.3").Content;
|
|
|
|
|
|
|
|
Time(4, mixok4 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok5 = PlcConnect.Instance.ReadBool("DB3000.0.4").Content;
|
|
|
|
|
|
|
|
Time(5, mixok5 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok6 = PlcConnect.Instance.ReadBool("DB3000.0.5").Content;
|
|
|
|
|
|
|
|
Time(6, mixok6 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok7 = PlcConnect.Instance.ReadBool("DB3000.0.6").Content;
|
|
|
|
|
|
|
|
Trace.WriteLine("7号信号:" + mixok7);
|
|
|
|
|
|
|
|
Time(7, mixok7 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool mixok8 = PlcConnect.Instance.ReadBool("DB3000.0.7").Content;
|
|
|
|
|
|
|
|
Trace.WriteLine("8号信号:" + mixok8);
|
|
|
|
|
|
|
|
Time(8, mixok8 ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
WetStatus.Add(deviceNo, statu);
|
|
|
|
|
|
|
|
DonwloadWetState(deviceNo, statu);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (WetStatus[deviceNo] != statu)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
WetStatus[deviceNo] = statu;
|
|
|
|
|
|
|
|
DonwloadWetState(deviceNo, statu);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void DonwloadWetState(int deviceNo, int statu)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
TankIsDischargedSyncEntity tankIsDischargedSyncEntity = new TankIsDischargedSyncEntity()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
reqCode = System.Guid.NewGuid().ToString(),
|
|
|
|
|
|
|
|
reqTime = DateTime.Now,
|
|
|
|
|
|
|
|
deviceNo = deviceNo.ToString(),
|
|
|
|
|
|
|
|
state = statu.ToString(),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//即使网络不同 也不会影响上位机的使用
|
|
|
|
|
|
|
|
ThreadPool.QueueUserWorkItem(delegate
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
HttpResponse httpResponse = new HttpResponse();
|
|
|
|
|
|
|
|
// MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}下发请求");
|
|
|
|
|
|
|
|
string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity);
|
|
|
|
|
|
|
|
// LjManualLog.ManualLogControl($"湿混机{deviceNo}返回数据 " + returnTest);
|
|
|
|
|
|
|
|
MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|