Esempio n. 1
0
        private void initialVhEvent(BCApplication _bcApp)
        {
            sc.AVEHICLE vh_1 = _bcApp.SCApplication.VehicleBLL.cache.getVhByID("B7_OHBLOOP_CR1");
            event_id = this.Name;
            vh_1.addEventHandler(event_id
                                 , nameof(vh_1.VhPositionChangeEvent)
                                 , (s1, e1) =>
            {
                updateVehiclePosition_vh1(vh1_position, s1 as sc.AVEHICLE);
            });
            //vh_1.addEventHandler(event_id
            //        , nameof(vh_1.VhStatusChangeEvent)
            //        , (s1, e1) =>
            //        {

            //        });
            //updateVehicleStatus_vh1(vh1, vh_1);

            sc.AVEHICLE vh_2 = _bcApp.SCApplication.VehicleBLL.cache.getVhByID("B7_OHBLOOP_CR2");
            event_id = this.Name;
            vh_2.addEventHandler(event_id
                                 , nameof(vh_2.VhPositionChangeEvent)
                                 , (s1, e1) =>
            {
                updateVehiclePosition_vh1(vh2_position, s1 as sc.AVEHICLE);
            });
            //updateVehicleStatus_vh1(vh2, vh_2);
        }
Esempio n. 2
0
            private void initialVhEvent()
            {
                string event_id = $"WPF_UI_{this.vh.VEHICLE_ID}";

                vh.addEventHandler(event_id
                                   , nameof(vh.VhPositionChangeEvent)
                                   , (s1, e1) =>
                {
                    updateVehiclePosition(s1 as sc.AVEHICLE);
                });
                vh.addEventHandler(event_id
                                   , nameof(vh.VhStatusChangeEvent)
                                   , (s1, e1) =>
                {
                    updateVehicleStatus(s1 as sc.AVEHICLE);
                });
                vh.addEventHandler(event_id
                                   , nameof(vh.isTcpIpConnect)
                                   , (s1, e1) =>
                {
                    updateVehicleStatus(s1 as sc.AVEHICLE);
                });
            }