コード例 #1
0
        public void setMonitorVehicle(string vh_id)
        {
            lock (predictPathHandler)
            {
                if (InObservationVh != null)
                {
                    InObservationVh.removeEventHandler(predictPathHandler);
                }

                resetSpecifyRail();
                resetSpecifyAdr();
                if (!BCFUtility.isEmpty(vh_id))
                {
                    InObservationVh = scApp.getEQObjCacheManager().getVehicletByVHID(vh_id);

                    changePredictPathByInObservation();

                    InObservationVh.addEventHandler(predictPathHandler
                                                    , BCFUtility.getPropertyName(() => InObservationVh.VhExcuteCMDStatusChangeEvent)
                                                    , (s1, e1) => { changePredictPathByInObservation(); });
                    InObservationVh.addEventHandler(predictPathHandler
                                                    , BCFUtility.getPropertyName(() => InObservationVh.VhStatusChangeEvent)
                                                    , (s1, e1) => { changePredictPathByInObservation(); });

                    cmb_Vehicle.Text = vh_id;
                    VehicleObjToShow veicleObjShow = scApp.getEQObjCacheManager().CommonInfo.ObjectToShow_list.Where(o => o.VEHICLE_ID == vh_id).FirstOrDefault();
                    if (veicleObjShow != null)
                    {
                        int selectIndex = scApp.getEQObjCacheManager().CommonInfo.ObjectToShow_list.IndexOf(veicleObjShow);
                        if (selectIndex >= 0)
                        {
                            if ((dgv_vhStatus.SelectedRows.Count > 0 && dgv_vhStatus.SelectedRows[0].Index != selectIndex) ||
                                dgv_vhStatus.SelectedRows.Count == 0)
                            {
                                dgv_vhStatus.Rows[selectIndex].Selected      = true;
                                dgv_vhStatus.FirstDisplayedScrollingRowIndex = selectIndex;
                            }
                        }
                    }
                }
                else
                {
                    if (dgv_vhStatus.SelectedRows.Count > 0)
                    {
                        dgv_vhStatus.SelectedRows[0].Selected = false;
                    }
                    cmb_Vehicle.Text = string.Empty;
                }
            }
        }
コード例 #2
0
        public void setMonitorVehicle(object obj, string vh_id)
        {
            try
            {
                lock (predictPathHandler)
                {
                    if (InObservationVh != null)
                    {
                        InObservationVh.removeEventHandler(predictPathHandler);
                    }

                    resetSpecifyRail();
                    resetSpecifyAdr();
                    if (!BCFUtility.isEmpty(vh_id))
                    {
                        InObservationVh = app.ObjCacheManager.GetVEHICLE(vh_id);

                        changePredictPathByInObservation();

                        InObservationVh.addEventHandler(predictPathHandler
                                                        , BCFUtility.getPropertyName(() => InObservationVh.VhExcuteCMDStatusChangeEvent)
                                                        , (s1, e1) => { changePredictPathByInObservation(); });
                        InObservationVh.addEventHandler(predictPathHandler
                                                        , BCFUtility.getPropertyName(() => InObservationVh.VhStatusChangeEvent)
                                                        , (s1, e1) => { changePredictPathByInObservation(); });

                        IndicateVhInfoFromDgv(vh_id);
                    }
                    //else
                    //{
                    //    if (dgv_vehilce_status.SelectedRows.Count > 0)
                    //        dgv_vehilce_status.SelectedRows[0].Selected = false;
                    //}
                }
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Exception");
            }
        }
コード例 #3
0
 private void removeEvent()
 {
     eqpt.removeEventHandler(event_id);
 }