Inheritance: Vixen.Sys.Dispatch.CommandDispatch
Esempio n. 1
0
        public FGDimmer()
        {
            _commandHandler = new CommandHandler();
            DataPolicyFactory = new FGDimmerDataPolicyFactory();

            _packets = new byte[][]
            {
                new byte[34],
                new byte[34],
                new byte[34],
                new byte[34]
            };

            for (int i = 0; i < 4; i++)
            {
                _packets[i][0] = 0x55;
                _packets[i][1] = (byte)(i + 1);

            }
                _modules = new FGDimmerControlModule[4];
                for (int i = 0; i < 4; i++)
                {
                    _modules[i] = new FGDimmerControlModule(i + 1);
                }

                _eventThread = new Thread(new ThreadStart(EventThread));
                _eventTrigger = new AutoResetEvent(false);
                _multiplier = (float)100 / 255;
        }
Esempio n. 2
0
        public FGDimmer()
        {
            _commandHandler = new CommandHandler();
            DataPolicyFactory = new FGDimmerDataPolicyFactory();

            _packets = new byte[][]
            {
                new byte[34],
                new byte[34],
                new byte[34],
                new byte[34]
            };

            for (int i = 0; i < 4; i++)
            {
                _packets[i][0] = 0x55;
                _packets[i][1] = (byte)(i + 1);

            }
            _modules = new FGDimmerControlModule[4];
            for (int i = 0; i < 4; i++)
            {
                _modules[i] = new FGDimmerControlModule(i + 1);
            }

            _eventThread = new Thread(new ThreadStart(EventThread));
            _eventTrigger = new AutoResetEvent(false);
            _multiplier = (float)100 / 255;

            //set 2 minute timer before retrying to access com port
            _retryTimer = new System.Timers.Timer(120000);
            _retryTimer.Elapsed += new ElapsedEventHandler(_retryTimer_Elapsed);
            _retryCounter = 0;
        }