Example #1
0
        public EventsViewerViewModel()
        {
            EventsSummaries                  = new Dictionary <string, EventsSummaryViewModel>();
            EventsSummaries["Поточні"]       = new EventsSummaryViewModel(Env.Current.EventsSummary, new FreeSCADA.Common.Events.Filters.GlobalFilter());
            EventsSummaries["Всі"]           = new EventsSummaryViewModel(new ArchiveEventsSource(), new FreeSCADA.Common.Events.Filters.GlobalFilter());
            EventsSummaries["Технологичні"]  = new EventsSummaryViewModel(new ArchiveEventsSource(), new FreeSCADA.Common.Events.Filters.TechnologyFilter());
            EventsSummaries["Диагностичні"]  = new EventsSummaryViewModel(new ArchiveEventsSource(), new FreeSCADA.Common.Events.Filters.DiagnosticFilter());
            EventsSummaries["Дії Оператора"] = new EventsSummaryViewModel(new ArchiveEventsSource(), new FreeSCADA.Common.Events.Filters.AuditFilter());

            //           EventsSummaries["Аварийные"] = new EventsSummaryViewModel(new ArchiveEventsSource(), new FreeSCADA.Common.Events.Filters.LevelFilter(FreeSCADA.Interfaces.AlarmLevel.Red));
//            EventsSummaries["Предупредительные"] = new EventsSummaryViewModel(new ArchiveEventsSource(), new FreeSCADA.Common.Events.Filters.LevelFilter(FreeSCADA.Interfaces.AlarmLevel.Orange));
        }
        public MainWindowViewModel()
        {
            base.DisplayName  = Strings.MainWindowViewModel_DisplayName;
            _schemaRepository = new SchemaRepository();


            _loginCommandViewModel = new LoginCommandViewModel();
            CommonEventSummaries   = new EventsSummaryViewModel(Env.Current.EventsSummary, new FreeSCADA.Common.Events.Filters.GlobalFilter());
            _statusChanel          = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.Pwork");
            if (_statusChanel == null)
            {
                throw new Exception("Status channel does not exists");
            }
            _statusChanel.PropertyChanged += new PropertyChangedEventHandler(_chanel_PropertyChanged);
            _autoModeChannel = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.Mode");
            _autoModeChannel.PropertyChanged += new PropertyChangedEventHandler(_chanel_PropertyChanged);
            ShowSchema(new MainSchema());
        }