Commit f9b287c6 authored by 潘栩锋's avatar 潘栩锋 🚴

称重服务器 看到与测厚仪的连接状态

parent c523cf27
...@@ -7,6 +7,12 @@ ...@@ -7,6 +7,12 @@
<Grid x:Name="grid_plcos"/> <Grid x:Name="grid_plcos"/>
<Grid x:Name="grid_WeightSystem"/> <Grid x:Name="grid_WeightSystem"/>
<StackPanel Margin="5"> <StackPanel Margin="5">
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding ElementName=grid_WeightSystem,Path=DataContext}">
<TextBlock Text="当前线速度设置m/min*10" />
<TextBlock FontSize="20">
<Run Text="{Binding Accessory.CurrentVelocitySet,StringFormat=\{0:F0\}, Mode=OneWay}" />
</TextBlock>
</StackPanel>
<ItemsControl x:Name="itemcontrol"> <ItemsControl x:Name="itemcontrol">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
......
...@@ -46,8 +46,9 @@ namespace FLY.Weight.UI.Server ...@@ -46,8 +46,9 @@ namespace FLY.Weight.UI.Server
gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem; gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem;
//grid_plcos.DataContext = plsos; //grid_plcos.DataContext = plsos;
//grid_plc.DataContext = plsos.PLCs[0]; //grid_plc.DataContext = plsos.PLCs[0];
//grid_WeightSystem.DataContext = mTDGage.mData; grid_WeightSystem.DataContext = gage.mData;
this.itemcontrol.ItemsSource = plsos.PLCs; this.itemcontrol.ItemsSource = plsos.PLCs;
} }
private void btnSetupClick(object sender, RoutedEventArgs e) private void btnSetupClick(object sender, RoutedEventArgs e)
......
...@@ -96,6 +96,10 @@ ...@@ -96,6 +96,10 @@
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Project.FLY.Thick.Blowing\FLY.Thick.Blowing\FLY.Thick.Blowing.csproj">
<Project>{CC20ABEB-59F6-492B-A963-51121EB5AE66}</Project>
<Name>FLY.Thick.Blowing</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.AppHelper\FLY.AppHelper\FLY.AppHelper.csproj"> <ProjectReference Include="..\..\thick_public\Project.FLY.AppHelper\FLY.AppHelper\FLY.AppHelper.csproj">
<Project>{9c46d98f-6500-490b-9e56-c89dfffa05f8}</Project> <Project>{9c46d98f-6500-490b-9e56-c89dfffa05f8}</Project>
<Name>FLY.AppHelper</Name> <Name>FLY.AppHelper</Name>
......
...@@ -6,28 +6,41 @@ ...@@ -6,28 +6,41 @@
<Grid x:Name="grid_plc"/> <Grid x:Name="grid_plc"/>
<Grid x:Name="grid_plcos"/> <Grid x:Name="grid_plcos"/>
<Grid x:Name="grid_WeightSystem"/> <Grid x:Name="grid_WeightSystem"/>
<StackPanel Orientation="Vertical" Margin="5"> <StackPanel Margin="5">
<StackPanel Orientation="Horizontal">
<StackPanel Margin="4" DataContext="{Binding ElementName=grid_WeightSystem,Path=DataContext}">
<TextBlock Text="当前线速度设置m/min*10" />
<TextBlock FontSize="20">
<Run Text="{Binding Accessory.CurrentVelocitySet,StringFormat=\{0:F0\}, Mode=OneWay}" />
</TextBlock>
</StackPanel>
<StackPanel Margin="4" x:Name="spBDetect">
<TextBlock Text="测厚仪服务器连接状态" />
<TextBlock Text="{Binding IsConnected}" FontSize="20"/>
</StackPanel>
</StackPanel>
<ItemsControl x:Name="itemcontrol"> <ItemsControl x:Name="itemcontrol">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel> <StackPanel>
<StackPanel Orientation="Horizontal" > <StackPanel Orientation="Horizontal" >
<StackPanel Orientation="Vertical" Margin="4" > <StackPanel Margin="4" >
<TextBlock Text="更新速度" /> <TextBlock Text="更新速度" />
<TextBlock FontSize="20"> <TextBlock FontSize="20">
<Run Text="{Binding ActUpdateInterval,StringFormat=\{0:sfff\}, Mode=OneWay}" /> <Run Text="{Binding ActUpdateInterval,StringFormat=\{0:sfff\}, Mode=OneWay}" />
<Run Text="ms" FontSize="15"/> <Run Text="ms" FontSize="15"/>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="4" > <StackPanel Margin="4" >
<TextBlock Text="PLC连接状态" /> <TextBlock Text="PLC连接状态" />
<TextBlock Text="{Binding Client.IsConnected}" FontSize="20"/> <TextBlock Text="{Binding Client.IsConnected}" FontSize="20"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="4" > <StackPanel Margin="4" >
<TextBlock Text="异常次数" /> <TextBlock Text="异常次数" />
<TextBlock Text="{Binding ErrorCnt}" FontSize="20"/> <TextBlock Text="{Binding ErrorCnt}" FontSize="20"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="4" > <StackPanel Margin="4" >
<TextBlock Text="寄存器更新数" /> <TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding DRNeedUpdateCnt}" FontSize="20"/> <TextBlock Text="{Binding DRNeedUpdateCnt}" FontSize="20"/>
...@@ -41,15 +54,15 @@ ...@@ -41,15 +54,15 @@
</ItemsControl.ItemTemplate> </ItemsControl.ItemTemplate>
</ItemsControl> </ItemsControl>
<!--<StackPanel Orientation="Horizontal" > <!--<StackPanel Orientation="Horizontal" >
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}"> <StackPanel Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}">
<TextBlock Text="更新速度" /> <TextBlock Text="更新速度" />
<TextBlock Text="{Binding ActUpdateInterval}" FontSize="20"/> <TextBlock Text="{Binding ActUpdateInterval}" FontSize="20"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding DataContext,ElementName=grid_plcos}"> <StackPanel Margin="4" DataContext="{Binding DataContext,ElementName=grid_plcos}">
<TextBlock Text="PLC连接状态" /> <TextBlock Text="PLC连接状态" />
<TextBlock Text="{Binding IsRunning}" FontSize="20"/> <TextBlock Text="{Binding IsRunning}" FontSize="20"/>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}"> <StackPanel Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}">
<TextBlock Text="寄存器更新数" /> <TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding DRNeedUpdateCnt}" FontSize="20"/> <TextBlock Text="{Binding DRNeedUpdateCnt}" FontSize="20"/>
......
...@@ -30,8 +30,9 @@ namespace FLY.Weight2.UI.Server ...@@ -30,8 +30,9 @@ namespace FLY.Weight2.UI.Server
gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem; gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem;
//grid_plcos.DataContext = plsos; //grid_plcos.DataContext = plsos;
//grid_plc.DataContext = plsos.PLCs[0]; //grid_plc.DataContext = plsos.PLCs[0];
//grid_WeightSystem.DataContext = mTDGage.mData; grid_WeightSystem.DataContext = gage.mData;
this.itemcontrol.ItemsSource = plsos.PLCs; this.itemcontrol.ItemsSource = plsos.PLCs;
spBDetect.DataContext = gage.mBDetect;
} }
} }
} }
...@@ -27,27 +27,31 @@ namespace FLY.Weight2.Server ...@@ -27,27 +27,31 @@ namespace FLY.Weight2.Server
public SysParam() public SysParam()
{ {
Load(); if (!Load()) {
Save();
}
} }
public void Save() public void Save()
{ {
string json = Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); string json = Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText("system.json", json); File.WriteAllText("system.json", json);
} }
public void Load() public bool Load()
{ {
if (!File.Exists("system.json")) if (!File.Exists("system.json"))
{ {
return; return false;
} }
try try
{ {
string json = File.ReadAllText("system.json"); string json = File.ReadAllText("system.json");
Newtonsoft.Json.JsonConvert.PopulateObject(json, this); Newtonsoft.Json.JsonConvert.PopulateObject(json, this);
return true;
} }
catch { catch {
} }
return false;
} }
} }
} }
...@@ -35,7 +35,7 @@ namespace FLY.Weight2.Server ...@@ -35,7 +35,7 @@ namespace FLY.Weight2.Server
/// <summary> /// <summary>
/// 吹膜测厚仪, 旋转架模型 /// 吹膜测厚仪, 旋转架模型
/// </summary> /// </summary>
FLY.Thick.Blowing.Client.BlowingDetectServiceClient mBDetect; public FLY.Thick.Blowing.Client.BlowingDetectServiceClient mBDetect;
#endregion #endregion
public TDGage(string nam) public TDGage(string nam)
...@@ -88,7 +88,7 @@ namespace FLY.Weight2.Server ...@@ -88,7 +88,7 @@ namespace FLY.Weight2.Server
private void MBDetect_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) private void MBDetect_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{ {
if (e.PropertyName == "FilmVelocity") if (e.PropertyName == nameof(mBDetect.FilmVelocity))
{ {
mData.Accessory.CurrentVelocitySet = (((int)(mBDetect.FilmVelocity * 10)) / 10.0f); mData.Accessory.CurrentVelocitySet = (((int)(mBDetect.FilmVelocity * 10)) / 10.0f);
} }
......
...@@ -255,7 +255,7 @@ namespace FLY.Weight2.Server ...@@ -255,7 +255,7 @@ namespace FLY.Weight2.Server
}); });
//这个是从测厚仪获取的,每几秒就写一次,不调试!!!!! //这个是从测厚仪获取的,每几秒就写一次,不调试!!!!!
//plcos.IgnoreLogProperties.Add(new SenderProperty() { sender = Accessory, propertyName = "CurrentVelocitySet" }); plcos.IgnoreLogProperties.Add(new SenderProperty() { sender = Accessory, propertyName = nameof(Accessory.CurrentVelocitySet) });
} }
......
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