Browse Source

变量管理器模块添加

样式分支
pry 2 years ago
parent
commit
0b3502761d
12 changed files with 193 additions and 198 deletions
  1. +11
    -11
      BPASmart.VariableManager/ViewModels/CommunicationSetViewModel.cs
  2. +2
    -3
      BPASmart.VariableManager/ViewModels/DeviceManagermentSetViewModel.cs
  3. +34
    -34
      BPASmart.VariableManager/ViewModels/VariableConfig.cs
  4. +31
    -32
      BPASmart.VariableManager/ViewModels/VariableMonitorViewModel.cs
  5. +17
    -16
      BPASmart.VariableManager/Views/CommunicationSetView.xaml
  6. +1
    -1
      BPASmart.VariableManager/Views/CommunicationSetView.xaml.cs
  7. +5
    -5
      BPASmart.VariableManager/Views/DeviceManagermentSetView.xaml
  8. +3
    -3
      BPASmart.VariableManager/Views/DeviceManagermentSetView.xaml.cs
  9. +45
    -47
      BPASmart.VariableManager/Views/VariableConfig.xaml
  10. +3
    -3
      BPASmart.VariableManager/Views/VariableConfig.xaml.cs
  11. +40
    -42
      BPASmart.VariableManager/Views/VariableMonitorView.xaml
  12. +1
    -1
      BPASmart.VariableManager/Views/VariableMonitorView.xaml.cs

+ 11
- 11
BPASmart.VariableManager/ViewModels/CommunicationSetViewModel.cs View File

@@ -5,12 +5,12 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.ObjectModel;
using AlarmDetection.Model;
using Microsoft.Toolkit.Mvvm.Input;
using AlarmDetection.View;
using AlarmDetection.TypeEnum;
using BPASmart.VariableManager.Views;
using System.Windows;
using AlarmDetection.Server;
using BPASmartClient.Helper;
using BPASmart.VariableManager.Models;
using BPASmart.VariableManager.Enums;

namespace BPASmart.VariableManager.ViewModels
{
@@ -21,17 +21,17 @@ namespace BPASmart.VariableManager.ViewModels
NewConnectCommand = new RelayCommand(() => { NewConnect(); });
SaveConnectSetCommand = new RelayCommand(() =>
{
Json<CommunicationPar>.GetInstance.Base.communicationSets.Clear();
Json<CommunicationPar>.Data.communicationSets.Clear();
foreach (var item in communicationSets)
{
item.RemoveAction = null;
Json<CommunicationPar>.GetInstance.Base.communicationSets.Add(item);
Json<CommunicationPar>.Data.communicationSets.Add(item);
}
Json<CommunicationPar>.GetInstance.Save();
Json<CommunicationPar>.Save();
});

Json<CommunicationPar>.GetInstance.Read();
foreach (var item in Json<CommunicationPar>.GetInstance.Base.communicationSets)
Json<CommunicationPar>.Read();
foreach (var item in Json<CommunicationPar>.Data.communicationSets)
{
item.RemoveAction = RemoveDevice;
communicationSets.Add(item);
@@ -43,7 +43,7 @@ namespace BPASmart.VariableManager.ViewModels
});
}

public ObservableCollection<CommunicationSet> communicationSets { get; set; } = new ObservableCollection<CommunicationSet>();
public ObservableCollection<CommunicationModel> communicationSets { get; set; } = new ObservableCollection<CommunicationModel>();

public RelayCommand NewConnectCommand { get; set; }

