Пример #1
0
        //public Tag(
        //    //IEventBus eventBus,
        //    INotifierMediatorService<NotifyTagEvent> notifierMediatorService,
        //    //Guid tagId,
        //    Guid id,
        //    int automationTypeId,
        //    string name,
        //    Guid connectionId,
        //    Connection connection,
        //    bool enable,
        //    string inputOutput,
        //    string analogDigitalSignal,
        //    string address,
        //    bool invoke,
        //    Guid tagGroupId,
        //    TagGroup tagGroup
        //)
        //    :base(/*LogManager.GetCurrentClassLogger(),*/ notifierMediatorService)
        //{
        //    //_eventBus = eventBus;
        //    Id = id;
        //    AutomationTypeId = automationTypeId;
        //    Name = name;
        //    ConnectionId = connectionId;
        //    Connection = connection;
        //    Enable = enable;
        //    InputOutput = inputOutput;
        //    AnalogDigitalSignal = analogDigitalSignal;
        //    Address = address;
        //    Invoke = invoke;
        //    TagGroupId = tagGroupId;
        //    TagGroup = tagGroup;

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

        //For DataGrid
        public Tag(
            //IMediator mediator,
            //Guid tagId,
            Guid id,
            int automationTypeId,
            string name,
            Guid connectionId,
            bool enable,
            string inputOutput,
            string analogDigitalSignal,
            string memoryAddress,
            bool invoke,
            Guid tagGroupId
            )
        //:base(/*LogManager.GetCurrentClassLogger()*//*, mediator*/)
        {
            //Console.WriteLine("base ForCSV: " + memoryAddress);
            Id = id;
            AutomationTypeId    = automationTypeId;
            Name                = name;
            ConnectionId        = connectionId;
            Enable              = enable;
            InputOutput         = inputOutput;
            AnalogDigitalSignal = analogDigitalSignal;
            MemoryAddress       = memoryAddress;
            Invoke              = invoke;
            TagGroupId          = tagGroupId;

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

            commonTagValidator.ValidateAndThrow(this);
        }
Пример #2
0
        //public Tag(INotifierMediatorService<NotifyTagEvent> notifierMediatorService)
        //    : base(notifierMediatorService)
        //{

        //}
        //public Tag(/*ILogger<Tag> logger,*/ /*INotifierMediatorService<NotifyTagEvent> notifierMediatorService*/)
        //    //: base(logger, notifierMediatorService)
        //{

        //}

        public Tag(
            //ILogger<Tag> logger,
            //IMediator mediator,
            int automationTypeId,
            string name,
            Guid connectionId,
            bool enable,
            string inputOutput,
            string analogDigitalSignal,
            string memoryAddress,
            bool invoke,
            Guid tagGroupId
            )
        //:base(logger/*, mediator*/)
        {
            AutomationTypeId    = automationTypeId;
            Name                = name;
            ConnectionId        = connectionId;
            Enable              = enable;
            InputOutput         = inputOutput;
            AnalogDigitalSignal = analogDigitalSignal;
            MemoryAddress       = memoryAddress;
            Invoke              = invoke;
            TagGroupId          = tagGroupId;

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

            commonTagValidator.ValidateAndThrow(this);
        }
Пример #3
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);
        }