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
{
///
/// 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
///
[Serializable]
public class IobConfiguration
{
///
/// Codice univoco IOB
///
public string codIOB { get; set; }
///
/// Versione IOB
///
public string versIOB { get; set; }
///
/// Indirizzo Ip del CNC Controllato
///
public string cncIpAddr { get; set; }
///
/// Porta del CNC Controllato
///
public string cncPort { get; set; }
///
/// Dati di conf del server MoonPro cui comunicare
///
public serverMapo serverData { get; set; }
///
/// Porta del CNC Controllato
///
public tipoAdapter tipoIob { get; set; }
///
/// Valore MAX per countdown segnali blinking
///
public int MAX_COUNTER_BLINK;
///
/// Valore intero corrispondente ai BIT da filtrare x blinking
///
public int BLINK_FILT;
///
/// Avvio configurazione DUMMY
///
public IobConfiguration()
{
codIOB = "ND";
versIOB = "0";
cncIpAddr = "127.0.0.1";
cncPort = "0";
tipoIob = tipoAdapter.DEMO;
serverData = new serverMapo("127.0.0.1", "/", "/IOB/input/", "/IOB", "/IOB/enabled/", "/sendReboot.aspx?idxMacchina=");
MAX_COUNTER_BLINK = 10;
BLINK_FILT = 0;
}
}
public class serverMapo
{
///
/// Indirizzo IP server
///
public string MPIP = "";
///
/// URL Base del server applicativo
///
public string MPURL = "";
///
/// comando base x INPUT
///
public string CMDBASE = "";
///
/// comando base x check ALIVE
///
public string CMDALIVE = "";
///
/// comando base x check ENABLED
///
public string CMDENABLED = "";
///
/// comando base x comando reboot
///
public string CMDREBO = "";
///
/// Parametri configurazione server MoonPro cui inviare dati
///
/// Indirizzo IP del server MoonPro
/// URL Base server applicativo
/// Comando x invio INPUT
/// Comando x check alive
/// Comando x check abilitato
/// Comando x parametri opz
/// Comando x reboot
public serverMapo(string MPIP_, string MPURL_, string CMDBASE_, string CMDALIVE_, string CMDENABLED_, string CMDREBO_)
{
MPIP = MPIP_;
MPURL = MPURL_;
CMDBASE = CMDBASE_;
CMDALIVE = CMDALIVE_;
CMDENABLED = CMDENABLED_;
CMDREBO = CMDREBO_;
}
}
}