Exemplo n.º 1
0
        public Biz(
            ILoggerFactory loggerFactory,
            IConnectionFactory connectionFactory,
            IExchangeComDeclareParameters exchangeDeclareParameters,
            IQueueComDeclareParameters queueDeclareParameters,
            INotifierMediatorService notifierMediatorService,
            ITagGroupReady tagGroupReady,
            IAllTagGroupAllConnection allTagGroupAllConnection,
            IComponentContext componentContext
            )
        {
            _loggerFactory             = loggerFactory;
            _logger                    = _loggerFactory.CreateLogger <Biz>();
            _connectionFactory         = connectionFactory;
            _exchangeDeclareParameters = exchangeDeclareParameters;
            _queueDeclareParameters    = queueDeclareParameters;
            _notifierMediatorService   = notifierMediatorService;
            _tagGroupReady             = tagGroupReady;
            _allTagGroupAllConnection  = allTagGroupAllConnection;
            _componentContext          = componentContext;

            _machineName = Environment.MachineName;
            _logger.LogInformation("KBase.Business.Com startup machine name: " + _machineName);

            PersistentConnection = new DefaultRabbitMqPersistentConnection(_connectionFactory, _loggerFactory);
        }
Exemplo n.º 2
0
 public KafkaClient(IProducer <Null, string> producer, IJsonSerializer eventSerializer,
                    IConsumer <Null, string> consumer, INotifierMediatorService notifierMediatorService)
 {
     _producer                = producer;
     _eventSerializer         = eventSerializer;
     _consumer                = consumer;
     _notifierMediatorService = notifierMediatorService;
 }
 public DadJokeCommandHandler(TwitchClientServices twitchClient, IMapper mapper, INotifierMediatorService notifierMediatorService, TwitchAPI twitchApiClient, IHubContext <TwitchHub> twitchHub, DadJokeService service, IOptions <TwitchConfig> config)
 {
     _twitchClient            = twitchClient.Client;
     _mapper                  = mapper;
     _notifierMediatorService = notifierMediatorService;
     _twitchApiClient         = twitchApiClient;
     _service                 = service;
     _config                  = config.Value;
 }
Exemplo n.º 4
0
 public TwitchChatNotificationHandler(INotifierMediatorService notifierMediatorService, IMapper mapper, IOptions <TwitchConfig> config, HtmlSanitizer sanitizer, TwitchAPI twitchApiClient, IHubContext <TwitchHub> twitchHub)
 {
     _notifierMediatorService = notifierMediatorService;
     _mapper          = mapper;
     _sanitizer       = sanitizer;
     _twitchApiClient = twitchApiClient;
     _twitchHub       = twitchHub;
     _config          = config.Value;
 }
Exemplo n.º 5
0
        public S7Tag(
            ////IEventBus eventBus,
            INotifierMediatorService notifierMediatorService,
            Guid id,
            int automationTypeId,
            string name,
            Guid connectionId,
            Connection connection,
            bool enable,
            string inputOutput,
            string analogDigitalSignal,
            string memoryAddress,
            bool invoke,
            Guid tagGroupId,
            TagGroup tagGroup,//
            int?dataBlock,
            int?offset,
            byte?bitOfByte,
            int?wordLenId,
            int?areaId,
            int?stringLength
            )
            : base(
                ////eventBus,
                ////LogManager.GetCurrentClassLogger(),
                ////new Logger<Tag>(),
                notifierMediatorService,
                id,
                automationTypeId,
                name,
                connectionId,
                connection,
                enable,
                inputOutput,
                analogDigitalSignal,
                memoryAddress,
                invoke,
                tagGroupId,
                tagGroup
                )
        {
            DataBlock    = dataBlock;
            Offset       = offset;
            BitOfByte    = bitOfByte;
            WordLenId    = wordLenId;
            AreaId       = areaId;
            StringLength = stringLength;

            var s7TagValidator = new Validator.S7.Tag();

            s7TagValidator.ValidateAndThrow(this);

            SetDataItem();
        }
 public StudenController(ILogger <StudenController> logger,
                         INotifierMediatorService notifierMediatorService,
                         ICommandBusMediatorService commandBusMediatorService,
                         IQueryBusMediatorService queryBusMediatorService
                         )
 {
     _logger = logger;
     _notifierMediatorService   = notifierMediatorService;
     _commandBusMediatorService = commandBusMediatorService;
     _queryBusMediatorService   = queryBusMediatorService;
 }
