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

            _st.m_rocrailClient        = rocrailClient;
            _st.m_bka                  = (string)xml.Attribute("bka");
            _st.m_bkaside              = (bool?)xml.Attribute("bkaside");
            _st.m_bkb                  = (string)xml.Attribute("bkb");
            _st.m_bkbside              = (bool?)xml.Attribute("bkbside");
            _st.m_bkc                  = (string)xml.Attribute("bkc");
            _st.m_cmd                  = (string)xml.Attribute("cmd");
            _st.m_commuter             = (bool?)xml.Attribute("commuter");
            _st.m_countcars            = (string)xml.Attribute("countcars");
            _st.m_crossingblocksignals = (bool?)xml.Attribute("crossingblocksignals");
            _st.m_ctcaddr1             = (int?)xml.Attribute("ctcaddr1");
            _st.m_ctcaddr2             = (int?)xml.Attribute("ctcaddr2");
            _st.m_ctcaddr3             = (int?)xml.Attribute("ctcaddr3");
            _st.m_ctcbus1              = (int?)xml.Attribute("ctcbus1");
            _st.m_ctcbus2              = (int?)xml.Attribute("ctcbus2");
            _st.m_ctcbus3              = (int?)xml.Attribute("ctcbus3");
            _st.m_ctciid1              = (string)xml.Attribute("ctciid1");
            _st.m_ctciid2              = (string)xml.Attribute("ctciid2");
            _st.m_ctciid3              = (string)xml.Attribute("ctciid3");
            _st.m_ctcoutput1           = (string)xml.Attribute("ctcoutput1");
            _st.m_ctcoutput2           = (string)xml.Attribute("ctcoutput2");
            _st.m_ctcoutput3           = (string)xml.Attribute("ctcoutput3");
            _st.m_desc                 = (string)xml.Attribute("desc");
            _st.m_id           = (string)xml.Attribute("id");
            _st.m_locid        = (string)xml.Attribute("locid");
            _st.m_manual       = (bool?)xml.Attribute("manual");
            _st.m_maxkmh       = (int?)xml.Attribute("maxkmh");
            _st.m_maxlen       = (int?)xml.Attribute("maxlen");
            _st.m_minlen       = (int?)xml.Attribute("minlen");
            _st.m_modid        = (string)xml.Attribute("modid");
            _st.m_nocommuter   = (bool?)xml.Attribute("nocommuter");
            _st.m_ori          = (string)xml.Attribute("ori");
            _st.m_reduceV      = (bool?)xml.Attribute("reduceV");
            _st.m_sga          = (int?)xml.Attribute("sga");
            _st.m_sgb          = (int?)xml.Attribute("sgb");
            _st.m_show         = (bool?)xml.Attribute("show");
            _st.m_speed        = (string)xml.Attribute("speed");
            _st.m_speedpercent = (int?)xml.Attribute("speedpercent");
            _st.m_status       = (int?)xml.Attribute("status");
            _st.m_swappost     = (bool?)xml.Attribute("swappost");
            _st.m_typeperm     = (string)xml.Attribute("typeperm");
            _st.m_x            = (int?)xml.Attribute("x");
            _st.m_y            = (int?)xml.Attribute("y");
            _st.m_z            = (int?)xml.Attribute("z");
            Definitions.Tools.ParseList <actionctrl>(_st.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient);
            Definitions.Tools.ParseList <excl>(_st.m_excllist, xml, "excl", excl.Parse, rocrailClient);
            Definitions.Tools.ParseList <fbevent>(_st.m_fbeventlist, xml, "fbevent", fbevent.Parse, rocrailClient);
            Definitions.Tools.ParseList <incl>(_st.m_incllist, xml, "incl", incl.Parse, rocrailClient);
            Definitions.Tools.ParseList <stcondition>(_st.m_stconditionlist, xml, "stcondition", stcondition.Parse, rocrailClient);
            Definitions.Tools.ParseList <swcmd>(_st.m_swcmdlist, xml, "swcmd", swcmd.Parse, rocrailClient);
            return(_st);
        }
