Esempio n. 1
0
        public void OpenSession(SequenceSessionData sessionData)
        {
            _curPeriod   = 0;
            _sessionData = sessionData;
            try
            {
                _outfs = File.Create(_sessionData.OutFileName, _sessionData.ChannelNames.Count * 2, FileOptions.None);
            }
            catch (Exception e)
            {
                _outfs = null;
                throw e;
            }
            _xmlData          = new Vix2XMLData();
            _xmlData.Channels = new List <Vix2Channel>();

            _xmlData.Time = _sessionData.TimeMS.ToString();

            _xmlData.EventPeriodInMilliseconds = _sessionData.PeriodMS.ToString();

            _adder = 0;
            if (_sessionData.TimeMS % _sessionData.PeriodMS != 0)
            {
                _adder = 1;
            }

            _periodData = new Byte[sessionData.ChannelNames.Count * (_sessionData.NumPeriods + _adder)];

            _xmlData.MinimumLevel = "0";
            _xmlData.MaximumLevel = "255";
            _xmlData.AudioDevice  = "-1";
            _xmlData.AudioVolume  = "0";
        }
Esempio n. 2
0
        public void OpenSession(SequenceSessionData sessionData)
        {
            _curPeriod = 0;
            _sessionData = sessionData;
            try
            {
                _outfs = File.Create(_sessionData.OutFileName, _sessionData.ChannelNames.Count * 2, FileOptions.None);
            }
            catch (Exception e)
            {
                _outfs = null;
                throw e;
            }
            _xmlData = new Vix2XMLData();
            _xmlData.Channels = new List<Vix2Channel>();

            _xmlData.Time = _sessionData.TimeMS.ToString();

            _xmlData.EventPeriodInMilliseconds = _sessionData.PeriodMS.ToString();

            _adder = 0;
            if (_sessionData.TimeMS % _sessionData.PeriodMS != 0)
            {
                _adder = 1;
            }

            _periodData = new Byte[sessionData.ChannelNames.Count * (_sessionData.NumPeriods + _adder)];

            _xmlData.MinimumLevel = "0";
            _xmlData.MaximumLevel = "255";
            _xmlData.AudioDevice = "-1";
            _xmlData.AudioVolume = "0";
        }