|
|
|
@ -26,6 +26,7 @@ using Mesnac.Action.ChemicalWeighing.MinAn;
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using DataBlockHelper.DBHelpers;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
{
|
|
|
|
@ -133,6 +134,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
MCButton Focus;
|
|
|
|
|
MCButton SaveSetting;
|
|
|
|
|
MCButton LoadSetting;
|
|
|
|
|
MCButton DownloadRequest;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -142,10 +144,6 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
|
|
|
|
|
IBaseControl keywords;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DB2119Helper DB2119;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void Run(RuntimeParameter runtime)
|
|
|
|
|
{
|
|
|
|
|
base.RunIni(runtime); //必须要调用
|
|
|
|
@ -157,8 +155,6 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
SingleSelect();
|
|
|
|
|
BottomSelect(runtime);
|
|
|
|
|
|
|
|
|
|
DB2119 = new DB2119Helper();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 控件获取导入
|
|
|
|
@ -259,6 +255,8 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
|
|
|
|
|
SaveSetting = GetButtonControl("SaveSetting");
|
|
|
|
|
LoadSetting = GetButtonControl("LoadSetting");
|
|
|
|
|
|
|
|
|
|
DownloadRequest = GetButtonControl("DownloadRequest");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
@ -365,6 +363,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
Focus.Focus();
|
|
|
|
|
|
|
|
|
|
DB2119Helper DB2119 = new DB2119Helper();
|
|
|
|
|
Db3000Helper DB3000 = new Db3000Helper();
|
|
|
|
|
|
|
|
|
|
#region 消除报警
|
|
|
|
|
if (EliAlarms == runtime.Sender)
|
|
|
|
@ -373,11 +372,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
PlcControl("DB2107.10.7", false);
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 水称称量按钮
|
|
|
|
|
#region 水称称量按钮
|
|
|
|
|
|
|
|
|
|
if (StartMetage1 == runtime.Sender)
|
|
|
|
|
if (StartMetage1 == runtime.Sender)
|
|
|
|
|
{
|
|
|
|
|
if (DB2119.Coolwater_A.Dos_Status)
|
|
|
|
|
{
|
|
|
|
@ -859,7 +858,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
// return;
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WaterStopAction("DB2119.28.5", WaterStop1, "冷", "A");
|
|
|
|
|
//MessageBox.Show("冷水称A已停止排水");
|
|
|
|
@ -1011,7 +1010,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
{
|
|
|
|
|
var record = FreeSqlUnit.Instance.Select<ManualLogEntity>()
|
|
|
|
|
.Where(x => x.valuekind == 3 && x.devicekind == 2 && x.deviceno == 1 && x.value > 350).ToList().LastOrDefault();
|
|
|
|
|
if(record == null) { return; }
|
|
|
|
|
if (record == null) { return; }
|
|
|
|
|
if ((DateTime.Now - record.logtime).Value.TotalMinutes < 15)
|
|
|
|
|
{
|
|
|
|
|
if (MessageBox.Show("距离上次下料大于350KG不足15分钟 确认下料?", "螺旋启动确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
|
|
|
@ -1447,6 +1446,54 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region 下发请求
|
|
|
|
|
|
|
|
|
|
if(DownloadRequest == runtime.Sender)
|
|
|
|
|
{
|
|
|
|
|
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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 下发请求
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="deviceNo"></param>
|
|
|
|
|
/// <param name="statu"></param>
|
|
|
|
|
private void Time(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();
|
|
|
|
|
string returnTest = httpResponse.PostResponse(tankIsDischargedSyncEntity);
|
|
|
|
|
MesnacServiceManager.Instance.LoggingService.Info($"湿混机{deviceNo}返回数据" + returnTest);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|