Merge branch 'release/UpdateCallMTC_01'
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace IOB_UT_NEXT
|
||||
{
|
||||
@@ -649,7 +650,6 @@ namespace IOB_UT_NEXT
|
||||
/// </summary>
|
||||
public bool doSubsSample { get; set; } = true;
|
||||
|
||||
|
||||
#endregion Public Properties
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,16 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
protected bool enableCliRestart = false;
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione invio dataitem
|
||||
/// </summary>
|
||||
protected bool enableSendDataItem = true;
|
||||
protected int minVetoSendDataItem = 60;
|
||||
/// <summary>
|
||||
/// DataOra x veto all'invio dataItem
|
||||
/// </summary>
|
||||
protected DateTime dtVetoSenDataItem= DateTime.Now;
|
||||
|
||||
/// <summary>
|
||||
/// Boolean x indicare contapezzi abilitato a livello di conf applicazione
|
||||
/// </summary>
|
||||
|
||||
@@ -64,6 +64,10 @@ ENABLE_CLI_RESTART=TRUE
|
||||
MAX_ELAPSED_TIME_SEC=60
|
||||
READ_ERROR_MAX=10
|
||||
READ_ERROR_SLEEP_TIME=30000
|
||||
; gestione custom timer
|
||||
timerIntMs=150
|
||||
ENABLE_SEND_DATAITEM=true
|
||||
MIN_VETO_SEND_DATAITEM=120
|
||||
|
||||
; conf parametri memoria READ/WRITE
|
||||
MTC_PARAM_CONF=3024.json
|
||||
|
||||
+19
-36
@@ -39,7 +39,6 @@ namespace IOB_WIN_MTC.Iob
|
||||
readErrorSleepTime = IobConfFull.Device.ReadErrorSleepTime;
|
||||
enableCliRestart = IobConfFull.Device.Connect.EnableRestart;
|
||||
|
||||
|
||||
// gestione data unavailable = poweroff...
|
||||
if (!string.IsNullOrEmpty(getOptPar("UNAVAIL_POWEROFF")))
|
||||
{
|
||||
@@ -50,39 +49,16 @@ namespace IOB_WIN_MTC.Iob
|
||||
{
|
||||
bool.TryParse(getOptPar("ENABLE_MTC_RESTART"), out enableMtcRestart);
|
||||
}
|
||||
|
||||
// gestione override contapezzi
|
||||
|
||||
|
||||
// vecchia gestione custom OPT_PAR
|
||||
#if false
|
||||
// gestione data filtering...
|
||||
if (!string.IsNullOrEmpty(getOptPar("ENABLE_DATA_FILTER")))
|
||||
// gestione parametri x sendDataItem
|
||||
if (!string.IsNullOrEmpty(getOptPar("ENABLE_SEND_DATAITEM")))
|
||||
{
|
||||
bool.TryParse(getOptPar("ENABLE_DATA_FILTER"), out enableDataFilter);
|
||||
}
|
||||
// init MaxSecReload
|
||||
if (!string.IsNullOrEmpty(getOptPar("MAX_ELAPSED_TIME_SEC")))
|
||||
bool.TryParse(getOptPar("ENABLE_SEND_DATAITEM"), out enableSendDataItem);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getOptPar("MIN_VETO_SEND_DATAITEM")))
|
||||
{
|
||||
int.TryParse(getOptPar("MAX_ELAPSED_TIME_SEC"), out MaxSecReload);
|
||||
int.TryParse(getOptPar("MIN_VETO_SEND_DATAITEM"), out minVetoSendDataItem);
|
||||
}
|
||||
|
||||
// init gestione reset errori lettura
|
||||
if (!string.IsNullOrEmpty(getOptPar("READ_ERROR_MAX")))
|
||||
{
|
||||
int.TryParse(getOptPar("READ_ERROR_MAX"), out readErrorMax);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(getOptPar("READ_ERROR_SLEEP_TIME")))
|
||||
{
|
||||
int.TryParse(getOptPar("READ_ERROR_SLEEP_TIME"), out readErrorSleepTime);
|
||||
}
|
||||
|
||||
// gestione restart OpcUa client...
|
||||
if (!string.IsNullOrEmpty(getOptPar("ENABLE_CLI_RESTART")))
|
||||
{
|
||||
bool.TryParse(getOptPar("ENABLE_CLI_RESTART"), out enableCliRestart);
|
||||
}
|
||||
#endif
|
||||
|
||||
// init datetime counters
|
||||
DateTime adesso = DateTime.Now;
|
||||
@@ -1758,10 +1734,6 @@ namespace IOB_WIN_MTC.Iob
|
||||
{
|
||||
lgInfo($"STEP 03 invio dati di {elencoDataItems.Count} records");
|
||||
sendDataItemsList(elencoDataItems);
|
||||
#if false
|
||||
// provo a tracciare dataitems...
|
||||
trackExchDataRaw(elencoDataItems, 1024);
|
||||
#endif
|
||||
|
||||
trackExchData(1024, 4096);
|
||||
}
|
||||
@@ -1978,8 +1950,19 @@ namespace IOB_WIN_MTC.Iob
|
||||
/// <param name="dataItems"></param>
|
||||
private void sendDataItemsList(List<machDataItem> dataItems)
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(dataItems);
|
||||
utils.CallUrlPost($"{urlSaveDataItems}", rawData);
|
||||
// verifico abilitazione preliminare all'invio
|
||||
if (enableSendDataItem)
|
||||
{
|
||||
// verifico veto ad invio (ogni 60 min...)
|
||||
DateTime adesso = DateTime.Now;
|
||||
if (adesso > dtVetoSenDataItem)
|
||||
{
|
||||
string rawData = JsonConvert.SerializeObject(dataItems);
|
||||
var resp = utils.CallUrlPost($"{urlSaveDataItems}", rawData);
|
||||
// imposto nuovo veto
|
||||
dtVetoSenDataItem = adesso.AddMinutes(minVetoSendDataItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -68,6 +68,8 @@ MAX_SEND_PZC_BLOCK=100
|
||||
DISABLE_SEND_WDST=TRUE
|
||||
; conf aree allarme
|
||||
ALARM_CONF=3010_alarm.json
|
||||
; gestione custom timer
|
||||
timerIntMs=100
|
||||
|
||||
[BRANCH]
|
||||
NAME=develop
|
||||
|
||||
@@ -69,6 +69,8 @@ MAX_SEND_PZC_BLOCK=100
|
||||
DISABLE_SEND_WDST=TRUE
|
||||
; conf aree allarme
|
||||
ALARM_CONF=3011_alarm.json
|
||||
; gestione custom timer
|
||||
timerIntMs=100
|
||||
|
||||
[BRANCH]
|
||||
NAME=master
|
||||
|
||||
@@ -68,6 +68,8 @@ MAX_SEND_PZC_BLOCK=100
|
||||
DISABLE_SEND_WDST=TRUE
|
||||
; conf aree allarme
|
||||
ALARM_CONF=3013_alarm.json
|
||||
; gestione custom timer
|
||||
timerIntMs=100
|
||||
|
||||
[BRANCH]
|
||||
NAME=develop
|
||||
|
||||
@@ -69,6 +69,8 @@ MAX_SEND_PZC_BLOCK=100
|
||||
DISABLE_SEND_WDST=TRUE
|
||||
; gestione veto coda ingresso dati
|
||||
VETO_QUEUE_IN=10
|
||||
; gestione custom timer
|
||||
timerIntMs=100
|
||||
|
||||
; conf aree allarme
|
||||
ALARM_CONF=3020_alarm.json
|
||||
|
||||
Reference in New Issue
Block a user