Continua pesante riorganizzazione con da legacy a nuova versione tree
This commit is contained in:
@@ -59,11 +59,11 @@ namespace IOB_UT_NEXT.Config.Base
|
||||
CurrSetup = new Dictionary<string, string>();
|
||||
CurrSetup.Add("alive", "IOB");
|
||||
//CurrSetup.Add("Base", "IOB/input/");
|
||||
CurrSetup.Add("BaseJson", "IOB/evListJson/");
|
||||
CurrSetup.Add("RawTransfJson", "IOB/rawTransfJson/");
|
||||
//CurrSetup.Add("BaseJson", "IOB/evListJson/");
|
||||
//CurrSetup.Add("RawTransfJson", "IOB/rawTransfJson/");
|
||||
//CurrSetup.Add("Enabled", "IOB/enabled/");
|
||||
//CurrSetup.Add("Flog", "IOB/flog/");
|
||||
CurrSetup.Add("FlogJson", "IOB/flogJson/");
|
||||
//CurrSetup.Add("FlogJson", "IOB/flogJson/");
|
||||
//CurrSetup.Add("fixDailyDossier", "IOB/fixDailyDossier/");
|
||||
//CurrSetup.Add("fixDailyOdl", "IOB/fixDailyOdl/");
|
||||
//CurrSetup.Add("fixDailyOdlConfPzCount", "IOB/fixDailyOdlConfPzCount/");
|
||||
@@ -72,7 +72,7 @@ namespace IOB_UT_NEXT.Config.Base
|
||||
//CurrSetup.Add("getPOdlAct", "IOB/getPOdlAct/");
|
||||
//CurrSetup.Add("IdleTime", "IOB/getIdlePeriod/");
|
||||
//CurrSetup.Add("OdlStarted", "IOB/getCurrOdlStart/");
|
||||
CurrSetup.Add("Reboot", "IOB/sendReboot.aspx?idxMacchina=");
|
||||
//CurrSetup.Add("Reboot", "IOB/sendReboot.aspx?idxMacchina=");
|
||||
//CurrSetup.Add("savePzCountInc", "IOB/savePzCountInc/");
|
||||
//CurrSetup.Add("savePzCountIncAtDate", "IOB/savePzCountIncAtDate/");
|
||||
// riordino
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
||||
namespace IOB_UT_NEXT.Config.Base
|
||||
{
|
||||
/// <summary>
|
||||
/// Info specifice all'IOB
|
||||
/// Info specifiche all'IOB
|
||||
/// </summary>
|
||||
public class IobDto
|
||||
{
|
||||
|
||||
@@ -37,20 +37,9 @@ namespace IOB_UT_NEXT.Config.Base
|
||||
{
|
||||
answ = $"{BaseAppUrl}{Commands[CmdReq]}";
|
||||
}
|
||||
// elimino doppie barre
|
||||
answ = answ.Replace("//", "/");
|
||||
return answ;
|
||||
#if false
|
||||
string answ = BaseAppUrl;
|
||||
if (Commands.ContainsKey(CmdReq))
|
||||
{
|
||||
answ = $"{BaseAppUrl}{Commands[CmdReq]}";
|
||||
}
|
||||
// altrimenti prendo cmd base IOB e compongo...
|
||||
else
|
||||
{
|
||||
answ = $"{BaseAppUrl}/IOB/{CmdReq}";
|
||||
}
|
||||
return answ;
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -59,9 +48,9 @@ namespace IOB_UT_NEXT.Config.Base
|
||||
public Dictionary<string, string> Commands { get; set; } = new CmdUriDto("IOB").StdCommands();
|
||||
|
||||
/// <summary>
|
||||
/// Installazione di riferimento
|
||||
/// Directory Installazione di riferimento x applicativi MAN/IOB sotto la radice C:\
|
||||
/// </summary>
|
||||
public string ClientInstall { get; set; } = "SW";
|
||||
public string ClientInstall { get; set; } = "SteamWare";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -236,6 +236,7 @@ namespace IOB_UT_NEXT.Config
|
||||
{
|
||||
newConfObj.MapoMesConf.Transport = MpIp.StartsWith("https://") ? "https" : "http";
|
||||
newConfObj.MapoMesConf.IpAddr = MpIp.Replace($"{newConfObj.MapoMesConf.Transport}://", ""); // tolgo http/https...
|
||||
newConfObj.MapoMesConf.ClientInstall = "SteamWare";
|
||||
}
|
||||
|
||||
// Altro
|
||||
@@ -357,6 +358,21 @@ namespace IOB_UT_NEXT.Config
|
||||
/// </summary>
|
||||
public Dictionary<string, string> OptParConf { get; set; } = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Recupera la chiave specifica richiesta
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public string OptParConfGet(string key)
|
||||
{
|
||||
string answ = "";
|
||||
if (OptParConf != null && OptParConf.ContainsKey(key))
|
||||
{
|
||||
answ = OptParConf[key];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dizionario delle chiavi opz da dizionario
|
||||
/// </summary>
|
||||
|
||||
+31
-14
@@ -10,6 +10,7 @@ using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.AccessControl;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using YamlDotNet.Core;
|
||||
@@ -108,7 +109,7 @@ namespace IOB_WIN_FORM
|
||||
}
|
||||
}
|
||||
|
||||
if (IOBConf == null || !utils.CRB("autoLoadConf"))
|
||||
if (IOBConfFull == null || !utils.CRB("autoLoadConf"))
|
||||
{
|
||||
// definisco e avvio tipo adapter generico
|
||||
tipoScelto = tipoAdapter.ND;
|
||||
@@ -122,6 +123,13 @@ namespace IOB_WIN_FORM
|
||||
|
||||
// cerco tra i parametri opzionali se ho il parametro di
|
||||
int timerIntMs = utils.CRI("timerIntMs");
|
||||
string rawTimer = IOBConfFull.OptParConfGet("timerIntMs");
|
||||
if (!string.IsNullOrEmpty(rawTimer))
|
||||
{
|
||||
int.TryParse(rawTimer, out timerIntMs);
|
||||
lgInfo($"Impostato timerIntMs da IOBConfFull: {timerIntMs}");
|
||||
}
|
||||
#if false
|
||||
if (IOBConf.optPar.ContainsKey("timerIntMs"))
|
||||
{
|
||||
// recupero
|
||||
@@ -131,7 +139,8 @@ namespace IOB_WIN_FORM
|
||||
int.TryParse(rawVal, out timerIntMs);
|
||||
lgInfo($"Impostato timerIntMs da IOB.ini: {timerIntMs}");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// Start timer periodico comunicazione
|
||||
gather.Interval = timerIntMs;
|
||||
gather.Enabled = true;
|
||||
@@ -1238,7 +1247,7 @@ namespace IOB_WIN_FORM
|
||||
/// </summary>
|
||||
protected virtual void loadIobType()
|
||||
{
|
||||
if (IOBConf != null)
|
||||
if (IOBConfFull != null)
|
||||
{
|
||||
switch (tipoScelto)
|
||||
{
|
||||
@@ -1248,19 +1257,27 @@ namespace IOB_WIN_FORM
|
||||
start.Enabled = false;
|
||||
break;
|
||||
}
|
||||
lblCNC.Text = $"CNC: {IOBConf.tipoIob} [{IOBConf.cncIpAddr}:{IOBConf.cncPort}]";
|
||||
lblSrvUrl.Text = $"SRV: {IOBConf.serverData.MPIP} | URL: {IOBConf.serverData.MPURL}{IOBConf.serverData.CMDBASE}";
|
||||
|
||||
// aggancio evento refresh
|
||||
iobObj.eh_refreshed += IobObj_eh_refreshed;
|
||||
|
||||
// carico i default values su interfaccia
|
||||
setDefaults();
|
||||
|
||||
displayTaskAndLog($"Caricata conf per adapter {tipoScelto}");
|
||||
UpdateDisplTypeIobSel();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update display info tipo IOB selezionato
|
||||
/// </summary>
|
||||
protected void UpdateDisplTypeIobSel()
|
||||
{
|
||||
lblCNC.Text = $"CNC: {IOBConfFull.GenConf.IobType} [{IOBConfFull.DeviceConf.ConnectConf.IpAddr}:{IOBConfFull.DeviceConf.ConnectConf.Port}]";
|
||||
lblSrvUrl.Text = $"SRV: {IOBConfFull.MapoMesConf.IpAddr} | BaseURL: {IOBConfFull.MapoMesConf.ApiUrl("")}";
|
||||
|
||||
// aggancio evento refresh
|
||||
iobObj.eh_refreshed += IobObj_eh_refreshed;
|
||||
|
||||
// carico i default values su interfaccia
|
||||
setDefaults();
|
||||
|
||||
displayTaskAndLog($"Caricata conf per adapter {tipoScelto}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Init form (grafica) con helper x testi e varie
|
||||
/// </summary>
|
||||
@@ -1838,7 +1855,7 @@ namespace IOB_WIN_FORM
|
||||
string confJson = JsonConvert.SerializeObject(IOBConf, Formatting.Indented);
|
||||
string path = fileMover.GetExecutingDirectoryName(); // Directory.GetCurrentDirectory();
|
||||
string fileName = Path.GetFileName(yamlConfFile).Replace(".ini", ".iob");
|
||||
string dirPath = $"{path}\\DATA\\{IOBConf.serverData.ClientInstall}";
|
||||
string dirPath = $"{path}\\DATA\\{IOBConfFull.MapoMesConf.ClientInstall}";
|
||||
string fullPath = $"{dirPath}\\{fileName}";
|
||||
// verifica directory
|
||||
baseUtils.checkDir(dirPath);
|
||||
|
||||
+97
-73
@@ -46,21 +46,21 @@ namespace IOB_WIN_FORM.Iob
|
||||
{
|
||||
if (IOBConf != null)
|
||||
{
|
||||
// init oggetto redis...
|
||||
redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.filenameIOB, $"{IOBConf.tipoIob}", IOBConf.minDeltaSec);
|
||||
//redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, $"{IOBConf.tipoIob}", IOBConf.minDeltaSec);
|
||||
|
||||
// initi oggetto TCMan
|
||||
tcMan = new TCMan(IOBConf.TCLambda, IOBConf.TCMaxDelayFactor, IOBConf.TCMaxIncrPz);
|
||||
|
||||
// salvo il form chiamante
|
||||
parentForm = caller;
|
||||
|
||||
// salvo configurazione versione legacy e nuova...
|
||||
cIobConf = IOBConf;
|
||||
IOBConfFull = IobConfNew;
|
||||
|
||||
// imposto le code!
|
||||
// init oggetto redis...
|
||||
redisMan = new RedisIobCache(IobConfNew.MapoMesConf.IpAddr, IobConfNew.GenConf.FilenameIOB, $"{IobConfNew.GenConf.IobType}", IobConfNew.GenConf.MinDeltaSec);
|
||||
//redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, $"{IOBConf.tipoIob}", IOBConf.minDeltaSec);
|
||||
|
||||
// initi oggetto TCMan
|
||||
tcMan = new TCMan(IobConfNew.TCDataConf.Lambda, IobConfNew.TCDataConf.MaxDelayFactor, IobConfNew.TCDataConf.MaxIncrPz);
|
||||
|
||||
// salvo il form chiamante
|
||||
parentForm = caller;
|
||||
|
||||
// imposto le code!
|
||||
QueueIN = new DataQueue(IOBConfFull.GenConf.CodIOB, "QueueIN", cIobConf.EnableRedisQueue);
|
||||
|
||||
lastConnectTry = DateTime.Now;
|
||||
@@ -498,29 +498,6 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
public int RawDataInputStart { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// URL di base del server MES da contattare
|
||||
/// </summary>
|
||||
private string urlMesServer
|
||||
{
|
||||
get => $@"{IOBConfFull.MapoMesConf.Transport}://{IOBConfFull.MapoMesConf.IpAddr}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL del comando letto da conf in aggiunta al server MES da contattare
|
||||
/// </summary>
|
||||
private string urlCommand(string cmqReq)
|
||||
{
|
||||
return $@"{urlMesServer}{IOBConfFull.MapoMesConf.ApiUrl(cmqReq)}";
|
||||
}
|
||||
/// <summary>
|
||||
/// URL come urlCommand + aggiunta codice IOB da cui viene inviato
|
||||
/// </summary>
|
||||
private string urlCommandIob(string cmqReq)
|
||||
{
|
||||
return $@"{urlMesServer}{IOBConfFull.MapoMesConf.ApiUrl(cmqReq)}{IOBConfFull.GenConf.CodIOB}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL per INVIO IN BLOCCO di un INCREMENTO x contapezzi (quelli della macchina: PLC/CNC)...
|
||||
/// </summary>
|
||||
@@ -720,7 +697,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
get
|
||||
{
|
||||
return $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMD_IDLE_TIME}{IOBConfFull.GenConf.CodIOB}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -734,7 +711,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
get
|
||||
{
|
||||
return $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMD_ODL_STARTED}{IOBConfFull.GenConf.CodIOB}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -748,7 +725,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
get
|
||||
{
|
||||
return $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDENABLED}{IOBConfFull.GenConf.CodIOB}";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -773,7 +750,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
public string urlOdlStartFromPOdl
|
||||
{
|
||||
get=> $@"{urlCommandIob("forceStartPOdl")}?idxPODL=";
|
||||
get => $@"{urlCommandIob("forceStartPOdl")}?idxPODL=";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -781,7 +758,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
public string urlPODLClose
|
||||
{
|
||||
get=> $@"{urlCommandIob("closePODL")}?idxPOdl=";
|
||||
get => $@"{urlCommandIob("closePODL")}?idxPOdl=";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -803,7 +780,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDREBO}{IOBConfFull.GenConf.CodIOB}";
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -812,7 +789,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
public string urlRemTask2Exe
|
||||
{
|
||||
get=> $@"{urlCommandIob("remTask2Exe")}?taskName=";
|
||||
get => $@"{urlCommandIob("remTask2Exe")}?taskName=";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -820,7 +797,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
public string urlSaveAllParams
|
||||
{
|
||||
get=> $@"{urlCommandIob("setObjItems")}";
|
||||
get => $@"{urlCommandIob("setObjItems")}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -828,7 +805,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
public string urlSaveMachIobConf
|
||||
{
|
||||
get=> $@"{urlCommandIob("saveMachineIobConf")}";
|
||||
get => $@"{urlCommandIob("saveMachineIobConf")}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -875,7 +852,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
lgError(exc, "Errore in composizione urlSetM2IOB");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -914,7 +891,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
lgError(exc, "Errore in composizione urlSetPzCountMAC");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -945,7 +922,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
lgError(exc, "Errore in composizione urlUpdateWriteParams");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -3892,6 +3869,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
{
|
||||
// verifico la parte di link "tipoComando"
|
||||
string tipoComando = "";
|
||||
#if false
|
||||
switch (tipoUrl)
|
||||
{
|
||||
case urlType.FLog:
|
||||
@@ -3913,10 +3891,32 @@ namespace IOB_WIN_FORM.Iob
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
switch (tipoUrl)
|
||||
{
|
||||
case urlType.FLog:
|
||||
tipoComando = "flogJson";
|
||||
break;
|
||||
|
||||
case urlType.SignIN:
|
||||
tipoComando = "evListJson";
|
||||
break;
|
||||
|
||||
case urlType.RawTransf:
|
||||
tipoComando = "rawTransfJson";
|
||||
break;
|
||||
|
||||
case urlType.ULog:
|
||||
tipoComando = "ulogJson";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
// URL base x input
|
||||
string answ = $@"{urlCommandIob(tipoComando)}";
|
||||
#if false
|
||||
string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{tipoComando}{IOBConfFull.GenConf.CodIOB}";
|
||||
string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{tipoComando}{IOBConfFull.GenConf.CodIOB}";
|
||||
#endif
|
||||
return answ;
|
||||
}
|
||||
@@ -3933,18 +3933,18 @@ namespace IOB_WIN_FORM.Iob
|
||||
#if false
|
||||
string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDFLOG}";
|
||||
#endif
|
||||
// decodifica valore!
|
||||
// decodifica valore!
|
||||
string[] valori = qDecodeIN(queueVal);
|
||||
// aggiungo flux e valore...
|
||||
answ += $@"?flux={valori[1]}&&valore={valori[2]}";
|
||||
#if false
|
||||
// aggiungo macchina e valore...
|
||||
answ += string.Format(@"{0}?flux={1}&&valore={2}", IOBConfFull.GenConf.CodIOB, valori[1], valori[2]);
|
||||
answ += string.Format(@"{0}?flux={1}&&valore={2}", IOBConfFull.GenConf.CodIOB, valori[1], valori[2]);
|
||||
#endif
|
||||
// aggiondo dataOra evento e corrente + contatore...
|
||||
answ += $@"&&dtEve={valori[0]}&&dtCurr={DateTime.Now:yyyyMMddHHmmssfff}&&cnt={valori[3]}";
|
||||
#if false
|
||||
answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[3]);
|
||||
answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[3]);
|
||||
#endif
|
||||
return answ;
|
||||
}
|
||||
@@ -3967,7 +3967,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
{
|
||||
// URL base x input
|
||||
#if false
|
||||
string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDBASE}";
|
||||
string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDBASE}";
|
||||
#endif
|
||||
string answ = $@"{urlCommandIob("input")}";
|
||||
// decodifica valore!
|
||||
@@ -3975,12 +3975,12 @@ namespace IOB_WIN_FORM.Iob
|
||||
// aggiungo macchina e valore...
|
||||
answ += $@"?valore={valori[1]}";
|
||||
#if false
|
||||
answ += string.Format(@"{0}?valore={1}", IOBConfFull.GenConf.CodIOB, valori[1]);
|
||||
answ += string.Format(@"{0}?valore={1}", IOBConfFull.GenConf.CodIOB, valori[1]);
|
||||
#endif
|
||||
// aggiondo dataOra evento e corrente + contatore...
|
||||
answ += $@"&&dtEve={valori[0]}&&dtCurr={DateTime.Now:yyyyMMddHHmmssfff}&&cnt={valori[2]}";
|
||||
#if false
|
||||
answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[2]);
|
||||
answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[2]);
|
||||
#endif
|
||||
return answ;
|
||||
}
|
||||
@@ -3994,7 +3994,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
{
|
||||
// URL base x input
|
||||
#if false
|
||||
string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDULOG}";
|
||||
string answ = $@"{urlMesServer}{IOBConfFull.MapoMesConf.BaseAppUrl}{cIobConf.serverData.CMDULOG}";
|
||||
#endif
|
||||
string answ = $@"{urlCommandIob("ulog")}";
|
||||
// decodifica valore!
|
||||
@@ -4002,12 +4002,12 @@ namespace IOB_WIN_FORM.Iob
|
||||
// aggiungo macchina e valore...
|
||||
answ += $@"?flux={valori[1]}&&valore={valori[2]}";
|
||||
#if false
|
||||
answ += string.Format(@"{0}?flux={1}&&valore={2}", IOBConfFull.GenConf.CodIOB, valori[1], valori[2]);
|
||||
answ += string.Format(@"{0}?flux={1}&&valore={2}", IOBConfFull.GenConf.CodIOB, valori[1], valori[2]);
|
||||
#endif
|
||||
// aggiondo dataOra evento e corrente + contatore...
|
||||
answ += $@"&&dtEve={valori[0]}&&dtCurr={DateTime.Now:yyyyMMddHHmmssfff}&&cnt={valori[3]}";
|
||||
#if false
|
||||
answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[3]);
|
||||
answ += string.Format(@"&&dtEve={0}&&dtCurr={1:yyyyMMddHHmmssfff}&&cnt={2}", valori[0], DateTime.Now, valori[3]);
|
||||
#endif
|
||||
return answ;
|
||||
}
|
||||
@@ -7763,6 +7763,14 @@ namespace IOB_WIN_FORM.Iob
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL di base del server MES da contattare
|
||||
/// </summary>
|
||||
private string urlMesServer
|
||||
{
|
||||
get => $@"{IOBConfFull.MapoMesConf.Transport}://{IOBConfFull.MapoMesConf.IpAddr}";
|
||||
}
|
||||
|
||||
#endregion Private Properties
|
||||
|
||||
#region Private Methods
|
||||
@@ -7989,23 +7997,6 @@ namespace IOB_WIN_FORM.Iob
|
||||
}
|
||||
}
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Traduzione del valore chiave configurato dal dizionario RecipeKeyTranslate + BaseKeyTranslate
|
||||
/// </summary>
|
||||
/// <param name="currKey"></param>
|
||||
/// <returns></returns>
|
||||
protected string RecipeKeyDecod(Dictionary<string, string> keyDict, string currKey)
|
||||
{
|
||||
string answ = currKey;
|
||||
if (keyDict != null)
|
||||
{
|
||||
answ = keyDict[currKey];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// recupera valore salvato in persistence layer (se non c'è crea...)
|
||||
/// </summary>
|
||||
@@ -8902,6 +8893,39 @@ namespace IOB_WIN_FORM.Iob
|
||||
return contAct;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL del comando letto da conf in aggiunta al server MES da contattare
|
||||
/// </summary>
|
||||
private string urlCommand(string cmqReq)
|
||||
{
|
||||
return $@"{urlMesServer}{IOBConfFull.MapoMesConf.ApiUrl(cmqReq)}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL come urlCommand + aggiunta codice IOB da cui viene inviato
|
||||
/// </summary>
|
||||
private string urlCommandIob(string cmqReq)
|
||||
{
|
||||
return $@"{urlMesServer}{IOBConfFull.MapoMesConf.ApiUrl(cmqReq)}{IOBConfFull.GenConf.CodIOB}";
|
||||
}
|
||||
|
||||
#endregion Private Methods
|
||||
|
||||
#if false
|
||||
/// <summary>
|
||||
/// Traduzione del valore chiave configurato dal dizionario RecipeKeyTranslate + BaseKeyTranslate
|
||||
/// </summary>
|
||||
/// <param name="currKey"></param>
|
||||
/// <returns></returns>
|
||||
protected string RecipeKeyDecod(Dictionary<string, string> keyDict, string currKey)
|
||||
{
|
||||
string answ = currKey;
|
||||
if (keyDict != null)
|
||||
{
|
||||
answ = keyDict[currKey];
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -8,26 +8,31 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace IOB_WIN_SHELLY
|
||||
{
|
||||
public class AdapterFormNext: IOB_WIN_FORM.AdapterForm
|
||||
public class AdapterFormNext : IOB_WIN_FORM.AdapterForm
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Avvio MainForm
|
||||
/// </summary>
|
||||
/// <param name="codIOB"></param>
|
||||
public AdapterFormNext(string codIOB): base(codIOB)
|
||||
public AdapterFormNext(string codIOB) : base(codIOB)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
/// <summary>
|
||||
/// carica IOB richiesto
|
||||
/// </summary>
|
||||
protected override void loadIobType()
|
||||
{
|
||||
if (IOBConf != null)
|
||||
if (IOBConfFull != null)
|
||||
{
|
||||
switch (tipoScelto)
|
||||
{
|
||||
|
||||
case tipoAdapter.Shelly:
|
||||
iobObj = new ShellyClient(this, IOBConf, IOBConfFull);
|
||||
btnStart.Enabled = true;
|
||||
@@ -40,17 +45,10 @@ namespace IOB_WIN_SHELLY
|
||||
btnStart.Enabled = false;
|
||||
break;
|
||||
}
|
||||
lblCncText = $"CNC: {IOBConf.tipoIob} [{IOBConf.cncIpAddr}:{IOBConf.cncPort}]";
|
||||
lblSrvUrlText = $"SRV: {IOBConf.serverData.MPIP} | URL: {IOBConf.serverData.MPURL}{IOBConf.serverData.CMDBASE}";
|
||||
|
||||
// aggancio evento refresh
|
||||
iobObj.eh_refreshed += IobObj_eh_refreshed;
|
||||
|
||||
// carico i default values su interfaccia
|
||||
setDefaults();
|
||||
|
||||
displayTaskAndLog($"Caricata conf per adapter {tipoScelto}");
|
||||
UpdateDisplTypeIobSel();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user