145 lines
4.6 KiB
C#
145 lines
4.6 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace EgwConf.Iob
|
|
{
|
|
/// <summary>
|
|
/// Set comandi URI x chiamate server
|
|
/// </summary>
|
|
public class CmdUri
|
|
{
|
|
#region Public Constructors
|
|
|
|
/// <summary>
|
|
/// Init classe gestione comandi
|
|
/// </summary>
|
|
/// <param name="baseURI"></param>
|
|
public CmdUri(string baseURI)
|
|
{
|
|
BaseUri = baseURI;
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO
|
|
/// </summary>
|
|
public string ULog { get; set; } = "IOB/ulog/";
|
|
|
|
/// <summary>
|
|
/// comando base x USER LOG - salvataggio parametri extra sistema MAPO in modalità JSON
|
|
/// payload come lista
|
|
/// </summary>
|
|
public string ULogJson { get; set; } = "IOB/ulogJson/";
|
|
|
|
#endregion Public Properties
|
|
|
|
#region Public Methods
|
|
|
|
/// <summary>
|
|
/// Recupera path/URI comando richiesto (SE disponibile)
|
|
/// </summary>
|
|
/// <param name="key"></param>
|
|
/// <returns></returns>
|
|
public string GetCommand(string key)
|
|
{
|
|
// default ad implicito...
|
|
string answ = $"{BaseUri}/{key}/";
|
|
if (CurrSetup.ContainsKey(key))
|
|
{
|
|
answ = CurrSetup[key];
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
public Dictionary<string, string> StdCommands()
|
|
{
|
|
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("Enabled", "IOB/enabled/");
|
|
CurrSetup.Add("Flog", "IOB/flog/");
|
|
CurrSetup.Add("FlogJson", "IOB/flogJson/");
|
|
CurrSetup.Add("ForcleSplitOdl", "IOB/forceSplitOdlFull/");
|
|
CurrSetup.Add("IdleTime", "IOB/getIdlePeriod/");
|
|
CurrSetup.Add("OdlStarted", "IOB/getCurrOdlStart/");
|
|
CurrSetup.Add("Reboot", "IOB/sendReboot.aspx?idxMacchina=/");
|
|
// riordino
|
|
CurrSetup = CurrSetup.OrderBy(x => x.Key).ToDictionary(x => x.Key, x => x.Value);
|
|
return CurrSetup;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Protected Properties
|
|
|
|
protected string BaseUri { get; set; } = "IOB";
|
|
protected Dictionary<string, string> CurrSetup { get; set; } = new Dictionary<string, string>();
|
|
|
|
#endregion Protected Properties
|
|
|
|
#if false
|
|
/// <summary>
|
|
/// comando base x check ALIVE
|
|
/// </summary>
|
|
public string Alive { get; set; } = "IOB";
|
|
|
|
/// <summary>
|
|
/// Comando base x INPUT
|
|
/// </summary>
|
|
public string Base { get; set; } = "IOB/input/";
|
|
|
|
/// <summary>
|
|
/// comando base x INPUT in modalità JSON payload come lista
|
|
/// </summary>
|
|
public string BaseJson { get; set; } = "IOB/evListJson/";
|
|
|
|
/// <summary>
|
|
/// comando base x Raw Transf LOG - salvataggio valori generici in modalità JSON payload
|
|
/// come lista
|
|
/// </summary>
|
|
public string RawTransfJson { get; set; } = "IOB/rawTransfJson/";
|
|
|
|
/// <summary>
|
|
/// comando base x check ENABLED
|
|
/// </summary>
|
|
public string Enabled { get; set; } = "IOB/enabled/";
|
|
|
|
/// <summary>
|
|
/// comando base x LOG di FLUSSO generico - salvataggio parametri extra sistema MAPO
|
|
/// </summary>
|
|
public string Flog { get; set; } = "IOB/flog/";
|
|
|
|
/// <summary>
|
|
/// comando base x LOG di FLUSSO generico - salvataggio parametri extra sistema MAPO in
|
|
/// modalità JSON payload come lista
|
|
/// </summary>
|
|
public string FlogJson { get; set; } = "IOB/flogJson/";
|
|
|
|
/// <summary>
|
|
/// Comando base x ForceSplitODL (check avvio ODL)
|
|
/// </summary>
|
|
public string ForcleSplitOdl { get; set; } = "IOB/forceSplitOdlFull/";
|
|
|
|
/// <summary>
|
|
/// comando base x check IDLE time IOB
|
|
/// </summary>
|
|
public string IdleTime { get; set; } = "IOB/getIdlePeriod/";
|
|
|
|
/// <summary>
|
|
/// comando base x check avvio ODL
|
|
/// </summary>
|
|
public string OdlStarted { get; set; } = "IOB/getCurrOdlStart/";
|
|
|
|
/// <summary>
|
|
/// comando base x comando reboot
|
|
/// </summary>
|
|
public string Reboot { get; set; } = "sendReboot.aspx?idxMacchina=";
|
|
|
|
#endif
|
|
}
|
|
} |