Quellcode durchsuchen

变量管理器修改

样式分支
pry vor 2 Jahren
Ursprung
Commit
2135215b94
5 geänderte Dateien mit 24 neuen und 2 gelöschten Zeilen
  1. +1
    -0
      BPASmart.Model/RedisDataModel.cs
  2. +1
    -1
      BPASmart.Model/VariableInfo.cs
  3. +2
    -1
      BPASmart.Server/CommunicationServer.cs
  4. +11
    -0
      BPASmart.VariableManager/App.xaml.cs
  5. +9
    -0
      ComputerTestDemo/Form1.cs

+ 1
- 0
BPASmart.Model/RedisDataModel.cs Datei anzeigen

@@ -10,5 +10,6 @@ namespace BPASmart.Model
{
public string VarName { get; set; }
public string VarVaule { get; set; }
public EDataType DataType { get; set; }
}
}

+ 1
- 1
BPASmart.Model/VariableInfo.cs Datei anzeigen

@@ -17,7 +17,7 @@ namespace BPASmart.Model
{
public class VariableInfo : AlarmSet
{
private ICommunicationDevice DeviceType;
private ICommunicationDevice DeviceType = new kinco();
public VariableInfo(params object[] s)
{
if (s != null && s.Length >= 0)


+ 2
- 1
BPASmart.Server/CommunicationServer.cs Datei anzeigen

@@ -185,7 +185,8 @@ namespace BPASmart.Server
reeisDataModels.Add(new ReeisDataModel()
{
VarName = tempVar.VarName,
VarVaule = tempVar.CurrentValue
VarVaule = tempVar.CurrentValue,
DataType = (EDataType)Enum.Parse(typeof(EDataType), tempVar.DataType)
});
}
});


+ 11
- 0
BPASmart.VariableManager/App.xaml.cs Datei anzeigen

@@ -112,6 +112,17 @@ namespace BPASmart.VariableManager

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();
}



+ 9
- 0
ComputerTestDemo/Form1.cs Datei anzeigen

@@ -2,6 +2,7 @@ using BPA.Helper;
using BPASmart.Model;
using BPA.Communication;
using Newtonsoft.Json;
using System.Diagnostics;

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();
private void MqttInit()
{


Laden…
Abbrechen
Speichern