160 lines
4.6 KiB
C#
160 lines
4.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using IOB_UT;
|
|
using System.IO;
|
|
using System.Xml.Serialization;
|
|
|
|
namespace IOB_WIN
|
|
{
|
|
/// <summary>
|
|
/// This Configuration class is basically just a set of
|
|
/// properties with a couple of static methods to manage
|
|
/// the serialization to and deserialization from a
|
|
/// simple XML file.
|
|
///
|
|
/// ref: http://www.cambiaresearch.com/articles/33/how-can-i-easily-manage-an-xml-configuration-file-in-dotnet
|
|
/// </summary>
|
|
[Serializable]
|
|
public class IobConfiguration
|
|
{
|
|
/// <summary>
|
|
/// Vendor della macchina
|
|
/// </summary>
|
|
public string vendor { get; set; }
|
|
/// <summary>
|
|
/// Modello della macchina
|
|
/// </summary>
|
|
public string model { get; set; }
|
|
/// <summary>
|
|
/// Codice univoco IOB
|
|
/// </summary>
|
|
public string codIOB { get; set; }
|
|
/// <summary>
|
|
/// Versione IOB
|
|
/// </summary>
|
|
public string versIOB { get; set; }
|
|
/// <summary>
|
|
/// Indirizzo Ip del CNC Controllato
|
|
/// </summary>
|
|
public string cncIpAddr { get; set; }
|
|
/// <summary>
|
|
/// Porta del CNC Controllato
|
|
/// </summary>
|
|
public string cncPort { get; set; }
|
|
/// <summary>
|
|
/// Nome file di INI
|
|
/// </summary>
|
|
public string iniFileName { get; set; }
|
|
/// <summary>
|
|
/// TipoCPU (es: Siemens)
|
|
/// </summary>
|
|
public string cpuType { get; set; }
|
|
/// <summary>
|
|
/// Rack (Siemens S7)
|
|
/// </summary>
|
|
public short rack { get; set; }
|
|
/// <summary>
|
|
/// Slot (Siemens S7)
|
|
/// </summary>
|
|
public short slot { get; set; }
|
|
/// <summary>
|
|
/// Dati di conf del server MoonPro cui comunicare
|
|
/// </summary>
|
|
public serverMapo serverData { get; set; }
|
|
/// <summary>
|
|
/// Porta del CNC Controllato
|
|
/// </summary>
|
|
public tipoAdapter tipoIob { get; set; }
|
|
/// <summary>
|
|
/// Valore MAX per countdown segnali blinking
|
|
/// </summary>
|
|
public int MAX_COUNTER_BLINK;
|
|
/// <summary>
|
|
/// Valore intero corrispondente ai BIT da filtrare x blinking
|
|
/// </summary>
|
|
public int BLINK_FILT;
|
|
/// <summary>
|
|
/// Dizionario dei parametri opzionali
|
|
/// </summary>
|
|
public Dictionary<string, string> optPar;
|
|
/// <summary>
|
|
/// Avvio configurazione DUMMY
|
|
/// </summary>
|
|
public IobConfiguration()
|
|
{
|
|
vendor = "ND";
|
|
model = "ND";
|
|
codIOB = "ND";
|
|
versIOB = "0";
|
|
cncIpAddr = "127.0.0.1";
|
|
cncPort = "0";
|
|
iniFileName = "";
|
|
cpuType = "";
|
|
rack = 0;
|
|
slot = 0;
|
|
tipoIob = tipoAdapter.DEMO;
|
|
serverData = new serverMapo("127.0.0.1", "/", "/IOB/input/", "/IOB/flog/", "/IOB", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina=");
|
|
MAX_COUNTER_BLINK = 10;
|
|
BLINK_FILT = 0;
|
|
optPar = new Dictionary<string, string>();
|
|
}
|
|
}
|
|
|
|
public class serverMapo
|
|
{
|
|
/// <summary>
|
|
/// Indirizzo IP server
|
|
/// </summary>
|
|
public string MPIP = "";
|
|
/// <summary>
|
|
/// URL Base del server applicativo
|
|
/// </summary>
|
|
public string MPURL = "";
|
|
/// <summary>
|
|
/// comando base x INPUT
|
|
/// </summary>
|
|
public string CMDBASE = "";
|
|
/// <summary>
|
|
/// comando base x LOG di FLUSSSO generico - salvataggio parametri extra sistema MAPO
|
|
/// </summary>
|
|
public string CMDFLOG = "";
|
|
/// <summary>
|
|
/// comando base x check ALIVE
|
|
/// </summary>
|
|
public string CMDALIVE = "";
|
|
/// <summary>
|
|
/// comando base x check ENABLED
|
|
/// </summary>
|
|
public string CMDENABLED = "";
|
|
/// <summary>
|
|
/// comando base x comando reboot
|
|
/// </summary>
|
|
public string CMDREBO = "";
|
|
/// <summary>
|
|
/// Parametri configurazione server MoonPro cui inviare dati
|
|
/// </summary>
|
|
/// <param name="MPIP_">Indirizzo IP del server MoonPro</param>
|
|
/// <param name="MPURL_">URL Base server applicativo</param>
|
|
/// <param name="CMDBASE_">Comando x invio INPUT</param>
|
|
/// <param name="CMDFLOG_">Comando x invio LOG per FLUSSO generico</param>
|
|
/// <param name="CMDALIVE_">Comando x check alive</param>
|
|
/// <param name="CMDENABLED_">Comando x check abilitato</param>
|
|
/// <param name="CMDADV1_">Comando x parametri opz</param>
|
|
/// <param name="CMDREBO_">Comando x reboot</param>
|
|
public serverMapo(string MPIP_, string MPURL_, string CMDBASE_, string CMDFLOG_, string CMDALIVE_, string CMDENABLED_, string CMDREBO_)
|
|
{
|
|
MPIP = MPIP_;
|
|
MPURL = MPURL_;
|
|
CMDBASE = CMDBASE_;
|
|
CMDFLOG = CMDFLOG_;
|
|
CMDALIVE = CMDALIVE_;
|
|
CMDENABLED = CMDENABLED_;
|
|
CMDREBO = CMDREBO_;
|
|
}
|
|
}
|
|
|
|
}
|