Ejemplo n.º 1
0
 public void Update(bk element)
 {
     if (element.m_acceptghost.HasValue == true)
     {
         this.acceptghost = element.acceptghost;
     }
     if (element.m_acceptident.HasValue == true)
     {
         this.acceptident = element.acceptident;
     }
     if (element.m_addr.HasValue == true)
     {
         this.addr = element.addr;
     }
     if (element.m_allowbbt.HasValue == true)
     {
         this.allowbbt = element.allowbbt;
     }
     if (element.m_allowchgdir.HasValue == true)
     {
         this.allowchgdir = element.allowchgdir;
     }
     if (element.m_blankatredsignal.HasValue == true)
     {
         this.blankatredsignal = element.blankatredsignal;
     }
     if (element.m_blankatredsignalR.HasValue == true)
     {
         this.blankatredsignalR = element.blankatredsignalR;
     }
     if (element.m_cmd != null)
     {
         this.cmd = element.cmd;
     }
     if (element.m_commuter != null)
     {
         this.commuter = element.commuter;
     }
     if (element.m_departdelay.HasValue == true)
     {
         this.departdelay = element.departdelay;
     }
     if (element.m_desc != null)
     {
         this.desc = element.desc;
     }
     if (element.m_electrified.HasValue == true)
     {
         this.electrified = element.electrified;
     }
     if (element.m_entering.HasValue == true)
     {
         this.entering = element.entering;
     }
     if (element.m_evttimer.HasValue == true)
     {
         this.evttimer = element.evttimer;
     }
     if (element.m_evttimer2.HasValue == true)
     {
         this.evttimer2 = element.evttimer2;
     }
     if (element.m_exitspeed != null)
     {
         this.exitspeed = element.exitspeed;
     }
     if (element.m_exitspeedpercent.HasValue == true)
     {
         this.exitspeedpercent = element.exitspeedpercent;
     }
     if (element.m_extstop.HasValue == true)
     {
         this.extstop = element.extstop;
     }
     if (element.m_fifoids != null)
     {
         this.fifoids = element.fifoids;
     }
     if (element.m_fifosize.HasValue == true)
     {
         this.fifosize = element.fifosize;
     }
     if (element.m_forceblocktimer.HasValue == true)
     {
         this.forceblocktimer = element.forceblocktimer;
     }
     if (element.m_gomanual.HasValue == true)
     {
         this.gomanual = element.gomanual;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_iid != null)
     {
         this.iid = element.iid;
     }
     if (element.m_incline.HasValue == true)
     {
         this.incline = element.incline;
     }
     if (element.m_len.HasValue == true)
     {
         this.len = element.len;
     }
     if (element.m_locid != null)
     {
         this.locid = element.locid;
     }
     if (element.m_managerid != null)
     {
         this.managerid = element.managerid;
     }
     if (element.m_manual.HasValue == true)
     {
         this.manual = element.manual;
     }
     if (element.m_maxkmh.HasValue == true)
     {
         this.maxkmh = element.maxkmh;
     }
     if (element.m_maxwaittime.HasValue == true)
     {
         this.maxwaittime = element.maxwaittime;
     }
     if (element.m_minwaittime.HasValue == true)
     {
         this.minwaittime = element.minwaittime;
     }
     if (element.m_mvdistance.HasValue == true)
     {
         this.mvdistance = element.mvdistance;
     }
     if (element.m_mvmph.HasValue == true)
     {
         this.mvmph = element.mvmph;
     }
     if (element.m_mvscale.HasValue == true)
     {
         this.mvscale = element.mvscale;
     }
     if (element.m_port.HasValue == true)
     {
         this.port = element.port;
     }
     if (element.m_power.HasValue == true)
     {
         this.power = element.power;
     }
     if (element.m_prevstate != null)
     {
         this.prevstate = element.prevstate;
     }
     if (element.m_remote.HasValue == true)
     {
         this.remote = element.remote;
     }
     if (element.m_reserved.HasValue == true)
     {
         this.reserved = element.reserved;
     }
     if (element.m_show.HasValue == true)
     {
         this.show = element.show;
     }
     if (element.m_signal != null)
     {
         this.signal = element.signal;
     }
     if (element.m_signalR != null)
     {
         this.signalR = element.signalR;
     }
     if (element.m_smallsymbol.HasValue == true)
     {
         this.smallsymbol = element.smallsymbol;
     }
     if (element.m_speed != null)
     {
         this.speed = element.speed;
     }
     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_td.HasValue == true)
     {
         this.td = element.td;
     }
     if (element.m_terminalstation.HasValue == true)
     {
         this.terminalstation = element.terminalstation;
     }
     if (element.m_ttid != null)
     {
         this.ttid = element.ttid;
     }
     if (element.m_turnoutstolock != null)
     {
         this.turnoutstolock = element.turnoutstolock;
     }
     if (element.m_type != null)
     {
         this.type = element.type;
     }
     if (element.m_typeperm != null)
     {
         this.typeperm = element.typeperm;
     }
     if (element.m_updateenterside.HasValue == true)
     {
         this.updateenterside = element.updateenterside;
     }
     if (element.m_wait.HasValue == true)
     {
         this.wait = element.wait;
     }
     if (element.m_waitmode != null)
     {
         this.waitmode = element.waitmode;
     }
     if (element.m_waittime.HasValue == true)
     {
         this.waittime = element.waittime;
     }
     if (element.m_wsignal != null)
     {
         this.wsignal = element.wsignal;
     }
     if (element.m_wsignalR != null)
     {
         this.wsignalR = element.wsignalR;
     }
     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;
     }
     if (element.m_ori != null)
     {
         this.ori = element.ori;
     }
     this.actionctrllist = element.actionctrllist;
     this.excllist       = element.excllist;
     this.fbeventlist    = element.fbeventlist;
     this.incllist       = element.incllist;
 }