Exemplo n.º 2
0
 public void Update(st element)
 {
     if (element.m_bka != null)
     {
         this.bka = element.bka;
     }
     if (element.m_bkaside.HasValue == true)
     {
         this.bkaside = element.bkaside;
     }
     if (element.m_bkb != null)
     {
         this.bkb = element.bkb;
     }
     if (element.m_bkbside.HasValue == true)
     {
         this.bkbside = element.bkbside;
     }
     if (element.m_bkc != null)
     {
         this.bkc = element.bkc;
     }
     if (element.m_cmd != null)
     {
         this.cmd = element.cmd;
     }
     if (element.m_commuter.HasValue == true)
     {
         this.commuter = element.commuter;
     }
     if (element.m_countcars != null)
     {
         this.countcars = element.countcars;
     }
     if (element.m_crossingblocksignals.HasValue == true)
     {
         this.crossingblocksignals = element.crossingblocksignals;
     }
     if (element.m_ctcaddr1.HasValue == true)
     {
         this.ctcaddr1 = element.ctcaddr1;
     }
     if (element.m_ctcaddr2.HasValue == true)
     {
         this.ctcaddr2 = element.ctcaddr2;
     }
     if (element.m_ctcaddr3.HasValue == true)
     {
         this.ctcaddr3 = element.ctcaddr3;
     }
     if (element.m_ctcbus1.HasValue == true)
     {
         this.ctcbus1 = element.ctcbus1;
     }
     if (element.m_ctcbus2.HasValue == true)
     {
         this.ctcbus2 = element.ctcbus2;
     }
     if (element.m_ctcbus3.HasValue == true)
     {
         this.ctcbus3 = element.ctcbus3;
     }
     if (element.m_ctciid1 != null)
     {
         this.ctciid1 = element.ctciid1;
     }
     if (element.m_ctciid2 != null)
     {
         this.ctciid2 = element.ctciid2;
     }
     if (element.m_ctciid3 != null)
     {
         this.ctciid3 = element.ctciid3;
     }
     if (element.m_ctcoutput1 != null)
     {
         this.ctcoutput1 = element.ctcoutput1;
     }
     if (element.m_ctcoutput2 != null)
     {
         this.ctcoutput2 = element.ctcoutput2;
     }
     if (element.m_ctcoutput3 != null)
     {
         this.ctcoutput3 = element.ctcoutput3;
     }
     if (element.m_desc != null)
     {
         this.desc = element.desc;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_locid != null)
     {
         this.locid = element.locid;
     }
     if (element.m_manual.HasValue == true)
     {
         this.manual = element.manual;
     }
     if (element.m_maxkmh.HasValue == true)
     {
         this.maxkmh = element.maxkmh;
     }
     if (element.m_maxlen.HasValue == true)
     {
         this.maxlen = element.maxlen;
     }
     if (element.m_minlen.HasValue == true)
     {
         this.minlen = element.minlen;
     }
     if (element.m_modid != null)
     {
         this.modid = element.modid;
     }
     if (element.m_nocommuter.HasValue == true)
     {
         this.nocommuter = element.nocommuter;
     }
     if (element.m_ori != null)
     {
         this.ori = element.ori;
     }
     if (element.m_reduceV.HasValue == true)
     {
         this.reduceV = element.reduceV;
     }
     if (element.m_sga.HasValue == true)
     {
         this.sga = element.sga;
     }
     if (element.m_sgb.HasValue == true)
     {
         this.sgb = element.sgb;
     }
     if (element.m_show.HasValue == true)
     {
         this.show = element.show;
     }
     if (element.m_speed != null)
     {
         this.speed = element.speed;
     }
     if (element.m_speedpercent.HasValue == true)
     {
         this.speedpercent = element.speedpercent;
     }
     if (element.m_status.HasValue == true)
     {
         this.status = element.status;
     }
     if (element.m_swappost.HasValue == true)
     {
         this.swappost = element.swappost;
     }
     if (element.m_typeperm != null)
     {
         this.typeperm = element.typeperm;
     }
     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.excllist        = element.excllist;
     this.fbeventlist     = element.fbeventlist;
     this.incllist        = element.incllist;
     this.stconditionlist = element.stconditionlist;
     this.swcmdlist       = element.swcmdlist;
 }