Пример #1
0
            public IndicatorItem(int indID, int methID, string desc, ref ObservableCollection <SignalTypeContainer> signalTypeList, ref ObservableCollection <FilterContainer> exFiltList, ref ObservableCollection <FilterContainer> emFiltList)
            {
                _indicatorID = indID;
                _methodID    = methID;
                _description = desc;

                _excitationFilterList = exFiltList;
                _emissionsFilterList  = emFiltList;
                _signalTypeList       = signalTypeList;

                if (_excitationFilterList.Count() > 0)
                {
                    FilterContainer filter = _excitationFilterList.ElementAt(0);
                    _excitationFilterPosition = filter.PositionNumber;
                }

                if (_emissionsFilterList.Count() > 0)
                {
                    FilterContainer filter = _emissionsFilterList.ElementAt(0);
                    _emissionsFilterPosition = filter.PositionNumber;
                }

                if (_signalTypeList.Count() > 0)
                {
                    SignalTypeContainer st = _signalTypeList.ElementAt(0);
                    _signalType = st.Value;
                }
            }
Пример #2
0
 public void LoadSignalTypes()
 {
     SignalTypeList = new ObservableCollection <SignalTypeContainer>();
     foreach (SIGNAL_TYPE st in Enum.GetValues(typeof(SIGNAL_TYPE)))
     {
         SignalTypeContainer stc = new SignalTypeContainer();
         stc.Value       = st;
         stc.Description = st.ToString();
         SignalTypeList.Add(stc);
     }
 }
Пример #3
0
        private void SignalType_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            XamComboEditor xce    = (XamComboEditor)sender;
            DataRecord     record = (DataRecord)xce.DataContext;

            if (record == null)
            {
                return;
            }
            IndicatorItem indItem = (IndicatorItem)record.DataItem;

            if (xamDataGrid.ActiveDataItem == null)
            {
                return;
            }

            if (xamDataGrid.ActiveDataItem.GetType() == typeof(IndicatorItem))
            {
                IndicatorItem indicator = (IndicatorItem)xamDataGrid.ActiveDataItem;

                if (e.NewValue == null)
                {
                    return;
                }

                if (e.NewValue.GetType() == typeof(SignalTypeContainer))
                {
                    SignalTypeContainer st = (SignalTypeContainer)e.NewValue;

                    if (indicator.IndicatorID != 0 && indicator.IndicatorID == indItem.IndicatorID)  // the 2nd condition makes sure the event is for the currently active Indicator
                    {
                        IndicatorContainer ic = new IndicatorContainer();
                        ic.Description              = indicator.Description;
                        ic.EmissionsFilterPosition  = indicator.EmissionsFilterPosition;
                        ic.ExcitationFilterPosition = indicator.ExcitationFilterPosition;
                        ic.IndicatorID              = indicator.IndicatorID;
                        ic.MethodID   = indicator.MethodID;
                        ic.SignalType = st.Value;

                        bool succcess = wgDB.UpdateIndicator(ic);
                    }
                }
            }
        }
Пример #4
0
        public void RefreshSignalTypeList()
        {
            if (VM.SignalTypeList == null)
            {
                VM.SignalTypeList = new ObservableCollection <SignalTypeContainer>();
            }
            else
            {
                VM.SignalTypeList.Clear();
            }

            foreach (SIGNAL_TYPE st in Enum.GetValues(typeof(SIGNAL_TYPE)))
            {
                SignalTypeContainer stc = new SignalTypeContainer();
                stc.Value       = st;
                stc.Description = st.ToString();
                VM.SignalTypeList.Add(stc);
            }
        }