diff --git a/Project Files/Source/ChannelMaster/aamix.c b/Project Files/Source/ChannelMaster/aamix.c index 9a4a79f2..1428c34c 100644 --- a/Project Files/Source/ChannelMaster/aamix.c +++ b/Project Files/Source/ChannelMaster/aamix.c @@ -31,6 +31,9 @@ __declspec (align (16)) AAMIX paamix[MAX_EXT_AAMIX]; // array of pointers for A void mix_main (void *pargs) { + const wchar_t* threadName = L"mix_main Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DWORD taskIndex = 0; HANDLE hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex); if (hTask != 0) AvSetMmThreadPriority(hTask, 2); diff --git a/Project Files/Source/ChannelMaster/cmUtilities.c b/Project Files/Source/ChannelMaster/cmUtilities.c index f876540e..ce7458c2 100644 --- a/Project Files/Source/ChannelMaster/cmUtilities.c +++ b/Project Files/Source/ChannelMaster/cmUtilities.c @@ -24,6 +24,9 @@ int done = 0; void WriteAudioFile (void* arg) { + const wchar_t* threadName = L"WriteAudioFile Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + byte* dat = (byte *) arg; FILE* file = fopen ("AudioFile", "wb"); @@ -115,6 +118,8 @@ struct EscribeEstructura EscribeCosas; void EscribeLoTodo (void* arg) { + const wchar_t* threadName = L"EscribeLoTodo Thread"; + SetThreadDescription(GetCurrentThread(), threadName); for (int i = 0; i < EscribeCosas.nddcs; i++) { diff --git a/Project Files/Source/ChannelMaster/cmbuffs.c b/Project Files/Source/ChannelMaster/cmbuffs.c index 01d6964a..12106c97 100644 --- a/Project Files/Source/ChannelMaster/cmbuffs.c +++ b/Project Files/Source/ChannelMaster/cmbuffs.c @@ -150,6 +150,9 @@ void cmdata (int id, double* out) void cm_main (void *pargs) { + const wchar_t* threadName = L"cm_main Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DWORD taskIndex = 0; HANDLE hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex); if (hTask != 0) AvSetMmThreadPriority(hTask, 2); diff --git a/Project Files/Source/ChannelMaster/netInterface.c b/Project Files/Source/ChannelMaster/netInterface.c index b4ccd198..7041c96e 100644 --- a/Project Files/Source/ChannelMaster/netInterface.c +++ b/Project Files/Source/ChannelMaster/netInterface.c @@ -1065,7 +1065,7 @@ void SetCWX(int bit) if (prn->tx[0].cwx != bit) { prn->tx[0].cwx = bit; - if (listenSock != INVALID_SOCKET) + if (listenSock != INVALID_SOCKET && prn->sendHighPriority != 0) //[2.10.3]MW0LGE considers high priority CmdHighPriority(); } } diff --git a/Project Files/Source/ChannelMaster/network.c b/Project Files/Source/ChannelMaster/network.c index 82d50681..9ec1c153 100644 --- a/Project Files/Source/ChannelMaster/network.c +++ b/Project Files/Source/ChannelMaster/network.c @@ -1228,6 +1228,9 @@ int IOThreadStop() { } DWORD WINAPI ReadThreadMain(LPVOID n) { + const wchar_t* threadName = L"ReadThreadMain Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DWORD taskIndex = 0; HANDLE hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex); if (hTask != 0) AvSetMmThreadPriority(hTask, 2); @@ -1243,6 +1246,8 @@ DWORD WINAPI ReadThreadMain(LPVOID n) { } DWORD WINAPI KeepAliveMain(LPVOID n) { + const wchar_t* threadName = L"KeepAliveMain Thread"; + SetThreadDescription(GetCurrentThread(), threadName); KeepAliveLoop(); diff --git a/Project Files/Source/ChannelMaster/networkproto1.c b/Project Files/Source/ChannelMaster/networkproto1.c index 40e5cb04..915f9624 100644 --- a/Project Files/Source/ChannelMaster/networkproto1.c +++ b/Project Files/Source/ChannelMaster/networkproto1.c @@ -234,6 +234,9 @@ int MetisWriteFrame(int endpoint, char* bufp) { // this is the main thread that reads data DWORD WINAPI MetisReadThreadMain(LPVOID n) { + const wchar_t* threadName = L"MetisReadThreadMain Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DWORD taskIndex = 0; HANDLE hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex); if (hTask != 0) AvSetMmThreadPriority(hTask, 2); @@ -677,6 +680,9 @@ void WriteMainLoop(char* bufp) DWORD WINAPI sendProtocol1Samples(LPVOID n) { + const wchar_t* threadName = L"sendProtocol1Samples Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DWORD taskIndex = 0; HANDLE hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex); if (hTask != 0) AvSetMmThreadPriority(hTask, 2); diff --git a/Project Files/Source/ChannelMaster/obbuffs.c b/Project Files/Source/ChannelMaster/obbuffs.c index a1436620..bfff9096 100644 --- a/Project Files/Source/ChannelMaster/obbuffs.c +++ b/Project Files/Source/ChannelMaster/obbuffs.c @@ -152,6 +152,9 @@ void obdata (int id, double* out) void ob_main (void *pargs) { + const wchar_t* threadName = L"ob_main Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DWORD taskIndex = 0; HANDLE hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex); if (hTask != 0) AvSetMmThreadPriority(hTask, 2); diff --git a/Project Files/Source/Console/BasicAudio.cs b/Project Files/Source/Console/BasicAudio.cs index 463cf020..bb01b3f4 100644 --- a/Project Files/Source/Console/BasicAudio.cs +++ b/Project Files/Source/Console/BasicAudio.cs @@ -86,6 +86,7 @@ public void Play() // even though m_objPlayer.Play() is async for some reason perhaps on initial play there would // be noticabled glitch in specturm. Starting it on this thread seems to reduce the occurance m_objThread = new Thread(new ThreadStart(playSound)); + m_objThread.Name = "Basic Audio Thread"; m_objThread.Priority = ThreadPriority.BelowNormal; m_objThread.IsBackground = true; m_objThread.Start(); diff --git a/Project Files/Source/Console/CAT/TCPIPcatServer.cs b/Project Files/Source/Console/CAT/TCPIPcatServer.cs index 334e0d93..cf1390c4 100644 --- a/Project Files/Source/Console/CAT/TCPIPcatServer.cs +++ b/Project Files/Source/Console/CAT/TCPIPcatServer.cs @@ -56,8 +56,9 @@ public void StartSocketListener() { m_clientListenerThread = new Thread(new ThreadStart(SocketListenerThreadStart)); + m_clientListenerThread.Name = "TCI clientListener Thread"; - m_clientListenerThread.Start(); + m_clientListenerThread.Start(); } } @@ -336,11 +337,13 @@ public void StartServer(Console c, bool bTCPIPcatWelcomeMessage = true) m_serverThread = new Thread(new ThreadStart(ServerThreadStart)); m_serverThread.Priority = ThreadPriority.BelowNormal; - m_serverThread.Start(); + m_serverThread.Name = "TCI server Thread"; + m_serverThread.Start(); m_purgingThread = new Thread(new ThreadStart(PurgingThreadStart)); m_purgingThread.Priority = ThreadPriority.Lowest; - m_purgingThread.Start(); + m_purgingThread.Name = "TCI purging Thread"; + m_purgingThread.Start(); } catch(SocketException se) { diff --git a/Project Files/Source/Console/TCIServer.cs b/Project Files/Source/Console/TCIServer.cs index 2a01b7d7..efaef872 100644 --- a/Project Files/Source/Console/TCIServer.cs +++ b/Project Files/Source/Console/TCIServer.cs @@ -393,8 +393,9 @@ public void StartSocketListener() m_clientListenerThread = new Thread(new ThreadStart(SocketListenerThreadStart)); + m_clientListenerThread.Name = "TCI client listener Thread"; - m_clientListenerThread.Start(); + m_clientListenerThread.Start(); } } @@ -2206,11 +2207,13 @@ public void StartServer(Console c, int rateLimit = 0, bool bCopyRX2VFObToVFOa = m_serverThread = new Thread(new ThreadStart(ServerThreadStart)); m_serverThread.Priority = ThreadPriority.BelowNormal; + m_serverThread.Name = "TCI server Thread"; m_serverThread.Start(); m_purgingThread = new Thread(new ThreadStart(PurgingThreadStart)); m_purgingThread.Priority = ThreadPriority.Lowest; - m_purgingThread.Start(); + m_purgingThread.Name = "TCI purging Thread"; + m_purgingThread.Start(); } catch(SocketException se) { diff --git a/Project Files/Source/Console/console.cs b/Project Files/Source/Console/console.cs index 8e7cd9a6..b6a662a1 100644 --- a/Project Files/Source/Console/console.cs +++ b/Project Files/Source/Console/console.cs @@ -1142,7 +1142,7 @@ public Console(string[] args) { draw_display_thread = new Thread(new ThreadStart(RunDisplay)) { - Name = "Draw Display Thread", + Name = "Run Display Thread", Priority = m_tpDisplayThreadPriority, //MW0LGE now defaulted with m_tpDisplayThreadPriority, and updated by setupform IsBackground = false//true MW0LGE_21b rundisplay now stops nicely, ensuring dx gpu resources are released }; @@ -2596,11 +2596,8 @@ public void ExitConsole() PA19.PA_Terminate(); // terminate audio interface DB.Exit(); // close and save database NetworkIO.DestroyRNet(); - if (radio != null) - { - radio.Shutdown(); - radio = null; - } + //if (radio != null) //[2.10.3]MW0LGE removed until WDSP close down issue resolved after using CWX - ForWarren + // radio.Shutdown(); Win32.TimeEndPeriod(1); // return to previous timing precision Thread.Sleep(100); } @@ -32894,6 +32891,24 @@ private void AudioMOXChanged(bool tx) ptbAF_Scroll(this, EventArgs.Empty); } + private bool _ignoreAntSelectionInHdwMox = false; + public void SetAntennasForCWX(bool state) + { + Debug.Print(">> SetAntennasForCWX <<"); + lock (_objBypassAntSelectionLocker) + { + _ignoreAntSelectionInHdwMox = true; + UpdateTRXAnt(); + if (rx1_xvtr_index >= 0) + { + Band lo_band = BandByFreq(XVTRForm.TranslateFreq(VFOAFreq), rx1_xvtr_index, false, current_region, true); + Alex.getAlex().UpdateAlexAntSelection(lo_band, state, alex_ant_ctrl_enabled, true); + } + else + Alex.getAlex().UpdateAlexAntSelection(tx_band, state, alex_ant_ctrl_enabled, false); + } + } + private object _objBypassAntSelectionLocker = new object(); private void HdwMOXChanged(bool tx, double freq) { if (tx) @@ -32923,10 +32938,8 @@ private void HdwMOXChanged(bool tx, double freq) UpdateRX2DDSFreq(); UpdateTXDDSFreq(); - Band lo_band = Band.FIRST; - Band lo_bandb = Band.FIRST; - lo_band = BandByFreq(XVTRForm.TranslateFreq(VFOAFreq), rx1_xvtr_index, false, current_region, true); - lo_bandb = BandByFreq(XVTRForm.TranslateFreq(VFOBFreq), rx2_xvtr_index, false, current_region, false); + Band lo_band = BandByFreq(XVTRForm.TranslateFreq(VFOAFreq), rx1_xvtr_index, false, current_region, true); + Band lo_bandb = BandByFreq(XVTRForm.TranslateFreq(VFOBFreq), rx2_xvtr_index, false, current_region, false); if (penny_ext_ctrl_enabled) //MW0LGE_21k { @@ -32934,28 +32947,35 @@ private void HdwMOXChanged(bool tx, double freq) if (!IsSetupFormNull) SetupForm.UpdateOCLedStrip(_mox, bits); } - UpdateTRXAnt(); - if (rx1_xvtr_index >= 0) + lock (_objBypassAntSelectionLocker) { - // Fix Penny O/C VHF control Vk4xv - // lo_band = BandByFreq(XVTRForm.TranslateFreq(VFOAFreq), rx1_xvtr_index, false, current_region); - // lo_bandb = BandByFreq(XVTRForm.TranslateFreq(VFOBFreq), rx2_xvtr_index, false, current_region); + if (!_ignoreAntSelectionInHdwMox) + { + UpdateTRXAnt(); + if (rx1_xvtr_index >= 0) + { + // Fix Penny O/C VHF control Vk4xv + // lo_band = BandByFreq(XVTRForm.TranslateFreq(VFOAFreq), rx1_xvtr_index, false, current_region); + // lo_bandb = BandByFreq(XVTRForm.TranslateFreq(VFOBFreq), rx2_xvtr_index, false, current_region); - //if (penny_ext_ctrl_enabled) - // Penny.getPenny().UpdateExtCtrl(lo_band, lo_bandb, mox); + //if (penny_ext_ctrl_enabled) + // Penny.getPenny().UpdateExtCtrl(lo_band, lo_bandb, mox); - // if (alex_ant_ctrl_enabled) - // Alex.getAlex().UpdateAlexAntSelection(lo_band, mox, true); - Alex.getAlex().UpdateAlexAntSelection(lo_band, _mox, alex_ant_ctrl_enabled, true); - } - else - { - // if (penny_ext_ctrl_enabled) - // Penny.getPenny().UpdateExtCtrl(tx_band, rx2_band, mox); + // if (alex_ant_ctrl_enabled) + // Alex.getAlex().UpdateAlexAntSelection(lo_band, mox, true); + Alex.getAlex().UpdateAlexAntSelection(lo_band, _mox, alex_ant_ctrl_enabled, true); + } + else + { + // if (penny_ext_ctrl_enabled) + // Penny.getPenny().UpdateExtCtrl(tx_band, rx2_band, mox); - // if (alex_ant_ctrl_enabled) - // Alex.getAlex().UpdateAlexAntSelection(tx_band, mox, false); - Alex.getAlex().UpdateAlexAntSelection(tx_band, _mox, alex_ant_ctrl_enabled, false); + // if (alex_ant_ctrl_enabled) + // Alex.getAlex().UpdateAlexAntSelection(tx_band, mox, false); + Alex.getAlex().UpdateAlexAntSelection(tx_band, _mox, alex_ant_ctrl_enabled, false); + } + } + _ignoreAntSelectionInHdwMox = false; } // Hdw.TransmitRelay = true; @@ -34300,27 +34320,27 @@ public void LoadedTXProfile() if (rx1_dsp_mode == DSPMode.DIGL || rx1_dsp_mode == DSPMode.DIGU) { - SetDigiMode(1, DigiMode.DigiModeSettingState.dmssStore); // store bunch of profile settings - SetDigiMode(1, DigiMode.DigiModeSettingState.dmssTurnOffSettings); // set it into digi mode + SetDigiMode(1, DigiMode.DigiModeSettingState.dmssStore, true); // store bunch of profile settings + SetDigiMode(1, DigiMode.DigiModeSettingState.dmssTurnOffSettings, true); // set it into digi mode } else { if (rx1dm != null && (rx1dm.Mode == DigiMode.DigiModeSettingState.dmssTurnOffSettings || rx1dm.Mode == DigiMode.DigiModeSettingState.dmssStore)) { - SetDigiMode(1, DigiMode.DigiModeSettingState.dmssRecall); // restore those profile settings, may be case where not initialised + SetDigiMode(1, DigiMode.DigiModeSettingState.dmssRecall, true); // restore those profile settings, may be case where not initialised } } if (rx2_dsp_mode == DSPMode.DIGL || rx2_dsp_mode == DSPMode.DIGU) { - SetDigiMode(2, DigiMode.DigiModeSettingState.dmssStore); // store bunch of profile settings - SetDigiMode(2, DigiMode.DigiModeSettingState.dmssTurnOffSettings); // set it into digi mode + SetDigiMode(2, DigiMode.DigiModeSettingState.dmssStore, true); // store bunch of profile settings + SetDigiMode(2, DigiMode.DigiModeSettingState.dmssTurnOffSettings, true); // set it into digi mode } else { if (rx2dm != null && (rx2dm.Mode == DigiMode.DigiModeSettingState.dmssTurnOffSettings || rx2dm.Mode == DigiMode.DigiModeSettingState.dmssStore)) { - SetDigiMode(2, DigiMode.DigiModeSettingState.dmssRecall); // restore those profile settings, may be case where not initialised + SetDigiMode(2, DigiMode.DigiModeSettingState.dmssRecall, true); // restore those profile settings, may be case where not initialised } } } @@ -40788,6 +40808,9 @@ private void SetRX1Mode(DSPMode new_mode) //MW0LGE_21d Band oldBand = RX1Band; // + bool bStoreDigiModeSettings = false; + bool bRecallDigiModeSettings = false; + bool bTurnOffSettingsForDigimode = false; DSPMode old_mode = rx1_dsp_mode; @@ -41024,7 +41047,7 @@ private void SetRX1Mode(DSPMode new_mode) SetupForm.VACEnable = false; } - if (new_mode != DSPMode.DIGU) SetDigiMode(1, DigiMode.DigiModeSettingState.dmssRecall); + if (new_mode != DSPMode.DIGU) bRecallDigiModeSettings = true; // see comment below SetDigiMode(1, DigiMode.DigiModeSettingState.dmssRecall); break; case DSPMode.DIGU: radModeDIGU.BackColor = SystemColors.Control; @@ -41035,7 +41058,7 @@ private void SetRX1Mode(DSPMode new_mode) SetupForm.VACEnable = false; } - if (new_mode != DSPMode.DIGL) SetDigiMode(1, DigiMode.DigiModeSettingState.dmssRecall); + if (new_mode != DSPMode.DIGL) bRecallDigiModeSettings = true; //[2.10.3]MW0LGE done below after tx profile change SetDigiMode(1, DigiMode.DigiModeSettingState.dmssRecall); break; case DSPMode.DRM: radModeDRM.BackColor = SystemColors.Control; @@ -41306,8 +41329,10 @@ private void SetRX1Mode(DSPMode new_mode) if (old_mode != DSPMode.DIGU) { - SetDigiMode(1, DigiMode.DigiModeSettingState.dmssStore); - SetDigiMode(1, DigiMode.DigiModeSettingState.dmssTurnOffSettings); + //SetDigiMode(1, DigiMode.DigiModeSettingState.dmssStore); + bStoreDigiModeSettings = true; //[2.10.3]MW0LGE done after tx profile change at end as we will overwrite existng tx profile if auto save is on + //SetDigiMode(1, DigiMode.DigiModeSettingState.dmssTurnOffSettings); + bTurnOffSettingsForDigimode = true; } break; case DSPMode.DIGU: @@ -41325,8 +41350,10 @@ private void SetRX1Mode(DSPMode new_mode) if (old_mode != DSPMode.DIGL) { - SetDigiMode(1, DigiMode.DigiModeSettingState.dmssStore); - SetDigiMode(1, DigiMode.DigiModeSettingState.dmssTurnOffSettings); + //SetDigiMode(1, DigiMode.DigiModeSettingState.dmssStore); + bStoreDigiModeSettings = true; //see comment above + //SetDigiMode(1, DigiMode.DigiModeSettingState.dmssTurnOffSettings); + bTurnOffSettingsForDigimode = true; } break; case DSPMode.DRM: @@ -41478,6 +41505,8 @@ private void SetRX1Mode(DSPMode new_mode) } // end of QSK-related code --------------------------------------- + if (bRecallDigiModeSettings) SetDigiMode(1, DigiMode.DigiModeSettingState.dmssRecall); // recall before as TX profile may change them + // MW0LGE from powersdr - selects tx profiles switch (rx1_dsp_mode) { @@ -41500,6 +41529,9 @@ private void SetRX1Mode(DSPMode new_mode) } // end powersdr chunk + if (bStoreDigiModeSettings) SetDigiMode(1, DigiMode.DigiModeSettingState.dmssStore); + if (bTurnOffSettingsForDigimode) SetDigiMode(1, DigiMode.DigiModeSettingState.dmssTurnOffSettings); + //MW0LGE_21b if (old_mode != new_mode/* || oldBand != RX1Band*/) ModeChangeHandlers?.Invoke(1, old_mode, new_mode, oldBand, RX1Band); } @@ -51079,7 +51111,7 @@ private void RAtoolStripMenuItem_Click(object sender, EventArgs e) raForm.Focus(); } - private void SetDigiMode(int rx, DigiMode.DigiModeSettingState mode) + private void SetDigiMode(int rx, DigiMode.DigiModeSettingState mode, bool bFromTXProfile = false) { if (rx == 1) { @@ -51117,16 +51149,23 @@ private void SetDigiMode(int rx, DigiMode.DigiModeSettingState mode) rx1dm.PhaseRotEnabled = SetupForm.PhaseRotEnabled; break; case DigiMode.DigiModeSettingState.dmssRecall: - chkNoiseGate.Checked = rx1dm.DEXP; - chkTXEQ.Checked = rx1dm.TXEQ; - SetupForm.TXLevelerOn = rx1dm.LEVELER; - chkCPDR.Checked = rx1dm.COMPRESSOR; - chkRXEQ.Checked = rx1dm.RXEQ; - chkANF.Checked = rx1dm.ANF; + //[2.10.3]MW0LGE only recover these if not coming from a TX profile as LoadedTXProfile uses this function + if (!bFromTXProfile) + { + chkNoiseGate.Checked = rx1dm.DEXP; + chkTXEQ.Checked = rx1dm.TXEQ; + SetupForm.TXLevelerOn = rx1dm.LEVELER; + chkCPDR.Checked = rx1dm.COMPRESSOR; + chkRXEQ.Checked = rx1dm.RXEQ; + } + chkANF.Checked = rx1dm.ANF; // these two not stored in a TX profile chkNR.CheckState = rx1dm.NR; - SetupForm.CESSB = rx1dm.CESSB; - CFCEnabled = rx1dm.CFCEnabled; - SetupForm.PhaseRotEnabled = rx1dm.PhaseRotEnabled; + if (!bFromTXProfile) + { + SetupForm.CESSB = rx1dm.CESSB; + CFCEnabled = rx1dm.CFCEnabled; + SetupForm.PhaseRotEnabled = rx1dm.PhaseRotEnabled; + } break; } } diff --git a/Project Files/Source/Console/cwx.cs b/Project Files/Source/Console/cwx.cs index f450cb8e..5d52efd7 100644 --- a/Project Files/Source/Console/cwx.cs +++ b/Project Files/Source/Console/cwx.cs @@ -268,12 +268,19 @@ private void setptt(bool state) { // CWPTTItem item = new CWPTTItem(state, CWSensorItem.GetCurrentTime()); // CWKeyer.PTTEnqueue(item); - } + } + + if (state) // only if ptt on, as we will not get a setkey after ptt is off + { + NetworkIO.SendHighPriority(0); // prevent UpdateAlex from doing it in SetAntennasForCWX, which will also prevent SetCWX doing it in setkey + Debug.Print("SendHighPriority(0) in setptt()"); + } + console.SetAntennasForCWX(state); //[2.10.3]MW0LGE ptt = state; if (state) pttLed.BackColor = System.Drawing.Color.Red; else pttLed.BackColor = System.Drawing.Color.Black; - + setptt_memory = state; } // if (newptt) Thread.Sleep(200); @@ -284,7 +291,12 @@ private void setkey(bool state) { if (setkey_memory != state) { - NetworkIO.SetCWX(Convert.ToInt32(state)); + //[2.10.3]MW0LGE note, ptt now sets up antenns in setptt() + //we had set SetHighPri to 0 there, so the SetCWX packet wont go out + //so need to SendHighPro(1) here + NetworkIO.SetCWX(Convert.ToInt32(state)); + NetworkIO.SendHighPriority(1); + Debug.Print("SendHighPriority(1) in setkey()"); if (state) keyLed.BackColor = System.Drawing.Color.Yellow; else keyLed.BackColor = System.Drawing.Color.Black; @@ -295,11 +307,15 @@ private void setkey(bool state) private void quitshut() { clear_fifo(); - clear_fifo2(); - setptt(false); - setkey(false); + clear_fifo2(); + //setptt(false); + //setkey(false); + setkey(false); //[2.10.3]MW0LGE swap + setptt(false); ttx = 0; pause = 0; newptt = 0; keying = false; + NetworkIO.SendHighPriority(1); + Debug.Print("SendHighPriority(1) in quitshut()"); } private void clear_fifo() { @@ -2088,8 +2104,11 @@ private void process_element() // called at the element rate // X on flow if (ttx > 0) ttx--; // time out timer down one element if (ttx > 0) return; // not yet timed out + //setptt(false); // cw timer timed out + //setkey(false); + //[2.10.3]MW0LGE swap + setkey(false); setptt(false); // cw timer timed out - setkey(false); } // keyboardFifo pops keys from fifo2 and then calls loadchar() to diff --git a/Project Files/Source/Console/frmFinder.cs b/Project Files/Source/Console/frmFinder.cs index d09a12ab..957b1002 100644 --- a/Project Files/Source/Console/frmFinder.cs +++ b/Project Files/Source/Console/frmFinder.cs @@ -61,7 +61,7 @@ public void GatherSearchData(Form frm, ToolTip tt) gatherSearchDataThread(frm, tt); }) { - Name = "Search Worker Thread for " + frm.Name, + Name = "Finder Worker Thread for " + frm.Name, Priority = ThreadPriority.Highest, IsBackground = true, }; diff --git a/Project Files/Source/wdsp/analyzer.c b/Project Files/Source/wdsp/analyzer.c index ebe5f248..1625cb46 100644 --- a/Project Files/Source/wdsp/analyzer.c +++ b/Project Files/Source/wdsp/analyzer.c @@ -883,6 +883,9 @@ int build_interpolants(int disp, int set, int n, int m, double *x, double (*y)[d void __cdecl sendbuf(void *arg) { + const wchar_t* threadName = L"sendbuf Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DP a = pdisp[(int)(uintptr_t)arg]; while(!a->end_dispatcher) { diff --git a/Project Files/Source/wdsp/calcc.c b/Project Files/Source/wdsp/calcc.c index e658e255..4fe60765 100644 --- a/Project Files/Source/wdsp/calcc.c +++ b/Project Files/Source/wdsp/calcc.c @@ -482,6 +482,9 @@ void calc (CALCC a) void __cdecl doPSCalcCorrection (void *arg) { + const wchar_t* threadName = L"doPSCalcCorrection Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + CALCC a = (CALCC)arg; while (!InterlockedAnd(&a->calccorr_bypass, 0xffffffff)) { @@ -506,6 +509,9 @@ void __cdecl doPSCalcCorrection (void *arg) void __cdecl doPSTurnoff (void *arg) { + const wchar_t* threadName = L"doPSTurnoff Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + CALCC a = (CALCC)arg; while (!InterlockedAnd(&a->turnoff_bypass, 0xffffffff)) { @@ -536,6 +542,9 @@ enum _calcc_state void __cdecl PSSaveCorrection (void *pargs) { + const wchar_t* threadName = L"PSSaveCorrection Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + int i, k; CALCC a = (CALCC)pargs; while (!InterlockedAnd(&a->savecorr_bypass, 0xffffffff)) @@ -566,6 +575,9 @@ void __cdecl PSSaveCorrection (void *pargs) void __cdecl PSRestoreCorrection(void *pargs) { + const wchar_t* threadName = L"PSRestoreCorrection Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + int i, k; CALCC a = (CALCC)pargs; while (!InterlockedAnd(&a->restcorr_bypass, 0xffffffff)) diff --git a/Project Files/Source/wdsp/channel.c b/Project Files/Source/wdsp/channel.c index cb43510c..ccb62d76 100644 --- a/Project Files/Source/wdsp/channel.c +++ b/Project Files/Source/wdsp/channel.c @@ -127,6 +127,9 @@ void CloseChannel (int channel) void flushChannel (void* p) { + const wchar_t* threadName = L"flushChannel Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + int channel = (int)(uintptr_t)p; IOB a = ch[channel].iob.pc; while (!InterlockedAnd(&a->flush_bypass, 0xffffffff)) diff --git a/Project Files/Source/wdsp/main.c b/Project Files/Source/wdsp/main.c index 9821af13..8fc7348e 100644 --- a/Project Files/Source/wdsp/main.c +++ b/Project Files/Source/wdsp/main.c @@ -28,6 +28,9 @@ warren@wpratt.com void wdspmain (void *pargs) { + const wchar_t* threadName = L"wdspmain Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + DWORD taskIndex = 0; HANDLE hTask = AvSetMmThreadCharacteristics(TEXT("Pro Audio"), &taskIndex); if (hTask != 0) AvSetMmThreadPriority(hTask, 2); diff --git a/Project Files/Source/wdsp/syncbuffs.c b/Project Files/Source/wdsp/syncbuffs.c index 883bfc7e..f0a5345a 100644 --- a/Project Files/Source/wdsp/syncbuffs.c +++ b/Project Files/Source/wdsp/syncbuffs.c @@ -161,6 +161,9 @@ void syncbdata (SYNCB a) void syncb_main (void *p) { + const wchar_t* threadName = L"syncb_main Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + SYNCB a = (SYNCB)p; while (_InterlockedAnd (&a->run, 1)) diff --git a/Project Files/Source/wdsp/utilities.c b/Project Files/Source/wdsp/utilities.c index 010935bc..afb6c569 100644 --- a/Project Files/Source/wdsp/utilities.c +++ b/Project Files/Source/wdsp/utilities.c @@ -262,6 +262,9 @@ void print_deviation (const char* filename, double dpmax, double rate) void __cdecl CalccPrintSamples (void *pargs) { + const wchar_t* threadName = L"CalccPrintSamples Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + int i; double env_tx, env_rx; int channel = (int)(uintptr_t)pargs; @@ -309,6 +312,9 @@ int done = 0; void WriteAudioFile(void* arg) { + const wchar_t* threadName = L"WriteAudioFile Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + byte* dat = (byte *)arg; FILE* file = fopen("AudioFile", "wb"); @@ -382,6 +388,9 @@ void WriteAudioWDSP (double seconds, int rate, int size, double* indata, int mod void WriteScaledAudioFile (void* arg) { + const wchar_t* threadName = L"WriteScaledAudioFile Thread"; + SetThreadDescription(GetCurrentThread(), threadName); + typedef struct { int n;