@@ -64,7 +64,7 @@ namespace BPASmart.VariableManager.ViewModels
var obj = communicationSets.FirstOrDefault(p => p.DeviceName == ResultTag.DeviceName);
if (obj == null)
{
CommunicationSet communicationObj = new CommunicationSet();
CommunicationModel communicationObj = new CommunicationModel();
EDeviceType eDeviceType = (EDeviceType)Enum.Parse(typeof(EDeviceType), ResultTag.DeviceType);
switch (eDeviceType)
{


+ 2
- 3
BPASmart.VariableManager/ViewModels/DeviceManagermentSetViewModel.cs View File

@@ -6,12 +6,11 @@ using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System.Collections.Concurrent;
using System.Collections.ObjectModel;
using AlarmDetection.TypeEnum;
using Microsoft.Toolkit.Mvvm.Input;
using Microsoft.Toolkit.Mvvm.Messaging;
using System.Diagnostics;
using AlarmDetection.Model;
using AlarmDetection.Server;
using BPASmart.VariableManager.Models;
using BPASmart.VariableManager.Enums;

namespace BPASmart.VariableManager.ViewModels
{


+ 34
- 34
BPASmart.VariableManager/ViewModels/VariableConfig.cs View File

@@ -45,25 +45,25 @@ namespace BPASmart.VariableManager.ViewModels
{
//SqlHelper<VariableInfo>.GetInstance.Database.EnsureCreated();
////多表查询
var DataList = SqlHelper<VariableInfo>.GetInstance.DbObj.ToList();
App.Current.Dispatcher.Invoke(new Action(() => { varialeInfos.Clear(); }));
foreach (var item in DataList)
{
PropBindInfo propBindInfo = new PropBindInfo();
propBindInfo.ID = item.ID;
propBindInfo.VarName = item.VarName;
propBindInfo.Address = item.Address;
propBindInfo.DataType = item.DataType;
propBindInfo.IsEnableAlarm = item.IsEnableAlarm;
propBindInfo.CurrentValue = item.CurrentValue;
var result = item.AlarmSetProp.AnalogAlarmModels.Where(p => p.AlarmSetId == item.ID).ToList();
result = result?.OrderBy(p => p.SortTag).ToList();
propBindInfo.AlarmSetProp.AnalogAlarmModels.Clear();
result?.ForEach(p => { propBindInfo.AlarmSetProp.AnalogAlarmModels.Add(p); });
propBindInfo.AlarmSetProp.DiscreteAlarmInfoSet = item.AlarmSetProp.DiscreteAlarmInfoSet;
App.Current?.Dispatcher.Invoke(new Action(() => { varialeInfos.Add(propBindInfo); }));
}
if (varialeInfos.Count <= 0) AddRow();
//var DataList = SqlHelper<VariableInfo>.GetInstance.DbObj.ToList();
//App.Current.Dispatcher.Invoke(new Action(() => { varialeInfos.Clear(); }));
//foreach (var item in DataList)
//{
// PropBindInfo propBindInfo = new PropBindInfo();
// propBindInfo.ID = item.ID;
// propBindInfo.VarName = item.VarName;
// propBindInfo.Address = item.Address;
// propBindInfo.DataType = item.DataType;
// propBindInfo.IsEnableAlarm = item.IsEnableAlarm;
// propBindInfo.CurrentValue = item.CurrentValue;
// var result = item.AlarmSetProp.AnalogAlarmModels.Where(p => p.AlarmSetId == item.ID).ToList();
// result = result?.OrderBy(p => p.SortTag).ToList();
// propBindInfo.AlarmSetProp.AnalogAlarmModels.Clear();
// result?.ForEach(p => { propBindInfo.AlarmSetProp.AnalogAlarmModels.Add(p); });
// propBindInfo.AlarmSetProp.DiscreteAlarmInfoSet = item.AlarmSetProp.DiscreteAlarmInfoSet;
// App.Current?.Dispatcher.Invoke(new Action(() => { varialeInfos.Add(propBindInfo); }));
//}
//if (varialeInfos.Count <= 0) AddRow();
return Task.FromResult(true);
}

@@ -73,22 +73,22 @@ namespace BPASmart.VariableManager.ViewModels
/// <returns></returns>
private Task<bool> SaveDataAsync()
{
SqlHelper<VariableInfo>.GetInstance.DbObj.RemoveRange(SqlHelper<VariableInfo>.GetInstance.DbObj.ToArray());
foreach (var item in varialeInfos)
{
SqlHelper<VariableInfo>.GetInstance.Add(new VariableInfo()
{
ID = item.ID,
VarName = item.VarName,
Address = item.Address,
DataType = item.DataType,
IsEnableAlarm = item.IsEnableAlarm,
CurrentValue = item.CurrentValue,
AlarmSetProp = item.AlarmSetProp,
//SqlHelper<VariableInfo>.GetInstance.DbObj.RemoveRange(SqlHelper<VariableInfo>.GetInstance.DbObj.ToArray());
//foreach (var item in varialeInfos)
//{
// SqlHelper<VariableInfo>.GetInstance.Add(new VariableInfo()
// {
// ID = item.ID,
// VarName = item.VarName,
// Address = item.Address,
// DataType = item.DataType,
// IsEnableAlarm = item.IsEnableAlarm,
// CurrentValue = item.CurrentValue,
// AlarmSetProp = item.AlarmSetProp,

});
}
SqlHelper<VariableInfo>.GetInstance.Save();
// });
//}
//SqlHelper<VariableInfo>.GetInstance.Save();
return Task.FromResult(true);
}



+ 31
- 32
BPASmart.VariableManager/ViewModels/VariableMonitorViewModel.cs View File

@@ -1,5 +1,4 @@
using AlarmDetection.Model;
using AlarmDetection.Server;
using BPASmart.VariableManager.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using System;
@@ -23,21 +22,21 @@ namespace BPASmart.VariableManager.ViewModels
/// </summary>
private Task<bool> GetLocalDataAsync()
{
var DataList = SqlHelper<VariableInfo>.GetInstance.DbObj.ToList();
App.Current.Dispatcher.Invoke(new Action(() => { varialeInfos.Clear(); }));
foreach (var item in DataList)
{
if (item.VarName?.Length > 0)
{
VarMonitorPropInfo varMonitorPropInfo = new VarMonitorPropInfo();
varMonitorPropInfo.ID = item.ID;
varMonitorPropInfo.VarName = item.VarName;
varMonitorPropInfo.Address = item.Address;
varMonitorPropInfo.DataType = item.DataType;
varMonitorPropInfo.DataDisplayFormat = TypeEnum.DisplayFormat.十进制.ToString();
App.Current?.Dispatcher.Invoke(new Action(() => { varialeInfos.Add(varMonitorPropInfo); }));
}
}
//var DataList = SqlHelper<VariableInfo>.GetInstance.DbObj.ToList();
//App.Current.Dispatcher.Invoke(new Action(() => { varialeInfos.Clear(); }));
//foreach (var item in DataList)
//{
// if (item.VarName?.Length > 0)
// {
// VarMonitorPropInfo varMonitorPropInfo = new VarMonitorPropInfo();
// varMonitorPropInfo.ID = item.ID;
// varMonitorPropInfo.VarName = item.VarName;
// varMonitorPropInfo.Address = item.Address;
// varMonitorPropInfo.DataType = item.DataType;
// varMonitorPropInfo.DataDisplayFormat = TypeEnum.DisplayFormat.十进制.ToString();
// App.Current?.Dispatcher.Invoke(new Action(() => { varialeInfos.Add(varMonitorPropInfo); }));
// }
//}
return Task.FromResult(true);
}

@@ -47,22 +46,22 @@ namespace BPASmart.VariableManager.ViewModels
/// <returns></returns>
private Task<bool> SaveDataAsync()
{
SqlHelper<VariableInfo>.GetInstance.DbObj.RemoveRange(SqlHelper<VariableInfo>.GetInstance.DbObj.ToArray());
foreach (var item in varialeInfos)
{
SqlHelper<VariableInfo>.GetInstance.Add(new VariableInfo()
{
ID = item.ID,
VarName = item.VarName,
Address = item.Address,
DataType = item.DataType,
IsEnableAlarm = item.IsEnableAlarm,
CurrentValue = item.CurrentValue,
AlarmSetProp = item.AlarmSetProp,
//SqlHelper<VariableInfo>.GetInstance.DbObj.RemoveRange(SqlHelper<VariableInfo>.GetInstance.DbObj.ToArray());
//foreach (var item in varialeInfos)
//{
// SqlHelper<VariableInfo>.GetInstance.Add(new VariableInfo()
// {
// ID = item.ID,
// VarName = item.VarName,
// Address = item.Address,
// DataType = item.DataType,
// IsEnableAlarm = item.IsEnableAlarm,
// CurrentValue = item.CurrentValue,
// AlarmSetProp = item.AlarmSetProp,

});
}
SqlHelper<VariableInfo>.GetInstance.Save();
// });
//}
//SqlHelper<VariableInfo>.GetInstance.Save();
return Task.FromResult(true);
}



+ 17
- 16
BPASmart.VariableManager/Views/CommunicationSetView.xaml View File

@@ -1,11 +1,10 @@
<UserControl
x:Class="AlarmDetection.View.CommunicationSetView"
x:Class="BPASmart.VariableManager.Views.CommunicationSetView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AlarmDetection.View"
xmlns:local="clr-namespace:BPASmart.VariableManager.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:AlarmDetection.PryUserControl"
xmlns:vm="clr-namespace:BPASmart.VariableManager.ViewModels"
d:DesignHeight="450"
d:DesignWidth="1000"
@@ -50,16 +49,18 @@
VerticalAlignment="Center"
Content="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}" />
<pry:Quadrilateral
<!--<pry:Quadrilateral
x:Name="poly"
Stroke="#FFDE7889"
StrokeThickness="2" />
StrokeThickness="2" />-->
</Grid>
<ControlTemplate.Triggers>
<!--<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="poly" Property="FillColor" Value="#22DE7889" />
-->
<!--<Setter TargetName="poly" Property="FillColor" Value="#22DE7889" />-->
<!--
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate.Triggers>-->
</ControlTemplate>
</Setter.Value>
</Setter>
@@ -87,9 +88,9 @@
FontSize="18"
Template="{StaticResource NewButtonTemp}">
<Button.Foreground>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFBB662A"/>
<GradientStop Color="White" Offset="1"/>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#FFBB662A" />
<GradientStop Offset="1" Color="White" />
</LinearGradientBrush>
</Button.Foreground>
</Button>
@@ -100,11 +101,11 @@
Content="保存"
FontFamily="楷体"
FontSize="18"
Template="{StaticResource SaveButtonTemp}" >
Template="{StaticResource SaveButtonTemp}">
<Button.Foreground>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFBB662A"/>
<GradientStop Color="White" Offset="1"/>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#FFBB662A" />
<GradientStop Offset="1" Color="White" />
</LinearGradientBrush>
</Button.Foreground>
</Button>
@@ -134,7 +135,7 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>

<pry:TitleTextBlock />
<!--<pry:TitleTextBlock />-->

<TextBlock
Margin="5"


+ 1
- 1
BPASmart.VariableManager/Views/CommunicationSetView.xaml.cs View File

@@ -13,7 +13,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AlarmDetection.View
namespace BPASmart.VariableManager.Views
{
/// <summary>
/// CommunicationSetView.xaml 的交互逻辑


+ 5
- 5
BPASmart.VariableManager/Views/DeviceManagermentSetView.xaml View File

@@ -1,9 +1,9 @@
<Window
x:Class="AlarmDetection.View.DeviceManagermentSetView"
x:Class="BPASmart.VariableManager.Views.DeviceManagermentSetView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AlarmDetection.View"
xmlns:local="clr-namespace:BPASmart.VariableManager.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:BPASmart.VariableManager.ViewModels"
Title="DeviceManagermentSetView"
@@ -74,7 +74,7 @@
BorderBrush="#55ffffff"
BorderThickness="0,0,0,1">
<StackPanel Orientation="Horizontal">
<Image Margin="15,5,0,5" Source="../Resource/Images/HBL.png" />
<!--<Image Margin="15,5,0,5" Source="../Resource/Images/HBL.png" />-->
<TextBlock
Name="tbTitle"
Margin="10,0"
@@ -165,7 +165,6 @@
Text="{Binding devcieManagerResult.DeviceName}" />

<TextBlock
TextWrapping="Wrap"
Grid.Row="2"
Grid.ColumnSpan="2"
Margin="20,0,0,0"
@@ -173,7 +172,8 @@
FontFamily="楷体"
FontSize="16"
Foreground="#FFE2415C"
Text="{Binding LogInfo}" />
Text="{Binding LogInfo}"
TextWrapping="Wrap" />

<Button
Grid.Row="3"


+ 3
- 3
BPASmart.VariableManager/Views/DeviceManagermentSetView.xaml.cs View File

@@ -13,10 +13,10 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Microsoft.Toolkit.Mvvm.Messaging;
using AlarmDetection.Model;
using AlarmDetection.Server;
using Microsoft.Toolkit.Mvvm.ComponentModel;
namespace AlarmDetection.View
using BPASmart.VariableManager.Models;

namespace BPASmart.VariableManager.Views
{
/// <summary>
/// DeviceManagermentSetView.xaml 的交互逻辑


+ 45
- 47
BPASmart.VariableManager/Views/VariableConfig.xaml View File

@@ -1,12 +1,10 @@
<UserControl
x:Class="AlarmDetection.View.VariableConfig"
x:Class="BPASmart.VariableManager.Views.VariableConfig"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:convert="clr-namespace:AlarmDetection.Convert"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AlarmDetection.View"
xmlns:local="clr-namespace:BPASmart.VariableManager.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:AlarmDetection.PryUserControl"
xmlns:vm="clr-namespace:BPASmart.VariableManager.ViewModels"
d:DesignHeight="450"
d:DesignWidth="1000"
@@ -17,41 +15,41 @@
</UserControl.DataContext>

<UserControl.Resources>
<ResourceDictionary Source="../Resource/Style/BasicStyle.xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<convert:TextDisplayConvert x:Key="textDisplayConvert" />
<!--<ResourceDictionary Source="../Resource/Style/BasicStyle.xaml">
<ResourceDictionary.MergedDictionaries>-->
<ResourceDictionary>
<!--<convert:TextDisplayConvert x:Key="textDisplayConvert" />
<convert:IsEnableConvert x:Key="isEnableConvert" />
<convert:AnalogAlarmConvert x:Key="analogAlarmConvert" />
<convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" />
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>

<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="22" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="BorderBrush" Value="#FF23CACA" />
<Setter Property="CaretBrush" Value="Aqua" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>

</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>

<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="22" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="BorderBrush" Value="#FF23CACA" />
<Setter Property="CaretBrush" Value="Aqua" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>

</ResourceDictionary>
<!--</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>-->
</UserControl.Resources>

<Grid Margin="10">
@@ -176,23 +174,23 @@
Text="{Binding ID}" />

<Grid Grid.Column="1">
<TextBox
<!--<TextBox
Background="Transparent"
CaretBrush="{StaticResource CursorColor}"
Foreground="{StaticResource FontColor}"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding VarName}" />
Text="{Binding VarName}" />-->
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>


<TextBox
<!--<TextBox
Grid.Column="2"
Background="Transparent"
CaretBrush="{StaticResource CursorColor}"
Foreground="{StaticResource FontColor}"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding Address}" />
Text="{Binding Address}" />-->

<Grid Grid.Column="3">
<ComboBox
@@ -212,7 +210,7 @@


<Grid Grid.Column="5">
<CheckBox
<!--<CheckBox
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="#ff23CACA"
@@ -220,7 +218,7 @@
FontSize="16"
Foreground="{StaticResource FontColor}"
IsChecked="{Binding IsEnableAlarm}"
Template="{StaticResource CbTemplate}" />
Template="{StaticResource CbTemplate}" />-->
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" />
</Grid>

@@ -259,7 +257,7 @@
</Grid.RowDefinitions>

<!--#region 离散量报警设置-->
<StackPanel
<!--<StackPanel
Grid.Row="0"
Margin="10"
Orientation="Vertical"
@@ -322,11 +320,11 @@
Text="{Binding AlarmSetProp.DiscreteAlarmInfoSet.AlarmInfo}" />
</Grid>

</StackPanel>
</StackPanel>-->
<!--#endregion-->

<!--#region 模拟量报警设置-->
<StackPanel
<!--<StackPanel
Grid.Row="1"
Margin="10"
Visibility="{Binding DataType, Converter={StaticResource analogAlarmConvert}}">
@@ -400,7 +398,7 @@
</ItemsControl.ItemTemplate>
</ItemsControl>

</StackPanel>
</StackPanel>-->
<!--#endregion-->

<!--#region 按钮控制-->
@@ -410,7 +408,7 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>

<Button
<!--<Button
Margin="10,5,10,10"
Command="{Binding CancelCommand}"
Content="取消"
@@ -427,7 +425,7 @@
FontFamily="楷体"
FontSize="20"
Foreground="#aa01FFFF"
Template="{StaticResource ConfirmButtonTemp}" />
Template="{StaticResource ConfirmButtonTemp}" />-->
</Grid>
<!--#endregion-->



+ 3
- 3
BPASmart.VariableManager/Views/VariableConfig.xaml.cs View File

@@ -1,4 +1,5 @@
using System;
using BPASmart.VariableManager.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
@@ -13,9 +14,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using AlarmDetection.Server;

namespace AlarmDetection.View
namespace BPASmart.VariableManager.Views
{
/// <summary>
/// VariableConfig.xaml 的交互逻辑


+ 40
- 42
BPASmart.VariableManager/Views/VariableMonitorView.xaml View File

@@ -1,12 +1,10 @@
<UserControl
x:Class="AlarmDetection.View.VariableMonitorView"
x:Class="BPASmart.VariableManager.Views.VariableMonitorView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:convert="clr-namespace:AlarmDetection.Convert"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:AlarmDetection.View"
xmlns:local="clr-namespace:BPASmart.VariableManager.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pry="clr-namespace:AlarmDetection.PryUserControl"
xmlns:vm="clr-namespace:BPASmart.VariableManager.ViewModels"
d:DesignHeight="450"
d:DesignWidth="1000"
@@ -16,41 +14,41 @@
</UserControl.DataContext>

<UserControl.Resources>
<ResourceDictionary Source="../Resource/Style/BasicStyle.xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<convert:TextDisplayConvert x:Key="textDisplayConvert" />
<!--<ResourceDictionary Source="../Resource/Style/BasicStyle.xaml">
<ResourceDictionary.MergedDictionaries>-->
<ResourceDictionary>
<!--<convert:TextDisplayConvert x:Key="textDisplayConvert" />
<convert:IsEnableConvert x:Key="isEnableConvert" />
<convert:AnalogAlarmConvert x:Key="analogAlarmConvert" />
<convert:DiscreteAlarmConvert x:Key="discreteAlarmConvert" />
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
<convert:AlarmTypeTextConvert x:Key="alarmTypeTextConvert" />-->
<SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
<SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
<SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
<SolidColorBrush x:Key="CursorColor" Color="Aqua" />
<SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />

<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style x:Key="TextBlockStyle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>

<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="22" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="BorderBrush" Value="#FF23CACA" />
<Setter Property="CaretBrush" Value="Aqua" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="TextBoxStyle" TargetType="TextBox">
<Setter Property="FontFamily" Value="楷体" />
<Setter Property="FontSize" Value="22" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource TextBlockForeground}" />
<Setter Property="BorderBrush" Value="#FF23CACA" />
<Setter Property="CaretBrush" Value="Aqua" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>

</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<!--</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>-->
</UserControl.Resources>

<Grid Margin="10">
@@ -60,7 +58,7 @@
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button
<!--<Button
Width="140"
Margin="0,0,20,0"
Background="#FF19B7EC"
@@ -75,8 +73,8 @@
<GradientStop Offset="1" Color="White" />
</LinearGradientBrush>
</Button.Foreground>
</Button>
<Button
</Button>-->
<!--<Button
Width="140"
Margin="0,0,20,0"
Background="#FF19B7EC"
@@ -91,7 +89,7 @@
<GradientStop Offset="1" Color="White" />
</LinearGradientBrush>
</Button.Foreground>
</Button>
</Button>-->
</StackPanel>

<!--#region 表格标题栏设置-->
@@ -201,23 +199,23 @@
Text="{Binding ID}" />

<Grid Grid.Column="1">
<TextBox
<!--<TextBox
Background="Transparent"
CaretBrush="{StaticResource CursorColor}"
Foreground="{StaticResource FontColor}"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding VarName}" />
Text="{Binding VarName}" />-->
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" />
</Grid>


<TextBox
<!--<TextBox
Grid.Column="2"
Background="Transparent"
CaretBrush="{StaticResource CursorColor}"
Foreground="{StaticResource FontColor}"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding Address}" />
Text="{Binding Address}" />-->

<Grid Grid.Column="3">
<TextBlock
@@ -261,13 +259,13 @@
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" />
</Grid>

<TextBox
<!--<TextBox
Grid.Column="7"
Background="Transparent"
CaretBrush="{StaticResource CursorColor}"
Foreground="{StaticResource FontColor}"
Style="{StaticResource InputTextboxStyle}"
Text="{Binding ModifyValue}" />
Text="{Binding ModifyValue}" />-->

<Border
Grid.ColumnSpan="8"


+ 1
- 1
BPASmart.VariableManager/Views/VariableMonitorView.xaml.cs View File

@@ -13,7 +13,7 @@ using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AlarmDetection.View
namespace BPASmart.VariableManager.Views
{
/// <summary>
/// VariableMonitorView.xaml 的交互逻辑


Loading…
Cancel
Save