Ejemplo n.º 2
0
        public static bk Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            bk _bk = new bk();

            _bk.m_rocrailClient     = rocrailClient;
            _bk.m_acceptghost       = (bool?)xml.Attribute("acceptghost");
            _bk.m_acceptident       = (bool?)xml.Attribute("acceptident");
            _bk.m_addr              = (int?)xml.Attribute("addr");
            _bk.m_allowbbt          = (bool?)xml.Attribute("allowbbt");
            _bk.m_allowchgdir       = (bool?)xml.Attribute("allowchgdir");
            _bk.m_blankatredsignal  = (bool?)xml.Attribute("blankatredsignal");
            _bk.m_blankatredsignalR = (bool?)xml.Attribute("blankatredsignalR");
            _bk.m_cmd              = (string)xml.Attribute("cmd");
            _bk.m_commuter         = (string)xml.Attribute("commuter");
            _bk.m_departdelay      = (int?)xml.Attribute("departdelay");
            _bk.m_desc             = (string)xml.Attribute("desc");
            _bk.m_electrified      = (bool?)xml.Attribute("electrified");
            _bk.m_entering         = (bool?)xml.Attribute("entering");
            _bk.m_evttimer         = (int?)xml.Attribute("evttimer");
            _bk.m_evttimer2        = (int?)xml.Attribute("evttimer2");
            _bk.m_exitspeed        = (string)xml.Attribute("exitspeed");
            _bk.m_exitspeedpercent = (int?)xml.Attribute("exitspeedpercent");
            _bk.m_extstop          = (bool?)xml.Attribute("extstop");
            _bk.m_fifoids          = (string)xml.Attribute("fifoids");
            _bk.m_fifosize         = (int?)xml.Attribute("fifosize");
            _bk.m_forceblocktimer  = (bool?)xml.Attribute("forceblocktimer");
            _bk.m_gomanual         = (bool?)xml.Attribute("gomanual");
            _bk.m_id              = (string)xml.Attribute("id");
            _bk.m_iid             = (string)xml.Attribute("iid");
            _bk.m_incline         = (int?)xml.Attribute("incline");
            _bk.m_len             = (int?)xml.Attribute("len");
            _bk.m_locid           = (string)xml.Attribute("locid");
            _bk.m_managerid       = (string)xml.Attribute("managerid");
            _bk.m_manual          = (bool?)xml.Attribute("manual");
            _bk.m_maxkmh          = (int?)xml.Attribute("maxkmh");
            _bk.m_maxwaittime     = (int?)xml.Attribute("maxwaittime");
            _bk.m_minwaittime     = (int?)xml.Attribute("minwaittime");
            _bk.m_mvdistance      = (int?)xml.Attribute("mvdistance");
            _bk.m_mvmph           = (bool?)xml.Attribute("mvmph");
            _bk.m_mvscale         = (int?)xml.Attribute("mvscale");
            _bk.m_port            = (int?)xml.Attribute("port");
            _bk.m_power           = (bool?)xml.Attribute("power");
            _bk.m_prevstate       = (string)xml.Attribute("prevstate");
            _bk.m_remote          = (bool?)xml.Attribute("remote");
            _bk.m_reserved        = (bool?)xml.Attribute("reserved");
            _bk.m_show            = (bool?)xml.Attribute("show");
            _bk.m_signal          = (string)xml.Attribute("signal");
            _bk.m_signalR         = (string)xml.Attribute("signalR");
            _bk.m_smallsymbol     = (bool?)xml.Attribute("smallsymbol");
            _bk.m_speed           = (string)xml.Attribute("speed");
            _bk.m_speedpercent    = (int?)xml.Attribute("speedpercent");
            _bk.m_state           = (string)xml.Attribute("state");
            _bk.m_stopspeed       = (string)xml.Attribute("stopspeed");
            _bk.m_td              = (bool?)xml.Attribute("td");
            _bk.m_terminalstation = (bool?)xml.Attribute("terminalstation");
            _bk.m_ttid            = (string)xml.Attribute("ttid");
            _bk.m_turnoutstolock  = (string)xml.Attribute("turnoutstolock");
            _bk.m_type            = (string)xml.Attribute("type");
            _bk.m_typeperm        = (string)xml.Attribute("typeperm");
            _bk.m_updateenterside = (bool?)xml.Attribute("updateenterside");
            _bk.m_wait            = (bool?)xml.Attribute("wait");
            _bk.m_waitmode        = (string)xml.Attribute("waitmode");
            _bk.m_waittime        = (int?)xml.Attribute("waittime");
            _bk.m_wsignal         = (string)xml.Attribute("wsignal");
            _bk.m_wsignalR        = (string)xml.Attribute("wsignalR");
            _bk.m_x   = (int?)xml.Attribute("x");
            _bk.m_y   = (int?)xml.Attribute("y");
            _bk.m_z   = (int?)xml.Attribute("z");
            _bk.m_ori = (string)xml.Attribute("ori");
            Definitions.Tools.ParseList <actionctrl>(_bk.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient);
            Definitions.Tools.ParseList <excl>(_bk.m_excllist, xml, "excl", excl.Parse, rocrailClient);
            Definitions.Tools.ParseList <fbevent>(_bk.m_fbeventlist, xml, "fbevent", fbevent.Parse, rocrailClient);
            Definitions.Tools.ParseList <incl>(_bk.m_incllist, xml, "incl", incl.Parse, rocrailClient);
            return(_bk);
        }