示例#1
0
        public static traverser Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            traverser _traverser = new traverser();

            _traverser.m_rocrailClient = rocrailClient;
            _traverser.m_addr0         = (int?)xml.Attribute("addr0");
            _traverser.m_addr1         = (int?)xml.Attribute("addr1");
            _traverser.m_addr2         = (int?)xml.Attribute("addr2");
            _traverser.m_addr3         = (int?)xml.Attribute("addr3");
            _traverser.m_addr4         = (int?)xml.Attribute("addr4");
            _traverser.m_b0sen         = (string)xml.Attribute("b0sen");
            _traverser.m_b1sen         = (string)xml.Attribute("b1sen");
            _traverser.m_b2sen         = (string)xml.Attribute("b2sen");
            _traverser.m_b3sen         = (string)xml.Attribute("b3sen");
            _traverser.m_bus           = (int?)xml.Attribute("bus");
            _traverser.m_cmd           = (string)xml.Attribute("cmd");
            _traverser.m_desc          = (string)xml.Attribute("desc");
            _traverser.m_id            = (string)xml.Attribute("id");
            _traverser.m_iid           = (string)xml.Attribute("iid");
            _traverser.m_inv           = (bool?)xml.Attribute("inv");
            _traverser.m_invnew        = (bool?)xml.Attribute("invnew");
            _traverser.m_locid         = (string)xml.Attribute("locid");
            _traverser.m_nrtracks      = (int?)xml.Attribute("nrtracks");
            _traverser.m_ori           = (string)xml.Attribute("ori");
            _traverser.m_pending       = (bool?)xml.Attribute("pending");
            _traverser.m_port0         = (int?)xml.Attribute("port0");
            _traverser.m_port1         = (int?)xml.Attribute("port1");
            _traverser.m_port2         = (int?)xml.Attribute("port2");
            _traverser.m_port3         = (int?)xml.Attribute("port3");
            _traverser.m_port4         = (int?)xml.Attribute("port4");
            _traverser.m_pos           = (int?)xml.Attribute("pos");
            _traverser.m_prot          = (string)xml.Attribute("prot");
            _traverser.m_psen          = (string)xml.Attribute("psen");
            _traverser.m_x             = (int?)xml.Attribute("x");
            _traverser.m_y             = (int?)xml.Attribute("y");
            _traverser.m_z             = (int?)xml.Attribute("z");
            return(_traverser);
        }
示例#2
0
 public void Update(traverser element)
 {
     if (element.m_addr0.HasValue == true)
     {
         this.addr0 = element.addr0;
     }
     if (element.m_addr1.HasValue == true)
     {
         this.addr1 = element.addr1;
     }
     if (element.m_addr2.HasValue == true)
     {
         this.addr2 = element.addr2;
     }
     if (element.m_addr3.HasValue == true)
     {
         this.addr3 = element.addr3;
     }
     if (element.m_addr4.HasValue == true)
     {
         this.addr4 = element.addr4;
     }
     if (element.m_b0sen != null)
     {
         this.b0sen = element.b0sen;
     }
     if (element.m_b1sen != null)
     {
         this.b1sen = element.b1sen;
     }
     if (element.m_b2sen != null)
     {
         this.b2sen = element.b2sen;
     }
     if (element.m_b3sen != null)
     {
         this.b3sen = element.b3sen;
     }
     if (element.m_bus.HasValue == true)
     {
         this.bus = element.bus;
     }
     if (element.m_cmd != null)
     {
         this.cmd = element.cmd;
     }
     if (element.m_desc != null)
     {
         this.desc = element.desc;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_iid != null)
     {
         this.iid = element.iid;
     }
     if (element.m_inv.HasValue == true)
     {
         this.inv = element.inv;
     }
     if (element.m_invnew.HasValue == true)
     {
         this.invnew = element.invnew;
     }
     if (element.m_locid != null)
     {
         this.locid = element.locid;
     }
     if (element.m_nrtracks.HasValue == true)
     {
         this.nrtracks = element.nrtracks;
     }
     if (element.m_ori != null)
     {
         this.ori = element.ori;
     }
     if (element.m_pending.HasValue == true)
     {
         this.pending = element.pending;
     }
     if (element.m_port0.HasValue == true)
     {
         this.port0 = element.port0;
     }
     if (element.m_port1.HasValue == true)
     {
         this.port1 = element.port1;
     }
     if (element.m_port2.HasValue == true)
     {
         this.port2 = element.port2;
     }
     if (element.m_port3.HasValue == true)
     {
         this.port3 = element.port3;
     }
     if (element.m_port4.HasValue == true)
     {
         this.port4 = element.port4;
     }
     if (element.m_pos.HasValue == true)
     {
         this.pos = element.pos;
     }
     if (element.m_prot != null)
     {
         this.prot = element.prot;
     }
     if (element.m_psen != null)
     {
         this.psen = element.psen;
     }
     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;
     }
 }