public static void SetSWRThreshold(double swr_thresh) { byte cmd = 0; if (swr_thresh == 1.1) { cmd = (byte)ATURequest.REQ_SWR11; } else if (swr_thresh == 1.3) { cmd = (byte)ATURequest.REQ_SWR13; } else if (swr_thresh == 1.5) { cmd = (byte)ATURequest.REQ_SWR15; } else if (swr_thresh == 1.7) { cmd = (byte)ATURequest.REQ_SWR17; } else if (swr_thresh == 2.0) { cmd = (byte)ATURequest.REQ_SWR20; } else if (swr_thresh == 2.5) { cmd = (byte)ATURequest.REQ_SWR25; } else if (swr_thresh == 3.0) { cmd = (byte)ATURequest.REQ_SWR30; } FWC.ATUSendCmd(cmd, 0, 0); FlushBuffer(true); }
public static void FullTune() { byte cmd, b2, b3; byte b4 = 1; int count = 0; FlushBuffer(false); Debug.WriteLine("fulltune start"); FWC.ATUSendCmd((byte)ATURequest.REQ_FULLTUNE, 0, 0); do { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); ParseResult(cmd, b2, b3); Thread.Sleep(10); } while (cmd != 6 && cmd != 10 && count++ < 900); //6 = CMD_SWR (tune success), 10 = CMD_TUNEFAIL if (tune_pass) { Debug.WriteLine("fwd: " + fwd_pwr.ToString("f2") + " ref: " + rev_pwr.ToString("f2") + " swr: " + swr.ToString("f2") + ":1-------------------------------"); } else { Debug.WriteLine("Tune Failed: " + ((ATUTuneFail)tune_fail).ToString()); } FlushBuffer(false); }
private void radModeBypass_CheckedChanged(object sender, System.EventArgs e) { if (!console.fwc_init || console.CurrentModel != Model.FLEX5000) { return; } if (radModeBypass.Checked) { if (FWCATU.AutoStatus == 1) { FWCATU.AutoTuning(false); } if (FWCATU.Active) { FWCATU.Activate(false); } if (FWC.old_atu == true) { FWC.ATUSendCmd(9, 0, 0); //prevent Thread.Sleep(200); } else { //Debug.WriteLine("setting antenna 1..."); FWCATU.SelectAntenna1(); } current_tune_mode = FWCATUMode.Bypass; console.FWCATUBypass(); } grpTune.Enabled = !radModeBypass.Checked; }
public static void DecrementCapacitance() { byte cmd, b2, b3, b4; FWC.ATUSendCmd((byte)ATURequest.REQ_CAPDN, 0, 0); do { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); ParseResult(cmd, b2, b3); } while(b4 > 0); }
public static void IncrementInductance() { byte cmd, b2, b3, b4; FWC.ATUSendCmd((byte)ATURequest.REQ_INDUP, 0, 0); do { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); ParseResult(cmd, b2, b3); } while(b4 > 0); }
//===================================================================== // ke9ns add public static void ReadSWR() { int count = 0; byte cmd, b2, b3, b4; FWC.ATUSendCmd((byte)ATURequest.REQ_ALLUPDATE, 0, 0); do { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 250); ParseResult(cmd, b2, b3); Thread.Sleep(10); } while (cmd != 255 && count++ < 20); //6 = CMD_SWR (tune success), 10 = CMD_TUNEFAIL } // ReadSWR()
public static void Activate(bool b) { byte cmd; if (b) { cmd = (byte)ATURequest.REQ_TUNER_ACTIVE; } else { cmd = (byte)ATURequest.REQ_TUNER_STANDBY; } FWC.ATUSendCmd(cmd, 0, 0); FlushBuffer(true); }
public static void AutoTuning(bool b) { byte cmd; if (b) { cmd = (byte)ATURequest.REQ_AUTO_ON; } else { cmd = (byte)ATURequest.REQ_AUTO_OFF; } FWC.ATUSendCmd(cmd, 0, 0); //Thread.Sleep(3000); FlushBuffer(true); }
private void radModeBypass_CheckedChanged(object sender, System.EventArgs e) { if (radModeBypass.Checked) { if (FWCATU.AutoStatus == 1) { FWCATU.AutoTuning(false); } if (FWCATU.Active) { FWCATU.Activate(false); } FWC.ATUSendCmd(9, 0, 0); current_tune_mode = FWCATUMode.Bypass; } grpTune.Enabled = !radModeBypass.Checked; }
public static void FullTune() { int count = 0; bool done_tuning = false; byte cmd, b2, b3, b4; FWC.ATUSendCmd((byte)ATURequest.REQ_FULLTUNE, 0, 0); while (!done_tuning) { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); ParseResult(cmd, b2, b3); switch ((ATUResponse)cmd) { case ATUResponse.CMD_TUNEPASS: case ATUResponse.CMD_TUNEFAIL: done_tuning = true; break; } Thread.Sleep(100); if (count++ > 200) { break; } } for (int i = 0; i < 13; i++) { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); if (cmd == 200 || b4 == 0) { break; } ParseResult(cmd, b2, b3); } if (tune_pass) { Debug.WriteLine("fwd: " + fwd_pwr.ToString("f2") + " ref: " + rev_pwr.ToString("f2") + " swr: " + swr.ToString("f2") + ":1"); } else { Debug.WriteLine("Tune Failed: " + ((ATUTuneFail)tune_fail).ToString()); } }
public static void Activate(bool b) { byte cmd, b2, b3, b4; if (b) { cmd = (byte)ATURequest.REQ_TUNER_ACTIVE; } else { cmd = (byte)ATURequest.REQ_TUNER_STANDBY; } FWC.ATUSendCmd(cmd, 0, 0); do { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); ParseResult(cmd, b2, b3); } while(b4 > 0); }
public static void AutoTuning(bool b) { byte cmd, b2, b3, b4; if (b) { cmd = (byte)ATURequest.REQ_AUTO_ON; } else { cmd = (byte)ATURequest.REQ_AUTO_OFF; } FWC.ATUSendCmd(cmd, 0, 0); do { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); ParseResult(cmd, b2, b3); } while(b4 > 0); }
public static void SetSWRThreshold(double swr_thresh) { byte cmd = 0, b2, b3, b4; if (swr_thresh == 1.1) { cmd = (byte)ATURequest.REQ_SWR11; } else if (swr_thresh == 1.3) { cmd = (byte)ATURequest.REQ_SWR13; } else if (swr_thresh == 1.5) { cmd = (byte)ATURequest.REQ_SWR15; } else if (swr_thresh == 1.7) { cmd = (byte)ATURequest.REQ_SWR17; } else if (swr_thresh == 2.0) { cmd = (byte)ATURequest.REQ_SWR20; } else if (swr_thresh == 2.5) { cmd = (byte)ATURequest.REQ_SWR25; } else if (swr_thresh == 3.0) { cmd = (byte)ATURequest.REQ_SWR30; } FWC.ATUSendCmd(cmd, 0, 0); do { FWC.ATUGetResult(out cmd, out b2, out b3, out b4, 200); ParseResult(cmd, b2, b3); } while(b4 > 0); }
public static void DecrementInductance() { FWC.ATUSendCmd((byte)ATURequest.REQ_INDDN, 0, 0); FlushBuffer(true); }
public static void NoOp() { FWC.ATUSendCmd((byte)ATURequest.REQ_NOOP, 0, 0); }
public static void SelectAntenna2() { FWC.ATUSendCmd((byte)ATURequest.REQ_ANT2, 0, 0); Thread.Sleep(200); FlushBuffer(true); }
public static void DecrementCapacitance() { FWC.ATUSendCmd((byte)ATURequest.REQ_CAPDN, 0, 0); FlushBuffer(true); }