CRemoteControlRepeaterData::CRemoteControlRepeaterData(const wxString& callsign, wxInt32 reconnect, const wxString& reflector) : m_callsign(callsign), m_reconnect(RECONNECT(reconnect)), m_reflector(reflector), m_links() { }
void CRemoteControlRepeaterPanel::onLink(wxCommandEvent& event) { int n = m_reconnect->GetCurrentSelection(); if (n == wxNOT_FOUND) return; RECONNECT reconnect = RECONNECT(n); n = m_reflector->GetCurrentSelection(); if (n == wxNOT_FOUND) return; wxString reflector = wxEmptyString; if (n > 0) { int n = m_channel->GetCurrentSelection(); if (n == wxNOT_FOUND) return; reflector = m_reflector->GetStringSelection(); if (reflector.IsEmpty()) return; wxString channel = m_channel->GetStringSelection(); if (channel.IsEmpty()) return; reflector.Append(wxT(" ")); reflector.Truncate(LONG_CALLSIGN_LENGTH - 1U); reflector.Append(channel); } ::wxGetApp().link(m_callsign, reconnect, reflector); }
RECONNECT CRepeaterDataSet::getReconnect() const { if (isDDMode()) return RECONNECT_NEVER; int n = m_reconnect->GetCurrentSelection(); return RECONNECT(n); }
void CRemoteControlRepeaterPanel::onUnlink(wxCommandEvent& event) { int n = m_reconnect->GetCurrentSelection(); if (n == wxNOT_FOUND) return; RECONNECT reconnect = RECONNECT(n); ::wxGetApp().link(m_callsign, reconnect, wxEmptyString); }
void CTimerControlRepeaterPanel::onModify(wxCommandEvent&) { if (m_item == NULL) return; int day = m_day->GetSelection(); int hour = m_hour->GetSelection(); int minute = m_minute->GetSelection(); int reflector = m_reflector->GetSelection(); int channel = m_channel->GetSelection(); int reconnect = m_reconnect->GetSelection(); if (day == wxNOT_FOUND || hour == wxNOT_FOUND || minute == wxNOT_FOUND || reflector == wxNOT_FOUND || channel == wxNOT_FOUND || reconnect == wxNOT_FOUND) return; CTimerControlItem* item = new CTimerControlItem; item->m_repeater = m_callsign; item->m_day = (unsigned int)day; item->m_hour = (unsigned int)hour; item->m_minute = (unsigned int)minute * 5U; if (reflector != 0) { wxString callsign = m_reflector->GetStringSelection(); callsign.Append(wxT(" ")); callsign.Truncate(7U); callsign.Append(m_channel->GetStringSelection()); item->m_reflector = callsign; } item->m_reconnect = RECONNECT(reconnect); m_list->DeleteItem(m_n); delete m_item; m_item = NULL; m_day->SetSelection(0); m_hour->SetSelection(0); m_minute->SetSelection(0); m_reflector->SetSelection(0); m_channel->SetSelection(0); m_reconnect->SetSelection(0); reload(item); ::wxGetApp().writeItems(); }
bool CRemoteProtocolHandler::readLink(wxString& callsign, RECONNECT& reconnect, wxString& reflector) { if (m_type != RPHT_LINK) return false; callsign = wxString((char*)(m_inBuffer + 3U), wxConvLocal, LONG_CALLSIGN_LENGTH); wxInt32 temp; ::memcpy(&temp, m_inBuffer + 3U + LONG_CALLSIGN_LENGTH, sizeof(wxInt32)); reconnect = RECONNECT(wxINT32_SWAP_ON_BE(temp)); reflector = wxString((char*)(m_inBuffer + 3U + LONG_CALLSIGN_LENGTH + sizeof(wxInt32)), wxConvLocal, LONG_CALLSIGN_LENGTH); if (reflector.IsSameAs(wxT(" "))) reflector.Clear(); return true; }
bool CRemoteProtocolHandler::readLinkScr(wxString& callsign, RECONNECT& reconnect, wxString& reflector) { if (m_type != RPHT_LINKSCR) return false; callsign = wxString((char*)(m_inBuffer + 3U), wxConvLocal, LONG_CALLSIGN_LENGTH); reflector = wxString((char*)(m_inBuffer + 3U + LONG_CALLSIGN_LENGTH), wxConvLocal, LONG_CALLSIGN_LENGTH); wxString rec = wxString((char*)(m_inBuffer + 3U + 2U * LONG_CALLSIGN_LENGTH), wxConvLocal, 1U); unsigned long val; rec.ToULong(&val); reconnect = RECONNECT(val); if (reflector.IsSameAs(wxT(" "))) reflector.Clear(); return true; }
RECONNECT CDCSGatewayReflectorSet::getReconnect() const { int n = m_reconnect->GetCurrentSelection(); return RECONNECT(n); }