Пример #1
0
        private void OnSignalGroupsChanged(FasenChangedMessage obj)
        {
            if (_fasenChanging)
            {
                return;
            }

            _fasenChanging = true;

            if (obj.RemovedFasen?.Any() == true)
            {
                foreach (var sg in obj.RemovedFasen)
                {
                    var vm = AllSignalGroups.FirstOrDefault(x => x.Naam == sg.Naam);
                    if (vm == null)
                    {
                        continue;
                    }
                    AllSignalGroups.Remove(vm);
                    AllSignalGroupStrings.Remove(vm.Naam);
                }
            }
            if (obj.AddedFasen?.Any() == true)
            {
                foreach (var sg in obj.AddedFasen)
                {
                    AllSignalGroups.Add(new FaseCyclusViewModel(sg));
                    AllSignalGroupStrings.Add(sg.Naam);
                }
            }
            AllSignalGroups.BubbleSort();
            AllSignalGroupStrings.BubbleSort();

            _fasenChanging = false;
        }
Пример #2
0
        private void OnNameChanged(NameChangedMessage obj)
        {
            switch (obj.ObjectType)
            {
            case TLCGenObjectTypeEnum.Fase:
                AllSignalGroupStrings.Remove(obj.OldName);
                AllSignalGroupStrings.Add(obj.NewName);
                AllSignalGroups.BubbleSort();
                AllSignalGroupStrings.BubbleSort();
                break;

            case TLCGenObjectTypeEnum.Detector:
                AllDetectorStrings.Remove(obj.OldName);
                AllDetectorStrings.Add(obj.NewName);
                AllDetectors.BubbleSort();
                AllDetectorStrings.BubbleSort();
                RefreshVecomDetectors();
                break;

            case TLCGenObjectTypeEnum.Input:
                AllIngangen.BubbleSort();
                break;

            case TLCGenObjectTypeEnum.SelectieveDetector:
                AllSelectiveDetectorStrings.Remove(obj.OldName);
                AllSelectiveDetectorStrings.Add(obj.NewName);
                AllSelectiveDetectorStrings.BubbleSort();
                break;
            }
            foreach (var detectorsCollectionView in _detectorsCollectionViews)
            {
                detectorsCollectionView.Value.Refresh();
            }
        }
Пример #3
0
        private void OnControllerLoaded(ControllerLoadedMessage obj)
        {
            AllIngangen.Clear();
            AllSignalGroups.Clear();
            AllSignalGroupStrings.Clear();
            AllDetectors.Clear();
            AllDetectorStrings.Clear();
            AllSelectiveDetectors.Clear();
            AllSelectiveDetectorStrings.Clear();
            AllVecomDetectors.Clear();
            AllVecomDetectorStrings.Clear();

            Controller = obj.Controller;

            if (obj.Controller == null)
            {
                return;
            }

            foreach (var sg in obj.Controller.Fasen)
            {
                AllSignalGroups.Add(new FaseCyclusViewModel(sg));
                AllSignalGroupStrings.Add(sg.Naam);
                foreach (var d in sg.Detectoren)
                {
                    AllDetectors.Add(new DetectorViewModel(d)
                    {
                        FaseCyclus = sg.Naam
                    });
                    AllDetectorStrings.Add(d.Naam);
                }
            }

            foreach (var d in obj.Controller.Detectoren)
            {
                AllDetectors.Add(new DetectorViewModel(d));
                AllDetectorStrings.Add(d.Naam);
            }
            foreach (var seld in obj.Controller.SelectieveDetectoren)
            {
                AllSelectiveDetectors.Add(new SelectieveDetectorViewModel(seld));
                AllSelectiveDetectorStrings.Add(seld.Naam);
            }
            foreach (var ingang in obj.Controller.Ingangen)
            {
                AllIngangen.Add(new IngangViewModel(ingang));
            }
        }
        public void ReLoadSignalsAndSignalGroups()
        {
            m_angleReference.GetPoints(out MetadataBase angleReference);

            AllSignals      allSignals      = new AllSignals();
            AllSignalGroups allSignalGroups = new AllSignalGroups();

            m_allSignals.Clear();
            allSignals.Signals.ForEach(x => m_allSignals.Add(x.MakeSignal()));
            Dictionary <ulong, MetadataBase> allPoints = m_allSignals.ToDictionary(signal => signal.HistorianId.Value);

            m_allSignalGroups.Clear();
            allSignalGroups.SignalGroups.ForEach(x =>
            {
                SignalGroup group = x.CreateGroup(allPoints, angleReference);
                group.GetAllSignals().ToList().ForEach(y => m_allSignals.Add(y));
                m_allSignalGroups.Add(group);
            });
        }
        public void ReLoadSignalsAndSignalGroups()
        {
            MetadataBase angleReference;
            m_angleReference.GetPoints(out angleReference);

            AllSignals allSignals = new AllSignals();
            AllSignalGroups allSignalGroups = new AllSignalGroups();

            m_allSignals.Clear();
            allSignals.Signals.ForEach(x => m_allSignals.Add(x.MakeSignal()));
            Dictionary<ulong, MetadataBase> allPoints = m_allSignals.ToDictionary(signal => signal.HistorianId.Value);

            m_allSignalGroups.Clear();
            allSignalGroups.SignalGroups.ForEach(x =>
            {
                SignalGroup group = x.CreateGroup(allPoints, angleReference);
                group.GetAllSignals().ToList().ForEach(y => m_allSignals.Add(y));
                m_allSignalGroups.Add(group);
            });
        }