change - 三通阀逻辑控制完善

master
wangsr 1 year ago
parent 927685d010
commit cfa80ec7f3

@ -70,6 +70,7 @@ namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode.NewFolder1
AlarmPosition_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmPosition"); AlarmPosition_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_AlarmPosition");
Alarm_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_Alarm"); Alarm_D.Text = PlcCommunicationUtil.GetDataToString(dmName, "_Alarm");
} }
private void Refresh_Click(object sender, EventArgs e) private void Refresh_Click(object sender, EventArgs e)

@ -638,6 +638,7 @@
<Content Include="Resources\swith_default.png" /> <Content Include="Resources\swith_default.png" />
<EmbeddedResource Include="Resources\p0.png" /> <EmbeddedResource Include="Resources\p0.png" />
<EmbeddedResource Include="Resources\p1.png" /> <EmbeddedResource Include="Resources\p1.png" />
<EmbeddedResource Include="Resources\ThreeWayValveHVError.png" />
<Content Include="Resources\xie.png" /> <Content Include="Resources\xie.png" />
<Content Include="Resources\拆包机.png" /> <Content Include="Resources\拆包机.png" />
<EmbeddedResource Include="Resources\loudou.png" /> <EmbeddedResource Include="Resources\loudou.png" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

@ -10,6 +10,7 @@ namespace Mesnac.Controls.ChemicalWeighing
/// </summary> /// </summary>
public partial class ThreeWayValve : ChemicalWeighingControl public partial class ThreeWayValve : ChemicalWeighingControl
{ {
private object lockobj = new object();
public ThreeWayValve() public ThreeWayValve()
{ {
InitializeComponent(); InitializeComponent();
@ -43,7 +44,7 @@ namespace Mesnac.Controls.ChemicalWeighing
sImages[4] = "Mesnac.Controls.ChemicalWeighing.Resources.ThreeWayValveVError.png"; sImages[4] = "Mesnac.Controls.ChemicalWeighing.Resources.ThreeWayValveVError.png";
//都报警 //都报警
sImages[5] = "Mesnac.Controls.ChemicalWeighing.Resources.ThreeWayValveHVError.png"; sImages[5] = "Mesnac.Controls.ChemicalWeighing.Resources.ThreeWayValveHVError.png";
//三个都通
sImages[6] = "Mesnac.Controls.ChemicalWeighing.Resources.ThreeWayValveAll.png"; sImages[6] = "Mesnac.Controls.ChemicalWeighing.Resources.ThreeWayValveAll.png";
@ -53,11 +54,11 @@ namespace Mesnac.Controls.ChemicalWeighing
private void ReloadStream() private void ReloadStream()
{ {
int defaultIndex = 0; int defaultIndex = 0;
//如果出现报警 就去判断是直还是斜 //如果出现报警 就去判断是直还是斜
//直报警 斜报警 //直报警 斜报警
if (_almtValue && _almdValue) if (_almtValue && _almdValue)
{ {
@ -66,48 +67,38 @@ namespace Mesnac.Controls.ChemicalWeighing
else else
{ {
//如果直的报警 //如果直的报警
if (_almdValue) if (_almdValue && _almtValue == false)
{ {
defaultIndex = 3; defaultIndex = 3;
} }
//如果斜的报警 //如果斜的报警
if (_almtValue) if (_almtValue && _almdValue == false)
{ {
defaultIndex = 4; defaultIndex = 4;
} }
} }
//如果不是故障 //如果不是故障
if (_almtValue == false && _almdValue == false) if (_almtValue == false && _almdValue == false)
{ {
if (_zltValue && _zldValue == false)
if (_zltValue && _zldValue)
{ {
defaultIndex = 2; defaultIndex = 2;
} }
if (_zltValue == false && _zldValue) if (_zltValue == false && _zldValue)
{ {
defaultIndex = 1; defaultIndex = 1;
} }
//如果都是假 就变成默认值 可能没有数据 //如果都是假 就变成默认值 可能没有数据
if (_zltValue == false && _zldValue == false) if (_zltValue == false && _zldValue == false)
{ {
defaultIndex = 0; defaultIndex = 0;
} }
//如果都是真 就是双通 //如果都是真 就是双通
if (_zltValue && _zldValue) if (_zltValue && _zldValue)
{ {
defaultIndex = 6; defaultIndex = 6;
} }
} }
@ -126,10 +117,13 @@ namespace Mesnac.Controls.ChemicalWeighing
} }
private void R() private void R()
{
lock (lockobj)
{ {
ReloadStream(); ReloadStream();
Reload(); Reload();
} }
}
/// <summary> /// <summary>
@ -145,10 +139,12 @@ namespace Mesnac.Controls.ChemicalWeighing
get => _zltValue; get => _zltValue;
set set
{ {
if(_zltValue != value) {
_zltValue = value; _zltValue = value;
R(); R();
} }
} }
}
/// <summary> /// <summary>
/// 直通到位Plc的Name /// 直通到位Plc的Name
@ -163,10 +159,12 @@ namespace Mesnac.Controls.ChemicalWeighing
get => _zldValue; get => _zldValue;
set set
{ {
if( _zldValue != value ) {
_zldValue = value; _zldValue = value;
R(); R();
} }
} }
}
/// <summary> /// <summary>
/// 协通报警 /// 协通报警
@ -181,9 +179,12 @@ namespace Mesnac.Controls.ChemicalWeighing
get => _almtValue; get => _almtValue;
set set
{ {
if( _almtValue != value ) {
_almtValue = value; _almtValue = value;
R(); R();
} }
}
} }
/// <summary> /// <summary>
@ -199,9 +200,11 @@ namespace Mesnac.Controls.ChemicalWeighing
get => _almdValue; get => _almdValue;
set set
{ {
if( _almdValue != value ) {
_almdValue = value; _almdValue = value;
R(); R();
} }
} }
} }
} }
}

