add - 手动操控 糊化机新需求 待整合PLC

dep_nodyang
wangsr 1 year ago
parent ef46dce828
commit 1c27c80404

@ -1,4 +1,5 @@
using Mesnac.Action.Base;
using DataBlockHelper;
using Mesnac.Action.Base;
using Mesnac.Controls.Base;
using Mesnac.Controls.Default;
using Mesnac.Core.Service;
@ -179,6 +180,8 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
return;
}
MesnacServiceManager.Instance.LoggingService.Info("冷水称A开始称量");
PlcConnect.Instance.Write("DB2119.20.0", Convert.ToUInt16(value));
PlcConnect.Instance.Write("DB2119.28.0", true);
}
else
{
@ -186,12 +189,11 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
MessageBox.Show("输入数值的格式有误!");
return;
}
}
if (StopMetage1 == runtime.Sender)
{
PlcConnect.Instance.Write("DB2119.28.1", true);
MesnacServiceManager.Instance.LoggingService.Info("冷水称A称量已手动停止");
MessageBox.Show("称量已停止!");
}
@ -206,6 +208,8 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
return;
}
MesnacServiceManager.Instance.LoggingService.Info("热水称A开始称量");
PlcConnect.Instance.Write("DB2119.0.0", Convert.ToUInt16(value));
PlcConnect.Instance.Write("DB2119.8.0", true);
}
else
{
@ -217,6 +221,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
if (StopMetage2 == runtime.Sender)
{
PlcConnect.Instance.Write("DB2119.8.1", true);
MesnacServiceManager.Instance.LoggingService.Info("热水称A称量已手动停止");
MessageBox.Show("称量已停止!");
}
@ -231,6 +236,8 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
return;
}
MesnacServiceManager.Instance.LoggingService.Info("冷水称B开始称量");
PlcConnect.Instance.Write("DB2119.30.0", Convert.ToUInt16(value));
PlcConnect.Instance.Write("DB2119.38.0", true);
}
else
{
@ -242,6 +249,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
if (StopMetage3 == runtime.Sender)
{
PlcConnect.Instance.Write("DB2119.38.1", true);
MesnacServiceManager.Instance.LoggingService.Info("冷水称B称量已手动停止");
MessageBox.Show("称量已停止!");
}
@ -256,6 +264,8 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
return;
}
MesnacServiceManager.Instance.LoggingService.Info("热水称B开始称量");
PlcConnect.Instance.Write("DB2119.10.0", Convert.ToUInt16(value));
PlcConnect.Instance.Write("DB2119.18.0", true);
}
else
{
@ -267,6 +277,7 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
if (StopMetage4 == runtime.Sender)
{
PlcConnect.Instance.Write("DB2119.18.1", true);
MesnacServiceManager.Instance.LoggingService.Info("热水称B称量已手动停止");
MessageBox.Show("称量已停止!");
}
@ -283,16 +294,20 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
switch (GelChooseA)
{
case 1:
PlcConnect.Instance.Write("DB2119.26.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write("DB2119.28.4", true);
break;
case 2:
PlcConnect.Instance.Write("DB2119.26.0", Convert.ToUInt16(2));
PlcConnect.Instance.Write("DB2119.28.4", true);
break;
case 3:
PlcConnect.Instance.Write("DB2119.26.0", Convert.ToUInt16(3));
PlcConnect.Instance.Write("DB2119.28.4", true);
break;
case 4:
PlcConnect.Instance.Write("DB2119.26.0", Convert.ToUInt16(4));
PlcConnect.Instance.Write("DB2119.28.4", true);
break;
default: break;
}
@ -310,16 +325,20 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
switch (GelChooseA)
{
case 1:
PlcConnect.Instance.Write("DB2119.6.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write("DB2119.8.4", true);
break;
case 2:
PlcConnect.Instance.Write("DB2119.6.0", Convert.ToUInt16(2));
PlcConnect.Instance.Write("DB2119.8.4", true);
break;
case 3:
PlcConnect.Instance.Write("DB2119.6.0", Convert.ToUInt16(3));
PlcConnect.Instance.Write("DB2119.8.4", true);
break;
case 4:
PlcConnect.Instance.Write("DB2119.6.0", Convert.ToUInt16(4));
PlcConnect.Instance.Write("DB2119.8.4", true);
break;
default: break;
}
@ -337,16 +356,20 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
switch (GelChooseB)
{
case 5:
PlcConnect.Instance.Write("DB2119.36.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write("DB2119.38.4", true);
break;
case 6:
PlcConnect.Instance.Write("DB2119.36.0", Convert.ToUInt16(2));
PlcConnect.Instance.Write("DB2119.8.4", true);
break;
case 7:
PlcConnect.Instance.Write("DB2119.36.0", Convert.ToUInt16(3));
PlcConnect.Instance.Write("DB2119.8.4", true);
break;
case 8:
PlcConnect.Instance.Write("DB2119.36.0", Convert.ToUInt16(4));
PlcConnect.Instance.Write("DB2119.8.4", true);
break;
default: break;
}
@ -364,16 +387,20 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
switch (GelChooseB)
{
case 5:
PlcConnect.Instance.Write("DB2119.16.0", Convert.ToUInt16(1));
PlcConnect.Instance.Write("DB2119.18.4", true);
break;
case 6:
PlcConnect.Instance.Write("DB2119.16.0", Convert.ToUInt16(2));
PlcConnect.Instance.Write("DB2119.18.4", true);
break;
case 7:
PlcConnect.Instance.Write("DB2119.16.0", Convert.ToUInt16(3));
PlcConnect.Instance.Write("DB2119.18.4", true);
break;
case 8:
PlcConnect.Instance.Write("DB2119.16.0", Convert.ToUInt16(4));
PlcConnect.Instance.Write("DB2119.18.4", true);
break;
default: break;
}
@ -471,32 +498,33 @@ namespace Mesnac.Action.ChemicalWeighing.ManualControl
if (SpiralOn4 == runtime.Sender)
{
float value;
if (float.TryParse(Convert.ToString(SetSpiralValue4.MCValue), out value))
{
if (MessageBox.Show("螺旋4确认启动", "螺旋启动确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{
return;
}
MesnacServiceManager.Instance.LoggingService.Info("螺旋4启动");
}
else
{
MesnacServiceManager.Instance.LoggingService.Info("螺旋4输入数值的格式有误");
MessageBox.Show("输入数值的格式有误!");
return;
}
switch (WetChoose4)
{
case 7:
break;
case 8:
break;
default: break;
}
MessageBox.Show("二期工程,敬请期待!");
//float value;
//if (float.TryParse(Convert.ToString(SetSpiralValue4.MCValue), out value))
//{
// if (MessageBox.Show("螺旋4确认启动", "螺旋启动确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
// {
// return;
// }
// MesnacServiceManager.Instance.LoggingService.Info("螺旋4启动");
//}
//else
//{
// MesnacServiceManager.Instance.LoggingService.Info("螺旋4输入数值的格式有误");
// MessageBox.Show("输入数值的格式有误!");
// return;
//}
//switch (WetChoose4)
//{
// case 7:
// break;
// case 8:
// break;
// default: break;
//}
}
#endregion

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save