OPC-UA + MTConnect
- deadband threshold: conversione INT a float
This commit is contained in:
@@ -405,12 +405,12 @@ namespace IOB_UT_NEXT
|
||||
/// <summary>
|
||||
/// Dictionary dei nomi da cercare come "endsWith" a cui applicare la soglia indicata
|
||||
/// </summary>
|
||||
public Dictionary<string, int> paramsEndThresh { get; set; } = new Dictionary<string, int>();
|
||||
public Dictionary<string, float> paramsEndThresh { get; set; } = new Dictionary<string, float>();
|
||||
|
||||
/// <summary>
|
||||
/// Dictionary dei nomi da cercare come "contains" a cui applicare la soglia indicata
|
||||
/// </summary>
|
||||
public Dictionary<string, int> paramsContainsThresh { get; set; } = new Dictionary<string, int>();
|
||||
public Dictionary<string, float> paramsContainsThresh { get; set; } = new Dictionary<string, float>();
|
||||
|
||||
/// <summary>
|
||||
/// Indica se il ping sia un criterio valido x determinare powerON impianto
|
||||
|
||||
@@ -525,7 +525,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
// provo a creare oggetot in memoria...
|
||||
List<machDataItem> elencoDataItems = new List<machDataItem>();
|
||||
int dSamplePeriod = 0;
|
||||
int threshDBand = 0;
|
||||
float threshDBand = 0;
|
||||
string uuid = "";
|
||||
var currDataItem = formatDataItem(ref dSamplePeriod, ref threshDBand, ref uuid, newValue);
|
||||
// aggiungo
|
||||
@@ -622,7 +622,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
{
|
||||
List<machDataItem> elencoDataItems = new List<machDataItem>();
|
||||
int dSamplePeriod = 0;
|
||||
int threshDBand = 0;
|
||||
float threshDBand = 0;
|
||||
string uuid = "";
|
||||
var currDataItem = formatDataItem(ref dSamplePeriod, ref threshDBand, ref uuid, newValue);
|
||||
// aggiungo
|
||||
@@ -688,7 +688,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
machDataItem currMapoDataItem = null;
|
||||
List<machDataItem> elencoDataItems = new List<machDataItem>();
|
||||
int dSamplePeriod = 0;
|
||||
int threshDBand = 0;
|
||||
float threshDBand = 0;
|
||||
string uuid = "";
|
||||
if (document != null)
|
||||
{
|
||||
@@ -1195,7 +1195,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="DISample"></param>
|
||||
/// <returns></returns>
|
||||
private MtcDataItemExt formatDataItem(ref int dSamplePeriod, ref int threshDBand, ref string uuid, MTConnectStreams.Sample DISample)
|
||||
private MtcDataItemExt formatDataItem(ref int dSamplePeriod, ref float threshDBand, ref string uuid, MTConnectStreams.Sample DISample)
|
||||
{
|
||||
// creo il nuovo dataitem da sample...
|
||||
MTConnectDevices.DataItem newDataItem = new MTConnectDevices.DataItem()
|
||||
@@ -1219,7 +1219,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="DIGen"></param>
|
||||
/// <returns></returns>
|
||||
private MtcDataItemExt formatDataItem(ref int dSamplePeriod, ref int threshDBand, ref string uuid, MTConnectStreams.DataItem DIGen)
|
||||
private MtcDataItemExt formatDataItem(ref int dSamplePeriod, ref float threshDBand, ref string uuid, MTConnectStreams.DataItem DIGen)
|
||||
{
|
||||
// creo il nuovo dataitem da sample...
|
||||
MTConnectDevices.DataItem newDataItem = new MTConnectDevices.DataItem()
|
||||
@@ -1241,7 +1241,7 @@ namespace IOB_WIN_NEXT.Iob
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="dataItem"></param>
|
||||
/// <returns></returns>
|
||||
private MtcDataItemExt formatDataItem(ref int dSamplePeriod, ref int threshDBand, ref string uuid, MTConnectDevices.DataItem dataItem)
|
||||
private MtcDataItemExt formatDataItem(ref int dSamplePeriod, ref float threshDBand, ref string uuid, MTConnectDevices.DataItem dataItem)
|
||||
{
|
||||
MtcDataItemExt currDataItem;
|
||||
// uuid e parametri secondo categoria...
|
||||
|
||||
@@ -913,8 +913,11 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
string varDef = item.Value.memAddr.Substring(iPos + 1);
|
||||
string convVal = ConvBArr(rByte, varDef, opcUaParams.memDelim);
|
||||
// metto in array currData...
|
||||
upsertKey(item.Key, convVal);
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
if (upsertKey(item.Key, convVal))
|
||||
{
|
||||
// accodo se variato!
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -940,8 +943,11 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
string varDef = item.Value.memAddr.Substring(iPos + 1);
|
||||
string convVal = ConvBArr(rByte, varDef, opcUaParams.memDelim);
|
||||
// metto in array currData...
|
||||
upsertKey(item.Key, convVal);
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
if (upsertKey(item.Key, convVal))
|
||||
{
|
||||
// accodo se variato!
|
||||
accodaFLog($"mMapRead | {item.Key} | {convVal}", qEncodeFLog(item.Key, convVal));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1475,7 +1481,7 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
try
|
||||
{
|
||||
int dSamplePeriod = 0;
|
||||
int threshDBand = 0;
|
||||
float threshDBand = 0;
|
||||
uuid = "";
|
||||
var currDataItem = formatDataItem(ref dSamplePeriod, ref threshDBand, ref uuid, dataItem);
|
||||
// sistemo valore/periodo
|
||||
@@ -2149,7 +2155,7 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
subscribedItems = UA_ref.SubscribeToDataChanges(selectedItemList);
|
||||
// aggiungo come DataItems
|
||||
int dSamplePeriod = 0;
|
||||
int threshDBand = 0;
|
||||
float threshDBand = 0;
|
||||
string uuid = "";
|
||||
foreach (var item in subscribedItems)
|
||||
{
|
||||
@@ -2246,7 +2252,7 @@ namespace IOB_WIN_NEXT.IobOpc
|
||||
/// <param name="uuid"></param>
|
||||
/// <param name="dataItem"></param>
|
||||
/// <returns></returns>
|
||||
private OpcUaDataItemExt formatDataItem(ref int dSamplePeriod, ref int threshDBand, ref string uuid, Opc.Ua.Client.MonitoredItem dataItem)
|
||||
private OpcUaDataItemExt formatDataItem(ref int dSamplePeriod, ref float threshDBand, ref string uuid, Opc.Ua.Client.MonitoredItem dataItem)
|
||||
{
|
||||
OpcUaDataItemExt currDataItem;
|
||||
// calcolo parametri secondo conf UniqueID
|
||||
|
||||
Reference in New Issue
Block a user