codemaid reorg x Generic
This commit is contained in:
+115
-117
@@ -1,8 +1,6 @@
|
||||
using EgwProxy.Ftp;
|
||||
using EgwProxy.MultiCncLib.OPENcontrol;
|
||||
using IOB_UT_NEXT;
|
||||
using MapoSDK;
|
||||
using MathNet.Numerics;
|
||||
using MathNet.Numerics.Statistics;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
@@ -510,6 +508,26 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL per creazione di un PODL da cod art (metodo GET)...
|
||||
/// </summary>
|
||||
public string urlCreatePOdl
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/forceCreatePOdl/{cIobConf.codIOB}?";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgError(exc, "Errore in composizione urlStartPODL");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// URL per chiamata generazione Snapshot Dossier giornalieri alla data
|
||||
/// </summary>
|
||||
@@ -859,28 +877,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// URL per creazione di un PODL da cod art (metodo GET)...
|
||||
/// </summary>
|
||||
public string urlCreatePOdl
|
||||
{
|
||||
get
|
||||
{
|
||||
string answ = "";
|
||||
try
|
||||
{
|
||||
answ = $@"{cIobConf.serverData.TRANSP}://{cIobConf.serverData.MPIP}{cIobConf.serverData.MPURL}{cIobConf.serverData.CMDALIVE}/forceCreatePOdl/{cIobConf.codIOB}?";
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lgError(exc, "Errore in composizione urlStartPODL");
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// URL per chiusura PODL --> ODL corrente (metodo GET)...
|
||||
@@ -4556,6 +4552,17 @@ namespace IOB_WIN_NEXT.Iob
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera ODL attivo su impianto
|
||||
/// </summary>
|
||||
protected int CurrOdl()
|
||||
{
|
||||
int answ = 0;
|
||||
string sCurrODL = utils.callUrl(urlGetCurrODL);
|
||||
int.TryParse(sCurrODL, out answ);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Imposta eventuali altri valori default
|
||||
/// </summary>
|
||||
@@ -5188,6 +5195,34 @@ namespace IOB_WIN_NEXT.Iob
|
||||
lgInfoStartup("DONE loadMemConf");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco PODL assegnabili
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected List<PODLModel> MachineNextPodl()
|
||||
{
|
||||
List<PODLModel> reqPOdlList = new List<PODLModel>();
|
||||
// per prima cosa recupero elenco PODL da gestire....
|
||||
var rawListPODL = callUrl(urlGetCurrPODL, false);
|
||||
if (!string.IsNullOrEmpty(rawListPODL))
|
||||
{
|
||||
try
|
||||
{
|
||||
reqPOdlList = JsonConvert.DeserializeObject<List<PODLModel>>(rawListPODL);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error($"Errore: chiamata elenco PODL ha restituito errore{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lg.Error($"Errore: chiamata elenco PODL ({urlGetCurrPODL}) ha restituito valore vuoto");
|
||||
}
|
||||
|
||||
return reqPOdlList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Metodo da overridare x scrivere DAVVERO i parametri sul PLC
|
||||
/// NB: deve resettare reqValue
|
||||
@@ -5853,34 +5888,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera elenco PODL assegnabili
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected List<PODLModel> MachineNextPodl()
|
||||
{
|
||||
List<PODLModel> reqPOdlList = new List<PODLModel>();
|
||||
// per prima cosa recupero elenco PODL da gestire....
|
||||
var rawListPODL = callUrl(urlGetCurrPODL, false);
|
||||
if (!string.IsNullOrEmpty(rawListPODL))
|
||||
{
|
||||
try
|
||||
{
|
||||
reqPOdlList = JsonConvert.DeserializeObject<List<PODLModel>>(rawListPODL);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
lg.Error($"Errore: chiamata elenco PODL ha restituito errore{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lg.Error($"Errore: chiamata elenco PODL ({urlGetCurrPODL}) ha restituito valore vuoto");
|
||||
}
|
||||
|
||||
return reqPOdlList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prepara le ricette dato path temp scaricando elenco PODL
|
||||
/// </summary>
|
||||
@@ -6031,6 +6038,34 @@ namespace IOB_WIN_NEXT.Iob
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa chiusura ODL
|
||||
/// </summary>
|
||||
/// <param name="idxOdl">Idx dell'ODL da chiudere</param>
|
||||
/// <param name="dtRif">DataOra di riferimento evento stop</param>
|
||||
protected bool SendCloseOdl(int idxOdl, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
DateTime dtCurr = DateTime.Now;
|
||||
string resp = callUrl($"{urlODLClose}{idxOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false);
|
||||
answ = resp == "OK";
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa chiusura PODL
|
||||
/// </summary>
|
||||
/// <param name="idxPOdl">Idx del PODL da chiudere</param>
|
||||
/// <param name="dtRif">DataOra di riferimento evento stop</param>
|
||||
protected bool SendClosePOdl(int idxPOdl, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
DateTime dtCurr = DateTime.Now;
|
||||
string resp = callUrl($"{urlPODLClose}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false);
|
||||
answ = resp == "OK";
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invia informazioni associazione IOB 2 machine
|
||||
/// </summary>
|
||||
@@ -6069,6 +6104,21 @@ namespace IOB_WIN_NEXT.Iob
|
||||
sendOptVal(paramName, paramValueInt.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa avvio PODL 8ed eventuale chiusura precedente)
|
||||
/// </summary>
|
||||
/// <param name="idxPOdl">Idx del PODL da avviare</param>
|
||||
/// <param name="dtRif">DataOra di riferimento evento start</param>
|
||||
protected bool SendStartPodl(int idxPOdl, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
DateTime dtCurr = DateTime.Now;
|
||||
// chiamata avvio PODL (a posteriori)
|
||||
string resp = callUrl($"{urlOdlStartFromPOdl}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false);
|
||||
answ = resp == "OK";
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invia messaggio a logWatcher
|
||||
/// </summary>
|
||||
@@ -6461,6 +6511,19 @@ namespace IOB_WIN_NEXT.Iob
|
||||
return fatto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa avvio PODL (ed eventuale chiusura precedente)
|
||||
/// </summary>
|
||||
/// <param name="codArt">Cod Articolo del PODL da avviare</param>
|
||||
/// <param name="numPz">num pz richiesti</param>
|
||||
protected int TryCreatePodl(string codArt, int numPz)
|
||||
{
|
||||
int answ = 0;
|
||||
string resp = callUrl($"{urlCreatePOdl}CodArt={codArt}&numPz={numPz}", false);
|
||||
int.TryParse(resp, out answ);
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Cerca di inviare su un altro thread i vari dati accumulati...
|
||||
/// </summary>
|
||||
@@ -7442,71 +7505,6 @@ namespace IOB_WIN_NEXT.Iob
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processa avvio PODL (ed eventuale chiusura precedente)
|
||||
/// </summary>
|
||||
/// <param name="codArt">Cod Articolo del PODL da avviare</param>
|
||||
/// <param name="numPz">num pz richiesti</param>
|
||||
protected int TryCreatePodl(string codArt, int numPz)
|
||||
{
|
||||
int answ = 0;
|
||||
string resp = callUrl($"{urlCreatePOdl}CodArt={codArt}&numPz={numPz}", false);
|
||||
int.TryParse(resp, out answ);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Recupera ODL attivo su impianto
|
||||
/// </summary>
|
||||
protected int CurrOdl()
|
||||
{
|
||||
int answ = 0;
|
||||
string sCurrODL = utils.callUrl(urlGetCurrODL);
|
||||
int.TryParse(sCurrODL, out answ);
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processa avvio PODL 8ed eventuale chiusura precedente)
|
||||
/// </summary>
|
||||
/// <param name="idxPOdl">Idx del PODL da avviare</param>
|
||||
/// <param name="dtRif">DataOra di riferimento evento start</param>
|
||||
protected bool SendStartPodl(int idxPOdl, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
DateTime dtCurr = DateTime.Now;
|
||||
// chiamata avvio PODL (a posteriori)
|
||||
string resp = callUrl($"{urlOdlStartFromPOdl}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false);
|
||||
answ = resp == "OK";
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processa chiusura ODL
|
||||
/// </summary>
|
||||
/// <param name="idxOdl">Idx dell'ODL da chiudere</param>
|
||||
/// <param name="dtRif">DataOra di riferimento evento stop</param>
|
||||
protected bool SendCloseOdl(int idxOdl, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
DateTime dtCurr = DateTime.Now;
|
||||
string resp = callUrl($"{urlODLClose}{idxOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false);
|
||||
answ = resp == "OK";
|
||||
return answ;
|
||||
}
|
||||
/// <summary>
|
||||
/// Processa chiusura PODL
|
||||
/// </summary>
|
||||
/// <param name="idxPOdl">Idx del PODL da chiudere</param>
|
||||
/// <param name="dtRif">DataOra di riferimento evento stop</param>
|
||||
protected bool SendClosePOdl(int idxPOdl, DateTime dtRif)
|
||||
{
|
||||
bool answ = false;
|
||||
DateTime dtCurr = DateTime.Now;
|
||||
string resp = callUrl($"{urlPODLClose}{idxPOdl}&dtEve={dtRif}&dtCurr={dtCurr}", false);
|
||||
answ = resp == "OK";
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elimino record da REDIS (locale e remoto)
|
||||
|
||||
Reference in New Issue
Block a user