Commit 2953169c authored by 潘栩锋's avatar 潘栩锋 🚴

修复 温区更新,设置问题

parent 69f2dd8b
<Application x:Class="FLY.IBC.UI.Client.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/Themes/UcTcStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
using System.Windows;
namespace FLY.IBC.UI.Client
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
}
}
......@@ -67,6 +67,10 @@
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Page Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="PgMenu2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
......@@ -165,6 +169,9 @@
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="PgMenu2.xaml.cs">
<DependentUpon>PgMenu2.xaml</DependentUpon>
</Compile>
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FLY.IBC.UI.Client.Themes"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/Themes/TempAreaPanelStyle.xaml"/>
......
......@@ -10,8 +10,73 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/Themes/TempAreaPanelStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/Themes/UcTcStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<ut:IbcServiceUt x:Key="viewModel"/>
<Style x:Key="UcTcStyle1" TargetType="{x:Type UserControl}">
<Setter Property="Width" Value="155"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type UserControl}">
<Grid >
<Border Background="{StaticResource DashBoardBrush}" BorderBrush="{StaticResource DashBoardBorderBrush}" BorderThickness="3" CornerRadius="3">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<StackPanel>
<Grid Margin="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="PV" Foreground="{StaticResource PrintBrush}" Margin="2"/>
<TextBlock Grid.Column="1" Style="{StaticResource SegTextStyle}"
Text="{Binding TempPV,StringFormat={}{0:0.#}}" />
</Grid>
<Rectangle Height="2" Fill="{StaticResource PrintBrush}"/>
<Grid Margin="2" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<TextBlock Text="SV" Foreground="{StaticResource PrintBrush}" Margin="2"/>
<TextBlock Grid.Column="1" Style="{StaticResource SegTextStyle}" Foreground="{StaticResource SegOrangeBrush}"
Text="{Binding TempSV,StringFormat={}{0:0.#}}" />
</Grid>
<Rectangle Height="2" Fill="{StaticResource PrintBrush}"/>
<Grid Margin="2,2,2,5">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ToggleButton IsChecked="{Binding IsHeatingSet,Mode=OneWay}" Content="Run" IsEnabled="False" Style="{DynamicResource LedStyle}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding IsHeating,Mode=OneWay}" Content="OT1" IsEnabled="False" Style="{DynamicResource LedStyle}"/>
<ToggleButton Grid.Column="2" IsChecked="{Binding IsSelfAdjusting,Mode=OneWay}" Content="AT" IsEnabled="False" Style="{DynamicResource LedStyle}"/>
<ToggleButton Grid.Column="3" IsChecked="{Binding IsCooling,Mode=OneWay}" Content="OT2" IsEnabled="False" Style="{DynamicResource LedStyle}"/>
</Grid>
</StackPanel>
<TextBlock Background="{StaticResource BrandBrush}" Grid.Row="1" Height="8" Text="8888888" FontWeight="Bold" Padding="1" FontSize="5" Foreground="{StaticResource PrintBrush}"/>
</Grid>
</Border>
<TextBlock HorizontalAlignment="Right" VerticalAlignment="Top"
Background="{StaticResource Color_badgeBg}" Foreground="{StaticResource Color_badgeText}"
Padding="6,2"
FontSize="30"
Text="{Binding Number}" Margin="0,-5,-5,0"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</UserControl.Resources>
<Viewbox Stretch="Uniform" VerticalAlignment="Top" HorizontalAlignment="Left">
......@@ -21,7 +86,7 @@
<RowDefinition Height="871*"/>
</Grid.RowDefinitions>
<StackPanel Grid.RowSpan="2">
<ItemsControl ItemsSource="{Binding TAreas}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
......@@ -32,23 +97,6 @@
<DataTemplate>
<Button Style="{StaticResource ButtonStyle_empty}" Tag="{Binding .}" Click="btnTAreaClick">
<Grid>
<Grid.Resources>
<ResourceDictionary>
<Style TargetType="local:UcTc">
<Setter Property="Number" Value="{Binding Number}"/>
<Setter Property="PV" Value="{Binding TempPV}"/>
<Setter Property="SV" Value="{Binding TempSV}"/>
<Setter Property="IsRun" Value="{Binding IsHeatingSet}" />
<Setter Property="IsOT1" Value="{Binding IsHeating}" />
<Setter Property="IsAT" Value="{Binding IsSelfAdjusting}" />
<Setter Property="IsOT2" Value="{Binding IsCooling}" />
<Setter Property="Margin" Value="5"/>
</Style>
<Style TargetType="Viewbox">
<Setter Property="Margin" Value="5"/>
</Style>
</ResourceDictionary>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition />
......@@ -61,12 +109,19 @@
<Border Style="{StaticResource BorderStyle_block}" CornerRadius="5,0,0,5" Margin="5" Width="100">
<TextBlock Text="{Binding Number}" FontSize="50" Foreground="{StaticResource Color_title}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<local:UcTc Grid.Column="1" DataContext="{Binding Temperatures[0]}" />
<UserControl Style="{StaticResource UcTcStyle1}" Grid.Column="1" DataContext="{Binding Temperatures[0]}" />
<UserControl Style="{StaticResource UcTcStyle1}" Grid.Column="2" DataContext="{Binding Temperatures[1]}" />
<UserControl Style="{StaticResource UcTcStyle1}" Grid.Column="3" DataContext="{Binding Temperatures[2]}" />
<UserControl Style="{StaticResource UcTcStyle1}" Grid.Column="4" DataContext="{Binding Temperatures[3]}" />
<UserControl Style="{StaticResource UcTcStyle1}" Grid.Column="5" DataContext="{Binding Temperatures[4]}" />
<UserControl Style="{StaticResource UcTcStyle1}" Grid.Column="6" DataContext="{Binding Temperatures[5]}" />
<!--<local:UcTc Grid.Column="1" DataContext="{Binding Temperatures[0]}" />
<local:UcTc Grid.Column="2" DataContext="{Binding Temperatures[1]}" />
<local:UcTc Grid.Column="3" DataContext="{Binding Temperatures[2]}" />
<local:UcTc Grid.Column="4" DataContext="{Binding Temperatures[3]}" />
<local:UcTc Grid.Column="5" DataContext="{Binding Temperatures[4]}" />
<local:UcTc Grid.Column="6" DataContext="{Binding Temperatures[5]}" />
<local:UcTc Grid.Column="6" DataContext="{Binding Temperatures[5]}" />-->
</Grid>
</Button>
......
......@@ -34,7 +34,7 @@ namespace FLY.IBC.UI.Client.UiModule
for (int i = 0; i < 6; i++) {
for (int j = 0; j < propertynames.Count(); j++)
{
update_propertynames.Add(propertynames[i].Replace("1", (i + 1).ToString()));
update_propertynames.Add(propertynames[j].Replace("1", (i + 1).ToString()));
}
}
......
......@@ -4,16 +4,15 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.IBC.UI.Client.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls" x:Class="FLY.IBC.UI.Client.UiModule.UcTc"
x:Class="FLY.IBC.UI.Client.UiModule.UcTc"
mc:Ignorable="d" Width="155"
x:Name="uc">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--加载 ResourceDictionary 会很慢,在TempAreaPanel中不能直接调用 UcTc,然后需要等3-4s才能启动 -->
<ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/Themes/UcTcStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!--资料内的数据不调用,是不会创建的,所以不用担心浪费内存-->
......
......@@ -58,7 +58,7 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<ToggleButton Grid.Column="0" IsChecked="{Binding IsRun}" Content="Run" Style="{StaticResource LedStyle}" Foreground="{StaticResource Color_text}"/>
<ToggleButton Grid.Column="1" IsChecked="{Binding IsOT1}" Content="OT1" Style="{StaticResource LedStyle}" Foreground="{StaticResource Color_text}"/>
<ToggleButton Grid.Column="2" IsChecked="{Binding IsAT}" Content="AT" Style="{StaticResource LedStyle}" Foreground="{StaticResource Color_text}"/>
<ToggleButton Grid.Column="3" IsChecked="{Binding IsOT2}" Content="OT2" Style="{StaticResource LedStyle}" Foreground="{StaticResource Color_text}"/>
......
......@@ -20,8 +20,8 @@
<Setter Property="Margin" Value="5"/>
<Setter Property="Number" Value="{Binding Number}"/>
<Setter Property="PV" Value="{Binding TempPV}" />
<Setter Property="SV" Value="{Binding TempSV}" />
<Setter Property="IsRun" Value="{Binding IsHeatingSet}"/>
<Setter Property="SV" Value="{Binding TempSV,Mode=TwoWay}" />
<Setter Property="IsRun" Value="{Binding IsHeatingSet,Mode=TwoWay}"/>
<Setter Property="IsOT1" Value="{Binding IsHeating}"/>
<Setter Property="IsAT" Value="{Binding IsSelfAdjusting}"/>
<Setter Property="IsOT2" Value="{Binding IsCooling}"/>
......@@ -45,7 +45,7 @@
<local:UcTcSet DataContext="{Binding Temperatures[3]}"/>
</StackPanel>
<StackPanel>
<local:UcTcAll Number="{Binding Number}" SV="{Binding AllTempSet}" IsAllRun="{Binding IsAllTempSame}"/>
<local:UcTcAll Number="{Binding Number}" SV="{Binding AllTempSet,Mode=TwoWay}" IsAllRun="{Binding IsAllTempSame,Mode=TwoWay}"/>
<local:UcTcSet DataContext="{Binding Temperatures[4]}" />
</StackPanel>
......
......@@ -3,6 +3,7 @@ using FLY.IBC.Client;
using FLY.IBC.Common;
using FLY.IBC.IService;
using FLY.OBJComponents.Client;
using FObjBase;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -24,6 +25,11 @@ namespace FLY.IBC.UI.Client.UiModule
/// </summary>
public partial class WdTempAreaSet : WindowBigClose
{
#region MARKNO
const int MARKNO_IsTempSetChanged = 1;
const int MARKNO_IsAllTempSetChanged = 2;
#endregion
static string[] update_propertynames = new string[] {
nameof(Common.TempArea.IsTempSetChanged1),
nameof(Common.TempArea.IsTempSetChanged2),
......@@ -76,7 +82,14 @@ namespace FLY.IBC.UI.Client.UiModule
var tempCell = sender as TempCell;
if (e.PropertyName == nameof(Common.TempCell.TempSV))
{
tempCell.IsTempSetChanged = true;
//0.5s 后再set 1
PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, () =>
{
tempCell.IsTempSetChanged = false;
tempCell.IsTempSetChanged = true;
}, TimeSpan.FromSeconds(0.5), false, false, this, MARKNO_IsTempSetChanged, true);
}
}
......@@ -91,7 +104,12 @@ namespace FLY.IBC.UI.Client.UiModule
}
if (e.PropertyName == nameof(Common.TempArea.AllTempSet)) {
tempArea.IsAllTempSetChanged = true;
//0.5s 后再set 1
PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, () =>
{
tempArea.IsAllTempSetChanged = false;
tempArea.IsAllTempSetChanged = true;
}, TimeSpan.FromSeconds(0.5), false, false, this, MARKNO_IsAllTempSetChanged, true);
}
}
......
......@@ -99,7 +99,7 @@
"DeviceIndex": 0,
"Mode": "4",
"Addr": 668,
"Type": "uint16",
"Type": "int16",
"Scale": 1.0,
"OwnerName": "Item",
"PropertyName": "FilmWidth"
......
......@@ -99,7 +99,7 @@
"DeviceIndex": 0,
"Mode": "4",
"Addr": 668,
"Type": "uint16",
"Type": "int16",
"Scale": 1.0,
"OwnerName": "Item",
"PropertyName": "FilmWidth"
......
......@@ -72,7 +72,7 @@
"DeviceIndex": 0,
"Mode": "4",
"Addr": 668,
"Type": "uint16",
"Type": "int16",
"Scale": 1.0,
"OwnerName": "Item",
"PropertyName": "FilmWidth"
......
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