private IDataPolicy _CreateDataPolicy(CommandOutput output) { IDataPolicy dataPolicy = _dataPolicyFactory.CreateDataPolicy(); _AddDataPolicy(output, dataPolicy); return(dataPolicy); }
internal OutputController(Guid id, string name, IOutputMediator <CommandOutput> outputMediator, IHardware executionControl, IOutputModuleConsumer <IControllerModuleInstance> outputModuleConsumer) { if (outputMediator == null) { throw new ArgumentNullException("outputMediator"); } if (executionControl == null) { throw new ArgumentNullException("executionControl"); } if (outputModuleConsumer == null) { throw new ArgumentNullException("outputModuleConsumer"); } Id = id; Name = name; _outputMediator = outputMediator; _executionControl = executionControl; _outputModuleConsumer = outputModuleConsumer; _dataPolicy = ControllerModule.DataPolicyFactory.CreateDataPolicy(); ControllerModule.DataPolicyFactoryChanged += DataPolicyFactoryChanged; }
private ICommand _GenerateOutputCommand(CommandOutput output) { if (output.State != null) { IDataPolicy effectiveDataPolicy = _dataPolicyProvider.GetDataPolicyForOutput(output); return(effectiveDataPolicy.GenerateCommand(output.State)); } return(null); }
private ICommand _GenerateOutputCommand(CommandOutput output) { if (output.State != null) { var lst = output.State.Value as List <IIntentState>; IDataPolicy effectiveDataPolicy = _dataPolicyProvider.GetDataPolicyForOutput(output); return(effectiveDataPolicy.GenerateCommand(output.State)); } return(null); }
private ICommand _GenerateOutputCommand(CommandOutput output) { if (output.State != null) { IDataPolicy effectiveDataPolicy = _dataPolicyProvider.GetDataPolicyForOutput(output); ICommand command = effectiveDataPolicy.GenerateCommand(output.State); if (command != null) { List <ICommand> commands = new List <ICommand>(); commands.Add(command); CommandsDataFlowData data = new CommandsDataFlowData(commands); command = effectiveDataPolicy.GenerateCommand(data); } return(command); } return(null); }
private void DataPolicyFactoryChanged(object sender, EventArgs eventArgs) { _dataPolicy = ControllerModule.DataPolicyFactory.CreateDataPolicy(); }
private void _AddDataPolicy(CommandOutput output, IDataPolicy dataPolicy) { lock (_outputDataPolicies) { _outputDataPolicies[output.Id] = dataPolicy; } }