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

            _booster.m_rocrailClient     = rocrailClient;
            _booster.m_blockids          = (string)xml.Attribute("blockids");
            _booster.m_district          = (string)xml.Attribute("district");
            _booster.m_id                = (string)xml.Attribute("id");
            _booster.m_iid               = (string)xml.Attribute("iid");
            _booster.m_load              = (int?)xml.Attribute("load");
            _booster.m_loadmax           = (int?)xml.Attribute("loadmax");
            _booster.m_modids            = (string)xml.Attribute("modids");
            _booster.m_power             = (bool?)xml.Attribute("power");
            _booster.m_powerfb           = (string)xml.Attribute("powerfb");
            _booster.m_powersw           = (string)xml.Attribute("powersw");
            _booster.m_scfb              = (string)xml.Attribute("scfb");
            _booster.m_scopt_poweroffall = (bool?)xml.Attribute("scopt_poweroffall");
            _booster.m_scopt_repoweron   = (bool?)xml.Attribute("scopt_repoweron");
            _booster.m_scopt_stoplocos   = (bool?)xml.Attribute("scopt_stoplocos");
            _booster.m_shortcut          = (bool?)xml.Attribute("shortcut");
            _booster.m_temp              = (int?)xml.Attribute("temp");
            _booster.m_tempmax           = (int?)xml.Attribute("tempmax");
            _booster.m_uid               = (int?)xml.Attribute("uid");
            _booster.m_volt              = (int?)xml.Attribute("volt");
            _booster.m_voltmin           = (int?)xml.Attribute("voltmin");
            Definitions.Tools.ParseList <actionctrl>(_booster.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient);
            Definitions.Tools.ParseList <boosterevent>(_booster.m_boostereventlist, xml, "boosterevent", boosterevent.Parse, rocrailClient);
            return(_booster);
        }
Exemplo n.º 2
0
 public void Update(booster element)
 {
     if (element.m_blockids != null)
     {
         this.blockids = element.blockids;
     }
     if (element.m_district != null)
     {
         this.district = element.district;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_iid != null)
     {
         this.iid = element.iid;
     }
     if (element.m_load.HasValue == true)
     {
         this.load = element.load;
     }
     if (element.m_loadmax.HasValue == true)
     {
         this.loadmax = element.loadmax;
     }
     if (element.m_modids != null)
     {
         this.modids = element.modids;
     }
     if (element.m_power.HasValue == true)
     {
         this.power = element.power;
     }
     if (element.m_powerfb != null)
     {
         this.powerfb = element.powerfb;
     }
     if (element.m_powersw != null)
     {
         this.powersw = element.powersw;
     }
     if (element.m_scfb != null)
     {
         this.scfb = element.scfb;
     }
     if (element.m_scopt_poweroffall.HasValue == true)
     {
         this.scopt_poweroffall = element.scopt_poweroffall;
     }
     if (element.m_scopt_repoweron.HasValue == true)
     {
         this.scopt_repoweron = element.scopt_repoweron;
     }
     if (element.m_scopt_stoplocos.HasValue == true)
     {
         this.scopt_stoplocos = element.scopt_stoplocos;
     }
     if (element.m_shortcut.HasValue == true)
     {
         this.shortcut = element.shortcut;
     }
     if (element.m_temp.HasValue == true)
     {
         this.temp = element.temp;
     }
     if (element.m_tempmax.HasValue == true)
     {
         this.tempmax = element.tempmax;
     }
     if (element.m_uid.HasValue == true)
     {
         this.uid = element.uid;
     }
     if (element.m_volt.HasValue == true)
     {
         this.volt = element.volt;
     }
     if (element.m_voltmin.HasValue == true)
     {
         this.voltmin = element.voltmin;
     }
     this.actionctrllist   = element.actionctrllist;
     this.boostereventlist = element.boostereventlist;
 }