Commit 55820bef authored by 潘栩锋's avatar 潘栩锋 🚴

修复 AD盒模拟涂布 bug

parent 1754ee24
......@@ -161,6 +161,7 @@ namespace FLY.Simulation.Coating
}
}
}
private bool ok_last = false;
public HMI(Coating coating, CoatingCtrl cc, int port)
{
mCoatingCtrl = cc;
......@@ -170,6 +171,8 @@ namespace FLY.Simulation.Coating
mPLCRegister.RegChanged += new ModbusModule.PLCRegister.RegChangedEventHandler(plcregister_RegChanged);
ok_last = OK;
Addrs_reg.Add(ADDR_D_PumpSet, "PumpSet");
Addrs_reg.Add(ADDR_D_LeftSet, "LeftSet");
Addrs_reg.Add(ADDR_D_Left, "Left");
......@@ -199,9 +202,14 @@ namespace FLY.Simulation.Coating
if (e.PropertyName == "OK")
{
if (OK == true)
if (ok_last != OK)
{
mCoatingCtrl.SetCoatingCtrl(PumpSet, LeftSet, RightSet);
ok_last = OK;
if (OK == true)
{
mCoatingCtrl.SetCoatingCtrl(PumpSet, LeftSet, RightSet);
}
}
}
}
......
......@@ -97,7 +97,7 @@
</Grid>
<StackPanel>
<CheckBox Content="设置位" FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding OK}" IsEnabled="False"/>
<CheckBox Content="设置位" FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding OK}" DataContext="{Binding DataContext,ElementName=hmi}"/>
<CheckBox Content="涂布状态" FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding DeviceState}" IsEnabled="False"/>
</StackPanel>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment