Exemplo n.º 1
0
        public static devices Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            devices _devices = new devices();

            _devices.m_rocrailClient  = rocrailClient;
            _devices.m_serial         = (string)xml.Attribute("serial");
            _devices.m_asciiprotocol  = (bool?)xml.Attribute("asciiprotocol");
            _devices.m_bits           = (int?)xml.Attribute("bits");
            _devices.m_bps            = (int?)xml.Attribute("bps");
            _devices.m_ctsretry       = (int?)xml.Attribute("ctsretry");
            _devices.m_device         = (string)xml.Attribute("device");
            _devices.m_dummyio        = (bool?)xml.Attribute("dummyio");
            _devices.m_fastclock      = (bool?)xml.Attribute("fastclock");
            _devices.m_fbmod          = (int?)xml.Attribute("fbmod");
            _devices.m_fboffset       = (int?)xml.Attribute("fboffset");
            _devices.m_fbpoll         = (bool?)xml.Attribute("fbpoll");
            _devices.m_fbreset        = (bool?)xml.Attribute("fbreset");
            _devices.m_flow           = (string)xml.Attribute("flow");
            _devices.m_host           = (string)xml.Attribute("host");
            _devices.m_identdelay     = (int?)xml.Attribute("identdelay");
            _devices.m_ignorebusy     = (bool?)xml.Attribute("ignorebusy");
            _devices.m_iid            = (string)xml.Attribute("iid");
            _devices.m_iid_master     = (string)xml.Attribute("iid_master");
            _devices.m_iid_slave      = (string)xml.Attribute("iid_slave");
            _devices.m_lib            = (string)xml.Attribute("lib");
            _devices.m_libpath        = (string)xml.Attribute("libpath");
            _devices.m_localip        = (string)xml.Attribute("localip");
            _devices.m_locolist       = (bool?)xml.Attribute("locolist");
            _devices.m_overrule       = (bool?)xml.Attribute("overrule");
            _devices.m_parity         = (string)xml.Attribute("parity");
            _devices.m_port           = (int?)xml.Attribute("port");
            _devices.m_poweratstartup = (bool?)xml.Attribute("poweratstartup");
            _devices.m_poweroffexit   = (bool?)xml.Attribute("poweroffexit");
            _devices.m_protver        = (int?)xml.Attribute("protver");
            _devices.m_psleep         = (int?)xml.Attribute("psleep");
            _devices.m_ptsupport      = (bool?)xml.Attribute("ptsupport");
            _devices.m_pw4acc         = (bool?)xml.Attribute("pw4acc");
            _devices.m_readbidi       = (bool?)xml.Attribute("readbidi");
            _devices.m_readfb         = (bool?)xml.Attribute("readfb");
            _devices.m_restricted     = (bool?)xml.Attribute("restricted");
            _devices.m_rtsdisabled    = (bool?)xml.Attribute("rtsdisabled");
            _devices.m_startpwstate   = (bool?)xml.Attribute("startpwstate");
            _devices.m_stopbits       = (int?)xml.Attribute("stopbits");
            _devices.m_stress         = (bool?)xml.Attribute("stress");
            _devices.m_sublib         = (string)xml.Attribute("sublib");
            _devices.m_swinvert       = (bool?)xml.Attribute("swinvert");
            _devices.m_switchlist     = (bool?)xml.Attribute("switchlist");
            _devices.m_swtime         = (int?)xml.Attribute("swtime");
            _devices.m_systeminfo     = (bool?)xml.Attribute("systeminfo");
            _devices.m_timeout        = (int?)xml.Attribute("timeout");
            return(_devices);
        }
