Пример #1
0
        public Task Execute(IJobExecutionContext context)
        {
            _sc = context.Scheduler.Context;
            _name = context.JobDetail.Key.Name;

            _tagGroup = (TagGroup)_sc.Get(_name);

            return _tagGroup.OnSchedulerTriggerRead();
        }
Пример #2
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);
        }