public void Initialize(FrmMain main) { int radioIndex, bandIndex, modeIndex, i, megaHertz; cdata = main.ContestDataProvider; mainForm = main; // Create look-up table based on actual frequency for simple look-up for (radioIndex = 0; radioIndex < 2; radioIndex++) { for (bandIndex = 0; bandIndex < 11; bandIndex++) { megaHertz = (int)(_scopeedge[radioIndex, bandIndex, 0, 0] / 1000.0); for (modeIndex = 0; modeIndex < 4; modeIndex++) { for (i = 0; i < 3; i++) { ScopeEdge[radioIndex, megaHertz, modeIndex, i] = _scopeedge[radioIndex, bandIndex, modeIndex, i]; } } } } cdata.ActiveRadioBandChanged += new ContestData.ActiveRadioBandChange(HandleActiveRadioBandChanged); }
public void Initialize(FrmMain main) { int radioIndex, bandIndex, megaHertz; CATCommon radio1 = main.COMMainProvider.RadioObject(1); cdata = main.ContestDataProvider; mainForm = main; if (radio1 != null) // Only test if radio is ICOM if radio exist { if (radio1.IsICOM()) { cdata.FocusedRadioChanged += new ContestData.FocusedRadioChange(HandleFocusChange); } } // Create look-up table based on actual frequency for simple look-up for (radioIndex = 0; radioIndex < 2; radioIndex++) { for (bandIndex = 0; bandIndex < 12; bandIndex++) { megaHertz = (int)(_txpower[radioIndex, bandIndex, 0] / 1000.0); TxPower[radioIndex, megaHertz] = _txpower[radioIndex, bandIndex, 1]; } } cdata.ActiveRadioBandChanged += new ContestData.ActiveRadioBandChange(HandleBandChange); }
// Toggle permanent stereo, execution of Main is mapped to Ctrl-Alt-S public void Main(FrmMain main, ContestData cdata, COMMain comMain) { int focusedRadio = cdata.FocusedRadio; bool stereoAudio = main.ListenStatusMode == COMMain.ListenMode.R1R2; if (cdata.OPTechnique == ContestData.Technique.SO2V) { if (!stereoAudio) { main.SetListenStatusMode(COMMain.ListenMode.R1R2, true, false); } else { main.SetListenStatusMode(focusedRadio == 1 ? COMMain.ListenMode.R1R1 : COMMain.ListenMode.R2R2, true, false); } main.SetMainStatusText(string.Format(statusMessage, focusedRadio == 1 ? "Main" : "Sub", stereoAudio ? "Single receiver" : "Stereo")); main.ScriptContinue = false; // Do not continue with DXLog's own key definition } else { main.ScriptContinue = true; // Use DXLog's own key definition if not SO2V } }
// Toggle dual watch in SO2V. Typically mapped to a key in upper left corner of keyboard. public void Main(FrmMain main, ContestData cdata, COMMain comMain) { int focusedRadio = cdata.FocusedRadio; bool stereoAudio = main.ListenStatusMode == COMMain.ListenMode.R1R2; bool tempStereoAudio; if (cdata.OPTechnique == ContestData.Technique.SO2V) { tempStereoAudio = tempStereoToggle ? stereoAudio : !stereoAudio; if (microHamPort != null) { main.SetMainStatusText(string.Format(statusMessage, focusedRadio == 1 ? "Main" : "Sub", tempStereoAudio ? "Stereo" : "Single receiver")); if (tempStereoAudio) { microHamPort._mk2r.SendCustomCommand("FRS"); } else { microHamPort._mk2r.SendCustomCommand(string.Format("FR{0}", focusedRadio == 1 ? 1 : 2)); // Remove conditional assignment? } tempStereoToggle = !tempStereoToggle; } } }
public DXLbuttonbar(ContestData cdata) { InitializeComponent(); ColorSetTypes = new string[] { "Background", "Color", "Header back color", "Header color", "Footer back color", "Footer color", "Final score color", "Selection back color", "Selection color" }; DefaultColors = new Color[] { Color.Turquoise, Color.Black, Color.Gray, Color.Black, Color.Silver, Color.Black, Color.Blue, Color.SteelBlue, Color.White }; FormLayoutChangeEvent += new FormLayoutChange(Handle_FormLayoutChangeEvent); }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { double frequency; int focusedradio, vfo; string mode, othervfo; focusedradio = cdata.FocusedRadio; // 1 or 2 vfo = cdata.Radios[focusedradio].ActiveVFO; // 0 = VFO A, 1 = VFO B mode = cdata.FocusedRadioActiveMode; frequency = cdata.Radios[focusedradio].Freq[vfo]; othervfo = vfo == 0 ? "B" : "A"; main.SetCATFrequency(focusedradio, othervfo, frequency); switch (mode) { case "SSB": case "LSB": case "USB": case "AM": case "FM": case "CW": main.SetCATMode(focusedradio, othervfo, mode, false); break; default: break; } }
public void Initialize(FrmMain main) { cdata = main.ContestDataProvider; mainForm = main; mainForm.KeyDown += new KeyEventHandler(HandleKeyPress); mainForm.KeyUp += new KeyEventHandler(HandleKeyRelease); }
// Executes at DXLog.net start public void Initialize(FrmMain main) { cdata = main.ContestDataProvider; mainForm = main; currentFilter = 2; // "Middle" filter SetIcomFilter(currentFilter); }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { //byte[] msg1 = new byte[] { 0x17, (byte)'A', (byte)'B', (byte)' ', (byte)'A', (byte)' ', (byte)'B' }; //byte[] msg2 = new byte[] { 0x17, (byte)'A', (byte)'B', (byte)' ', (byte)'A', (byte)' ', (byte)'B' }; byte[] msg1 = new byte[] { 0x17, (byte)'A', (byte)'B' }; byte[] msg2 = new byte[] { 0x17, (byte)'C', (byte)'D' }; CATCommon radio1 = mainForm.COMMainProvider.RadioObject(1); radio1.SendCustomCommand(msg1); radio1.SendCustomCommand(msg2); //main.SetMainStatusText(String.Format("Experiment: Speed={0} toggleSplit={1}", ICOMspeed, !toggleSplit)); //main.SetMainStatusText(String.Format("Experiment: Callsign = {0}", mainForm.CurrentEntryLine.ActualQSO.Callsign)); }
// Toggle dual watch when radio 1 is focused in SO2V. Typically mapped to a key in upper left corner of keyboard. public void Main(FrmMain main, ContestData cdata, COMMain comMain) { int focusedRadio = cdata.FocusedRadio; CATCommon radio1 = comMain.RadioObject(focusedRadio); bool radio1Present = radio1 != null; if ((focusedRadio == 1) && cdata.OPTechnique == ContestData.Technique.SO2V) { // If VFO A focused, SO2V and radio present tempStereoAudio = !tempStereoAudio; main.SetMainStatusText(tempStereoAudio ? "Both receivers." : "Main receiver only."); if (radio1Present) { radio1.SendCustomCommand(tempStereoAudio ? IcomDualWatchOn : IcomDualWatchOff); } } }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { cdata.TXOnRadio = cdata.FocusedRadio; if (!Sending) { Sending = true; mainForm.HandleTXRequestChange(Sending); mainForm.SetMainStatusText(string.Format("Transmitting on radio {0}.", cdata.TXOnRadio)); mainForm.COMMainProvider.SetPTTOn(cdata.TXOnRadio, false); } else { Sending = false; mainForm.HandleTXRequestChange(Sending); mainForm.SetMainStatusText(string.Format("PTT off on radio {0}", cdata.TXOnRadio)); mainForm.COMMainProvider.SetPTTOff(cdata.FocusedRadio); } }
// Toggle radio focus, call CQ public void Main(FrmMain main, ContestData cdata, COMMain comMain) { switch (cdata.OPTechnique) { case ContestData.Technique.SO2R: case ContestData.Technique.SO2V: cdata.ActiveRadio = (cdata.ActiveRadio == 1 ? 2 : 1); cdata.FocusedRadio = cdata.ActiveRadio; Thread.Sleep(50); // Wait 50ms for switch to safely complete main.SendKeyMessage(false, "F1"); main.SetMainStatusText(string.Format("Focus on radio {0}.", cdata.ActiveRadio)); main.ScriptContinue = false; // Do not continue with DXLog's own key definition break; default: main.ScriptContinue = true; // Use DXLog's own key definition if SO1R or SO2R advanced break; } }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { var radioObject = comMain.RadioObject(cdata.FocusedRadio); if (radioObject == null) { main.SetMainStatusText(string.Format("CAT object for radio {0} isn't available!", cdata.FocusedRadio)); return; } if (radioObject.TXStatus) { radioObject.SendCustomCommand("RX;"); } else { radioObject.SendCustomCommand("TX;"); } }
public void Initialize(FrmMain main) { CATCommon radio1 = main.COMMainProvider.RadioObject(1); cdata = main.ContestDataProvider; mainForm = main; lastFocus = 1; if ((radio1 != null) && (mainForm._cwKeyer != null)) { if (radio1.IsICOM()) { // Subscribe to CW speed change event mainForm._cwKeyer.CWSpeedChange += new CWKey.CWSpeedChangeDelegate(HandleCWSpeedChange); // Subscribe to radio focus change event cdata.FocusedRadioChanged += new ContestData.FocusedRadioChange(HandleFocusChange); } } }
// Toggle permanent dual watch, execution of Main is mapped to same key as built-in toggle Ctrl-Alt-S = AltGr-S. public void Main(FrmMain main, ContestData cdata, COMMain comMain) { CATCommon radio1 = comMain.RadioObject(1); int focusedRadio = cdata.FocusedRadio; bool stereoAudio = main.ListenStatusMode == COMMain.ListenMode.R1R2; bool modeIsSo2V = cdata.OPTechnique == ContestData.Technique.SO2V; bool radio1Present = radio1 != null; main.SetMainStatusText("Sub receiver " + (stereoAudio ? "not " : "") + "permanently on."); if (focusedRadio == 1 && radio1Present && modeIsSo2V) { if (radio1.IsICOM()) { radio1.SendCustomCommand(stereoAudio ? IcomDualWatchOff : IcomDualWatchOn); } } // Also execute the normal operation of the key main.ScriptContinue = true; }
// Switch to radio 1 if not selected. Then send CQ. public void Main(FrmMain main, ContestData cdata, COMMain comMain) { const int RUN = 0; const int radioSwitchingDelay = 25; if (cdata.OPTechnique == ContestData.Technique.SO2V) { if (cdata.FocusedRadio == 2) { main.handleKeyCommand("CHANGE_ACTIVE_RADIO", null, string.Empty); } //Thread.Sleep(25); if (cdata.RadioModePrimary != RUN) { main.handleKeyCommand("CHANGE_RUNSPMODE_PRIMARY", null, string.Empty); } Thread.Sleep(radioSwitchingDelay); main.SendKeyMessage(false, "F1"); } }
// Step through Antennas, Main is mapped to a key, typically not a shifted // key to allow rapid multiple presses // The value of currentAntenna steps through 1,2,3,1,2,3,1... public void Main(FrmMain main, ContestData cdata, COMMain comMain) { currentAntenna = (currentAntenna % 3) + 1; SetYaesuAntenna(currentAntenna, main); }
// No key is mapped to this script public void Main(FrmMain main, ContestData cdata, COMMain comMain) { }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { CATCommon usedRadio; int lowerEdge, upperEdge, refLevel, absRefLevel, megaHertz; int RadioNumber = cdata.FocusedRadio; // Radio index is radio number - 1 for SO2R, otherwise 0 which represents radio 1 int usedRadioIndex = ((cdata.OPTechnique == ContestData.Technique.SO2R) || (cdata.OPTechnique == ContestData.Technique.SO2R_ADV)) ? RadioNumber - 1 : 0; // If on VFO B in SO2V, do nothing and return if ((cdata.OPTechnique == ContestData.Technique.SO2V) && (RadioNumber == 2)) { return; } // If not waterfall capable, do nothing and return if (!WaterfallCapable[usedRadioIndex]) { return; } // only do when we know we have a valid radio index usedRadio = main.COMMainProvider.RadioObject(usedRadioIndex + 1); // If no CAT capable radio present if (usedRadio == null) { main.SetMainStatusText(string.Format("IcomWaterfallZoom: Radio {0} is not available.", usedRadioIndex + 1)); return; } megaHertz = (int)(usedRadio.VFOAFrequency / 1000.0); lowerEdge = (int)(usedRadio.VFOAFrequency + 0.5 - WaterfallWidth / 2.0); upperEdge = (int)(lowerEdge + WaterfallWidth); refLevel = RefLevel[usedRadioIndex, megaHertz]; absRefLevel = (refLevel >= 0) ? refLevel : -refLevel; IcomSetEdges[2] = (byte)(((RadioEdgeSet[megaHertz] / 10) << 4) + (RadioEdgeSet[megaHertz] % 10)); IcomSetEdges[5] = (byte)(((lowerEdge % 10) << 4)); // 1kHz & 100Hz IcomSetEdges[6] = (byte)((((lowerEdge / 100) % 10) << 4) + ((lowerEdge / 10) % 10)); // 100kHz & 10kHz IcomSetEdges[7] = (byte)((((lowerEdge / 10000) % 10) << 4) + (lowerEdge / 1000) % 10); // 10MHz & 1MHz IcomSetEdges[10] = (byte)(((upperEdge % 10) << 4)); // 1kHz & 100Hz IcomSetEdges[11] = (byte)((((upperEdge / 100) % 10) << 4) + (upperEdge / 10) % 10); // 100kHz & 10kHz IcomSetEdges[12] = (byte)((((upperEdge / 10000) % 10) << 4) + (upperEdge / 1000) % 10); // 10MHz & 1MHz IcomSetRefLevel[3] = (byte)((absRefLevel / 10) * 16 + absRefLevel % 10); IcomSetRefLevel[5] = (refLevel >= 0) ? (byte)0 : (byte)1; if (debug) { main.SetMainStatusText( string.Format("IcomWaterfallZoom: Radio # {0} Edge {1} Low {2} High {3} Ref {4} Commands: [{5}] [{6}]", usedRadioIndex + 1, UsedEdgeSet, lowerEdge, upperEdge, refLevel, BitConverter.ToString(IcomSetEdges), BitConverter.ToString(IcomSetRefLevel))); } usedRadio.SendCustomCommand(IcomSetFixedMode); // Set fixed mode usedRadio.SendCustomCommand(IcomSetEdgeSet); // Select edge set EdgeSet usedRadio.SendCustomCommand(IcomSetEdges); // set up waterfall edges usedRadio.SendCustomCommand(IcomSetRefLevel); // set scope ref level }
} // Do nothing at DXLog.net close down // Step through filters, Main is mapped to a key, typically not a shifted // key to allow rapid multiple presses public void Main(FrmMain main, ContestData cdata, COMMain comMain) { currentFilter = (currentFilter % 3) + 1; SetIcomFilter(currentFilter); }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { HandleActiveRadioBandChanged(1); }
public void Main(FrmMain main, ContestData cdata, COMMain comMain) { HandleBandChange(mainForm.ContestDataProvider.FocusedRadio); }