@@ -10,5 +10,6 @@ namespace BPASmart.Model | |||||
{ | { | ||||
public string VarName { get; set; } | public string VarName { get; set; } | ||||
public string VarVaule { get; set; } | public string VarVaule { get; set; } | ||||
public EDataType DataType { get; set; } | |||||
} | } | ||||
} | } |
@@ -17,7 +17,7 @@ namespace BPASmart.Model | |||||
{ | { | ||||
public class VariableInfo : AlarmSet | public class VariableInfo : AlarmSet | ||||
{ | { | ||||
private ICommunicationDevice DeviceType; | |||||
private ICommunicationDevice DeviceType = new kinco(); | |||||
public VariableInfo(params object[] s) | public VariableInfo(params object[] s) | ||||
{ | { | ||||
if (s != null && s.Length >= 0) | if (s != null && s.Length >= 0) | ||||
@@ -185,7 +185,8 @@ namespace BPASmart.Server | |||||
reeisDataModels.Add(new ReeisDataModel() | reeisDataModels.Add(new ReeisDataModel() | ||||
{ | { | ||||
VarName = tempVar.VarName, | VarName = tempVar.VarName, | ||||
VarVaule = tempVar.CurrentValue | |||||
VarVaule = tempVar.CurrentValue, | |||||
DataType = (EDataType)Enum.Parse(typeof(EDataType), tempVar.DataType) | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
@@ -112,6 +112,17 @@ namespace BPASmart.VariableManager | |||||
private void DataSave() | private void DataSave() | ||||
{ | { | ||||
for (int i = 0; i < Json<CommunicationPar>.Data.CommunicationDevices.Count; i++) | |||||
{ | |||||
for (int m = 0; m < Json<CommunicationPar>.Data.CommunicationDevices.ElementAt(i).VarTableModels.Count; m++) | |||||
{ | |||||
var deviceType = Json<CommunicationPar>.Data.CommunicationDevices.ElementAt(i).CommDevice; | |||||
var deviceValue = Json<CommunicationPar>.Data.CommunicationDevices.ElementAt(i).VarTableModels.ElementAt(m).Address; | |||||
string RealAddress = AddressConvert.GetInstance.PlcConverter(deviceType, deviceValue); | |||||
Json<CommunicationPar>.Data.CommunicationDevices.ElementAt(i).VarTableModels.ElementAt(m).RealAddress = RealAddress; | |||||
} | |||||
} | |||||
Json<CommunicationPar>.Save(); | Json<CommunicationPar>.Save(); | ||||
} | } | ||||
@@ -2,6 +2,7 @@ using BPA.Helper; | |||||
using BPASmart.Model; | using BPASmart.Model; | ||||
using BPA.Communication; | using BPA.Communication; | ||||
using Newtonsoft.Json; | using Newtonsoft.Json; | ||||
using System.Diagnostics; | |||||
namespace ComputerTestDemo | namespace ComputerTestDemo | ||||
{ | { | ||||
@@ -22,6 +23,14 @@ namespace ComputerTestDemo | |||||
})); | })); | ||||
} | } | ||||
private TResult GetData<TResult>() | |||||
{ | |||||
Type type = typeof(TResult); | |||||
var name = type.Name; | |||||
Debug.WriteLine(name); | |||||
return default; | |||||
} | |||||
MqttHelper mqttHelper = new MqttHelper(); | MqttHelper mqttHelper = new MqttHelper(); | ||||
private void MqttInit() | private void MqttInit() | ||||
{ | { | ||||