From d2e1ed171a696fbbcd66e351c104989512029c78 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com>
Date: Thu, 8 Sep 2022 14:26:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=AE=A1=E7=90=86=E7=B1=BB?=
=?UTF-8?q?=E5=9E=8B=E9=85=8D=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Converter/DeviceVisibleConverter.cs | 3 +-
.../Models/AnalogAlarmInfo.cs | 43 ---
.../Models/CommDeviceModel/Invoance.cs | 15 +
.../Models/CommDeviceModel/KincoOneMachine.cs | 15 +
.../Models/CommDeviceModel/ModbusRtu.cs | 41 ---
.../Models/CommDeviceModel/ModbusTcp.cs | 4 -
.../Models/CommDeviceModel/Siemens.cs | 21 --
.../kinco.cs} | 5 +-
.../Models/CommunicationSet.cs | 52 ----
.../Models/DeviceManagment.cs | 27 --
.../Models/DynamicMenu.cs | 26 --
.../Models/PropBindInfo.cs | 80 -----
.../Models/VarMonitorPropInfo.cs | 44 ---
.../ViewModels/CommunicationSetViewModel.cs | 7 -
.../ViewModels/VariableMonitorViewModel.cs | 75 -----
.../Views/VariableMonitorView.xaml | 284 ------------------
.../Views/VariableMonitorView.xaml.cs | 28 --
.../Pages/Model/AlarmHelper.cs | 10 +-
18 files changed, 45 insertions(+), 735 deletions(-)
delete mode 100644 BPASmart.VariableManager/Models/AnalogAlarmInfo.cs
create mode 100644 BPASmart.VariableManager/Models/CommDeviceModel/Invoance.cs
create mode 100644 BPASmart.VariableManager/Models/CommDeviceModel/KincoOneMachine.cs
rename BPASmart.VariableManager/Models/{VarTableModel.cs => CommDeviceModel/kinco.cs} (66%)
delete mode 100644 BPASmart.VariableManager/Models/CommunicationSet.cs
delete mode 100644 BPASmart.VariableManager/Models/DeviceManagment.cs
delete mode 100644 BPASmart.VariableManager/Models/DynamicMenu.cs
delete mode 100644 BPASmart.VariableManager/Models/PropBindInfo.cs
delete mode 100644 BPASmart.VariableManager/Models/VarMonitorPropInfo.cs
delete mode 100644 BPASmart.VariableManager/ViewModels/VariableMonitorViewModel.cs
delete mode 100644 BPASmart.VariableManager/Views/VariableMonitorView.xaml
delete mode 100644 BPASmart.VariableManager/Views/VariableMonitorView.xaml.cs
diff --git a/BPASmart.VariableManager/Converter/DeviceVisibleConverter.cs b/BPASmart.VariableManager/Converter/DeviceVisibleConverter.cs
index 0892559a..557bd01e 100644
--- a/BPASmart.VariableManager/Converter/DeviceVisibleConverter.cs
+++ b/BPASmart.VariableManager/Converter/DeviceVisibleConverter.cs
@@ -18,7 +18,8 @@ namespace BPASmart.VariableManager.Converter
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;
else
return Visibility.Collapsed;
diff --git a/BPASmart.VariableManager/Models/AnalogAlarmInfo.cs b/BPASmart.VariableManager/Models/AnalogAlarmInfo.cs
deleted file mode 100644
index 6772a903..00000000
--- a/BPASmart.VariableManager/Models/AnalogAlarmInfo.cs
+++ /dev/null
@@ -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
-{
- ///
- /// 模拟量报警信息
- ///
- [Table(nameof(AnalogAlarmInfo))]
- public class AnalogAlarmInfo
- {
- //[Key]
- //public int Id { get; set; }
-
- /////
- ///// 高高报警
- /////
- //public AnalogAlarmModel Condition_HIHI_Value { get; set; } = new AnalogAlarmModel();
- /////
- ///// 高报警
- /////
- //public AnalogAlarmModel Condition_HI_Value { get; set; } = new AnalogAlarmModel();
- /////
- ///// 低低报警
- /////
- //public AnalogAlarmModel Condition_LOLO_Value { get; set; } = new AnalogAlarmModel();
- /////
- ///// 低报警
- /////
- //public AnalogAlarmModel Condition_LO_Value { get; set; } = new AnalogAlarmModel();
-
- //[ForeignKey("AlarmSetId")]
- //public int AlarmSetId { get; set; }
-
- //public AlarmSet AlarmSet { get; set; }
-
- }
-}
diff --git a/BPASmart.VariableManager/Models/CommDeviceModel/Invoance.cs b/BPASmart.VariableManager/Models/CommDeviceModel/Invoance.cs
new file mode 100644
index 00000000..2870607d
--- /dev/null
+++ b/BPASmart.VariableManager/Models/CommDeviceModel/Invoance.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmart.VariableManager.Models
+{
+ ///
+ /// 汇川PLC
+ ///
+ public class Invoance : ModbusTcp
+ {
+ }
+}
diff --git a/BPASmart.VariableManager/Models/CommDeviceModel/KincoOneMachine.cs b/BPASmart.VariableManager/Models/CommDeviceModel/KincoOneMachine.cs
new file mode 100644
index 00000000..cfef2d29
--- /dev/null
+++ b/BPASmart.VariableManager/Models/CommDeviceModel/KincoOneMachine.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace BPASmart.VariableManager.Models
+{
+ ///
+ /// 步科一体机
+ ///
+ public class KincoOneMachine : ModbusTcp
+ {
+ }
+}
diff --git a/BPASmart.VariableManager/Models/CommDeviceModel/ModbusRtu.cs b/BPASmart.VariableManager/Models/CommDeviceModel/ModbusRtu.cs
index aade69db..3520c84e 100644
--- a/BPASmart.VariableManager/Models/CommDeviceModel/ModbusRtu.cs
+++ b/BPASmart.VariableManager/Models/CommDeviceModel/ModbusRtu.cs
@@ -12,15 +12,6 @@ namespace BPASmart.VariableManager.Models
{
public class ModbusRtu : ICommunicationDevice
{
- //public ModbusRtu()
- //{
- // Init();
- //}
-
- ///
- /// 显示/隐藏设置
- ///
- //public Visibility ModbusRtuVisible { get; set; } = Visibility.Collapsed;
///
/// 串口端口
@@ -52,37 +43,5 @@ namespace BPASmart.VariableManager.Models
///
public string Parity { get; set; }
-
- //public ObservableCollection Ports { get; set; } = new ObservableCollection();
-
- //public ObservableCollection BaudRates { get; set; } = new ObservableCollection();
-
- //public ObservableCollection Paritys { get; set; } = new ObservableCollection();
-
- //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);
- // }
- //}
}
}
diff --git a/BPASmart.VariableManager/Models/CommDeviceModel/ModbusTcp.cs b/BPASmart.VariableManager/Models/CommDeviceModel/ModbusTcp.cs
index 29f5a44c..ebf6241a 100644
--- a/BPASmart.VariableManager/Models/CommDeviceModel/ModbusTcp.cs
+++ b/BPASmart.VariableManager/Models/CommDeviceModel/ModbusTcp.cs
@@ -9,10 +9,6 @@ namespace BPASmart.VariableManager.Models
{
public class ModbusTcp : ICommunicationDevice
{
- ///
- /// 显示/隐藏设置
- ///
- //public Visibility ModbusTcpVisible { get; set; } = Visibility.Collapsed;
///
/// IP地址
diff --git a/BPASmart.VariableManager/Models/CommDeviceModel/Siemens.cs b/BPASmart.VariableManager/Models/CommDeviceModel/Siemens.cs
index 6a5d97fd..4f67206a 100644
--- a/BPASmart.VariableManager/Models/CommDeviceModel/Siemens.cs
+++ b/BPASmart.VariableManager/Models/CommDeviceModel/Siemens.cs
@@ -11,15 +11,6 @@ namespace BPASmart.VariableManager.Models
{
public class Siemens : ICommunicationDevice
{
- //public Siemens()
- //{
- // Init();
- //}
-
- ///
- /// 显示/隐藏设置
- ///
- //public Visibility SiemensVisible { get; set; } = Visibility.Collapsed;
///
/// IP地址
@@ -46,18 +37,6 @@ namespace BPASmart.VariableManager.Models
///
public string PlcType { get; set; }
- //public ObservableCollection PlcTypes { get; set; } = new ObservableCollection();
-
- //private void Init()
- //{
- // PlcTypes.Clear();
- // foreach (var item in Enum.GetNames(typeof(ESiemensPlcType)))
- // {
- // PlcTypes.Add(item.Substring(1));
- // }
- //}
-
-
}
diff --git a/BPASmart.VariableManager/Models/VarTableModel.cs b/BPASmart.VariableManager/Models/CommDeviceModel/kinco.cs
similarity index 66%
rename from BPASmart.VariableManager/Models/VarTableModel.cs
rename to BPASmart.VariableManager/Models/CommDeviceModel/kinco.cs
index 6ab9192a..fdd99955 100644
--- a/BPASmart.VariableManager/Models/VarTableModel.cs
+++ b/BPASmart.VariableManager/Models/CommDeviceModel/kinco.cs
@@ -6,7 +6,10 @@ using System.Threading.Tasks;
namespace BPASmart.VariableManager.Models
{
- public class VarTableModel : NoticeBase
+ ///
+ /// 步科PLC
+ ///
+ public class kinco : ModbusTcp
{
}
}
diff --git a/BPASmart.VariableManager/Models/CommunicationSet.cs b/BPASmart.VariableManager/Models/CommunicationSet.cs
deleted file mode 100644
index 93e7ac88..00000000
--- a/BPASmart.VariableManager/Models/CommunicationSet.cs
+++ /dev/null
@@ -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