示例#1
0
        internal void Pge_Sel(eVIWER id, object sender)
        {
            var pnl = (UserControl)sender;

            if (null == pnl)
            {
                return;
            }
            if (_CurrView == id)
            {
                return;
            }
            var userCtrl = _dicPnl[id];

            Tmr_Work(_CurrView, false);
            DoingExchange(eDATAEXCHANGE.UI2Data, Pnl_Curr);
            pnl_Main.Children.Clear();
            switch (id)
            {
            case eVIWER.None: break;

            case eVIWER.Pnl_Vec: break;

            case eVIWER.Pnl_Pwr: break;
            }
            DoingExchange(eDATAEXCHANGE.Data2UI, id);
            pnl_Main.Children.Add(userCtrl);
            _CurrView = id;
            Tmr_Work(_CurrView);
        }
示例#2
0
        public void _Initialize(eVIWER name, MainCtrl ctrl)
        {
            _ctrl       = ctrl;
            this.Name   = name.ToString();
            DataContext = this;

            _tmrUpdate          = new DispatcherTimer();
            _tmrUpdate.Interval = TimeSpan.FromMilliseconds(0.1);    //시간간격 설정
            _tmrUpdate.Tick    += new EventHandler(Tmr_Tick);        //이벤트 추가
            SetConnection(false);

            cmb_Dev.Items.Clear();
            foreach (ePWRTYPE item in Enum.GetValues(typeof(ePWRTYPE)))
            {
                cmb_Dev.Items.Add(item.ToString());
            }
            cmb_Dev.SelectedIndex = 0;

            cmb_Port.Items.Clear();
            foreach (ePWR_PortName item in Enum.GetValues(typeof(ePWR_PortName)))
            {
                cmb_Port.Items.Add(item.ToString());
            }
            cmb_Port.SelectedIndex = 0;
        }
        public void _Initialize(eVIWER name, MainCtrl ctrl)
        {
            _ctrl       = ctrl;
            this.Name   = name.ToString();
            DataContext = this;

            _tmrUpdate          = new DispatcherTimer();
            _tmrUpdate.Interval = TimeSpan.FromMilliseconds(0.1);    //시간간격 설정
            _tmrUpdate.Tick    += new EventHandler(Tmr_Tick);        //이벤트 추가

            SetConnection(false);
        }
示例#4
0
        private void Tmr_Work(eVIWER id, bool bTrg = true)
        {
            pgeMoni_Vec.Tmr_Work(false);
            pgeMoni_Pwr.Tmr_Work(false);
            if (true == bTrg)
            {
                switch (id)
                {
                case eVIWER.Pnl_Vec: pgeMoni_Vec.Tmr_Work(true); break;

                case eVIWER.Pnl_Pwr: pgeMoni_Pwr.Tmr_Work(true); break;
                }
            }
        }
示例#5
0
        public void DoingExchange(eDATAEXCHANGE dir, eVIWER id)
        {
            switch (dir)
            {
            case eDATAEXCHANGE.Data2UI:
                switch (id)
                {
                case eVIWER.None:
                    pgeMoni_Vec.DoingExchange(eDATAEXCHANGE.Data2UI);
                    pgeMoni_Pwr.DoingExchange(eDATAEXCHANGE.Data2UI);
                    break;

                case eVIWER.Pnl_Vec: pgeMoni_Vec.DoingExchange(eDATAEXCHANGE.Data2UI); break;

                case eVIWER.Pnl_Pwr: pgeMoni_Pwr.DoingExchange(eDATAEXCHANGE.Data2UI); break;
                }
                break;

            case eDATAEXCHANGE.UI2Data:
                switch (id)
                {
                case eVIWER.None: break;

                case eVIWER.Pnl_Vec: pgeMoni_Vec.DoingExchange(eDATAEXCHANGE.UI2Data); break;

                case eVIWER.Pnl_Pwr: pgeMoni_Pwr.DoingExchange(eDATAEXCHANGE.UI2Data); break;
                }
                break;

            case eDATAEXCHANGE.Load:
                Tmr_Work(true);
                Pge_Sel(eVIWER.Pnl_Vec, pgeMoni_Vec);
                DoingExchange(eDATAEXCHANGE.Data2UI, id);
                break;

            case eDATAEXCHANGE.Save:
                DoingExchange(eDATAEXCHANGE.UI2Data, id);
                //_Data.Inst.SysSave();
                DoingExchange(eDATAEXCHANGE.Data2UI, id);
                break;

            case eDATAEXCHANGE.StatusUpdate:
                if (togleTime.IsOver(1 * 1000))
                {
                    bTogle ^= true;
                }
                break;
            }
        }
        public void ViewDataUpdate(UserControl userControl, string ucname = "")
        {
            string UC_Name = string.Empty;

            if (userControl != null)
            {
                UC_Name = userControl.ToString().Split('.')[2].Split('_')[2];
            }
            else
            {
                UC_Name = ucname;
            }

            switch (UC_Name)
            {
            case "Monitor":
                OnEventProvingData?.Invoke(this, providingData);
                OnEventRecvingData?.Invoke(this, recvingData);
                break;

            case "Manual":
                break;

            case "IO":
                OnEventViewIOList?.Invoke(this, viewIOList);
                break;

            case "TowerLamp":
                OnEventViewLampList?.Invoke(this, _sys.lmp);
                break;

            case "Goal":
                OnEventViewGoalList?.Invoke(this, _sys.goals);
                break;

            case "PIO":
                OnEventViewPIOList?.Invoke(this, _sys.cfg.pio);
                break;

            case "Option":
                OnEventViewOptionList?.Invoke(this, _sys.cfg);
                break;
            }
            CurrentView = (eVIWER)Enum.Parse(typeof(eVIWER), UC_Name);
        }
示例#7
0
 public SubItem(eVIWER name, PackIconKind icon, UserControl screen = null)
 {
     Name   = name;
     Icon   = icon;
     Screen = screen;
 }
 public pge_Moni_Vec(eVIWER name, MainCtrl ctrl)
 {
     InitializeComponent();
     _Initialize(name, ctrl);
 }
示例#9
0
 public UDATESTATUS()
 {
     id   = eVIWER.None;
     mthd = msg = string.Empty;
 }