Exemplo n.º 7
0
 public OBSServices(
     OBSWebsocket obs,
     IOptions <OBSConfig> obsConfig,
     INotifierMediatorService notifierMediatorService,
     ILogger <OBSServices> logger)
 {
     OBSClient  = obs;
     _obsConfig = obsConfig.Value;
     _notifierMediatorService = notifierMediatorService;
     _logger = logger;
     SetupOBS();
 }
Exemplo n.º 8
0
 public OBSServices(
     IServiceProvider services,
     IOptions <OBSConfig> obsConfig,
     INotifierMediatorService notifierMediatorService,
     ILoggerFactory loggerFactory
     )
 {
     _obsConfig = obsConfig.Value;
     _services  = services;
     _notifierMediatorService = notifierMediatorService;
     _logger = loggerFactory.CreateLogger <OBSServices>();
     SetupOBS();
 }
Exemplo n.º 9
0
 public TagGroup(
     INotifierMediatorService notifierMediatorService,
     //ILoggerFactory loggerFactory,
     ////IConnectionFactory connectionFactory,
     Guid id, string name, int clock, int update, bool enable)
     : base(/*LogManager.GetCurrentClassLogger(),*/ notifierMediatorService)
 {
     //Logger = loggerFactory.CreateLogger<TagGroup>();
     //_connectionFactory = connectionFactory;
     //TagGroupId = tagGroupId;
     Id     = id;
     Name   = name;
     Clock  = clock;
     Update = update;
     Enable = enable;
 }
Exemplo n.º 10
0
        public TwitchBot(
            ILogger <TwitchBot> logger,
            TwitchClientServices twitchClientServices,
            INotifierMediatorService notifierMediatorService,
            TwitchPubSubService twitchPubSubService)
        {
            _logger = logger;
            _notifierMediatorService = notifierMediatorService;
            _twitchClientServices    = twitchClientServices;
            _twitchClientServices.Init();

            twitchPubSubService.PubSubClient.OnRewardRedeemed += OnRewardRedeemed;

            _twitchClientServices.Client.OnJoinedChannel       += ClientOnJoinedChannel;
            _twitchClientServices.Client.OnChatCommandReceived += ClientOnChatCommandReceived;
            _twitchClientServices.Client.OnMessageReceived     += ClientOnMessageReceived;

            _twitchClientServices.Connect();
        }
Exemplo n.º 11
0
        //public Tag(
        //    //IMediator mediator,
        //    int automationTypeId,
        //    string name,
        //    Guid connectionId,
        //    bool enable,
        //    string inputOutput,
        //    string analogDigitalSignal,
        //    string address,
        //    bool invoke,
        //    Guid tagGroupId
        //)
        //    //:base()
        //{
        //    AutomationTypeId = automationTypeId;
        //    Name = name;
        //    ConnectionId = connectionId;
        //    Enable = enable;
        //    InputOutput = inputOutput;
        //    AnalogDigitalSignal = analogDigitalSignal;
        //    Address = address;
        //    Invoke = invoke;
        //    TagGroupId = tagGroupId;

        //    var commonTagValidator = new Validator.Common.Tag();
        //    commonTagValidator.ValidateAndThrow(this);
        //}

        public Tag(
            ////IEventBus eventBus,
            ////ILogger<Tag> logger,
            INotifierMediatorService notifierMediatorService,
            ////Guid tagId,
            Guid id,
            int automationTypeId,
            string name,
            Guid connectionId,
            Connection connection,
            bool enable,
            string inputOutput,
            string analogDigitalSignal,
            string memoryAddress,
            bool invoke,
            Guid tagGroupId,
            TagGroup tagGroup
            )
            : base(/*logger,*/ notifierMediatorService)
        {
            //_eventBus = eventBus;
            Id = id;
            AutomationTypeId    = automationTypeId;
            Name                = name;
            ConnectionId        = connectionId;
            Connection          = connection;
            Enable              = enable;
            InputOutput         = inputOutput;
            AnalogDigitalSignal = analogDigitalSignal;
            MemoryAddress       = memoryAddress;
            Invoke              = invoke;
            TagGroupId          = tagGroupId;
            TagGroup            = tagGroup;

            var commonTagValidator = new Validator.Common.Tag();

            commonTagValidator.ValidateAndThrow(this);
        }