Exemplo n.º 2
0
 public void Update(devices element)
 {
     if (element.m_serial != null)
     {
         this.serial = element.serial;
     }
     if (element.m_asciiprotocol.HasValue == true)
     {
         this.asciiprotocol = element.asciiprotocol;
     }
     if (element.m_bits.HasValue == true)
     {
         this.bits = element.bits;
     }
     if (element.m_bps.HasValue == true)
     {
         this.bps = element.bps;
     }
     if (element.m_ctsretry.HasValue == true)
     {
         this.ctsretry = element.ctsretry;
     }
     if (element.m_device != null)
     {
         this.device = element.device;
     }
     if (element.m_dummyio.HasValue == true)
     {
         this.dummyio = element.dummyio;
     }
     if (element.m_fastclock.HasValue == true)
     {
         this.fastclock = element.fastclock;
     }
     if (element.m_fbmod.HasValue == true)
     {
         this.fbmod = element.fbmod;
     }
     if (element.m_fboffset.HasValue == true)
     {
         this.fboffset = element.fboffset;
     }
     if (element.m_fbpoll.HasValue == true)
     {
         this.fbpoll = element.fbpoll;
     }
     if (element.m_fbreset.HasValue == true)
     {
         this.fbreset = element.fbreset;
     }
     if (element.m_flow != null)
     {
         this.flow = element.flow;
     }
     if (element.m_host != null)
     {
         this.host = element.host;
     }
     if (element.m_identdelay.HasValue == true)
     {
         this.identdelay = element.identdelay;
     }
     if (element.m_ignorebusy.HasValue == true)
     {
         this.ignorebusy = element.ignorebusy;
     }
     if (element.m_iid != null)
     {
         this.iid = element.iid;
     }
     if (element.m_iid_master != null)
     {
         this.iid_master = element.iid_master;
     }
     if (element.m_iid_slave != null)
     {
         this.iid_slave = element.iid_slave;
     }
     if (element.m_lib != null)
     {
         this.lib = element.lib;
     }
     if (element.m_libpath != null)
     {
         this.libpath = element.libpath;
     }
     if (element.m_localip != null)
     {
         this.localip = element.localip;
     }
     if (element.m_locolist.HasValue == true)
     {
         this.locolist = element.locolist;
     }
     if (element.m_overrule.HasValue == true)
     {
         this.overrule = element.overrule;
     }
     if (element.m_parity != null)
     {
         this.parity = element.parity;
     }
     if (element.m_port.HasValue == true)
     {
         this.port = element.port;
     }
     if (element.m_poweratstartup.HasValue == true)
     {
         this.poweratstartup = element.poweratstartup;
     }
     if (element.m_poweroffexit.HasValue == true)
     {
         this.poweroffexit = element.poweroffexit;
     }
     if (element.m_protver.HasValue == true)
     {
         this.protver = element.protver;
     }
     if (element.m_psleep.HasValue == true)
     {
         this.psleep = element.psleep;
     }
     if (element.m_ptsupport.HasValue == true)
     {
         this.ptsupport = element.ptsupport;
     }
     if (element.m_pw4acc.HasValue == true)
     {
         this.pw4acc = element.pw4acc;
     }
     if (element.m_readbidi.HasValue == true)
     {
         this.readbidi = element.readbidi;
     }
     if (element.m_readfb.HasValue == true)
     {
         this.readfb = element.readfb;
     }
     if (element.m_restricted.HasValue == true)
     {
         this.restricted = element.restricted;
     }
     if (element.m_rtsdisabled.HasValue == true)
     {
         this.rtsdisabled = element.rtsdisabled;
     }
     if (element.m_startpwstate.HasValue == true)
     {
         this.startpwstate = element.startpwstate;
     }
     if (element.m_stopbits.HasValue == true)
     {
         this.stopbits = element.stopbits;
     }
     if (element.m_stress.HasValue == true)
     {
         this.stress = element.stress;
     }
     if (element.m_sublib != null)
     {
         this.sublib = element.sublib;
     }
     if (element.m_swinvert.HasValue == true)
     {
         this.swinvert = element.swinvert;
     }
     if (element.m_switchlist.HasValue == true)
     {
         this.switchlist = element.switchlist;
     }
     if (element.m_swtime.HasValue == true)
     {
         this.swtime = element.swtime;
     }
     if (element.m_systeminfo.HasValue == true)
     {
         this.systeminfo = element.systeminfo;
     }
     if (element.m_timeout.HasValue == true)
     {
         this.timeout = element.timeout;
     }
 }