Пример #1
0
        public static fb Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            fb _fb = new fb();

            _fb.m_rocrailClient = rocrailClient;
            _fb.m_accnr         = (int?)xml.Attribute("accnr");
            _fb.m_activelow     = (bool?)xml.Attribute("activelow");
            _fb.m_addr          = (int?)xml.Attribute("addr");
            _fb.m_blockid       = (string)xml.Attribute("blockid");
            _fb.m_bus           = (int?)xml.Attribute("bus");
            _fb.m_carcount      = (int?)xml.Attribute("carcount");
            _fb.m_category      = (int?)xml.Attribute("category");
            _fb.m_cmd           = (string)xml.Attribute("cmd");
            _fb.m_countedcars   = (int?)xml.Attribute("countedcars");
            _fb.m_counter       = (int?)xml.Attribute("counter");
            _fb.m_ctcaddr       = (int?)xml.Attribute("ctcaddr");
            _fb.m_ctcasswitch   = (bool?)xml.Attribute("ctcasswitch");
            _fb.m_ctcbus        = (int?)xml.Attribute("ctcbus");
            _fb.m_ctcgate       = (int?)xml.Attribute("ctcgate");
            _fb.m_ctciid        = (string)xml.Attribute("ctciid");
            _fb.m_ctcport       = (int?)xml.Attribute("ctcport");
            _fb.m_curve         = (bool?)xml.Attribute("curve");
            _fb.m_cutoutaddr    = (int?)xml.Attribute("cutoutaddr");
            _fb.m_cutoutbus     = (int?)xml.Attribute("cutoutbus");
            _fb.m_desc          = (string)xml.Attribute("desc");
            _fb.m_direction     = (bool?)xml.Attribute("direction");
            _fb.m_fbtype        = (int?)xml.Attribute("fbtype");
            _fb.m_id            = (string)xml.Attribute("id");
            _fb.m_identifier    = (string)xml.Attribute("identifier");
            _fb.m_iid           = (string)xml.Attribute("iid");
            _fb.m_info          = (string)xml.Attribute("info");
            _fb.m_load          = (int?)xml.Attribute("load");
            _fb.m_oid           = (string)xml.Attribute("oid");
            _fb.m_ori           = (string)xml.Attribute("ori");
            _fb.m_resetwc       = (bool?)xml.Attribute("resetwc");
            _fb.m_shortcut      = (bool?)xml.Attribute("shortcut");
            _fb.m_show          = (bool?)xml.Attribute("show");
            _fb.m_state         = (bool?)xml.Attribute("state");
            _fb.m_timer         = (int?)xml.Attribute("timer");
            _fb.m_val           = (int?)xml.Attribute("val");
            _fb.m_wheelcount    = (int?)xml.Attribute("wheelcount");
            _fb.m_x             = (int?)xml.Attribute("x");
            _fb.m_y             = (int?)xml.Attribute("y");
            _fb.m_z             = (int?)xml.Attribute("z");
            _fb.m_zone          = (string)xml.Attribute("zone");

            if (_fb.id == "D164")
            {
            }

            Definitions.Tools.ParseList <actionctrl>(_fb.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient);

            _fb.m_routeids = (string)xml.Attribute("routeids");

            return(_fb);
        }
Пример #2
0
        public void Update(fb element)
        {
            if (element.m_accnr.HasValue == true)
            {
                this.accnr = element.accnr;
            }
            if (element.m_activelow.HasValue == true)
            {
                this.activelow = element.activelow;
            }
            if (element.m_addr.HasValue == true)
            {
                this.addr = element.addr;
            }
            if (element.m_blockid != null)
            {
                this.blockid = element.blockid;
            }
            if (element.m_bus.HasValue == true)
            {
                this.bus = element.bus;
            }
            if (element.m_carcount.HasValue == true)
            {
                this.carcount = element.carcount;
            }
            if (element.m_category.HasValue == true)
            {
                this.category = element.category;
            }
            if (element.m_cmd != null)
            {
                this.cmd = element.cmd;
            }
            if (element.m_countedcars.HasValue == true)
            {
                this.countedcars = element.countedcars;
            }
            if (element.m_counter.HasValue == true)
            {
                this.counter = element.counter;
            }
            if (element.m_ctcaddr.HasValue == true)
            {
                this.ctcaddr = element.ctcaddr;
            }
            if (element.m_ctcasswitch.HasValue == true)
            {
                this.ctcasswitch = element.ctcasswitch;
            }
            if (element.m_ctcbus.HasValue == true)
            {
                this.ctcbus = element.ctcbus;
            }
            if (element.m_ctcgate.HasValue == true)
            {
                this.ctcgate = element.ctcgate;
            }
            if (element.m_ctciid != null)
            {
                this.ctciid = element.ctciid;
            }
            if (element.m_ctcport.HasValue == true)
            {
                this.ctcport = element.ctcport;
            }
            if (element.m_curve.HasValue == true)
            {
                this.curve = element.curve;
            }
            if (element.m_cutoutaddr.HasValue == true)
            {
                this.cutoutaddr = element.cutoutaddr;
            }
            if (element.m_cutoutbus.HasValue == true)
            {
                this.cutoutbus = element.cutoutbus;
            }
            if (element.m_desc != null)
            {
                this.desc = element.desc;
            }
            if (element.m_direction.HasValue == true)
            {
                this.direction = element.direction;
            }
            if (element.m_fbtype.HasValue == true)
            {
                this.fbtype = element.fbtype;
            }
            if (element.m_id != null)
            {
                this.id = element.id;
            }
            if (element.m_identifier != null)
            {
                this.identifier = element.identifier;
            }
            if (element.m_iid != null)
            {
                this.iid = element.iid;
            }
            if (element.m_info != null)
            {
                this.info = element.info;
            }
            if (element.m_load.HasValue == true)
            {
                this.load = element.load;
            }
            if (element.m_oid != null)
            {
                this.oid = element.oid;
            }
            if (element.m_ori != null)
            {
                this.ori = element.ori;
            }
            if (element.m_resetwc.HasValue == true)
            {
                this.resetwc = element.resetwc;
            }
            if (element.m_shortcut.HasValue == true)
            {
                this.shortcut = element.shortcut;
            }
            if (element.m_show.HasValue == true)
            {
                this.show = element.show;
            }
            if (element.m_state.HasValue == true)
            {
                this.state = element.state;
            }
            if (element.m_timer.HasValue == true)
            {
                this.timer = element.timer;
            }
            if (element.m_val.HasValue == true)
            {
                this.val = element.val;
            }
            if (element.m_wheelcount.HasValue == true)
            {
                this.wheelcount = element.wheelcount;
            }
            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_zone != null)
            {
                this.zone = element.zone;
            }
            //this.actionctrllist = element.actionctrllist;

            if (element.m_routeids != null)
            {
                this.routeids = element.routeids;
            }
        }