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 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; } }
private void InitializeStatusLoop() { var thread = new Thread(() => { while (_working) { // 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.Error("Request general status failed by TimeoutException", ex); } // Perform your work here. try { logger.Info("Request General Status"); ExciterManagerApi.GeneralStatus(); logger.Info("Request Supply Status"); ExciterManagerApi.SupplyStatus(); logger.Info("Request Rfcu1 Status"); ExciterManagerApi.Rfcu1Status(); logger.Info("Request Rfcu2 Status"); ExciterManagerApi.Rfcu2Status(); logger.Info("Request Warning Status"); ExciterManagerApi.WarningStatus(); } catch (InvalidOperationException ex) { logger.Error("Request general status failed: ", ex); ExciterManagerApi.Dispose(); } Thread.Sleep(2000); } finally { if (hasHandle) { mutex.ReleaseMutex(); } } } } ExciterManagerApi.Dispose(); }) { Name = "Exciter Device Status" }; thread.Start(); }
public void SelfTest() { ExciterManagerApi.SelfTest(); }
public void Reset() { ExciterManagerApi.Reset(); }
public void SwitchToRemoteMode() { ExciterManagerApi.ControlMode(AccessMode.Remote); }
public void SwitchToLocalMode() { ExciterManagerApi.ControlMode(AccessMode.Local); }
public void PowerOff() { ExciterManagerApi.PowerOff(); }
public void PowerOn() { ExciterManagerApi.PowerOn(Power); }
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(); } } } }