Commit 2422f671 authored by 潘栩锋's avatar 潘栩锋 🚴
parents 58852a0d 02fb55ad
...@@ -21,6 +21,7 @@ namespace FLY.Simulation.Coating ...@@ -21,6 +21,7 @@ namespace FLY.Simulation.Coating
const UInt16 ADDR_D_FilmVelocity=6;//float const UInt16 ADDR_D_FilmVelocity=6;//float
const UInt16 ADDR_C_STATE = 0;//涂布状态 bit 0 const UInt16 ADDR_C_STATE = 0;//涂布状态 bit 0
const UInt16 ADDR_C_OK = 2;//设置 0->1 设置
CoatingCtrl mCoatingCtrl; CoatingCtrl mCoatingCtrl;
...@@ -109,6 +110,7 @@ namespace FLY.Simulation.Coating ...@@ -109,6 +110,7 @@ namespace FLY.Simulation.Coating
} }
} }
public double FilmVelocity public double FilmVelocity
{ {
get get
...@@ -143,6 +145,21 @@ namespace FLY.Simulation.Coating ...@@ -143,6 +145,21 @@ namespace FLY.Simulation.Coating
} }
} }
public bool OK
{
get
{
return mPLCRegister.GetBool(ADDR_C_OK);
}
set
{
if (OK != value)
{
mPLCRegister.SetBool(ADDR_C_OK, value);
NotifyPropertyChanged("OK");
}
}
}
public HMI(Coating coating, CoatingCtrl cc, int port) public HMI(Coating coating, CoatingCtrl cc, int port)
{ {
mCoatingCtrl = cc; mCoatingCtrl = cc;
...@@ -158,6 +175,9 @@ namespace FLY.Simulation.Coating ...@@ -158,6 +175,9 @@ namespace FLY.Simulation.Coating
Addrs.Add(ADDR_D_RightSet, "RightSet"); Addrs.Add(ADDR_D_RightSet, "RightSet");
Addrs.Add(ADDR_D_Right, "Right"); Addrs.Add(ADDR_D_Right, "Right");
Addrs.Add(ADDR_D_FilmVelocity, "FilmVelocity"); Addrs.Add(ADDR_D_FilmVelocity, "FilmVelocity");
Addrs.Add(ADDR_C_OK, "OK");
Misc.BindingOperations.SetBinding(cc.NowCtrl, "Pump", this, "PumpSet", Misc.BindingOperations.BindingMode.TwoWay); Misc.BindingOperations.SetBinding(cc.NowCtrl, "Pump", this, "PumpSet", Misc.BindingOperations.BindingMode.TwoWay);
Misc.BindingOperations.SetBinding(cc.NowCtrl, "LeftDis", this, "Left"); Misc.BindingOperations.SetBinding(cc.NowCtrl, "LeftDis", this, "Left");
...@@ -169,13 +189,19 @@ namespace FLY.Simulation.Coating ...@@ -169,13 +189,19 @@ namespace FLY.Simulation.Coating
LeftSet = Left; LeftSet = Left;
RightSet = Right; RightSet = Right;
this.PropertyChanged += new PropertyChangedEventHandler(HMI_PropertyChanged); this.PropertyChanged += new PropertyChangedEventHandler(HMI_PropertyChanged);
} }
void HMI_PropertyChanged(object sender, PropertyChangedEventArgs e) void HMI_PropertyChanged(object sender, PropertyChangedEventArgs e)
{ {
if ((e.PropertyName == "PumpSet") || (e.PropertyName == "LeftSet") || (e.PropertyName == "RightSet"))
if (e.PropertyName == "OK")
{ {
mCoatingCtrl.SetCoatingCtrl(PumpSet, LeftSet, RightSet); if (OK == true)
{
mCoatingCtrl.SetCoatingCtrl(PumpSet, LeftSet, RightSet);
}
} }
} }
......
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