Inizio move oggetti in SDK da IOB-WIN

This commit is contained in:
Samuele E. Locatelli
2019-11-07 11:21:44 +01:00
parent a626f3c791
commit 302f4226d8
3 changed files with 111 additions and 3 deletions
+49
View File
@@ -1,6 +1,55 @@
namespace MapoSDK
{
/// <summary>
/// Tipologia di elaborazione/funzione da applicare a VC
/// </summary>
public enum VC_func
{
/// <summary>
/// Valore puntuale
/// </summary>
POINT = 0,
/// <summary>
/// Valore medio del periodo
/// </summary>
AVG,
/// <summary>
/// Valore massimo del periodo
/// </summary>
MAX,
/// <summary>
/// Valore minimo del periodo
/// </summary>
MIN
}
/// <summary>
/// Elenco dei tipi di valore gestiti da PLC (inizialmente SIEMENS)
/// </summary>
public enum plcDataType
{
/// <summary>
/// Tipo boolean
/// </summary>
Boolean,
/// <summary>
/// Tipo intero 16bit
/// </summary>
Int,
/// <summary>
/// Tipo intero 32bit
/// </summary>
DInt,
/// <summary>
/// Tipo REAL 32 bit
/// </summary>
Real,
/// <summary>
/// Tipo stringa
/// </summary>
String
}
/// <summary>
/// Elenco task ammessi (x IOB-WIN da eseguire...)
/// </summary>
-1
View File
@@ -47,7 +47,6 @@
<Link>MoonPro.cs</Link>
</Compile>
<Compile Include="Enums.cs" />
<Compile Include="JsonConverterAttribute.cs" />
<Compile Include="Objects.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
+62 -2
View File
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace MapoSDK
{
#region oggetti per scambio dati IO - IOB
public class fileEmbed
@@ -78,6 +78,66 @@ namespace MapoSDK
public bool CNC_Counter;
}
/// <summary>
/// Struttura conf tipo dati
/// </summary>
public class dataConf
{
/// <summary>
/// NOME parametro
/// </summary>
public string name { get; set; } = "none";
/// <summary>
/// Tipo di dato
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public plcDataType tipoMem { get; set; } = plcDataType.Int;
/// <summary>
/// Indice nell'area di memoria (da valore iniziale = 0)
/// </summary>
public int index { get; set; } = 0;
/// <summary>
/// Nome "assoluto" della posizione nell'area di memoria (anche diverso da indice)
/// </summary>
public string memAddr { get; set; } = "";
/// <summary>
/// Size in byte
/// </summary>
public int size { get; set; } = 0;
/// <summary>
/// Fattore per eventuale divisione (es leggo 1234 --> 12,34 con factor=100)
/// </summary>
public int factor { get; set; } = 1;
/// <summary>
/// Valore parametro (come stringa, decimali con ",")
/// </summary>
public string value { get; set; } = "0";
/// <summary>
/// Valore minimo ammesso (ove usato, es simulazione)
/// </summary>
public int minVal { get; set; } = 0;
/// <summary>
/// Valore massimo ammesso (ove usato, es simulazione)
/// </summary>
public int maxVal { get; set; } = 9999;
}
/// <summary>
/// Struttura conf tipo dati
/// </summary>
public class dataConfTSVC : dataConf
{
/// <summary>
/// Tipo di funzione da applicare al dato
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public VC_func func { get; set; } = VC_func.MAX;
/// <summary>
/// Periodo campionamento
/// </summary>
public int period { get; set; } = 60;
}
#endregion