@@ -18,7 +18,8 @@ namespace BPASmart.VariableManager.Converter | |||||
if (type != null && parameter != null) | if (type != null && parameter != null) | ||||
{ | { | ||||
if (type.Name == parameter.ToString()) | |||||
string typeName = type.BaseType.Name == "Object" ? type.Name : type.BaseType.Name; | |||||
if (typeName == parameter.ToString()) | |||||
return Visibility.Visible; | return Visibility.Visible; | ||||
else | else | ||||
return Visibility.Collapsed; | return Visibility.Collapsed; | ||||
@@ -1,43 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.ComponentModel.DataAnnotations; | |||||
using System.ComponentModel.DataAnnotations.Schema; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
/// <summary> | |||||
/// 模拟量报警信息 | |||||
/// </summary> | |||||
[Table(nameof(AnalogAlarmInfo))] | |||||
public class AnalogAlarmInfo | |||||
{ | |||||
//[Key] | |||||
//public int Id { get; set; } | |||||
///// <summary> | |||||
///// 高高报警 | |||||
///// </summary> | |||||
//public AnalogAlarmModel Condition_HIHI_Value { get; set; } = new AnalogAlarmModel(); | |||||
///// <summary> | |||||
///// 高报警 | |||||
///// </summary> | |||||
//public AnalogAlarmModel Condition_HI_Value { get; set; } = new AnalogAlarmModel(); | |||||
///// <summary> | |||||
///// 低低报警 | |||||
///// </summary> | |||||
//public AnalogAlarmModel Condition_LOLO_Value { get; set; } = new AnalogAlarmModel(); | |||||
///// <summary> | |||||
///// 低报警 | |||||
///// </summary> | |||||
//public AnalogAlarmModel Condition_LO_Value { get; set; } = new AnalogAlarmModel(); | |||||
//[ForeignKey("AlarmSetId")] | |||||
//public int AlarmSetId { get; set; } | |||||
//public AlarmSet AlarmSet { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,15 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
/// <summary> | |||||
/// 汇川PLC | |||||
/// </summary> | |||||
public class Invoance : ModbusTcp | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,15 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
/// <summary> | |||||
/// 步科一体机 | |||||
/// </summary> | |||||
public class KincoOneMachine : ModbusTcp | |||||
{ | |||||
} | |||||
} |
@@ -12,15 +12,6 @@ namespace BPASmart.VariableManager.Models | |||||
{ | { | ||||
public class ModbusRtu : ICommunicationDevice | public class ModbusRtu : ICommunicationDevice | ||||
{ | { | ||||
//public ModbusRtu() | |||||
//{ | |||||
// Init(); | |||||
//} | |||||
/// <summary> | |||||
/// 显示/隐藏设置 | |||||
/// </summary> | |||||
//public Visibility ModbusRtuVisible { get; set; } = Visibility.Collapsed; | |||||
/// <summary> | /// <summary> | ||||
/// 串口端口 | /// 串口端口 | ||||
@@ -52,37 +43,5 @@ namespace BPASmart.VariableManager.Models | |||||
/// </summary> | /// </summary> | ||||
public string Parity { get; set; } | public string Parity { get; set; } | ||||
//public ObservableCollection<string> Ports { get; set; } = new ObservableCollection<string>(); | |||||
//public ObservableCollection<string> BaudRates { get; set; } = new ObservableCollection<string>(); | |||||
//public ObservableCollection<string> Paritys { get; set; } = new ObservableCollection<string>(); | |||||
//private void Init() | |||||
//{ | |||||
// Ports.Clear(); | |||||
// foreach (var item in SerialPort.GetPortNames()) | |||||
// { | |||||
// Ports.Add(item); | |||||
// } | |||||
// BaudRates.Clear(); | |||||
// BaudRates.Add("110"); | |||||
// int initValue = 300; | |||||
// for (int i = 0; i < 17; i++) | |||||
// { | |||||
// BaudRates.Add(initValue.ToString()); | |||||
// initValue *= 2; | |||||
// } | |||||
// Paritys.Clear(); | |||||
// foreach (var item in Enum.GetNames(typeof(EParity))) | |||||
// { | |||||
// Paritys.Add(item); | |||||
// } | |||||
//} | |||||
} | } | ||||
} | } |
@@ -9,10 +9,6 @@ namespace BPASmart.VariableManager.Models | |||||
{ | { | ||||
public class ModbusTcp : ICommunicationDevice | public class ModbusTcp : ICommunicationDevice | ||||
{ | { | ||||
/// <summary> | |||||
/// 显示/隐藏设置 | |||||
/// </summary> | |||||
//public Visibility ModbusTcpVisible { get; set; } = Visibility.Collapsed; | |||||
/// <summary> | /// <summary> | ||||
/// IP地址 | /// IP地址 | ||||
@@ -11,15 +11,6 @@ namespace BPASmart.VariableManager.Models | |||||
{ | { | ||||
public class Siemens : ICommunicationDevice | public class Siemens : ICommunicationDevice | ||||
{ | { | ||||
//public Siemens() | |||||
//{ | |||||
// Init(); | |||||
//} | |||||
/// <summary> | |||||
/// 显示/隐藏设置 | |||||
/// </summary> | |||||
//public Visibility SiemensVisible { get; set; } = Visibility.Collapsed; | |||||
/// <summary> | /// <summary> | ||||
/// IP地址 | /// IP地址 | ||||
@@ -46,18 +37,6 @@ namespace BPASmart.VariableManager.Models | |||||
/// </summary> | /// </summary> | ||||
public string PlcType { get; set; } | public string PlcType { get; set; } | ||||
//public ObservableCollection<string> PlcTypes { get; set; } = new ObservableCollection<string>(); | |||||
//private void Init() | |||||
//{ | |||||
// PlcTypes.Clear(); | |||||
// foreach (var item in Enum.GetNames(typeof(ESiemensPlcType))) | |||||
// { | |||||
// PlcTypes.Add(item.Substring(1)); | |||||
// } | |||||
//} | |||||
} | } | ||||
@@ -6,7 +6,10 @@ using System.Threading.Tasks; | |||||
namespace BPASmart.VariableManager.Models | namespace BPASmart.VariableManager.Models | ||||
{ | { | ||||
public class VarTableModel : NoticeBase | |||||
/// <summary> | |||||
/// 步科PLC | |||||
/// </summary> | |||||
public class kinco : ModbusTcp | |||||
{ | { | ||||
} | } | ||||
} | } |
@@ -1,52 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System.Collections.ObjectModel; | |||||
using BPASmart.VariableManager.Enums; | |||||
using System.IO.Ports; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using BPASmart.VariableManager.Models; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
public class CommunicationSet : ObservableObject | |||||
{ | |||||
public CommunicationSet() | |||||
{ | |||||
RemoveCommand = new RelayCommand<object>((o) => { if (RemoveAction != null) RemoveAction(o); }); | |||||
} | |||||
public Action<object> RemoveAction { get; set; } | |||||
public Siemens CommSiemens { get { return _mCommSiemens; } set { _mCommSiemens = value; OnPropertyChanged(); } } | |||||
private Siemens _mCommSiemens = new Siemens(); | |||||
public ModbusTcp CommModbusTcp { get { return _mCommModbusTcp; } set { _mCommModbusTcp = value; OnPropertyChanged(); } } | |||||
private ModbusTcp _mCommModbusTcp = new ModbusTcp(); | |||||
public ModbusRtu CommModbusRtu { get { return _mCommModbusRtu; } set { _mCommModbusRtu = value; OnPropertyChanged(); } } | |||||
private ModbusRtu _mCommModbusRtu = new ModbusRtu(); | |||||
/// <summary> | |||||
/// 是否激活 | |||||
/// </summary> | |||||
public bool IsActive { get { return _mIsActive; } set { _mIsActive = value; OnPropertyChanged(); } } | |||||
private bool _mIsActive; | |||||
/// <summary> | |||||
/// 新增设备名称 | |||||
/// </summary> | |||||
public string DeviceName { get { return _mDeviceName; } set { _mDeviceName = value; OnPropertyChanged(); } } | |||||
private string _mDeviceName; | |||||
public RelayCommand<object> RemoveCommand { get; set; } | |||||
} | |||||
} |
@@ -1,27 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
public class DeviceManagment : ObservableObject | |||||
{ | |||||
public string Content { get { return _mContent; } set { _mContent = value; OnPropertyChanged(); } } | |||||
private string _mContent; | |||||
public string CommandParameter { get { return _mCommandParameter; } set { _mCommandParameter = value; OnPropertyChanged(); } } | |||||
private string _mCommandParameter; | |||||
public string DeviceIco { get { return _mDeviceIco; } set { _mDeviceIco = value; OnPropertyChanged(); } } | |||||
private string _mDeviceIco; | |||||
public RelayCommand<object> NavChangedCommand { get; set; } | |||||
} | |||||
} |
@@ -1,26 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
public class DynamicMenu | |||||
{ | |||||
/// <summary> | |||||
/// 通讯设备菜单管理 | |||||
/// </summary> | |||||
public List<DeviceManagment> CommunDeviceManagments { get; set; } = new List<DeviceManagment>(); | |||||
/// <summary> | |||||
/// 变量菜单管理 | |||||
/// </summary> | |||||
public List<DeviceManagment> VariableManagments { get; set; } = new List<DeviceManagment>(); | |||||
/// <summary> | |||||
/// 变量监控菜单管理 | |||||
/// </summary> | |||||
public List<DeviceManagment> VariableMonitors { get; set; } = new List<DeviceManagment>(); | |||||
} | |||||
} |
@@ -1,80 +0,0 @@ | |||||
using BPASmart.VariableManager.Enums; | |||||
using Microsoft.Toolkit.Mvvm.Input; | |||||
using Newtonsoft.Json; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Collections.ObjectModel; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
/// <summary> | |||||
/// 属性绑定信息 | |||||
/// </summary> | |||||
public class PropBindInfo : VariableInfo | |||||
{ | |||||
//public PropBindInfo() | |||||
//{ | |||||
// ComboBoxItemInit(); | |||||
// //CancelCommand = new RelayCommand(() => { IsOpen = false; }); | |||||
// //ConfirmCommand = new RelayCommand(() => { IsOpen = false; }); | |||||
//} | |||||
///// <summary> | |||||
///// 数据类型下拉列表 | |||||
///// </summary> | |||||
//public ObservableCollection<string> dataType { get; set; } = new ObservableCollection<string>(); | |||||
///// <summary> | |||||
///// 报警类型下拉列表 | |||||
///// </summary> | |||||
//public ObservableCollection<string> alarmType { get; set; } = new ObservableCollection<string>(); | |||||
///// <summary> | |||||
///// 报警设置窗离散量报警类型 | |||||
///// </summary> | |||||
//public ObservableCollection<string> PopupDiscreteAlarmType { get; set; } = new ObservableCollection<string>(); | |||||
///// <summary> | |||||
///// 是否显示报警设置框 | |||||
///// </summary> | |||||
//public bool IsOpen { get { return _mIsOpen; } set { _mIsOpen = value; OnPropertyChanged(); } } | |||||
//private bool _mIsOpen; | |||||
//public bool IsRedundant { get { return _mIsRedundant; } set { _mIsRedundant = value; OnPropertyChanged(); } } | |||||
//private bool _mIsRedundant; | |||||
///// <summary> | |||||
///// 报警设置框取消操作 | |||||
///// </summary> | |||||
//public RelayCommand CancelCommand { get; set; } | |||||
///// <summary> | |||||
///// 报警设置框确认按钮 | |||||
///// </summary> | |||||
//public RelayCommand ConfirmCommand { get; set; } | |||||
///// <summary> | |||||
///// 下拉列表初始化 | |||||
///// </summary> | |||||
//private void ComboBoxItemInit() | |||||
//{ | |||||
// dataType.Clear(); | |||||
// alarmType.Clear(); | |||||
// PopupDiscreteAlarmType.Clear(); | |||||
// string[] DataTypeNames = Enum.GetNames(typeof(EDataType)); | |||||
// foreach (var item in DataTypeNames) { dataType.Add(item); } | |||||
// string[] AlarmTypeNames = Enum.GetNames(typeof(EAlarmType)); | |||||
// foreach (var item in AlarmTypeNames) { alarmType.Add(item); } | |||||
// string[] PopupAlarmTypes = Enum.GetNames(typeof(EAlongTriggerType)); | |||||
// foreach (var item in PopupAlarmTypes) { PopupDiscreteAlarmType.Add(item); } | |||||
//} | |||||
} | |||||
} |
@@ -1,44 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Collections.ObjectModel; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using BPASmart.VariableManager.Enums; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
namespace BPASmart.VariableManager.Models | |||||
{ | |||||
internal class VarMonitorPropInfo : VariableInfo | |||||
{ | |||||
public VarMonitorPropInfo() | |||||
{ | |||||
Init(); | |||||
} | |||||
/// <summary> | |||||
/// 数据显示格式 | |||||
/// </summary> | |||||
public string DataDisplayFormat { get { return _mDataDisplayFormat; } set { _mDataDisplayFormat = value; OnPropertyChanged(); } } | |||||
private string _mDataDisplayFormat; | |||||
/// <summary> | |||||
/// 修改值 | |||||
/// </summary> | |||||
public string ModifyValue { get { return _mModifyValue; } set { _mModifyValue = value; OnPropertyChanged(); } } | |||||
private string _mModifyValue; | |||||
public ObservableCollection<string> DisplayFormat { get; set; } = new ObservableCollection<string>(); | |||||
private void Init() | |||||
{ | |||||
DisplayFormat.Clear(); | |||||
foreach (var item in Enum.GetNames(typeof(DisplayFormat))) | |||||
{ | |||||
DisplayFormat.Add(item); | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -29,13 +29,6 @@ namespace BPASmart.VariableManager.ViewModels | |||||
RemoveDeviceCommand = new RelayCommand<object>(RemoveDevice); | RemoveDeviceCommand = new RelayCommand<object>(RemoveDevice); | ||||
SaveConnectSetCommand = new RelayCommand(() => { Json<CommunicationPar>.Save(); }); | SaveConnectSetCommand = new RelayCommand(() => { Json<CommunicationPar>.Save(); }); | ||||
//Json<CommunicationPar>.Read(); | |||||
//foreach (var item in Json<CommunicationPar>.Data.CommunicationDevices) | |||||
//{ | |||||
// //item.RemoveAction = RemoveDevice; | |||||
// Json<CommunicationPar>.Data.CommunicationDevices.Add(item); | |||||
//} | |||||
DelegationNotifi.GetInstance.AddDeviceVerify = new Func<DeviceManagermentResult, bool>((p) => | DelegationNotifi.GetInstance.AddDeviceVerify = new Func<DeviceManagermentResult, bool>((p) => | ||||
{ | { | ||||
return Json<CommunicationPar>.Data.CommunicationDevices.FirstOrDefault(s => s.DeviceName == p.DeviceName) == null; | return Json<CommunicationPar>.Data.CommunicationDevices.FirstOrDefault(s => s.DeviceName == p.DeviceName) == null; | ||||
@@ -1,75 +0,0 @@ | |||||
using BPASmart.VariableManager.Models; | |||||
using Microsoft.EntityFrameworkCore; | |||||
using Microsoft.Toolkit.Mvvm.ComponentModel; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Collections.ObjectModel; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmart.VariableManager.ViewModels | |||||
{ | |||||
internal class VariableMonitorViewModel : ObservableObject | |||||
{ | |||||
public VariableMonitorViewModel() | |||||
{ | |||||
GetLocalDataAsync(); | |||||
} | |||||
/// <summary> | |||||
/// 异步获取本地数据 | |||||
/// </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); })); | |||||
// } | |||||
//} | |||||
return Task.FromResult(true); | |||||
} | |||||
/// <summary> | |||||
/// 异步保存数据 | |||||
/// </summary> | |||||
/// <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.Save(); | |||||
return Task.FromResult(true); | |||||
} | |||||
/// <summary> | |||||
/// 变量信息 | |||||
/// </summary> | |||||
public ObservableCollection<VarMonitorPropInfo> varialeInfos { get; set; } = new ObservableCollection<VarMonitorPropInfo>(); | |||||
} | |||||
} | |||||
@@ -1,284 +0,0 @@ | |||||
<UserControl | |||||
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:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmart.VariableManager.Views" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:vm="clr-namespace:BPASmart.VariableManager.ViewModels" | |||||
d:DesignHeight="450" | |||||
d:DesignWidth="1000" | |||||
mc:Ignorable="d"> | |||||
<UserControl.DataContext> | |||||
<vm:VariableMonitorViewModel /> | |||||
</UserControl.DataContext> | |||||
<UserControl.Resources> | |||||
<!--<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> | |||||
</ResourceDictionary>--> | |||||
</UserControl.Resources> | |||||
<Grid Margin="10"> | |||||
<Grid.RowDefinitions> | |||||
<RowDefinition Height="35" /> | |||||
<RowDefinition Height="40" /> | |||||
<RowDefinition /> | |||||
</Grid.RowDefinitions> | |||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> | |||||
<!--<Button | |||||
Width="140" | |||||
Margin="0,0,20,0" | |||||
Background="#FF19B7EC" | |||||
Command="{Binding NewConnectCommand}" | |||||
Content="开始监控" | |||||
FontFamily="楷体" | |||||
FontSize="18" | |||||
Template="{StaticResource NewButtonTemp}"> | |||||
<Button.Foreground> | |||||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | |||||
<GradientStop Color="#FFBB662A" /> | |||||
<GradientStop Offset="1" Color="White" /> | |||||
</LinearGradientBrush> | |||||
</Button.Foreground> | |||||
</Button>--> | |||||
<!--<Button | |||||
Width="140" | |||||
Margin="0,0,20,0" | |||||
Background="#FF19B7EC" | |||||
Command="{Binding NewConnectCommand}" | |||||
Content="停止监控" | |||||
FontFamily="楷体" | |||||
FontSize="18" | |||||
Template="{StaticResource NewButtonTemp}"> | |||||
<Button.Foreground> | |||||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> | |||||
<GradientStop Color="#FFBB662A" /> | |||||
<GradientStop Offset="1" Color="White" /> | |||||
</LinearGradientBrush> | |||||
</Button.Foreground> | |||||
</Button>--> | |||||
</StackPanel> | |||||
<!--#region 表格标题栏设置--> | |||||
<Grid Grid.Row="1" Margin="0 10 0 0" Background="#dd2AB2E7"> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.3*" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="ID" /> | |||||
<Grid Grid.Column="1"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="名称" /> | |||||
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="2" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="地址" /> | |||||
<Grid Grid.Column="3"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="数据类型" /> | |||||
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<Grid Grid.Column="5"> | |||||
<TextBlock | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="数据显示格式" /> | |||||
<Border BorderBrush="{StaticResource TitleBorderColor}" BorderThickness="0,0,1,0" /> | |||||
</Grid> | |||||
<TextBlock | |||||
Grid.Column="6" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="当前值" /> | |||||
<TextBlock | |||||
Grid.Column="7" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
FontSize="16" | |||||
Foreground="{StaticResource TitleFontColor}" | |||||
Text="修改值" /> | |||||
</Grid> | |||||
<!--#endregion--> | |||||
<!--#region 表格数据显示--> | |||||
<ScrollViewer | |||||
Grid.Row="2" | |||||
HorizontalScrollBarVisibility="Hidden" | |||||
VerticalScrollBarVisibility="Hidden"> | |||||
<ItemsControl ItemsSource="{Binding varialeInfos}"> | |||||
<ItemsControl.ItemTemplate> | |||||
<DataTemplate> | |||||
<Grid> | |||||
<Grid.ColumnDefinitions> | |||||
<ColumnDefinition Width="0.3*" /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0" /> | |||||
<ColumnDefinition Width="0.7*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
<ColumnDefinition Width="0.5*" /> | |||||
</Grid.ColumnDefinitions> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
FontSize="14" | |||||
Foreground="{StaticResource FontColor}" | |||||
Text="{Binding ID}" /> | |||||
<Grid Grid.Column="1"> | |||||
<!--<TextBox | |||||
Background="Transparent" | |||||
CaretBrush="{StaticResource CursorColor}" | |||||
Foreground="{StaticResource FontColor}" | |||||
Style="{StaticResource InputTextboxStyle}" | |||||
Text="{Binding VarName}" />--> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<!--<TextBox | |||||
Grid.Column="2" | |||||
Background="Transparent" | |||||
CaretBrush="{StaticResource CursorColor}" | |||||
Foreground="{StaticResource FontColor}" | |||||
Style="{StaticResource InputTextboxStyle}" | |||||
Text="{Binding Address}" />--> | |||||
<Grid Grid.Column="3"> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
FontSize="14" | |||||
Foreground="{StaticResource FontColor}" | |||||
Text="{Binding DataType}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="1,0,1,0" /> | |||||
</Grid> | |||||
<Grid Grid.Column="5"> | |||||
<ComboBox | |||||
VerticalAlignment="Center" | |||||
BorderBrush="Transparent" | |||||
BorderThickness="1" | |||||
FontFamily="楷体" | |||||
FontSize="20" | |||||
Foreground="{StaticResource FontColor}" | |||||
IsEditable="False" | |||||
ItemsSource="{Binding DisplayFormat}" | |||||
SelectedValue="{Binding DataDisplayFormat}" | |||||
Style="{StaticResource ComboBoxStyle}" | |||||
Text="{Binding DataDisplayFormat}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" /> | |||||
</Grid> | |||||
<Grid Grid.Column="6"> | |||||
<TextBlock | |||||
Grid.Column="0" | |||||
HorizontalAlignment="Center" | |||||
VerticalAlignment="Center" | |||||
Background="Transparent" | |||||
FontSize="14" | |||||
Foreground="{StaticResource FontColor}" | |||||
Text="{Binding CurrentValue}" /> | |||||
<Border BorderBrush="{StaticResource BorderSolid}" BorderThickness="0,0,1,0" /> | |||||
</Grid> | |||||
<!--<TextBox | |||||
Grid.Column="7" | |||||
Background="Transparent" | |||||
CaretBrush="{StaticResource CursorColor}" | |||||
Foreground="{StaticResource FontColor}" | |||||
Style="{StaticResource InputTextboxStyle}" | |||||
Text="{Binding ModifyValue}" />--> | |||||
<Border | |||||
Grid.ColumnSpan="8" | |||||
BorderBrush="{StaticResource BorderSolid}" | |||||
BorderThickness="1" /> | |||||
</Grid> | |||||
</DataTemplate> | |||||
</ItemsControl.ItemTemplate> | |||||
</ItemsControl> | |||||
</ScrollViewer> | |||||
<!--#endregion--> | |||||
</Grid> | |||||
</UserControl> |
@@ -1,28 +0,0 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
using System.Windows.Controls; | |||||
using System.Windows.Data; | |||||
using System.Windows.Documents; | |||||
using System.Windows.Input; | |||||
using System.Windows.Media; | |||||
using System.Windows.Media.Imaging; | |||||
using System.Windows.Navigation; | |||||
using System.Windows.Shapes; | |||||
namespace BPASmart.VariableManager.Views | |||||
{ | |||||
/// <summary> | |||||
/// VariableMonitorView.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class VariableMonitorView : UserControl | |||||
{ | |||||
public VariableMonitorView() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -1,6 +1,5 @@ | |||||
using BPASmartClient.CustomResource.Pages.ViewModel; | using BPASmartClient.CustomResource.Pages.ViewModel; | ||||
using BPASmartClient.Helper; | using BPASmartClient.Helper; | ||||
//using BPASmartClient.Message; | |||||
using BPASmartClient.Model; | using BPASmartClient.Model; | ||||
using System; | using System; | ||||
using System.Collections.Concurrent; | using System.Collections.Concurrent; | ||||
@@ -48,6 +47,15 @@ namespace BPASmartClient.CustomResource.Pages.Model | |||||
} | } | ||||
//public static void AnalogAlarm(dynamic Trigger, string info, dynamic HH = null, dynamic H = 0, dynamic L = 0, dynamic LL = 0) | |||||
//{ | |||||
//} | |||||
/// <summary> | /// <summary> | ||||
/// 沿报警检测 | /// 沿报警检测 | ||||
/// </summary> | /// </summary> | ||||