@ -420,7 +420,7 @@
<Propertys> <Propertys>
<Property Name="ZLTName" Caption="斜通到位" Group="控制阀门" ControlPropertyName="ZLTValue"/> <Property Name="ZLTName" Caption="斜通到位" Group="控制阀门" ControlPropertyName="ZLTValue"/>
<Property Name="ZLDName" Caption="直通到位" Group="控制阀门" ControlPropertyName="ZLDValue"/> <Property Name="ZLDName" Caption="直通到位" Group="控制阀门" ControlPropertyName="ZLDValue"/>
<Property Name="ALMTName" Caption="通报警" Group="控制阀门" ControlPropertyName="ALMTValue"/> <Property Name="ALMTName" Caption="通报警" Group="控制阀门" ControlPropertyName="ALMTValue"/>
<Property Name="ALMDName" Caption="直通报警" Group="控制阀门" ControlPropertyName="ALMDValue"/> <Property Name="ALMDName" Caption="直通报警" Group="控制阀门" ControlPropertyName="ALMDValue"/>
</Propertys> </Propertys>
</Component> </Component>

@ -4,7 +4,7 @@
<Main> <Main>
<Brand value="Siemens" /> <Brand value="Siemens" />
<Model value="S7" /> <Model value="S7" />
<ReadHz value="1000" /> <ReadHz value="5000" />
<UnitLen value="8" /> <UnitLen value="8" />
<Connection mode="Net"> <Connection mode="Net">
<IP value="192.168.0.1" /> <IP value="192.168.0.1" />

File diff suppressed because it is too large Load Diff

@ -4022,7 +4022,7 @@
<Property name="RefreshDataActionList"> <Property name="RefreshDataActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary> <Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAAAAAAAAAAABwMAAAAAAQAAAAAAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAL</Binary>
</Property> </Property>
<Property name="BHaveAction">False</Property> <Property name="BHaveAction">True</Property>
<Property name="MCPurview">False</Property> <Property name="MCPurview">False</Property>
<Property name="AllowOriginalSizeShow">False</Property> <Property name="AllowOriginalSizeShow">False</Property>
<Property name="BackColor">Control</Property> <Property name="BackColor">Control</Property>

@ -460,9 +460,7 @@
<Content Include="Data\MCProject\nodeDataSource.xml"> <Content Include="Data\MCProject\nodeDataSource.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Data\MCProject\nodeDevice.xml"> <Content Include="Data\MCProject\nodeDevice.xml" />
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Data\MCProject\nodeForm\FrmAlarmInfo.xml"> <Content Include="Data\MCProject\nodeForm\FrmAlarmInfo.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>

Loading…
Cancel
Save