Exemplo n.º 12
0
 public ValuesController(INotifierMediatorService notifierMediatorService)
 {
     _notifierMediatorService = notifierMediatorService;
 }
        public Entity.Common.Tag GetCommonTag(INotifierMediatorService notifierMediatorService, /*IEventBus eventBus,*/ Connection connection, TagGroup tagGroup)
        {
            try
            {
                //return new Tag(LogManager.GetCurrentClassLogger());
                switch (AutomationTypeId)
                {
                case 0:
                    return(new Tag(
                               ////eventBus,
                               notifierMediatorService,
                               Id,
                               AutomationTypeId,
                               TagName,
                               ConnectionId,
                               connection,
                               true,
                               InputOutput,
                               AnalogDigitalSignal,
                               MemoryAddress,
                               Invoke,
                               TagGroupId,
                               tagGroup
                               ));

                case 1:
                    return(new Entity.S7.S7Tag(
                               ////eventBus,
                               notifierMediatorService,
                               Id,
                               AutomationTypeId,
                               TagName,
                               ConnectionId,
                               connection,
                               true,
                               InputOutput,
                               AnalogDigitalSignal,
                               MemoryAddress,
                               Invoke,
                               TagGroupId,
                               tagGroup,
                               DataBlock,
                               Offset,
                               BitOfByte,
                               WordLenId,
                               AreaId,
                               StringLength
                               ));

                //case 2:
                //    break;


                default:
                    return(new Entity.Common.Tag(
                               ////eventBus,
                               notifierMediatorService,
                               Id,
                               AutomationTypeId,
                               TagName,
                               ConnectionId,
                               connection,
                               true,
                               InputOutput,
                               AnalogDigitalSignal,
                               MemoryAddress,
                               Invoke,
                               TagGroupId,
                               tagGroup
                               ));
                }
            }
            catch (Exception ex)
            {
                //Logger.LogError("Domain.Entity.View.Joined.AllTagGroupAllConnection GetCommonTag: " + ex.Message + " - " + ex.StackTrace);
                return(null);
            }
        }
Exemplo n.º 14
0
 public ValuesController(INotifierMediatorService notifierMediatorService,
                         IMessageMediatorService messageMediatorService)
 {
     this._notifierMediatorService = notifierMediatorService;
     this._messageMediatorService  = messageMediatorService;
 }
 public WeatherForecastController(ILogger <WeatherForecastController> logger, IMediator mediator, INotifierMediatorService notifierMediatorService)
 {
     _logger   = logger;
     _mediator = mediator;
     _notifierMediatorService = notifierMediatorService;
 }
 public TwitchChatNotificationHandler2(IOptions <TwitchConfig> config, INotifierMediatorService notifierMediatorService)
 {
     _notifierMediatorService = notifierMediatorService;
     _config = config.Value;
 }
Exemplo n.º 17
0
 public NotifyController(ILogger <NotifyController> logger, INotifierMediatorService notifierMediatorService, INotifier notifier)
 {
     _logger = logger;
     this.notifierMediatorService = notifierMediatorService;
     this.notifier = notifier;
 }
Exemplo n.º 18
0
 public ValuesController(IEnumerable <INotifier> notifiers, INotifierMediatorService notifierMediatorService)
 {
     _notifiers = notifiers;
     _notifierMediatorService = notifierMediatorService;
 }
Exemplo n.º 19
0
 public void AddNotifierMediatorService(INotifierMediatorService notifierMediatorService)
 {
     NotifierMediatorService = notifierMediatorService;
 }
Exemplo n.º 20
0
 public EntityNotifier(INotifierMediatorService notifierMediatorService)
 {
     NotifierMediatorService = notifierMediatorService;
 }
Exemplo n.º 21
0
        public Entity.Common.TagGroup GetTagGroup(/*IConnectionFactory connectionFactory,*/ INotifierMediatorService notifierMediatorService)
        //public Entity.Common.TagGroup GetTagGroup(IConnection connectionFactory)
        {
            Logger?.LogInformation("GetTagGroup: " + Name);

            var tagGroup = new Entity.Common.TagGroup(
                notifierMediatorService,
                ////connectionFactory,
                Id,
                Name,
                Clock,
                Update,
                true
                );

            if (LoggerFactory is null)
            {
                return(tagGroup);
            }

            tagGroup.AddLoggerFactory(LoggerFactory);

            return(tagGroup);
        }
Exemplo n.º 22
0
 public HomeController(INotifierMediatorService notifierMediatorService)
 {
     _notifierMediatorService = notifierMediatorService;
 }
Exemplo n.º 23
0
 public WhoIsController(INotifierMediatorService notifierMediatorService,
                        IPublishEndpoint publishEndpoint)
 {
     _notifierMediatorService = notifierMediatorService ?? throw new System.ArgumentNullException(nameof(notifierMediatorService));
     _publishEndpoint         = publishEndpoint ?? throw new System.ArgumentNullException(nameof(publishEndpoint));
 }