Ejemplo n.º 1
0
        public static sb Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            sb _sb = new sb();

            _sb.m_rocrailClient    = rocrailClient;
            _sb.m_cmd              = (string)xml.Attribute("cmd");
            _sb.m_departdelay      = (int?)xml.Attribute("departdelay");
            _sb.m_desc             = (string)xml.Attribute("desc");
            _sb.m_entering         = (bool?)xml.Attribute("entering");
            _sb.m_entersignal      = (string)xml.Attribute("entersignal");
            _sb.m_exitsignal       = (string)xml.Attribute("exitsignal");
            _sb.m_exitspeed        = (string)xml.Attribute("exitspeed");
            _sb.m_exitspeedpercent = (int?)xml.Attribute("exitspeedpercent");
            _sb.m_exitstate        = (string)xml.Attribute("exitstate");
            _sb.m_fbenterid        = (string)xml.Attribute("fbenterid");
            _sb.m_gap              = (int?)xml.Attribute("gap");
            _sb.m_id           = (string)xml.Attribute("id");
            _sb.m_inatlen      = (bool?)xml.Attribute("inatlen");
            _sb.m_locid        = (string)xml.Attribute("locid");
            _sb.m_maxwaittime  = (int?)xml.Attribute("maxwaittime");
            _sb.m_minwaittime  = (int?)xml.Attribute("minwaittime");
            _sb.m_remote       = (bool?)xml.Attribute("remote");
            _sb.m_reserved     = (bool?)xml.Attribute("reserved");
            _sb.m_secid        = (string)xml.Attribute("secid");
            _sb.m_slen         = (int?)xml.Attribute("slen");
            _sb.m_speedpercent = (int?)xml.Attribute("speedpercent");
            _sb.m_state        = (string)xml.Attribute("state");
            _sb.m_stopspeed    = (string)xml.Attribute("stopspeed");
            _sb.m_suitswell    = (bool?)xml.Attribute("suitswell");
            _sb.m_usewd        = (bool?)xml.Attribute("usewd");
            _sb.m_waitmode     = (string)xml.Attribute("waitmode");
            _sb.m_waittime     = (int?)xml.Attribute("waittime");
            _sb.m_x            = (int?)xml.Attribute("x");
            _sb.m_y            = (int?)xml.Attribute("y");
            _sb.m_z            = (int?)xml.Attribute("z");
            Definitions.Tools.ParseList <actionctrl>(_sb.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient);
            Definitions.Tools.ParseList <section>(_sb.m_sectionlist, xml, "section", section.Parse, rocrailClient);
            return(_sb);
        }
Ejemplo n.º 2
0
 public void Update(sb element)
 {
     if (element.m_cmd != null)
     {
         this.cmd = element.cmd;
     }
     if (element.m_departdelay.HasValue == true)
     {
         this.departdelay = element.departdelay;
     }
     if (element.m_desc != null)
     {
         this.desc = element.desc;
     }
     if (element.m_entering.HasValue == true)
     {
         this.entering = element.entering;
     }
     if (element.m_entersignal != null)
     {
         this.entersignal = element.entersignal;
     }
     if (element.m_exitsignal != null)
     {
         this.exitsignal = element.exitsignal;
     }
     if (element.m_exitspeed != null)
     {
         this.exitspeed = element.exitspeed;
     }
     if (element.m_exitspeedpercent.HasValue == true)
     {
         this.exitspeedpercent = element.exitspeedpercent;
     }
     if (element.m_exitstate != null)
     {
         this.exitstate = element.exitstate;
     }
     if (element.m_fbenterid != null)
     {
         this.fbenterid = element.fbenterid;
     }
     if (element.m_gap.HasValue == true)
     {
         this.gap = element.gap;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_inatlen.HasValue == true)
     {
         this.inatlen = element.inatlen;
     }
     if (element.m_locid != null)
     {
         this.locid = element.locid;
     }
     if (element.m_maxwaittime.HasValue == true)
     {
         this.maxwaittime = element.maxwaittime;
     }
     if (element.m_minwaittime.HasValue == true)
     {
         this.minwaittime = element.minwaittime;
     }
     if (element.m_remote.HasValue == true)
     {
         this.remote = element.remote;
     }
     if (element.m_reserved.HasValue == true)
     {
         this.reserved = element.reserved;
     }
     if (element.m_secid != null)
     {
         this.secid = element.secid;
     }
     if (element.m_slen.HasValue == true)
     {
         this.slen = element.slen;
     }
     if (element.m_speedpercent.HasValue == true)
     {
         this.speedpercent = element.speedpercent;
     }
     if (element.m_state != null)
     {
         this.state = element.state;
     }
     if (element.m_stopspeed != null)
     {
         this.stopspeed = element.stopspeed;
     }
     if (element.m_suitswell.HasValue == true)
     {
         this.suitswell = element.suitswell;
     }
     if (element.m_usewd.HasValue == true)
     {
         this.usewd = element.usewd;
     }
     if (element.m_waitmode != null)
     {
         this.waitmode = element.waitmode;
     }
     if (element.m_waittime.HasValue == true)
     {
         this.waittime = element.waittime;
     }
     if (element.m_x.HasValue == true)
     {
         this.x = element.x;
     }
     if (element.m_y.HasValue == true)
     {
         this.y = element.y;
     }
     if (element.m_z.HasValue == true)
     {
         this.z = element.z;
     }
     this.actionctrllist = element.actionctrllist;
     this.sectionlist    = element.sectionlist;
 }