コード例 #1
0
        public async Task AddCommand(ScadaCommand command)
        {
            var commands = await this.StateManager.GetOrAddAsync <IReliableDictionary <string, List <ScadaCommand> > >("commands", TimeSpan.FromSeconds(60));

            if (command.RegisterType == SCADA.Common.DataModel.RegisterType.BINARY_INPUT)
            {
                using (var tx = this.StateManager.CreateTransaction())
                {
                    if (await commands.GetCountAsync(tx) == 0)
                    {
                        await commands.SetAsync(tx, "scada", new List <ScadaCommand>(), TimeSpan.FromSeconds(60), CancellationToken.None);
                    }
                    await tx.CommitAsync();
                }
                localCommands = new List <ScadaCommand>();
                return;
            }
            AddLocalCommand(command);
        }
コード例 #2
0
 public async Task ExecuteCommand(ScadaCommand command)
 {
     var client = BuildClient();
     await client.InvokeWithRetryAsync(x => x.Channel.ExecuteCommand(command));
 }
コード例 #3
0
ファイル: FEPService.cs プロジェクト: vukisic/SCADA_Project
 public Task AddCommand(ScadaCommand command)
 {
     _fep.ExecuteCommand(command);
     return(Task.CompletedTask);
 }
コード例 #4
0
        public Task Commmand(ScadaCommand command)
        {
            var client = BuildClient();

            return(client.InvokeWithRetryAsync(x => x.Channel.Commmand(command)));
        }
コード例 #5
0
 public Task ExecuteCommand(ScadaCommand command)
 {
     ServiceEventSource.Current.ServiceMessage(_context, "FEP - ExecuteCommand called!");
     _addCommand(command);
     return(Task.CompletedTask);
 }
コード例 #6
0
ファイル: FEP.cs プロジェクト: vukisic/SCADA_Project
 public void ExecuteCommand(ScadaCommand command)
 {
     processingManager.ExecuteWriteCommand(command.RegisterType, command.Index, command.Value);
 }
コード例 #7
0
 public void AddLocalCommand(ScadaCommand command)
 {
     localCommands.Add(command);
 }