Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 public LogicPWMConnector()
 {
     deviceConnector = new MSaleaeDevices();
     deviceConnector.OnLogicConnect += new MSaleaeDevices.OnLogicConnectDelegate(devices_OnConnect);
     deviceConnector.OnDisconnect   += new MSaleaeDevices.OnDisconnectDelegate(devices_OnDisconnect);
     pwmGenerator            = new LogicPwmDataGenerator();
     pwmGenerator.sampleRate = sampleRate;
     deviceConnector.BeginConnect();
 }
Пример #2
0
        public void Dispose()
        {
            this.Disconnect();
            Thread.Sleep(100);                  // Allow the PWM generator to fully stop
            pwmGenerator.Dispose();

            pwmGenerator    = null;
            logicDevice     = null;
            deviceConnector = null;
            running         = false;

            GC.Collect();
        }