public void ForceOutputLine1(ExciterOutputLine value) { _outputLine1 = value; switch (_outputLine1) { case ExciterOutputLine.Line1: ExciterManagerApi.Line1(true, false); break; case ExciterOutputLine.Line2: ExciterManagerApi.Line2(true, false); break; case ExciterOutputLine.Mic: ExciterManagerApi.Mic(true, false); break; case ExciterOutputLine.Mmc: ExciterManagerApi.Mmc(true, false); break; case ExciterOutputLine.Noise: ExciterManagerApi.Noise(NoiseSource1, ExciterNoise.Off); break; case ExciterOutputLine.Tone: ExciterManagerApi.ToneFrequency(ToneSource1, 0); break; } }
public void ForceOutputLine2(ExciterOutputLine value) { _outputLine2 = value; switch (_outputLine2) { case ExciterOutputLine.Line1: ExciterManagerApi.Line1(false, true); break; case ExciterOutputLine.Line2: ExciterManagerApi.Line2(false, true); break; case ExciterOutputLine.Mic: ExciterManagerApi.Mic(false, true); break; case ExciterOutputLine.Mmc: ExciterManagerApi.Mmc(false, true); break; case ExciterOutputLine.Noise: ExciterManagerApi.Noise(ExciterNoise.Off, NoiseSource2); break; case ExciterOutputLine.Tone: ExciterManagerApi.ToneFrequency(0, ToneSource2); break; } }
public void InitializeDefault() { // Need a place to store a return value in Mutex() constructor call bool createdNew; using (Mutex mutex = new Mutex(false, MutexId, out createdNew, SecuritySettings)) { bool hasHandle = false; try { try { // mutex.WaitOne(Timeout.Infinite, false); hasHandle = mutex.WaitOne(MutexTimeout, false); if (hasHandle == false) { throw new TimeoutException("Timeout waiting for exclusive access"); } } catch (AbandonedMutexException) { // Log the fact that the mutex was abandoned in another process, it will still get acquired hasHandle = true; } catch (TimeoutException ex) { logger.Info("InitializeDefault failed by TimeoutException", ex); } // Perform your work here. ExciterSpotApi.Spot(5000000, ExciterModulation.Cw); Thread.Sleep(400); ExciterManagerApi.ToneFrequency(1000, 1000); Thread.Sleep(400); //Exciter.MultiSpotPoint(0, 5000000, 20); MultiSpot[0] = new Tuple <uint, byte>(5000000, 20); Thread.Sleep(400); //Exciter.MultiSpotPoint(1, 5000000, 20); MultiSpot[1] = new Tuple <uint, byte>(5000000, 20); Thread.Sleep(400); for (byte i = 2; i < 16; i++) { MultiSpot[i] = new Tuple <uint, byte>(5000000, 0); //Exciter.MultiSpotPoint(i, 5000000, 0); Thread.Sleep(400); } Hopping.Gain = 20f; Exciter = Spot; } finally { if (hasHandle) { mutex.ReleaseMutex(); } } } }