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,15 +189,21 @@ namespace FLY.Simulation.Coating ...@@ -169,15 +189,21 @@ 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")
{
if (OK == true)
{ {
mCoatingCtrl.SetCoatingCtrl(PumpSet, LeftSet, RightSet); mCoatingCtrl.SetCoatingCtrl(PumpSet, LeftSet, RightSet);
} }
} }
}
void plcregister_RegChanged(object sender, ModbusModule.PLCRegister.RegChangedEventArgs e) void plcregister_RegChanged(object sender, ModbusModule.PLCRegister.RegChangedEventArgs e)
{ {
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="273*" /> <RowDefinition Height="273*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid HorizontalAlignment="Left" Margin="12,3" Name="grid1" > <StackPanel Orientation="Horizontal">
<Grid HorizontalAlignment="Left" Margin="12,3" >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
<ColumnDefinition Width="auto" /> <ColumnDefinition Width="auto" />
...@@ -80,6 +81,13 @@ ...@@ -80,6 +81,13 @@
</Grid> </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 DeviceState}" IsEnabled="False"/>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="1" Margin="12,3"> <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="12,3">
<StackPanel Orientation="Horizontal" Margin="3"> <StackPanel Orientation="Horizontal" Margin="3">
<TextBlock Text="modbusTCP 端口:" /> <TextBlock Text="modbusTCP 端口:" />
...@@ -97,7 +105,6 @@ ...@@ -97,7 +105,6 @@
<TextBlock Text="转移涂布"/> <TextBlock Text="转移涂布"/>
</ComboBoxItem> </ComboBoxItem>
</ComboBox> </ComboBox>
<CheckBox Content="涂布状态" FontSize="18" FontWeight="Bold" Height="23" Margin="3" Name="checkBox1" VerticalAlignment="Center" FlowDirection="RightToLeft" IsChecked="{Binding DeviceState}"/>
<TextBlock FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" > <TextBlock FontSize="18" FontWeight="Bold" Height="23" Margin="3" VerticalAlignment="Center" >
<Run Text="当前平均值:" /> <Run Text="当前平均值:" />
<Run Text="{Binding Avg}" /> <Run Text="{Binding Avg}" />
......
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