Esempio n. 1
0
        public ClientRabbit(int port)
        {
            Init();
            Id   = GetMacAddress();
            Port = port;

            _parser             = new BufferParser();
            _parser.StructRead += (parser, structure) =>
            {
                if (DataReceived != null)
                {
                    foreach (var struc in structure)
                    {
                        DataReceived(this, struc);
                    }
                }
            };
            HasSubscriptionToData = false;
        }
Esempio n. 2
0
        public Client()
        {
            Init();

            _parser             = new BufferParser();
            _parser.StructRead += (parser, structure) =>
            {
                if (DataReceived != null)
                {
                    DataReceived(this, structure);
                }
            };
            _parserHistory = new BufferParser()
            {
                IsHistorical = true
            };
            _parserHistory.StructRead += (parser, structure) =>
            {
                if (DataReceived != null)
                {
                    DataReceived(this, structure);
                }
            };
            _parserRT             = new BufferParser();
            _parserRT.StructRead += (parser, structure) =>
            {
                if (DataReceived != null)
                {
                    DataReceived(this, structure);
                }
            };

            FlushStructsHistory.Elapsed  += FlushStructsHistoryEvent;
            FlushStructsHistory.AutoReset = true;
            FlushStructsHistory.Start();

            HasSubscriptionToData = false;
        }