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