Пример #1
0
        public HttpResponseMessage JoinChannel(ChannelJoinModel channelModel)
        {
            var responseMsg = this.PerformOperation(() =>
            {
                ChannelsRepository.JoinChannel(channelModel.Name, channelModel.Nickname, channelModel.Password);
            });

            return(responseMsg);
        }
Пример #2
0
        public HttpResponseMessage ExitChannel(ChannelExitModel channelModel)
        {
            var responseMsg = this.PerformOperation(() =>
            {
                ChannelsRepository.ExitChannel(channelModel.Name, channelModel.Nickname);
            });

            return(responseMsg);
        }
Пример #3
0
        public HttpResponseMessage GetChannels()
        {
            var responseMsg = this.PerformOperation(() =>
            {
                var channels = ChannelsRepository.GetChannels();
                return(channels);
            });

            return(responseMsg);
        }
Пример #4
0
        public HttpResponseMessage GetHistory(string channelName)
        {
            var responseMsg = this.PerformOperation(() =>
            {
                var history = ChannelsRepository.GetHistory(channelName);
                return(history);
            });

            return(responseMsg);
        }
Пример #5
0
        public HttpResponseMessage AddMessage(ChannelAddMessageModel channelModel)
        {
            var responseMsg = this.PerformOperation(() =>
            {
                ChannelsRepository.AddMessage(channelModel.Name, channelModel.Nickname, channelModel.Message);
            });

            pubnub.Publish(channelModel.Name, channelModel.Message);

            return(responseMsg);
        }
Пример #6
0
        public HttpResponseMessage AddMessage(ChannelAddMessageModel channelModel)
        {
            var responseMsg = this.PerformOperation(() =>
            {
                var index   = channelModel.Message.IndexOf(':');
                var message = channelModel.Message.Substring(index + 2);
                ChannelsRepository.AddMessage(channelModel.Name, channelModel.Nickname, message);
            });

            pubnub.Publish(channelModel.Name, channelModel.Message);

            return(responseMsg);
        }
Пример #7
0
        public AutoSettingsSchema()
        {
            Name = "Автомат. режим";

            Kran3Prioritet = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Kran3.Prioritet");
            Kran4Prioritet = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Kran4.Prioritet");
            Pwork          = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.Pwork");
            SetPointMinMin = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.SetPointMinMIn");
            SetPointMin    = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.SetPointMin");
            SetPointMax    = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.SetPointMax");
            SetPointMaxMax = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.SetPointMaxMax");
            SpTimeout      = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.SpTimeout");
            RepairTime     = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.RepairTime");
            SecurityRule   = "Tune";
        }
Пример #8
0
        public KranElement(String name, String description)
        {
            Name = description;
            String prefix = "opc_connection_plug.Zachist." + name;

            OpenStateChannel    = ChannelsRepository.GetChannel(prefix + ".Opened");
            CloseStateChannel   = ChannelsRepository.GetChannel(prefix + ".Closed");
            OpenCommandChannel  = ChannelsRepository.GetChannel(prefix + ".OpenCMD");
            CloseCommandChannel = ChannelsRepository.GetChannel(prefix + ".CloseCMD");
            CommandChannel      = ChannelsRepository.GetChannel(prefix + ".Command");
            TimeoutChannel      = ChannelsRepository.GetChannel(prefix + ".Timeout");
            Prioritet           = ChannelsRepository.GetChannel(prefix + ".Prioritet");
            Prioritet2          = ChannelsRepository.GetChannel(prefix + ".Prioritet2");
            V110Channel         = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Discrets.V110");
            CoilOpenError       = ChannelsRepository.GetChannel(prefix + ".CoilOpenError");
            CoilCloseError      = ChannelsRepository.GetChannel(prefix + ".CoilCloseError");
        }
Пример #9
0
        public MainSchema()
        {
            Name = "Мнемосхема";

            Kran1 = new KranElement("Kran1", "Кран №1");
            Kran2 = new KranElement("Kran2", "Кран №2");
            Kran3 = new KranElement("Kran3", "Кран №3");
            Kran4 = new KranElement("Kran4", "Кран №4");
            Pin   = new ComplexParametrElement("Pin", "Вхiодний тиск");
            Pout  = new ComplexParametrElement("Pout", "Вихідний тиск");
            Tin   = new ComplexParametrElement("Tin", "Вхідна температура");
            Tout  = new ComplexParametrElement("Tout", "Вихідна температура");
            Pwork = ChannelsRepository.GetChannel("opc_connection_plug.Zachist.Auto.Pwork");
            Q1    = new ComplexParametrElement("Q1", "Загазованість канал 1");
            Q2    = new ComplexParametrElement("Q2", "Загазованість канал 2");
            Q3    = new ComplexParametrElement("Q3", "Загазованість канал 3");
            Q4    = new ComplexParametrElement("Q4", "Загазованість канал 4");
        }
        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());
        }
        public ComplexParametrElement(String name, string desc)
        {
            String prefix = "opc_connection_plug.Zachist.Analog." + name;

            Name         = name;
            Value        = ChannelsRepository.GetChannel(prefix + ".Value");
            SetpointLow  = ChannelsRepository.GetChannel(prefix + ".SetpointLow");
            SetpointHigh = ChannelsRepository.GetChannel(prefix + ".SetpointHigh");
            Gisteresis   = ChannelsRepository.GetChannel(prefix + ".Gisteresis");
            DiscretsLow  = ChannelsRepository.GetChannel(prefix + ".DiscretsLow");
            DiscretsHigh = ChannelsRepository.GetChannel(prefix + ".DiscretsHigh");
            RangeLow     = ChannelsRepository.GetChannel(prefix + ".RangeLow");
            RangeHigh    = ChannelsRepository.GetChannel(prefix + ".RangeHigh");
            Discrets     = ChannelsRepository.GetChannel(prefix + ".Discrets");
            BreakLow     = ChannelsRepository.GetChannel(prefix + ".BreakLow");
            BreakHigh    = ChannelsRepository.GetChannel(prefix + ".BreakHigh");
            Break        = ChannelsRepository.GetChannel(prefix + ".Break");
            SpLow        = ChannelsRepository.GetChannel(prefix + ".SpLow");
            SpHigh       = ChannelsRepository.GetChannel(prefix + ".SpHigh");
            Gisteresis   = ChannelsRepository.GetChannel(prefix + ".Gisteresis");
            Error        = ChannelsRepository.GetChannel(prefix + ".Error");
            Description  = desc;
        }
Пример #12
0
 public ChartModel(FreeSCADA.Archiver.ChannelInfo ch, List <ChartItemModel> data, Brush color)
 {
     Channel   = ChannelsRepository.GetChannel(ch.PluginId + "." + ch.ChannelName);
     ChartData = new MyObservableCollection <ChartItemModel>(data);
     Color     = color;
 }
Пример #13
0
        public ChannelsDataProvider(string connectionString)
        {
            var x = new DbConnectionOptions().GetMySqlConnection(connectionString);

            _repo = new ChannelsRepository(x);
        }