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

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

parent c523cf27
......@@ -7,6 +7,12 @@
<Grid x:Name="grid_plcos"/>
<Grid x:Name="grid_WeightSystem"/>
<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.ItemTemplate>
<DataTemplate>
......
......@@ -46,8 +46,9 @@ namespace FLY.Weight.UI.Server
gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem;
//grid_plcos.DataContext = plsos;
//grid_plc.DataContext = plsos.PLCs[0];
//grid_WeightSystem.DataContext = mTDGage.mData;
grid_WeightSystem.DataContext = gage.mData;
this.itemcontrol.ItemsSource = plsos.PLCs;
}
private void btnSetupClick(object sender, RoutedEventArgs e)
......
......@@ -96,6 +96,10 @@
<None Include="App.config" />
</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">
<Project>{9c46d98f-6500-490b-9e56-c89dfffa05f8}</Project>
<Name>FLY.AppHelper</Name>
......
......@@ -6,28 +6,41 @@
<Grid x:Name="grid_plc"/>
<Grid x:Name="grid_plcos"/>
<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.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal" >
<StackPanel Orientation="Vertical" Margin="4" >
<StackPanel Margin="4" >
<TextBlock Text="更新速度" />
<TextBlock FontSize="20">
<Run Text="{Binding ActUpdateInterval,StringFormat=\{0:sfff\}, Mode=OneWay}" />
<Run Text="ms" FontSize="15"/>
</TextBlock>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="4" >
<StackPanel Margin="4" >
<TextBlock Text="PLC连接状态" />
<TextBlock Text="{Binding Client.IsConnected}" FontSize="20"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="4" >
<StackPanel Margin="4" >
<TextBlock Text="异常次数" />
<TextBlock Text="{Binding ErrorCnt}" FontSize="20"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="4" >
<StackPanel Margin="4" >
<TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding DRNeedUpdateCnt}" FontSize="20"/>
......@@ -41,15 +54,15 @@
</ItemsControl.ItemTemplate>
</ItemsControl>
<!--<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="{Binding ActUpdateInterval}" FontSize="20"/>
</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="{Binding IsRunning}" FontSize="20"/>
</StackPanel>
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}">
<StackPanel Margin="4" DataContext="{Binding DataContext,ElementName=grid_plc}">
<TextBlock Text="寄存器更新数" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding DRNeedUpdateCnt}" FontSize="20"/>
......
......@@ -30,8 +30,9 @@ namespace FLY.Weight2.UI.Server
gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem;
//grid_plcos.DataContext = plsos;
//grid_plc.DataContext = plsos.PLCs[0];
//grid_WeightSystem.DataContext = mTDGage.mData;
grid_WeightSystem.DataContext = gage.mData;
this.itemcontrol.ItemsSource = plsos.PLCs;
spBDetect.DataContext = gage.mBDetect;
}
}
}
......@@ -27,27 +27,31 @@ namespace FLY.Weight2.Server
public SysParam()
{
Load();
if (!Load()) {
Save();
}
}
public void Save()
{
string json = Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText("system.json", json);
}
public void Load()
public bool Load()
{
if (!File.Exists("system.json"))
{
return;
return false;
}
try
{
string json = File.ReadAllText("system.json");
Newtonsoft.Json.JsonConvert.PopulateObject(json, this);
return true;
}
catch {
}
return false;
}
}
}
......@@ -35,7 +35,7 @@ namespace FLY.Weight2.Server
/// <summary>
/// 吹膜测厚仪, 旋转架模型
/// </summary>
FLY.Thick.Blowing.Client.BlowingDetectServiceClient mBDetect;
public FLY.Thick.Blowing.Client.BlowingDetectServiceClient mBDetect;
#endregion
public TDGage(string nam)
......@@ -88,7 +88,7 @@ namespace FLY.Weight2.Server
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);
}
......
......@@ -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