diff --git a/CMakeLists.txt b/CMakeLists.txt index 60473248..ebd7c81b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(pamworkspace VERSION 1.5.4) -SET(CMAKE_CXX_STANDARD 14) +set(CMAKE_INSTALL_PREFIX "/usr/local") SET(NMOS OFF CACHE BOOL "set to ON to include NMOS") @@ -15,7 +15,7 @@ SET(DIR_PTPMONKEY ${DIR_BASE}/ptpmonkey CACHE STRING "location of ptpmonkey") SET(DIR_SAPSERVER ${DIR_BASE}/sapserver CACHE STRING "location of sapserver") SET(DIR_LOG ${DIR_BASE}/log CACHE STRING "location of pml log") SET(DIR_DNSSD ${DIR_BASE}/dnssd CACHE STRING "location of pml dnssd") -SET(DIR_RESTGOOSE ${DIR_BASE}/restgoose CACHE STRING "location of pml restgoose") +SET(DIR_RESTGOOSE ${DIR_BASE}/Restgoose CACHE STRING "location of pml restgoose") #set the following to off so we build them rather than one of the sub projects SET(BUILD_DNSSD OFF) @@ -124,6 +124,8 @@ else() unset(NMOS_TEMP_DIR2) else() message(STATUS "restgoose found - update to latest version") + execute_process(COMMAND git -C ${DIR_RESTGOOSE} checkout v3_7.10) + #execute_process(COMMAND git -C ${DIR_RESTGOOSE} pull) execute_process(COMMAND git -C ${DIR_RESTGOOSE} pull --no-rebase) endif() unset(NMOS_TEMP_DIR) @@ -209,8 +211,6 @@ message(STATUS "Configure plugin fftdiff") add_subdirectory(plugins/fftdiff) message(STATUS "Configure plugin correlation") add_subdirectory(plugins/correlation) -message(STATUS "Configure bob") -add_subdirectory(plugins/bob) #Add new plugin projects above this line message(STATUS "Configure pam2") diff --git a/InitialSetup/CMakeLists.txt b/InitialSetup/CMakeLists.txt index 13bf39a7..3b0340a5 100644 --- a/InitialSetup/CMakeLists.txt +++ b/InitialSetup/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.3.16 FATAL_ERROR) project(InitialSetup LANGUAGES CXX VERSION 1.0.0.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -26,11 +26,11 @@ target_link_libraries(InitialSetup ${wxWidgets_LIBRARIES} pambase restgoose ssl) -set_property(TARGET InitialSetup PROPERTY CXX_STANDARD 14) +set_property(TARGET InitialSetup PROPERTY CXX_STANDARD 17) set_target_properties(InitialSetup PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../../bin/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") -install(TARGETS InitialSetup RUNTIME DESTINATION /usr/local/bin) +install(TARGETS InitialSetup RUNTIME DESTINATION bin) endif() diff --git a/documents/pam2.ini b/documents/pam2.ini index 153d4486..9251279e 100644 --- a/documents/pam2.ini +++ b/documents/pam2.ini @@ -34,7 +34,7 @@ generators=White,Grey AoIP=0 Device=0 Reset=0 -Type=Soundcard +Type=Disabled [Log] Level=2 ScrollLock=0 @@ -48,19 +48,20 @@ _Options=0 [Monitor] Source=0 [Monitor Plugins] -0000=meters -0001=anglemeters -0002=lissajou -0003=fft -0004=r128 -0005=spectogram -0006=scope -0007=aoipinfo -0008=ptp -0009=radar -0010=polarscope -0011=waveform -0012=fftphase +0000=r128 +0001=bob +0002=aoipinfo +0003=waveform +0004=fftphase +0005=radar +0006=fft +0007=scope +0008=meters +0009=polarscope +0010=anglemeters +0011=lissajou +0012=spectogram +0013=correlation [Monitor::Angle Meters] DisplayText_Current=1 DisplayText_Peak=1 @@ -146,7 +147,7 @@ Channel_5=0 Channel_6=1 Channel_7=0 Channel_8=1 -Destination=Disabled +Destination=AoIP Device=0 Enabled=0 Latency=200 @@ -154,8 +155,12 @@ Left=0 Right=1 Sequence=glits Source=Sequence +[PTP Monkey] +_Options=0 [QoS] Interval=1000 +[R128] +_Options=0 [Server] ChannelMapping=St Channels=2 @@ -165,14 +170,14 @@ PacketTime=1000 RTP_Port=5004 RTSP_Address=192.168.1.123 RTSP_Interface=eth0 -State=1 +State=0 Stream=AlwaysOn [Session Info] Graph=kBit/s Type=Line Graph _Options=0 [Settings] -_Options=0 +_Options=7 [Splash] Screen=Main [Startup] @@ -190,7 +195,7 @@ Lock=0 0008=bufferlog 0009=LTC 0010=lineup -0011=InputAlign +0011=car [Test::InputAlign] Channel=0 [Test::Levels] @@ -205,4 +210,4 @@ _Panel=3 LTC_Format=2 Sync=0 [Version] -pam2=1.6.0-05095fa.x +pam2=1.6.1-9f68d46 diff --git a/dosetup/CMakeLists.txt b/dosetup/CMakeLists.txt index 71786a73..ab9c58f9 100644 --- a/dosetup/CMakeLists.txt +++ b/dosetup/CMakeLists.txt @@ -1,6 +1,7 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(dosetup LANGUAGES CXX VERSION 1.0.0.0) + execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -21,12 +22,12 @@ target_link_libraries(dosetup pml_log) -set_property(TARGET dosetup PROPERTY CXX_STANDARD 14) +set_property(TARGET dosetup PROPERTY CXX_STANDARD 17) set_target_properties(dosetup PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../../bin/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") -install(TARGETS dosetup RUNTIME DESTINATION /usr/local/bin) +install(TARGETS dosetup RUNTIME DESTINATION bin) endif() diff --git a/external/live/liveMedia/RTPSource.cpp b/external/live/liveMedia/RTPSource.cpp index 3a27b2cb..fe2126d7 100644 --- a/external/live/liveMedia/RTPSource.cpp +++ b/external/live/liveMedia/RTPSource.cpp @@ -399,6 +399,13 @@ void RTPReceptionStats::reset() { fLastResetExtSeqNumReceived = fHighestExtSeqNumReceived; } + +void RTPReceptionStats::resetMinMax() +{ + fMinInterPacketGapUS = 0x7FFFFFFF; + fMaxInterPacketGapUS = 0; +} + Boolean seqNumLT(u_int16_t s1, u_int16_t s2) { // a 'less-than' on 16-bit sequence numbers int diff = s2-s1; diff --git a/external/live/liveMedia/include/RTPSource.hh b/external/live/liveMedia/include/RTPSource.hh index 69ba1844..27f8d72d 100644 --- a/external/live/liveMedia/include/RTPSource.hh +++ b/external/live/liveMedia/include/RTPSource.hh @@ -214,11 +214,12 @@ public: unsigned minInterPacketGapUS() const { return fMinInterPacketGapUS; } unsigned maxInterPacketGapUS() const { return fMaxInterPacketGapUS; } - unsigned currentInterPacketGapUS() const { return fCurrentInterPacketGapUS; } struct timeval const& totalInterPacketGaps() const { return fTotalInterPacketGaps; } + void resetMinMax(); + protected: // called only by RTPReceptionStatsDB: friend class RTPReceptionStatsDB; diff --git a/pam2/CMakeLists.txt b/pam2/CMakeLists.txt index 3e4d4041..39ae066d 100644 --- a/pam2/CMakeLists.txt +++ b/pam2/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -project(pam2 LANGUAGES CXX VERSION 1.6.1) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) +project(pam2 LANGUAGES CXX VERSION 1.7.1) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -73,21 +73,19 @@ target_link_libraries(pam2 optimized pamfft debug pamfftd) target_link_libraries(pam2 optimized pamlevel debug pamleveld) +set_target_properties(pam2 PROPERTIES CXX_STANDARD 17) set_target_properties(pam2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "../../bin/") #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") -install(TARGETS pam2 RUNTIME DESTINATION /usr/local/bin) +install(TARGETS pam2 RUNTIME DESTINATION bin) install(CODE "execute_process(COMMAND setcap cap_sys_time,cap_sys_admin,cap_net_bind_service+ep /usr/local/bin/pam2 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})") -install(CODE "execute_process(COMMAND cp ${CMAKE_SOURCE_DIR}/documents/pam2.conf /etc/ld.so.conf.d/)") +install(FILES ${CMAKE_SOURCE_DIR}/documents/pam2.conf DESTINATION "../../etc/ld.so.conf.d/") install(CODE "execute_process(COMMAND ldconfig)") -install(CODE "execute_process(COMMAND mkdir -p ${DIR_PAM})") -install(CODE "execute_process(COMMAND chown ${DIR_PAM} -Rv --reference=${DIR_PAM}/..)") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/audio_hats.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/macaddress.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/ppmtypes.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/r128types.xml ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -p ${CMAKE_SOURCE_DIR}/documents/pam2.ini ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -rp ${CMAKE_SOURCE_DIR}/documents/help ${DIR_PAM})") -install(CODE "execute_process(COMMAND cp -rp ${CMAKE_SOURCE_DIR}/documents/generator ${DIR_PAM})") +install(FILES ${CMAKE_SOURCE_DIR}/documents/audio_hats.xml DESTINATION etc/pam2/) +install(FILES ${CMAKE_SOURCE_DIR}/documents/macaddress.xml DESTINATION etc/pam2/) +install(FILES ${CMAKE_SOURCE_DIR}/documents/ppmtypes.xml DESTINATION etc/pam2/) +install(FILES ${CMAKE_SOURCE_DIR}/documents/pam2.ini DESTINATION etc/pam2/) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/documents/help DESTINATION etc/pam2/) +install(DIRECTORY ${CMAKE_SOURCE_DIR}/documents/generator DESTINATION /etc/pam2/) endif() diff --git a/pam2/pam2Main.cpp b/pam2/pam2Main.cpp index e01c1c06..8d66e946 100644 --- a/pam2/pam2Main.cpp +++ b/pam2/pam2Main.cpp @@ -297,7 +297,7 @@ pam2Dialog::pam2Dialog(wxWindow* parent,wxWindowID id) : m_ppnlLog = new pnlLog(m_pswpMain); pml::LogStream::AddOutput(std::make_unique()); - pml::LogStream::SetOutputLevel(pml::LOG_TRACE); + pml::LogStream::SetOutputLevel(pml::LOG_DEBUG); wxImage img(16,16); img.SetRGB(wxRect(0,0,16,16),0,0,0); diff --git a/pam2/pnlAoipManual.cpp b/pam2/pnlAoipManual.cpp index 42d631f2..55d55ff5 100644 --- a/pam2/pnlAoipManual.cpp +++ b/pam2/pnlAoipManual.cpp @@ -8,10 +8,15 @@ //(*InternalHeaders(pnlAoipManual) #include #include +#include #include //*) //(*IdInit(pnlAoipManual) +const long pnlAoipManual::ID_M_PKBD2 = wxNewId(); +const long pnlAoipManual::ID_M_PBTN3 = wxNewId(); +const long pnlAoipManual::ID_M_PBTN5 = wxNewId(); +const long pnlAoipManual::ID_M_PLST1 = wxNewId(); const long pnlAoipManual::ID_M_PLBL8 = wxNewId(); const long pnlAoipManual::ID_M_PIP1 = wxNewId(); const long pnlAoipManual::ID_M_PLBL1 = wxNewId(); @@ -22,11 +27,13 @@ const long pnlAoipManual::ID_M_PBTN1 = wxNewId(); const long pnlAoipManual::ID_M_PLBL4 = wxNewId(); const long pnlAoipManual::ID_M_PBTN2 = wxNewId(); const long pnlAoipManual::ID_M_PBTN13 = wxNewId(); -const long pnlAoipManual::ID_M_PKBD2 = wxNewId(); -const long pnlAoipManual::ID_M_PBTN3 = wxNewId(); -const long pnlAoipManual::ID_M_PBTN5 = wxNewId(); const long pnlAoipManual::ID_M_PLBL11 = wxNewId(); const long pnlAoipManual::ID_M_PBTN4 = wxNewId(); +const long pnlAoipManual::ID_PANEL2 = wxNewId(); +const long pnlAoipManual::ID_M_PLBL3 = wxNewId(); +const long pnlAoipManual::ID_M_PEDT1 = wxNewId(); +const long pnlAoipManual::ID_PANEL3 = wxNewId(); +const long pnlAoipManual::ID_M_PSWP2 = wxNewId(); const long pnlAoipManual::ID_PANEL1 = wxNewId(); const long pnlAoipManual::ID_CHANNEL_MAPPING = wxNewId(); const long pnlAoipManual::ID_M_PSWP1 = wxNewId(); @@ -46,73 +53,95 @@ pnlAoipManual::pnlAoipManual(wxWindow* parent,wxWindowID id,const wxPoint& pos,c m_pswpMain->SetPageNameStyle(0); m_ppnlSettings = new wxPanel(m_pswpMain, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); m_ppnlSettings->SetBackgroundColour(wxColour(0,0,0)); - m_pLbl9 = new wmLabel(m_ppnlSettings, ID_M_PLBL8, _("IP"), wxPoint(10,15), wxSize(100,40), 0, _T("ID_M_PLBL8")); + m_pkbd = new wmKeyboard(m_ppnlSettings, ID_M_PKBD2, wxPoint(10,160), wxSize(240,200), 5, 0); + m_pkbd->SetForegroundColour(wxColour(255,255,255)); + wxFont m_pkbdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT); + m_pkbd->SetFont(m_pkbdFont); + m_pbtnStream = new wmButton(m_ppnlSettings, ID_M_PBTN3, _("Receive"), wxPoint(260,161), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN3")); + m_pbtnStream->SetBackgroundColour(wxColour(0,128,0)); + m_pbtnStream->SetToggleLook(true, wxT("Stop"), wxT("Start"), 40); + m_pbtnSave = new wmButton(m_ppnlSettings, ID_M_PBTN5, _("Save"), wxPoint(340,315), wxSize(100,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN5")); + m_pbtnSave->SetBackgroundColour(wxColour(0,128,0)); + m_plstManualMode = new wmList(m_ppnlSettings, ID_M_PLST1, wxPoint(5,13), wxSize(94,132), wmList::STYLE_SELECT, 0, wxSize(90,64), 1, wxSize(-1,-1)); + m_plstManualMode->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_SCROLLBAR)); + wxFont m_plstManualModeFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_plstManualMode->SetFont(m_plstManualModeFont); + m_plstManualMode->SetButtonColour(wxColour(wxT("#006C6C"))); + m_plstManualMode->SetPressedButtonColour(wxColour(wxT("#F07800"))); + m_pswpManualMode = new wmSwitcherPanel(m_ppnlSettings, ID_M_PSWP2, wxPoint(100,0), wxSize(470,150), wmSwitcherPanel::STYLE_NOSWIPE|wmSwitcherPanel::STYLE_NOANIMATION, _T("ID_M_PSWP2")); + m_pswpManualMode->SetPageNameStyle(0); + pnlIp = new wxPanel(m_pswpManualMode, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL2")); + pnlIp->SetBackgroundColour(wxColour(0,0,0)); + m_pLbl9 = new wmLabel(pnlIp, ID_M_PLBL8, _("IP"), wxPoint(10,15), wxSize(100,40), 0, _T("ID_M_PLBL8")); m_pLbl9->SetBorderState(uiRect::BORDER_NONE); m_pLbl9->GetUiRect().SetGradient(0); m_pLbl9->SetForegroundColour(wxColour(255,255,255)); m_pLbl9->SetBackgroundColour(wxColour(64,0,128)); - m_pipServer = new wmipeditpnl(m_ppnlSettings, ID_M_PIP1, wxPoint(110,15), wxSize(200,40)); + m_pipServer = new wmipeditpnl(pnlIp, ID_M_PIP1, wxPoint(110,15), wxSize(200,40)); m_pipServer->SetValue(wxEmptyString); - m_pLbl1 = new wmLabel(m_ppnlSettings, ID_M_PLBL1, _("PORT"), wxPoint(310,15), wxSize(50,40), 0, _T("ID_M_PLBL1")); + m_pLbl1 = new wmLabel(pnlIp, ID_M_PLBL1, _("PORT"), wxPoint(310,15), wxSize(50,40), 0, _T("ID_M_PLBL1")); m_pLbl1->SetBorderState(uiRect::BORDER_NONE); m_pLbl1->GetUiRect().SetGradient(0); m_pLbl1->SetForegroundColour(wxColour(255,255,255)); m_pLbl1->SetBackgroundColour(wxColour(64,0,128)); - m_pedtPort = new wmEdit(m_ppnlSettings, ID_M_PEDT3, wxEmptyString, wxPoint(360,15), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT3")); + m_pedtPort = new wmEdit(pnlIp, ID_M_PEDT3, wxEmptyString, wxPoint(360,15), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PEDT3")); m_pedtPort->SetValidation(4); m_pedtPort->SetBorderStyle(1,1); - m_pLbl2 = new wmLabel(m_ppnlSettings, ID_M_PLBL2, _("Sample Rate"), wxPoint(10,60), wxSize(100,40), 0, _T("ID_M_PLBL2")); + m_pLbl2 = new wmLabel(pnlIp, ID_M_PLBL2, _("Sample Rate"), wxPoint(10,60), wxSize(100,40), 0, _T("ID_M_PLBL2")); m_pLbl2->SetBorderState(uiRect::BORDER_NONE); m_pLbl2->GetUiRect().SetGradient(0); m_pLbl2->SetForegroundColour(wxColour(255,255,255)); m_pLbl2->SetBackgroundColour(wxColour(64,0,128)); - m_pbtnSampleRate = new wmButton(m_ppnlSettings, ID_M_PBTN6, _("48000"), wxPoint(110,60), wxSize(90,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN6")); + m_pbtnSampleRate = new wmButton(pnlIp, ID_M_PBTN6, _("48000"), wxPoint(110,60), wxSize(90,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN6")); m_pbtnSampleRate->SetForegroundColour(wxColour(0,0,0)); m_pbtnSampleRate->SetBackgroundColour(wxColour(255,255,255)); m_pbtnSampleRate->SetColourDisabled(wxColour(wxT("#B0B0B0"))); - m_pbtnBits = new wmButton(m_ppnlSettings, ID_M_PBTN1, _("Bits"), wxPoint(260,60), wxSize(200,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN1")); + m_pbtnBits = new wmButton(pnlIp, ID_M_PBTN1, _("Bits"), wxPoint(260,60), wxSize(200,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN1")); m_pbtnBits->SetBackgroundColour(wxColour(0,128,0)); - m_pbtnBits->SetToggle(true, wxT("16"), wxT("24"), 40); - m_pLbl4 = new wmLabel(m_ppnlSettings, ID_M_PLBL4, _("Channels"), wxPoint(10,105), wxSize(100,40), 0, _T("ID_M_PLBL4")); + m_pbtnBits->SetToggleLook(true, wxT("16"), wxT("24"), 40); + m_pLbl4 = new wmLabel(pnlIp, ID_M_PLBL4, _("Channels"), wxPoint(10,105), wxSize(100,40), 0, _T("ID_M_PLBL4")); m_pLbl4->SetBorderState(uiRect::BORDER_NONE); m_pLbl4->GetUiRect().SetGradient(0); m_pLbl4->SetForegroundColour(wxColour(255,255,255)); m_pLbl4->SetBackgroundColour(wxColour(64,0,128)); - m_pbtnChannels = new wmButton(m_ppnlSettings, ID_M_PBTN2, _("2"), wxPoint(110,105), wxSize(90,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN2")); + m_pbtnChannels = new wmButton(pnlIp, ID_M_PBTN2, _("2"), wxPoint(110,105), wxSize(90,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN2")); m_pbtnChannels->SetForegroundColour(wxColour(0,0,0)); m_pbtnChannels->SetBackgroundColour(wxColour(255,255,255)); m_pbtnChannels->SetColourDisabled(wxColour(wxT("#B0B0B0"))); - m_pbtnMapping = new wmButton(m_ppnlSettings, ID_M_PBTN13, _("Mapping"), wxPoint(200,105), wxSize(60,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN13")); + m_pbtnMapping = new wmButton(pnlIp, ID_M_PBTN13, _("Mapping"), wxPoint(200,105), wxSize(60,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN13")); m_pbtnMapping->SetForegroundColour(wxColour(0,0,0)); m_pbtnMapping->SetBackgroundColour(wxColour(163,211,211)); m_pbtnMapping->SetColourDisabled(wxColour(wxT("#B0B0B0"))); - m_pkbd = new wmKeyboard(m_ppnlSettings, ID_M_PKBD2, wxPoint(10,160), wxSize(240,200), 5, 0); - m_pkbd->SetForegroundColour(wxColour(255,255,255)); - wxFont m_pkbdFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT); - m_pkbd->SetFont(m_pkbdFont); - m_pbtnStream = new wmButton(m_ppnlSettings, ID_M_PBTN3, _("Receive"), wxPoint(260,161), wxSize(268,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN3")); - m_pbtnStream->SetBackgroundColour(wxColour(0,128,0)); - m_pbtnStream->SetToggle(true, wxT("Stop"), wxT("Start"), 40); - m_pbtnSave = new wmButton(m_ppnlSettings, ID_M_PBTN5, _("Save"), wxPoint(340,315), wxSize(100,40), wmButton::STYLE_SELECT, wxDefaultValidator, _T("ID_M_PBTN5")); - m_pbtnSave->SetBackgroundColour(wxColour(0,128,0)); - m_pLbl8 = new wmLabel(m_ppnlSettings, ID_M_PLBL11, _("RTP Payload"), wxPoint(310,105), wxSize(70,40), 0, _T("ID_M_PLBL11")); + m_pLbl8 = new wmLabel(pnlIp, ID_M_PLBL11, _("RTP Payload"), wxPoint(310,105), wxSize(70,40), 0, _T("ID_M_PLBL11")); m_pLbl8->SetBorderState(uiRect::BORDER_NONE); m_pLbl8->GetUiRect().SetGradient(0); m_pLbl8->SetForegroundColour(wxColour(255,255,255)); m_pLbl8->SetBackgroundColour(wxColour(64,0,128)); - m_pbtnRtpMap = new wmButton(m_ppnlSettings, ID_M_PBTN4, _("96"), wxPoint(380,105), wxSize(80,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN4")); + m_pbtnRtpMap = new wmButton(pnlIp, ID_M_PBTN4, _("96"), wxPoint(380,105), wxSize(80,40), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN4")); m_pbtnRtpMap->SetForegroundColour(wxColour(0,0,0)); m_pbtnRtpMap->SetBackgroundColour(wxColour(255,255,255)); m_pbtnRtpMap->SetColourDisabled(wxColour(wxT("#B0B0B0"))); + pnlLivewire = new wxPanel(m_pswpManualMode, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3")); + pnlLivewire->SetBackgroundColour(wxColour(0,0,0)); + m_pLbl3 = new wmLabel(pnlLivewire, ID_M_PLBL3, _("STREAM"), wxPoint(10,15), wxSize(100,40), 0, _T("ID_M_PLBL3")); + m_pLbl3->SetBorderState(uiRect::BORDER_NONE); + m_pLbl3->GetUiRect().SetGradient(0); + m_pLbl3->SetForegroundColour(wxColour(255,255,255)); + m_pLbl3->SetBackgroundColour(wxColour(64,0,128)); + m_pedtLivewire = new wmEdit(pnlLivewire, ID_M_PEDT1, wxEmptyString, wxPoint(110,15), wxSize(250,40), 0, wxDefaultValidator, _T("ID_M_PEDT1")); + m_pedtLivewire->SetValidation(4); + m_pedtLivewire->SetBorderStyle(1,1); + m_pswpManualMode->AddPage(pnlIp, _("IP"), false); + m_pswpManualMode->AddPage(pnlLivewire, _("Livewire+"), false); m_ppnlMapping = new pnlChannelMapping(m_pswpMain,"ManualAoIp", ID_CHANNEL_MAPPING,wxDefaultPosition,wxDefaultSize); m_pswpMain->AddPage(m_ppnlSettings, _("Settings"), true); m_pswpMain->AddPage(m_ppnlMapping, _("Mapping"), false); + Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnStreamClick); + Connect(ID_M_PBTN5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnSaveClick); Connect(ID_M_PBTN6,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnSampleRateClick); Connect(ID_M_PBTN2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnChannelsClick); Connect(ID_M_PBTN13,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnMappingClick); - Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnStreamClick); - Connect(ID_M_PBTN5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnSaveClick); Connect(ID_M_PBTN4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlAoipManual::OnbtnRtpMapClick); //*) SetSize(size); @@ -137,7 +166,14 @@ pnlAoipManual::pnlAoipManual(wxWindow* parent,wxWindowID id,const wxPoint& pos,c m_pbtnChannels->SetPopup({"1", "2", "3", "4", "5", "6", "7", "8"}); m_pbtnChannels->ConnectToSetting("ManualAoIp", "Channels", "2"); + m_plstManualMode->AddButton("IP"); + m_plstManualMode->AddButton("Livewire+"); + m_plstManualMode->ConnectToSetting("ManualAoIp", "Mode", "IP"); + m_pswpManualMode->ChangeSelection(Settings::Get().Read("ManualAoIp", "Mode", "IP")); + m_pedtLivewire->ConnectToSetting("ManualAoIp", "Livewire", "", false); + Settings::Get().AddHandler(this, "Input", "AoIP"); + Settings::Get().AddHandler(this, "ManualAoIp", "Mode"); Bind(wxEVT_SETTING_CHANGED, &pnlAoipManual::OnSettingChanged, this); Bind(wxEVT_COMMAND_BUTTON_CLICKED, &pnlAoipManual::OnbtnBackClick, this, m_ppnlMapping->m_pbtnBack->GetId()); @@ -159,9 +195,12 @@ void pnlAoipManual::OnbtnSampleRateClick(wxCommandEvent& event) wxString pnlAoipManual::CreateSDP() { wxString sSdp; - sSdp << "v=0\r\n" - << "o=- " << wxDateTime::UNow().Format("%Y%m%d%H%M%S%l") << " 1 IN 169.254.1.1\r\n" - << "s=Manual SDP created by PAM\r\n" + if(Settings::Get().Read("ManualAoIp", "Mode", "IP") == "IP") + { + sSdp << "v=0\r\n" + << "o=- " << wxDateTime::UNow().Format("%Y%m%d%H%M%S%l") << " 1 IN IP4 " << Settings::Get().Read("ManualAoip","Source", "0.0.0.0") << "\r\n" + << "s=Manual IP=" <GetValue().ToULong(&nChannel); + unsigned long X = nChannel/256; + unsigned long Y = nChannel-(X*256); + + sSdp << "v=0\r\n" + << "o=- " << wxDateTime::UNow().Format("%Y%m%d%H%M%S%l") << " 1 IN IP4 169.254.1.1\r\n" + << "s=Livewire+ channel=" << nChannel << "\r\n" + << "i=Manual SDP created by PAM. Origin source ip will be incorrect\r\n" + << "t=0 0\r\n" + << "a=recvonly\r\n" + << "m=audio 5004" << " RTP/AVP " << "96" << "\r\n" + << "a=recvonly\r\n" + << "a=ptime:1\r\n" + << "a=maxptime:5\r\n" + << "c=IN IP4 239.192." << X << "." << Y << "\r\n" + << "a=rtpmap:96 L24/48000/2\r\n" + << "a=sync-time:0\r\n" + << "a=mediaclk:direct=0\r\n"; + //@todo grandmaster if we have , + + } return sSdp; } @@ -201,13 +265,18 @@ void pnlAoipManual::OnSettingChanged(SettingEvent& event) { if(event.GetSection() == "Input" && event.GetKey() == "AoIP") { - m_pbtnBits->Enable(event.GetValue(0l) == 0); - m_pbtnChannels->Enable(event.GetValue(0l) == 0); - m_pbtnRtpMap->Enable(event.GetValue(0l) == 0); - m_pipServer->Enable(event.GetValue(0l) == 0); - m_pkbd->Enable(event.GetValue(0l) == 0); - m_pedtPort->Enable(event.GetValue(0l) == 0); - m_pbtnSampleRate->Enable(event.GetValue(0l) == 0); + m_pbtnBits->Enable(event.GetValue(0L) == 0); + m_pbtnChannels->Enable(event.GetValue(0L) == 0); + m_pbtnRtpMap->Enable(event.GetValue(0L) == 0); + m_pipServer->Enable(event.GetValue(0L) == 0); + m_pkbd->Enable(event.GetValue(0L) == 0); + m_pedtPort->Enable(event.GetValue(0L) == 0); + m_pbtnSampleRate->Enable(event.GetValue(0L) == 0); + m_plstManualMode->Enable(event.GetValue(0L) == 0); + } + else if(event.GetSection() == "ManualAoIp" && event.GetKey() == "Mode") + { + m_pswpManualMode->ChangeSelection(event.GetValue()); } } diff --git a/pam2/pnlAoipManual.h b/pam2/pnlAoipManual.h index f365f9f9..98208d12 100644 --- a/pam2/pnlAoipManual.h +++ b/pam2/pnlAoipManual.h @@ -8,6 +8,7 @@ #include "wmipeditpnl.h" #include "wmkeyboard.h" #include "wmlabel.h" +#include "wmlist.h" #include "wmswitcherpanel.h" #include #include @@ -29,21 +30,31 @@ class pnlAoipManual: public wxPanel wmButton* m_pbtnSampleRate; wmButton* m_pbtnSave; wmButton* m_pbtnStream; + wmEdit* m_pedtLivewire; wmEdit* m_pedtPort; wmipeditpnl* m_pipServer; wmKeyboard* m_pkbd; wmLabel* m_pLbl1; wmLabel* m_pLbl2; + wmLabel* m_pLbl3; wmLabel* m_pLbl4; wmLabel* m_pLbl8; wmLabel* m_pLbl9; + wmList* m_plstManualMode; wmSwitcherPanel* m_pswpMain; + wmSwitcherPanel* m_pswpManualMode; wxPanel* m_ppnlSettings; + wxPanel* pnlIp; + wxPanel* pnlLivewire; //*) protected: //(*Identifiers(pnlAoipManual) + static const long ID_M_PKBD2; + static const long ID_M_PBTN3; + static const long ID_M_PBTN5; + static const long ID_M_PLST1; static const long ID_M_PLBL8; static const long ID_M_PIP1; static const long ID_M_PLBL1; @@ -54,11 +65,13 @@ class pnlAoipManual: public wxPanel static const long ID_M_PLBL4; static const long ID_M_PBTN2; static const long ID_M_PBTN13; - static const long ID_M_PKBD2; - static const long ID_M_PBTN3; - static const long ID_M_PBTN5; static const long ID_M_PLBL11; static const long ID_M_PBTN4; + static const long ID_PANEL2; + static const long ID_M_PLBL3; + static const long ID_M_PEDT1; + static const long ID_PANEL3; + static const long ID_M_PSWP2; static const long ID_PANEL1; static const long ID_CHANNEL_MAPPING; static const long ID_M_PSWP1; diff --git a/pam2/pnlSettingsTime.cpp b/pam2/pnlSettingsTime.cpp index 51b779b8..bc7a99cf 100644 --- a/pam2/pnlSettingsTime.cpp +++ b/pam2/pnlSettingsTime.cpp @@ -21,13 +21,16 @@ const long pnlSettingsTime::ID_M_PLBL8 = wxNewId(); const long pnlSettingsTime::ID_M_PEDT1 = wxNewId(); const long pnlSettingsTime::ID_M_PKBD1 = wxNewId(); const long pnlSettingsTime::ID_M_PBTN1 = wxNewId(); +const long pnlSettingsTime::ID_M_PBTN2 = wxNewId(); const long pnlSettingsTime::ID_PANEL2 = wxNewId(); const long pnlSettingsTime::ID_M_PLBL13 = wxNewId(); const long pnlSettingsTime::ID_M_PLST2 = wxNewId(); const long pnlSettingsTime::ID_PANEL3 = wxNewId(); const long pnlSettingsTime::ID_M_PSWP1 = wxNewId(); +const long pnlSettingsTime::ID_M_PLBL2 = wxNewId(); const long pnlSettingsTime::ID_M_PLST3 = wxNewId(); const long pnlSettingsTime::ID_M_PLBL1 = wxNewId(); +const long pnlSettingsTime::ID_M_PLBL3 = wxNewId(); const long pnlSettingsTime::ID_TIMER1 = wxNewId(); //*) @@ -41,24 +44,24 @@ pnlSettingsTime::pnlSettingsTime(wxWindow* parent,wxWindowID id,const wxPoint& p //(*Initialize(pnlSettingsTime) Create(parent, id, wxDefaultPosition, wxSize(600,400), wxTAB_TRAVERSAL, _T("id")); SetBackgroundColour(wxColour(0,0,0)); - m_pswpSettings = new wmSwitcherPanel(this, ID_M_PSWP1, wxPoint(0,110), wxSize(600,330), wmSwitcherPanel::STYLE_NOSWIPE|wmSwitcherPanel::STYLE_NOANIMATION, _T("ID_M_PSWP1")); + m_pswpSettings = new wmSwitcherPanel(this, ID_M_PSWP1, wxPoint(0,125), wxSize(600,315), wmSwitcherPanel::STYLE_NOSWIPE|wmSwitcherPanel::STYLE_NOANIMATION, _T("ID_M_PSWP1")); m_pswpSettings->SetPageNameStyle(3); m_ppnlNTP = new wxPanel(m_pswpSettings, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1")); m_ppnlNTP->SetBackgroundColour(wxColour(0,0,0)); - m_plstNTPServers = new wmList(m_ppnlNTP, ID_M_PLST1, wxPoint(0,10), wxSize(600,240), wmList::STYLE_SELECT, 0, wxSize(-1,40), 3, wxSize(5,5)); + m_plstNTPServers = new wmList(m_ppnlNTP, ID_M_PLST1, wxPoint(0,10), wxSize(600,220), wmList::STYLE_SELECT, 0, wxSize(-1,40), 3, wxSize(5,5)); m_plstNTPServers->SetBackgroundColour(wxColour(0,0,0)); m_plstNTPServers->SetButtonColour(wxColour(wxT("#005555"))); m_plstNTPServers->SetSelectedButtonColour(wxColour(wxT("#008000"))); m_plstNTPServers->SetDisabledColour(wxColour(wxT("#808080"))); - m_pbtnNtpServerAdd = new wmButton(m_ppnlNTP, ID_M_PBTN3, _("Add Server"), wxPoint(70,250), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN3")); + m_pbtnNtpServerAdd = new wmButton(m_ppnlNTP, ID_M_PBTN3, _("Add Server"), wxPoint(70,235), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN3")); m_pbtnNtpServerAdd->SetColourDisabled(wxColour(wxT("#808080"))); - m_pbtnNtpServerEdit = new wmButton(m_ppnlNTP, ID_M_PBTN4, _("Edit Server"), wxPoint(180,250), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN4")); + m_pbtnNtpServerEdit = new wmButton(m_ppnlNTP, ID_M_PBTN4, _("Edit Server"), wxPoint(180,235), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN4")); m_pbtnNtpServerEdit->Disable(); m_pbtnNtpServerEdit->SetColourDisabled(wxColour(wxT("#808080"))); - m_pbtnNtpServerDelete = new wmButton(m_ppnlNTP, ID_M_PBTN5, _("Delete Server"), wxPoint(290,250), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN5")); + m_pbtnNtpServerDelete = new wmButton(m_ppnlNTP, ID_M_PBTN5, _("Delete Server"), wxPoint(290,235), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN5")); m_pbtnNtpServerDelete->Disable(); m_pbtnNtpServerDelete->SetColourDisabled(wxColour(wxT("#808080"))); - m_pbtnNTPServerDeleteAll = new wmButton(m_ppnlNTP, ID_M_PBTN6, _("Delete All"), wxPoint(400,250), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN6")); + m_pbtnNTPServerDeleteAll = new wmButton(m_ppnlNTP, ID_M_PBTN6, _("Delete All"), wxPoint(400,235), wxSize(100,40), 0, wxDefaultValidator, _T("ID_M_PBTN6")); m_pbtnNTPServerDeleteAll->SetColourDisabled(wxColour(wxT("#808080"))); m_ppnlPTP = new wxPanel(m_pswpSettings, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL2")); m_ppnlPTP->SetBackgroundColour(wxColour(0,0,0)); @@ -80,6 +83,10 @@ pnlSettingsTime::pnlSettingsTime(wxWindow* parent,wxWindowID id,const wxPoint& p m_pbtnSync->SetBackgroundColour(wxColour(0,128,64)); m_pbtnSync->SetColourDisabled(wxColour(wxT("#808080"))); m_pbtnSync->SetToggleLook(true, wxT("UTC"), wxT("TAI"), 60); + m_pbtnPtpMode = new wmButton(m_ppnlPTP, ID_M_PBTN2, _("Mode"), wxPoint(350,110), wxSize(200,40), 0, wxDefaultValidator, _T("ID_M_PBTN2")); + m_pbtnPtpMode->SetBackgroundColour(wxColour(0,128,64)); + m_pbtnPtpMode->SetColourDisabled(wxColour(wxT("#808080"))); + m_pbtnPtpMode->SetToggleLook(true, wxT("Multicast"), wxT("Hybrid"), 35); m_ppnlLTCS = new wxPanel(m_pswpSettings, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3")); m_ppnlLTCS->SetBackgroundColour(wxColour(0,0,0)); m_plblListTitle = new wmLabel(m_ppnlLTCS, ID_M_PLBL13, _("Format:"), wxPoint(0,10), wxSize(200,44), 0, _T("ID_M_PLBL13")); @@ -96,16 +103,30 @@ pnlSettingsTime::pnlSettingsTime(wxWindow* parent,wxWindowID id,const wxPoint& p m_pswpSettings->AddPage(m_ppnlNTP, _("NTP Servers"), false); m_pswpSettings->AddPage(m_ppnlPTP, _("PTP Domain"), false); m_pswpSettings->AddPage(m_ppnlLTCS, _("LTC Settings"), false); - m_plstSync = new wmList(this, ID_M_PLST3, wxPoint(10,10), wxSize(580,45), wmList::STYLE_SELECT, 0, wxSize(-1,-1), 4, wxSize(-1,-1)); + m_pLbl2 = new wmLabel(this, ID_M_PLBL2, _("Sync To:"), wxPoint(10,10), wxSize(100,40), 0, _T("ID_M_PLBL2")); + m_pLbl2->SetBorderState(uiRect::BORDER_NONE); + m_pLbl2->GetUiRect().SetGradient(0); + m_pLbl2->SetForegroundColour(wxColour(255,255,255)); + m_pLbl2->SetBackgroundColour(wxColour(128,128,255)); + wxFont m_pLbl2Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); + m_pLbl2->SetFont(m_pLbl2Font); + m_plstSync = new wmList(this, ID_M_PLST3, wxPoint(110,10), wxSize(480,40), wmList::STYLE_SELECT, 0, wxSize(-1,-1), 4, wxSize(-1,-1)); m_plstSync->SetBackgroundColour(wxColour(0,0,0)); m_plstSync->SetButtonColour(wxColour(wxT("#00006A"))); m_plstSync->SetSelectedButtonColour(wxColour(wxT("#FF8000"))); - m_plblTime = new wmLabel(this, ID_M_PLBL1, _("2021-12-12 12:22:30"), wxPoint(100,60), wxSize(400,40), 0, _T("ID_M_PLBL1")); + m_plblTime = new wmLabel(this, ID_M_PLBL1, _("2021-12-12 12:22:30"), wxPoint(100,50), wxSize(400,40), 0, _T("ID_M_PLBL1")); m_plblTime->SetBorderState(uiRect::BORDER_NONE); m_plblTime->GetUiRect().SetGradient(0); m_plblTime->SetForegroundColour(wxColour(0,128,0)); wxFont m_plblTimeFont(16,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblTime->SetFont(m_plblTimeFont); + m_pLbl3 = new wmLabel(this, ID_M_PLBL3, _("Settings"), wxPoint(10,90), wxSize(580,30), 0, _T("ID_M_PLBL3")); + m_pLbl3->SetBorderState(uiRect::BORDER_FLAT); + m_pLbl3->GetUiRect().SetGradient(0); + m_pLbl3->SetForegroundColour(wxColour(255,255,255)); + m_pLbl3->SetBackgroundColour(wxColour(0,64,64)); + wxFont m_pLbl3Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); + m_pLbl3->SetFont(m_pLbl3Font); m_timerTime.SetOwner(this, ID_TIMER1); m_timerTime.Start(500, false); @@ -115,11 +136,15 @@ pnlSettingsTime::pnlSettingsTime(wxWindow* parent,wxWindowID id,const wxPoint& p Connect(ID_M_PBTN5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsTime::OnbtnNtpServerDeleteClick); Connect(ID_M_PBTN6,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsTime::OnbtnNTPServerDeleteAllClick); Connect(ID_M_PEDT1,wxEVT_COMMAND_TEXT_ENTER,(wxObjectEventFunction)&pnlSettingsTime::OnedtDomainTextEnter); + Connect(ID_M_PBTN1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsTime::OnbtnNtpServerAddClick); + Connect(ID_M_PBTN2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&pnlSettingsTime::OnbtnNtpServerAddClick); Connect(ID_M_PLST2,wxEVT_LIST_SELECTED,(wxObjectEventFunction)&pnlSettingsTime::OnlstDateSelected); Connect(ID_M_PLST3,wxEVT_LIST_SELECTED,(wxObjectEventFunction)&pnlSettingsTime::OnlstSyncSelected); Connect(ID_TIMER1,wxEVT_TIMER,(wxObjectEventFunction)&pnlSettingsTime::OntimerTimeTrigger); //*) + //extra buttons etc + for(auto pairServer : TimeManager::Get().GetNtpServers()) { if(pairServer.second) @@ -162,6 +187,7 @@ pnlSettingsTime::pnlSettingsTime(wxWindow* parent,wxWindowID id,const wxPoint& p m_plstDate->ConnectToSetting("Time", "LTC_Format", (int)2); m_pbtnSync->ConnectToSetting("Time", "Tai", false); + m_pbtnPtpMode->ConnectToSetting("Time", "Ptp_Mode", false); } pnlSettingsTime::~pnlSettingsTime() diff --git a/pam2/pnlSettingsTime.h b/pam2/pnlSettingsTime.h index 50a3fef2..3607712c 100644 --- a/pam2/pnlSettingsTime.h +++ b/pam2/pnlSettingsTime.h @@ -25,10 +25,13 @@ class pnlSettingsTime: public wxPanel wmButton* m_pbtnNtpServerAdd; wmButton* m_pbtnNtpServerDelete; wmButton* m_pbtnNtpServerEdit; + wmButton* m_pbtnPtpMode; wmButton* m_pbtnSync; wmEdit* m_pedtDomain; wmKeyboard* m_pKbd1; wmLabel* m_pLbl1; + wmLabel* m_pLbl2; + wmLabel* m_pLbl3; wmLabel* m_plblListTitle; wmLabel* m_plblTime; wmList* m_plstDate; @@ -54,13 +57,16 @@ class pnlSettingsTime: public wxPanel static const long ID_M_PEDT1; static const long ID_M_PKBD1; static const long ID_M_PBTN1; + static const long ID_M_PBTN2; static const long ID_PANEL2; static const long ID_M_PLBL13; static const long ID_M_PLST2; static const long ID_PANEL3; static const long ID_M_PSWP1; + static const long ID_M_PLBL2; static const long ID_M_PLST3; static const long ID_M_PLBL1; + static const long ID_M_PLBL3; static const long ID_TIMER1; //*) diff --git a/pam2/wxsmith/pnlAoipManual.wxs b/pam2/wxsmith/pnlAoipManual.wxs index 5d8a1c84..a6bc0d26 100644 --- a/pam2/wxsmith/pnlAoipManual.wxs +++ b/pam2/wxsmith/pnlAoipManual.wxs @@ -8,95 +8,6 @@ #000000 - - - 10,15 - 100,40 - #FFFFFF - #400080 - - - 110,15 - 200,40 - - - - 310,15 - 50,40 - #FFFFFF - #400080 - - - Integer - uiRect::BORDER_DOWN - uiRect::BORDER_DOWN - 360,15 - 100,40 - - - - 10,60 - 100,40 - #FFFFFF - #400080 - - - - #B0B0B0 - Stop - Start - 50 - 110,60 - 90,40 - #000000 - #FFFFFF - - - - - - 1 - 16 - 24 - 40 - 260,60 - 200,40 - #008000 - - - - - 10,105 - 100,40 - #FFFFFF - #400080 - - - - #B0B0B0 - Stop - Start - 50 - 110,105 - 90,40 - #000000 - #FFFFFF - - - - - - #B0B0B0 - Stop - Start - 50 - 200,105 - 60,40 - #000000 - #A3D3D3 - - - Calc 10,160 @@ -134,25 +45,164 @@ - - - 310,105 - 70,40 - #FFFFFF - #400080 + + None + 90,64 + + #F07800 + + 5,13 + 94,132 + wxSYS_COLOUR_SCROLLBAR + + 10 + + bold + 0 + swiss + + + - - - #B0B0B0 - Stop - Start - 50 - 380,105 - 80,40 - #000000 - #FFFFFF - - + + 100,0 + 470,150 + + + + #000000 + + + 10,15 + 100,40 + #FFFFFF + #400080 + + + 110,15 + 200,40 + + + + 310,15 + 50,40 + #FFFFFF + #400080 + + + Integer + uiRect::BORDER_DOWN + uiRect::BORDER_DOWN + 360,15 + 100,40 + + + + 10,60 + 100,40 + #FFFFFF + #400080 + + + + #B0B0B0 + Stop + Start + 50 + 110,60 + 90,40 + #000000 + #FFFFFF + + + + + + 1 + 16 + 24 + 40 + 260,60 + 200,40 + #008000 + + + + + 10,105 + 100,40 + #FFFFFF + #400080 + + + + #B0B0B0 + Stop + Start + 50 + 110,105 + 90,40 + #000000 + #FFFFFF + + + + + + #B0B0B0 + Stop + Start + 50 + 200,105 + 60,40 + #000000 + #A3D3D3 + + + + + + 310,105 + 70,40 + #FFFFFF + #400080 + + + + #B0B0B0 + Stop + Start + 50 + 380,105 + 80,40 + #000000 + #FFFFFF + + + + + + + + + #000000 + + + 10,15 + 100,40 + #FFFFFF + #400080 + + + Integer + uiRect::BORDER_DOWN + uiRect::BORDER_DOWN + 110,15 + 250,40 + + + + @@ -163,6 +213,7 @@ $(THIS) = new $(CLASS)($(PARENT),"ManualAoIp", $(ID),$(POS),$(SIZE)); pnlChannelMapping.h 1 + diff --git a/pam2/wxsmith/pnlSettingsTime.wxs b/pam2/wxsmith/pnlSettingsTime.wxs index 1d666a8e..16186226 100644 --- a/pam2/wxsmith/pnlSettingsTime.wxs +++ b/pam2/wxsmith/pnlSettingsTime.wxs @@ -7,8 +7,8 @@ 1 Button - 0,110 - 600,330 + 0,125 + 600,315 @@ -23,7 +23,7 @@ #808080 0,10 - 600,240 + 600,220 #000000 @@ -31,14 +31,14 @@ #808080 - 70,250 + 70,235 100,40 #808080 - 180,250 + 180,235 100,40 0 @@ -46,7 +46,7 @@ #808080 - 290,250 + 290,235 100,40 0 @@ -54,7 +54,7 @@ #808080 - 400,250 + 400,235 100,40 @@ -106,6 +106,18 @@ #008040 + + + #808080 + 1 + Multicast + Hybrid + 35 + 350,110 + 200,40 + #008040 + + @@ -144,21 +156,36 @@ + + + 10,10 + 100,40 + #FFFFFF + #8080FF + + 10 + + bold + 0 + swiss + Tahoma + + None 4 #FF8000 - 10,10 - 580,45 + 110,10 + 480,40 #000000 - 100,60 + 100,50 400,40 #008000 @@ -170,6 +197,22 @@ Tahoma + + + uiRect::BORDER_FLAT + 10,90 + 580,30 + #FFFFFF + #004040 + + 10 + + bold + 0 + swiss + Tahoma + + 500 diff --git a/pam2_paths.h.in b/pam2_paths.h.in index 846d6fb6..2f95f231 100644 --- a/pam2_paths.h.in +++ b/pam2_paths.h.in @@ -6,7 +6,7 @@ namespace pml { namespace pam2 { - const char* CONFIG_PATH = "@DIR_PAM@"; + const char* CONFIG_PATH = "/usr/local/etc"; } } #endif diff --git a/pambase/AES67ServerMediaSubsession.cpp b/pambase/AES67ServerMediaSubsession.cpp index df29b5fd..4ed2b982 100644 --- a/pambase/AES67ServerMediaSubsession.cpp +++ b/pambase/AES67ServerMediaSubsession.cpp @@ -63,7 +63,7 @@ char const* AES67ServerMediaSubsession::sdpLines(int addressFamily) ss << "a=ptime:" << m_nPacketTime << "\r\n"; ss << "a=maxptime:" << m_nPacketTime << "\r\n"; #ifdef PTPMONKEY - ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId(0) << ":0\r\n"; + ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId() << ":0\r\n"; #else ss << "a=ts-refclk:" << "\r\n"; #endif // PTPMONKEY @@ -251,7 +251,7 @@ unsigned int AES67ServerMediaSubsession::GetEpochTimestamp() // //get the current time // timeval tvNow; // #ifdef PTPMONKEY -// tvNow = wxPtp::Get().GetPtpTime(0); +// tvNow = wxPtp::Get().GetPtpTime(); // #else // gettimeofday(&tvNow, 0); // #endif // PTPMONKEY diff --git a/pambase/CMakeLists.txt b/pambase/CMakeLists.txt index 56fbaf13..375daf05 100644 --- a/pambase/CMakeLists.txt +++ b/pambase/CMakeLists.txt @@ -1,5 +1,6 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -project(pambase LANGUAGES CXX VERSION 1.7.1) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) +project(pambase LANGUAGES CXX VERSION 1.8.1) + execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -37,11 +38,11 @@ message(${CMAKE_CURRENT_SOURCE_DIR}) #pambase settubgs -set(SOURCES "advelement.cpp" "aes67mediasession.cpp" "AES67ServerMediaSubsession.cpp" "aes67source.cpp" "anglemeter.cpp" "aoipsourcemanager.cpp" "audio.cpp" "audioevent.cpp" "dlgmask.cpp" +set(SOURCES "advelement.cpp" "AES67ServerMediaSubsession.cpp" "aes67source.cpp" "anglemeter.cpp" "aoipsourcemanager.cpp" "audio.cpp" "audioevent.cpp" "dlgmask.cpp" "generator.cpp" "generatorpluginbuilder.cpp" "generatorpluginfactory.cpp" "histogram.cpp" "historygraph.cpp" "inimanager.cpp" "inisection.cpp" "iomanager.cpp" "levelcalculator.cpp" "levelgraph.cpp" "levelmeter.cpp" "liveaudiosource.cpp" "monitorevent.cpp" "monitorpluginbuilder.cpp" "monitorpluginfactory.cpp" "networkcontrol.cpp" "pamRTSPServer.cpp" "niir.cpp" "ondemandaes67mediasubsession.cpp" "ondemandpamsubsession.cpp" "ondemandstreamer.cpp" "ourRTSPClient.cpp" "ourSIPClient.cpp" "PamTaskScheduler.cpp" "PamUsageEnvironment.cpp" "pcstats.cpp" "pmcontrol.cpp" "pmpanel.cpp" "ppmtypes.cpp" "qos.cpp" "r128calculator.cpp" - "r128thread.cpp" "rawvideosource.cpp" "remoteapi.cpp" "RTCPTransmissionEvent.cpp" "rtpserverthread.cpp" "rtpthread.cpp" "rtsputil.cpp" "servicebrowser.cpp" "session.cpp" "settingevent.cpp" "settings.cpp" "smpte2110mediasession.cpp" + "r128thread.cpp" "rawvideosource.cpp" "remoteapi.cpp" "RTCPTransmissionEvent.cpp" "rtpframeevent.cpp" "rtpserverthread.cpp" "rtpthread.cpp" "rtsputil.cpp" "servicebrowser.cpp" "session.cpp" "settingevent.cpp" "settings.cpp" "smpte2110mediasession.cpp" "soundcardmanager.cpp" "soundfile.cpp" "streamclientstate.cpp" "testpluginbuilder.cpp" "testpluginfactory.cpp" "timemanager.cpp" "uirect.cpp" "wmbutton.cpp" "wmedit.cpp" "wmfocusmanager.cpp" "wmipeditpnl.cpp" "wmkeyboard.cpp" "wmlabel.cpp" "wmline.cpp" "wmlist.cpp" "wmlistadv.cpp" "wmslider.cpp" "wmslidewnd.cpp" "wmswipebutton.cpp" "wmswitcherpanel.cpp" "wmtimeedit.cpp" "wxptp.cpp" "wxsaphandler.cpp" "wxsink.cpp" "wxtouchscreenhtml.cpp" "wxzxposter.cpp" ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_version.cpp) @@ -58,7 +59,8 @@ target_include_directories(pambase PUBLIC ${DIR_JSON}/dist) target_include_directories(pambase PUBLIC ${CMAKE_BINARY_DIR}/include) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +set_target_properties(pambase PROPERTIES CXX_STANDARD 17) +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -112,5 +114,5 @@ set_target_properties(pambase PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS pambase LIBRARY DESTINATION /usr/local/lib) + install(TARGETS pambase LIBRARY DESTINATION lib) endif() diff --git a/pambase/aes67source.cpp b/pambase/aes67source.cpp index 6543e133..ce8dac6c 100644 --- a/pambase/aes67source.cpp +++ b/pambase/aes67source.cpp @@ -1,4 +1,4 @@ -#include "aes67mediasession.h" +//#include "aes67mediasession.h" #include "UsageEnvironment.hh" #include "aes67source.h" #include @@ -34,7 +34,7 @@ ::Aes67Source(UsageEnvironment& env, Groupsock* RTPgs, m_nSyncTimestamp(nSync) { #ifdef PTPMONKEY - wxPtp::Get().ResyncToMaster(0); + wxPtp::Get().ResyncToMaster(); #endif // PTPMONKEY WorkoutLastEpoch(); } diff --git a/pambase/aoipsourcemanager.cpp b/pambase/aoipsourcemanager.cpp index 694a5353..47cfa048 100644 --- a/pambase/aoipsourcemanager.cpp +++ b/pambase/aoipsourcemanager.cpp @@ -348,7 +348,7 @@ void AoipSourceManager::OnSap(wxCommandEvent& event) unsigned long nCodec; if(asLines[i].AfterFirst(':').BeforeFirst(' ').ToULong(&nCodec) && nCodec > 95 && nCodec < 127) { - if(asLines[i].find("L24") != wxNOT_FOUND || asLines[i].find("L16") != wxNOT_FOUND) + if(asLines[i].find("L24") != wxNOT_FOUND || asLines[i].find("L16") != wxNOT_FOUND || asLines[i].find("AM824") != wxNOT_FOUND) { bCanDecode = true; break; diff --git a/pambase/dlgmask.cpp b/pambase/dlgmask.cpp index c1f37067..c6085f78 100644 --- a/pambase/dlgmask.cpp +++ b/pambase/dlgmask.cpp @@ -79,7 +79,10 @@ dlgMask::~dlgMask() void dlgMask::OnActivate(wxActivateEvent& event) { - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } } void dlgMask::MoveToCorrectPlace(size_t nButtons) diff --git a/pambase/histogram.cpp b/pambase/histogram.cpp index 83f3ce5a..29d5feda 100644 --- a/pambase/histogram.cpp +++ b/pambase/histogram.cpp @@ -342,13 +342,19 @@ void Histogram::OnLeftDown(wxMouseEvent& event) m_bMouseDown = true; itGraph->second.dFirstDisplay = m_dFirstColumn; } - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } } void Histogram::OnLeftUp(wxMouseEvent& event) { m_bMouseDown = false; - ReleaseMouse(); + if(HasCapture()) + { + ReleaseMouse(); + } } void Histogram::OnMouseMove(wxMouseEvent& event) diff --git a/pambase/iomanager.cpp b/pambase/iomanager.cpp index 6ac7eb53..b9c3c429 100644 --- a/pambase/iomanager.cpp +++ b/pambase/iomanager.cpp @@ -54,6 +54,16 @@ void IOManager::DeregisterForRTSPTransmission(wxEvtHandler* pHandler) m_setRTSPHandlers.erase(pHandler); } +void IOManager::RegisterForRTPFrame(wxEvtHandler* pHandler) +{ + m_setRtpFrameHandlers.insert(pHandler); +} + +void IOManager::DeregisterForRTPFrame(wxEvtHandler* pHandler) +{ + m_setRtpFrameHandlers.erase(pHandler); +} + void IOManager::RegisterHandler(wxEvtHandler* pHandler) { if(m_bSingleHandler) @@ -113,15 +123,17 @@ IOManager::IOManager() : Connect(wxID_ANY,wxEVT_RTP_SESSION_CLOSED,(wxObjectEventFunction)&IOManager::OnRTPSessionClosed); Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&IOManager::OnSettingEvent); + Connect(wxID_ANY,wxEVT_RTP_FRAME,(wxObjectEventFunction)&IOManager::OnRtpFrame); Connect(wxID_ANY,wxEVT_QOS_UPDATED,(wxObjectEventFunction)&IOManager::OnQoS); + Connect(wxID_ANY, wxEVT_STREAMING, (wxObjectEventFunction)&IOManager::OnStreaming); #ifdef PTPMONKEY wxPtp::Get().AddHandler(this); Connect(wxID_ANY, wxEVT_CLOCK_MASTER, (wxObjectEventFunction)&IOManager::OnPtpEvent); Connect(wxID_ANY, wxEVT_CLOCK_SLAVE, (wxObjectEventFunction)&IOManager::OnPtpEvent); - wxPtp::Get().RunDomain(std::string(Settings::Get().Read(wxT("AoIP_Settings"), wxT("Interface"), wxT("eth0")).mb_str()), - Settings::Get().Read(wxT("AoIP_Settings"), wxT("Domain"), 0)); + wxPtp::Get().Run(std::string(Settings::Get().Read("AoIP_Settings", "Interface", "eth0").mb_str()), + Settings::Get().Read("Time", "PTP_Domain", 0), Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); #endif // PTPMONKEY m_pGenerator = std::make_unique(); m_pGenerator->SetSampleRate(48000); @@ -189,7 +201,7 @@ void IOManager::StopStream() void IOManager::OnSettingEvent(SettingEvent& event) { - if(event.GetSection() == wxT("Monitor")) + if(event.GetSection() == "Monitor") { OnSettingEventMonitor(event); } @@ -780,7 +792,7 @@ void IOManager::InitAudioInputDevice(bool bStart) m_SessionIn = session(wxEmptyString, wxT("Soundcard"), SoundcardManager::Get().GetInputDeviceName()); //@todo its possible soundcard might not be two channels - m_SessionIn.lstSubsession.push_back(subsession(wxEmptyString, SoundcardManager::Get().GetInputDeviceName(), wxEmptyString, + m_SessionIn.lstSubsession.push_back(subsession(wxEmptyString, SoundcardManager::Get().GetInputDeviceName(), "0", wxEmptyString, wxT("L24"), wxEmptyString, SoundcardManager::Get().GetInputDevice(), SoundcardManager::Get().GetInputSampleRate(), CreateChannels(2), 0, {0,0}, refclk())); m_SessionIn.SetCurrentSubsession(); @@ -897,7 +909,7 @@ void IOManager::CreateSessionFromOutput(const wxString& sSource) m_pGenerator->SetSampleRate(nSampleRate); } m_SessionOut.lstSubsession.push_back(subsession(Settings::Get().Read(wxT("Output"), wxT("Source"),wxEmptyString), - sSource, wxEmptyString, wxT("F32"), wxEmptyString, 0, nSampleRate, CreateChannels(nChannels), + sSource, "0", wxEmptyString, wxT("F32"), wxEmptyString, 0, nSampleRate, CreateChannels(nChannels), 0, {0,0}, refclk())); m_SessionOut.SetCurrentSubsession(); @@ -1146,19 +1158,19 @@ void IOManager::OnRTPSessionClosed(wxCommandEvent& event) { m_nCurrentRtp = 0; } - //m_setRtpOrphan.erase(event.GetInt()); + m_mRtp.erase(event.GetInt()); pmlLog(pml::LOG_INFO) << "IOManager\tOnRTPSessionClosed: " << event.GetInt(); } void IOManager::OnRTPSession(wxCommandEvent& event) { - session* pSession = reinterpret_cast(event.GetClientData()); + auto pSession = reinterpret_cast(event.GetClientData()); - m_SessionIn = session(pSession->sRawSDP, pSession->sName, pSession->sType, pSession->sDescription, pSession->sGroups); - for(list::iterator itSub = pSession->lstSubsession.begin(); itSub != pSession->lstSubsession.end(); ++itSub) + m_SessionIn = session(pSession->sRawSDP, pSession->sName, pSession->sType, pSession->sDescription, pSession->setGroups); + for(const auto& sub : pSession->lstSubsession) { - m_SessionIn.lstSubsession.push_back((*itSub)); + m_SessionIn.lstSubsession.push_back(sub); } m_SessionIn.SetCurrentSubsession(); @@ -1291,6 +1303,15 @@ void IOManager::OnQoS(wxCommandEvent& event) } } +void IOManager::OnRtpFrame(RtpFrameEvent& event) +{ + for(auto pHandler : m_setRtpFrameHandlers) + { + RtpFrameEvent eventUp(event.GetFrame()); + pHandler->ProcessEvent(eventUp); + } +} + void IOManager::OnTimerSilence(wxTimerEvent& event) { @@ -1401,7 +1422,6 @@ void IOManager::Stream() if(m_bStreamAlwaysOn || bNmos) //@todo bodge for NMOS { StreamAlwaysOn(); - DoSAP(Settings::Get().Read("Server", "SAP",0)); } else { @@ -1438,6 +1458,19 @@ void IOManager::StreamAlwaysOn() } } +void IOManager::OnStreaming(wxCommandEvent& event) +{ + pmlLog() << "IOManager::OnStreaming " << event.GetInt(); + if(event.GetInt() == 1) + { + DoSAP(Settings::Get().Read("Server", "SAP",0)); + } + else + { + DoSAP(false); + } +} + void IOManager::StreamOnDemand() { pmlLog(pml::LOG_INFO) << "IOManager\tCreate OnDemand AES67 Server"; diff --git a/pambase/iomanager.h b/pambase/iomanager.h index 89809d8e..4db06903 100644 --- a/pambase/iomanager.h +++ b/pambase/iomanager.h @@ -9,6 +9,7 @@ #include #include #include "session.h" +#include "rtpframeevent.h" class SettingEvent; class AudioEvent; @@ -43,6 +44,9 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler void RegisterForRTSPTransmission(wxEvtHandler* pHandler); void DeregisterForRTSPTransmission(wxEvtHandler* pHandler); + void RegisterForRTPFrame(wxEvtHandler* pHandler); + void DeregisterForRTPFrame(wxEvtHandler* pHandler); + void Stop(); const session& GetSession(); const session& GetInputSession(); @@ -77,6 +81,7 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler void OnRTPSession(wxCommandEvent& event); void OnRTPSessionClosed(wxCommandEvent& event); void OnQoS(wxCommandEvent& event); + void OnRtpFrame(RtpFrameEvent& event); void InputTypeChanged(); void InputChanged(const wxString& sKey); @@ -124,11 +129,14 @@ class PAMBASE_IMPEXPORT IOManager : public wxEvtHandler void CheckIfGain(); void InitAoIPInput(); + void OnStreaming(wxCommandEvent& event); + std::vector CreateRouting(); - std::set m_setHandlers; + std::set m_setHandlers; std::set m_setRTCPHandlers; std::set m_setRTSPHandlers; + std::set m_setRtpFrameHandlers; bool m_bSingleHandler; session m_SessionIn; diff --git a/pambase/levelcalculator.cpp b/pambase/levelcalculator.cpp index 596acb3d..4a949559 100644 --- a/pambase/levelcalculator.cpp +++ b/pambase/levelcalculator.cpp @@ -51,7 +51,7 @@ void LevelCalculator::InputSession(const session& aSession) { dBits = 16; } - else if(aSession.GetCurrentSubsession()->sCodec == wxT("L24")) + else if(aSession.GetCurrentSubsession()->sCodec == wxT("L24") || aSession.GetCurrentSubsession()->sCodec == wxT("AM824")) { dBits = 24; } diff --git a/pambase/ondemandaes67mediasubsession.cpp b/pambase/ondemandaes67mediasubsession.cpp index 48813c6f..ea86dd57 100644 --- a/pambase/ondemandaes67mediasubsession.cpp +++ b/pambase/ondemandaes67mediasubsession.cpp @@ -38,7 +38,7 @@ char const* AES67RTPSink::auxSDPLine() std::stringstream ss; #ifdef PTPMONKEY - ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId(0).ToStdString() << ":0\r\n"; + ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId().ToStdString() << ":0\r\n"; #else ss << "a=ts-refclk:" << "\r\n"; #endif // PTPMONKEY @@ -207,7 +207,7 @@ void OnDemandAES67MediaSubsession::FlushQueue() // ss << "a=ptime:" << m_ePacketTime << "\r\n"; // ss << "a=maxptime:" << m_ePacketTime << "\r\n"; // #ifdef PTPMONKEY -// ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId(0) << ":0\r\n"; +// ss << "a=ts-refclk:ptp=IEEE1588-2008:" << wxPtp::Get().GetMasterClockId() << ":0\r\n"; // #else // ss << "a=ts-refclk:" << "\r\n"; // #endif // PTPMONKEY diff --git a/pambase/qos.cpp b/pambase/qos.cpp index 38d86753..88221ad0 100644 --- a/pambase/qos.cpp +++ b/pambase/qos.cpp @@ -4,17 +4,43 @@ #include "rtpthread.h" #include #include +#include "smpte2110mediasession.h" +#include "log.h" - +qosMeasurementRecord::qosMeasurementRecord(Smpte2110MediaSubsession* pSubsession) : + m_pSubsession(pSubsession) +{ + + gettimeofday(&m_tvMeasurementStart, nullptr); + gettimeofday(&m_tvMeasurementEnd, nullptr); + + if(m_pSubsession->rtpSource()) + { + RTPReceptionStatsDB::Iterator statsIter(m_pSubsession->rtpSource()->receptionStatsDB()); + // Assume that there's only one SSRC source (usually the case): + RTPReceptionStats* stats = statsIter.next(True); + if (stats != NULL) + { + m_dkBytesTotal = stats->totNumKBytesReceived(); + m_nTotNumPacketsReceived = stats->totNumPacketsReceived(); + m_nTotNumPacketsExpected = stats->totNumPacketsExpected(); + } + } +} void qosMeasurementRecord::periodicQOSMeasurement(struct timeval const& timeNow) { + if(!m_pSubsession || !m_pSubsession->rtpSource() || !m_pThread) + { + return; + } + unsigned secsDiff = timeNow.tv_sec - m_tvMeasurementEnd.tv_sec; int usecsDiff = timeNow.tv_usec - m_tvMeasurementEnd.tv_usec; double timeDiff = secsDiff + usecsDiff/1000000.0; m_tvMeasurementEnd = timeNow; - RTPReceptionStatsDB::Iterator statsIter(m_pSource->receptionStatsDB()); + RTPReceptionStatsDB::Iterator statsIter(m_pSubsession->rtpSource()->receptionStatsDB()); // Assume that there's only one SSRC source (usually the case): RTPReceptionStats* stats = statsIter.next(True); if (stats != NULL) @@ -42,7 +68,6 @@ void qosMeasurementRecord::periodicQOSMeasurement(struct timeval const& timeNow) m_nTotNumPacketsExpected = totExpectedNow; double lossFractionNow = deltaExpectedNow == 0 ? 0.0 : 1.0 - deltaReceivedNow/(double)deltaExpectedNow; - //if (lossFractionNow < 0.0) lossFractionNow = 0.0; //reordering can cause if (lossFractionNow < m_dPacket_loss_fraction_min) { m_dPacket_loss_fraction_min = lossFractionNow; @@ -99,27 +124,27 @@ void qosMeasurementRecord::printQOSData() pData->dPacket_loss_fraction_av = 100*packetLossFraction; pData->dPacket_loss_fraction_max = (packetLossFraction == 1.0 ? 100.0 : 100*m_dPacket_loss_fraction_max); - if(m_pSource) + if(m_pSubsession->rtpSource()) { - - RTPReceptionStatsDB::Iterator statsIter(m_pSource->receptionStatsDB()); + RTPReceptionStatsDB::Iterator statsIter(m_pSubsession->rtpSource()->receptionStatsDB()); // Assume that there's only one SSRC source (usually the case): RTPReceptionStats* stats = statsIter.next(True); if (stats != NULL) { - pData->dInter_packet_gap_ms_Now = stats->currentInterPacketGapUS()/1000.0; pData->dInter_packet_gap_ms_min = stats->minInterPacketGapUS()/1000.0; - struct timeval totalGaps = stats->totalInterPacketGaps(); - double totalGapsMS = totalGaps.tv_sec*1000.0 + totalGaps.tv_usec/1000.0; - unsigned totNumPacketsReceived = stats->totNumPacketsReceived(); + auto totalGaps = stats->totalInterPacketGaps(); + auto totalGapsMS = totalGaps.tv_sec*1000.0 + totalGaps.tv_usec/1000.0; + auto totNumPacketsReceived = stats->totNumPacketsReceived(); pData->dInter_packet_gap_ms_av = (totNumPacketsReceived == 0 ? 0.0 : totalGapsMS/totNumPacketsReceived); pData->dInter_packet_gap_ms_max = stats->maxInterPacketGapUS()/1000.0; + stats->resetMinMax(); //reset the min and max interpacket gap as we monitor them every second + pData->nBaseExtSeqNum = stats->baseExtSeqNumReceived(); pData->nLastResetExtSeqNum = stats->lastResetExtSeqNumReceived(); pData->nHighestExtSeqNum = stats->highestExtSeqNumReceived(); - pData->dJitter = static_cast(stats->jitter())/static_cast(m_pSource->timestampFrequency()); + pData->dJitter = static_cast(stats->jitter())/static_cast(m_pSubsession->rtpSource()->timestampFrequency()); pData->dJitter *= 1000.0; //into ms not seconds pData->nLastSR_NTPmsw = stats->lastReceivedSR_NTPmsw(); pData->nLastSR_NTPlsw = stats->lastReceivedSR_NTPlsw(); @@ -131,7 +156,17 @@ void qosMeasurementRecord::printQOSData() pData->tvSync.tv_usec = (unsigned)(microseconds+0.5); } - } + pData->sStream = m_pSubsession->GetGroup(); m_pThread->QosUpdated(pData); } + + +unsigned long qosMeasurementRecord::GetQosMeasurementIntervalMS() const +{ + if(m_pThread) + { + return m_pThread->GetQosMeasurementIntervalMS(); + } + return 5000; +} \ No newline at end of file diff --git a/pambase/qos.h b/pambase/qos.h index 43e0dfb7..8a45ba72 100644 --- a/pambase/qos.h +++ b/pambase/qos.h @@ -4,65 +4,41 @@ #include "session.h" class RtpThread; - - +class Smpte2110MediaSubsession; class qosMeasurementRecord { public: - qosMeasurementRecord(struct timeval const& startTime, RTPSource* src,UsageEnvironment& env, RtpThread* pThread) - : m_pSource(src), m_pNext(NULL), - m_pEnv(&env), - m_pThread(pThread), - m_tvMeasurementEnd(startTime), - m_tvMeasurementStart(startTime), - m_dkbits_per_second_min(1e20), m_dkbits_per_second_max(0), - m_dkBytesTotal(0.0), - m_kBytesDeltaNow(0.0), - m_dkbpsNow(0.0), - m_dPacket_loss_fraction_min(1.0), m_dPacket_loss_fraction_max(0.0), - m_nTotNumPacketsReceived(0), m_nTotNumPacketsExpected(0) - { - - - RTPReceptionStatsDB::Iterator statsIter(src->receptionStatsDB()); - // Assume that there's only one SSRC source (usually the case): - RTPReceptionStats* stats = statsIter.next(True); - if (stats != NULL) - { - m_dkBytesTotal = stats->totNumKBytesReceived(); - m_nTotNumPacketsReceived = stats->totNumPacketsReceived(); - m_nTotNumPacketsExpected = stats->totNumPacketsExpected(); - } - } - virtual ~qosMeasurementRecord() - { - delete m_pNext; - } - + explicit qosMeasurementRecord(Smpte2110MediaSubsession* pSubsession); + virtual ~qosMeasurementRecord(){} + void periodicQOSMeasurement(struct timeval const& timeNow); void printQOSData(); + void SetHandler(RtpThread* pThread) { m_pThread = pThread;} + + unsigned long GetQosMeasurementIntervalMS() const; public: - RTPSource* m_pSource; - qosMeasurementRecord* m_pNext; - UsageEnvironment* m_pEnv; + - RtpThread* m_pThread; timeval m_tvMeasurementStart; timeval m_tvMeasurementEnd; - double m_dkbits_per_second_min; - double m_dkbits_per_second_max; - double m_dkBytesTotal; - double m_kBytesDeltaNow; - double m_dkbpsNow; - double m_dPacket_loss_fraction_min; - double m_dPacket_loss_fraction_max; - unsigned int m_nTotNumPacketsReceived; - unsigned int m_nTotNumPacketsExpected; - + double m_dkbits_per_second_min = 1e20; + double m_dkbits_per_second_max = 0.0; + double m_dkBytesTotal = 0.0; + double m_kBytesDeltaNow = 0.0; + double m_dkbpsNow = 0.0; + double m_dPacket_loss_fraction_min = 1.0; + double m_dPacket_loss_fraction_max = 0.0; + unsigned int m_nTotNumPacketsReceived = 0; + unsigned int m_nTotNumPacketsExpected = 0; + +private: + Smpte2110MediaSubsession* m_pSubsession; + //qosMeasurementRecord* m_pNext = nullptr; + RtpThread* m_pThread = nullptr; }; diff --git a/pambase/remoteapi.cpp b/pambase/remoteapi.cpp index b511e2e5..183b3586 100644 --- a/pambase/remoteapi.cpp +++ b/pambase/remoteapi.cpp @@ -732,7 +732,7 @@ pml::restgoose::response RemoteApi::PostWavFile(const query& theQuery, const std } else if(data.name.Get() == "file") { - sLocation = wxString(data.filepath.Get()); + sLocation = wxString(data.filepath.string()); } } pmlLog() << "Name: " << sFilename.ToStdString() << "\tLocation: " << sLocation.ToStdString(); diff --git a/pambase/rtpframeevent.cpp b/pambase/rtpframeevent.cpp new file mode 100644 index 00000000..1d785501 --- /dev/null +++ b/pambase/rtpframeevent.cpp @@ -0,0 +1,31 @@ +#include "rtpframeevent.h" + + +#ifdef WXSPAM +DEFINE_EVENT_TYPE(wxEVT_RTP_FRAME) +#else +wxDEFINE_EVENT(wxEVT_RTP_FRAME, RtpFrameEvent); +#endif // WXSPAM + +//wxDECLARE_DYNAMIC_CLASS(RtpFrameEvent, wxCommandEvent) + +RtpFrameEvent::RtpFrameEvent() : wxCommandEvent(wxEVT_RTP_FRAME, wxID_ANY) +{ + +} + +RtpFrameEvent::RtpFrameEvent(std::shared_ptr pFrame) : wxCommandEvent(wxEVT_RTP_FRAME,wxID_ANY), +m_pFrame(pFrame) +{ + +} + + +RtpFrameEvent::RtpFrameEvent(const RtpFrameEvent& event) : wxCommandEvent(event), + m_pFrame(event.GetFrame()) +{ +} +std::shared_ptr RtpFrameEvent::GetFrame() const +{ + return m_pFrame; +} \ No newline at end of file diff --git a/pambase/rtpframeevent.h b/pambase/rtpframeevent.h new file mode 100644 index 00000000..e060280e --- /dev/null +++ b/pambase/rtpframeevent.h @@ -0,0 +1,73 @@ +#pragma once +#include +#include "dlldefine.h" +#include +#include + +typedef std::map mExtension_t; + +struct rtpFrame +{ + wxString sEndpoint; + wxString sGroup; + unsigned long nSSRC = 0; + + timeval timePresentation; + timeval timeTransmission; + timeval timeLatency; + unsigned int nTimestamp = 0; + int nTimestampDifference = 0; + + unsigned long nFrameSize = 0; + u_int8_t* pBuffer = nullptr; + u_int8_t nBytesPerSample = 0; + double dTSDF = 0.0; + mExtension_t* mExt = nullptr; +}; + + +class PAMBASE_IMPEXPORT RtpFrameEvent : public wxCommandEvent +{ + +public: + + /** @brief Constructor + * @param commandType should be wxEVT_NI... + * @param id the ID of the button list control + **/ + explicit RtpFrameEvent(std::shared_ptr pFrame); + + RtpFrameEvent(); + /** @brief Copy Constructor + * @param event a wxNIEvent + **/ + RtpFrameEvent(const RtpFrameEvent& event); + + /** @brief Destructor + **/ + virtual ~RtpFrameEvent()=default; + + /** @brief Creates a copy of the wxNIEvent + * @return wxNIEvent + **/ + virtual wxEvent *Clone() const { return new RtpFrameEvent(*this); } + + std::shared_ptr GetFrame() const; + + //wxDECLARE_DYNAMIC_CLASS(RtpFrameEvent) + + +protected: + + std::shared_ptr m_pFrame; +}; + +typedef void (wxEvtHandler::*RtpFrameEventFunction)(RtpFrameEvent&); + + +#ifdef WXSPAM +DECLARE_EXPORTED_EVENT_TYPE(WXEXPORT, wxEVT_RTP_FRAME, -1) +#else +wxDECLARE_EXPORTED_EVENT(PAMBASE_IMPEXPORT, wxEVT_RTP_FRAME,RtpFrameEvent); +#endif + diff --git a/pambase/rtpserverthread.cpp b/pambase/rtpserverthread.cpp index 1d9cddc2..84b29763 100644 --- a/pambase/rtpserverthread.cpp +++ b/pambase/rtpserverthread.cpp @@ -7,6 +7,7 @@ #include "log.h" #include "iomanager.h" +wxDEFINE_EVENT(wxEVT_STREAMING, wxCommandEvent); RtpServerThread::RtpServerThread(wxEvtHandler* pHandler, const std::set& setRTCPHandlers, const wxString& sRTSP, unsigned int nRTSPPort, const wxString& sSourceIp, unsigned int nRTPPort, bool bSSM, LiveAudioSource::enumPacketTime ePacketTime, const std::vector& vRouting) : @@ -48,17 +49,29 @@ void* RtpServerThread::Entry() if(!CreateStream()) { m_mutex.Unlock(); + wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_STREAMING); + pEvent->SetInt(0); + wxQueueEvent(m_pHandler, pEvent); return NULL; } m_mutex.Unlock(); + wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_STREAMING); + pEvent->SetInt(1); + wxQueueEvent(m_pHandler, pEvent); + while(m_eventLoopWatchVariable == 0) { m_penv->taskScheduler().doEventLoop(&m_eventLoopWatchVariable); } CloseStream(); + + pEvent = new wxCommandEvent(wxEVT_STREAMING); + pEvent->SetInt(0); + wxQueueEvent(m_pHandler, pEvent); + return NULL; } @@ -189,11 +202,11 @@ bool RtpServerThread::CreateStream() pmlLog(pml::LOG_INFO) << m_sSDP; - + m_bStreaming = true; m_pSink->startPlaying(*m_pSource, afterPlaying, reinterpret_cast(this)); - m_bStreaming = true; + // Settings::Get().Write(wxT("AoIP"), wxT("Epoch"), pSmss->GetEpochTimestamp()); return true; diff --git a/pambase/rtpserverthread.h b/pambase/rtpserverthread.h index 5d7d5d7f..c47e37cf 100644 --- a/pambase/rtpserverthread.h +++ b/pambase/rtpserverthread.h @@ -65,3 +65,4 @@ class PAMBASE_IMPEXPORT RtpServerThread : public wxThread std::vector m_vRouting; }; +wxDECLARE_EXPORTED_EVENT(WXEXPORT, wxEVT_STREAMING, wxCommandEvent); \ No newline at end of file diff --git a/pambase/rtpthread.cpp b/pambase/rtpthread.cpp index 148803ca..fe5c9d9b 100644 --- a/pambase/rtpthread.cpp +++ b/pambase/rtpthread.cpp @@ -14,6 +14,9 @@ #include "wxptp.h" #include "aes67source.h" #include "log.h" +#include "settings.h" +#include "rtpframeevent.h" + using namespace std; //// A function that outputs a string that identifies each subsession (for debugging output). Modify this if you wish: @@ -22,12 +25,19 @@ UsageEnvironment& operator<<(UsageEnvironment& env, const Smpte2110MediaSubsessi return env << subsession.mediumName() << "/" << subsession.codecName(); } +bool Tv1LessThanTv2(const timeval& tv1, const timeval& tv2) +{ + return (tv1.tv_sec < tv2.tv_sec || (tv1.tv_sec == tv2.tv_sec && tv1.tv_usec < tv2.tv_usec)); +} + + DEFINE_EVENT_TYPE(wxEVT_QOS_UPDATED) DEFINE_EVENT_TYPE(wxEVT_RTP_SESSION) DEFINE_EVENT_TYPE(wxEVT_RTP_SESSION_CLOSED) DEFINE_EVENT_TYPE(wxEVT_SDP) + RtpThread::RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface, const wxString& sProg, const AoIPSource& source, unsigned int nBufferSize, bool bSaveSDPOnly) : wxThread(wxTHREAD_JOINABLE), m_pHandler(pHandler), @@ -37,11 +47,7 @@ RtpThread::RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface m_pCurrentBuffer(nullptr), m_dTransmission(0), m_dPresentation(0), - m_dDelay0(std::numeric_limits::lowest()), - m_dTSDFMax(std::numeric_limits::lowest()), - m_dTSDFMin(std::numeric_limits::max()), - m_dTSDF(0), - m_nTSDFCount(0), + m_nSampleRate(48000), m_nTimestampErrors(0), m_nTimestampErrorsTotal(0), @@ -120,7 +126,7 @@ void* RtpThread::Entry() // @todo do we need to delete clients etc? if(m_pRtspClient) { - pmlLog(pml::LOG_TRACE) << "RTPThread::Entry\t" << "Shutdown stream"; + pmlLog(pml::LOG_DEBUG) << "RTPThread::Entry\t" << "Shutdown stream"; shutdownStream(m_pRtspClient, 0); m_pRtspClient = nullptr; } @@ -135,9 +141,8 @@ void RtpThread::StreamFromSDP() pmlLog() << m_sDescriptor; - m_pSession = Smpte2110MediaSession::createNew(*m_penv, m_sDescriptor.c_str()); - if (m_pSession == NULL) + if (m_pSession == nullptr) { pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a MediaSession object from the SDP description: " << m_penv->getResultMsg(); return; @@ -149,69 +154,53 @@ void RtpThread::StreamFromSDP() //count number of subsessions unsigned int nCountAudio(0); - unsigned int nCountVideo(0); MediaSubsessionIterator iterCount(*m_pSession); - MediaSubsession* pSubsessionCount = NULL; - while ((pSubsessionCount = iterCount.next()) != NULL) + MediaSubsession* pSubsessionCount = nullptr; + while ((pSubsessionCount = iterCount.next()) != nullptr) { - if (strcmp(pSubsessionCount->codecName(), "L16") == 0 || strcmp(pSubsessionCount->codecName(), "L24") == 0) // 16 or 24-bit linear audio (RFC 3190) + if (strcmp(pSubsessionCount->codecName(), "L16") == 0 || strcmp(pSubsessionCount->codecName(), "L24") == 0 + || strcmp(pSubsessionCount->codecName(), "AM824") == 0) // 16 or 24-bit linear audio (RFC 3190) or 2110-31 { if(pSubsessionCount->numChannels() > 0) + { nCountAudio++; + } else { pmlLog(pml::LOG_WARN) << "RTP Client\tAudio subsession, but 0 channels defined"; } } - else if (strcmp(pSubsessionCount->codecName(), "RAW") == 0) - { - nCountVideo++; - } } pmlLog(pml::LOG_DEBUG) << "RTP Client\tNumber of AES67 Subsessions: " << nCountAudio; - pmlLog(pml::LOG_DEBUG) << "RTP Client\tNumber of Video Subsessions: " << nCountVideo; + pmlLog(pml::LOG_DEBUG) << "RTP Client\tStreams = " << m_pSession->GetGroups().size(); if(nCountAudio == 0) { pmlLog(pml::LOG_WARN) << "RTP Client\tNo AES67 subsessions. Exit"; return; } + + MediaSubsessionIterator iter(*m_pSession); - Smpte2110MediaSubsession* subsession = NULL; - while ((subsession = dynamic_cast(iter.next())) != NULL) + Smpte2110MediaSubsession* pSubsession = nullptr; + while ((pSubsession = dynamic_cast(iter.next())) != nullptr) { - if (!subsession->initiate (0)) - { - pmlLog(pml::LOG_WARN) << "RTP Client\tFailed to initiate the subsession: " << m_penv->getResultMsg(); - } - else + if((m_pSession->GetGroups().find(pSubsession->GetGroup()) != m_pSession->GetGroups().end())) // duplicate streams { - subsession->sink = wxSink::createNew(*m_penv, *subsession, this); - pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the subsession: "; - if (subsession->rtcpIsMuxed()) + if (!pSubsession->initiate (0)) { - pmlLog(pml::LOG_DEBUG) << "client port " << subsession->clientPortNum(); + pmlLog(pml::LOG_WARN) << "RTP Client\tFailed to initiate the subsession: " << m_penv->getResultMsg(); } else { - pmlLog(pml::LOG_DEBUG) << "client ports " << subsession->clientPortNum() << "-" << subsession->clientPortNum()+1; - } - - pmlLog(pml::LOG_DEBUG) << "RTP Client\tSessionId: " << subsession->GetEndpoint(); - if (subsession->sink == NULL) - { - pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a data sink for the subsession: " << m_penv->getResultMsg(); - } - else - { - pmlLog(pml::LOG_DEBUG) << "RTP Client\tCreated a data sink for the subsession"; - - subsession->sink->startPlaying(*subsession->readSource(), NULL, NULL); - beginQOSMeasurement(*m_penv, m_pSession, this); + CreateSink(pSubsession); } } } PassSessionDetails(m_pSession); + beginQOSMeasurement(*m_penv, m_pSession, this); + + while(m_eventLoopWatchVariable == 0) { @@ -219,6 +208,31 @@ void RtpThread::StreamFromSDP() } } +void RtpThread::CreateSink(Smpte2110MediaSubsession* pSubsession) +{ + pSubsession->sink = wxSink::createNew(*m_penv, *pSubsession, this); + pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the subsession: "; + if (pSubsession->rtcpIsMuxed()) + { + pmlLog(pml::LOG_DEBUG) << "client port " << pSubsession->clientPortNum(); + } + else + { + pmlLog(pml::LOG_DEBUG) << "client ports " << pSubsession->clientPortNum() << "-" << pSubsession->clientPortNum()+1; + } + pmlLog(pml::LOG_DEBUG) << "RTP Client\tSessionId: " << pSubsession->GetEndpoint(); + + if (pSubsession->sink == nullptr) + { + pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a data sink for the subsession: " << m_penv->getResultMsg(); + } + else + { + pmlLog(pml::LOG_DEBUG) << "RTP Client\tCreated a data sink for the subsession"; + pSubsession->sink->startPlaying(*pSubsession->readSource(), nullptr, nullptr); + } +} + bool RtpThread::DoRTSP() { // Begin by creating a "RTSPClient" object. Note that there is a separate "RTSPClient" object for each stream that we wish @@ -226,14 +240,13 @@ bool RtpThread::DoRTSP() wxString sUrl(m_source.sDetails); sUrl.Replace(wxT(" "), wxT("%20")); m_pRtspClient = ourRTSPClient::createNew((*m_penv), sUrl.mb_str(), this, 1, m_sProgName.mb_str()); - if (m_pRtspClient == NULL) + if (m_pRtspClient == nullptr) { pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a RTSP client for URL \"" << sUrl.ToStdString() << "\": " << (*m_penv).getResultMsg(); return false; } pmlLog() << "RTSP Send Options"; m_pRtspClient->sendOptionsCommand(continueAfterOPTIONS); - //m_pRtspClient->sendDescribeCommand(continueAfterDESCRIBE); return true; } @@ -243,7 +256,7 @@ bool RtpThread::DoSIP() wxString sUrl(m_source.sDetails); sUrl.Replace(wxT(" "), wxT("%20")); m_pSipClient = ourSIPClient::createNew((*m_penv), sUrl.mb_str(), this, 1, m_sProgName.mb_str()); - if (m_pRtspClient == NULL) + if (m_pRtspClient == nullptr) { pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to create a RTSP client for URL \"" << sUrl.ToStdString() << "\": " << (*m_penv).getResultMsg(); return false; @@ -254,8 +267,8 @@ bool RtpThread::DoSIP() timeval RtpThread::ConvertDoubleToPairTime(double dTime) { - double dInt, dDec; - dDec = modf(dTime, &dInt); + double dInt; + auto dDec = modf(dTime, &dInt); return {static_cast(dInt), static_cast<__suseconds_t>(dDec*1000000.0)}; } @@ -270,17 +283,122 @@ float RtpThread::ConvertFrameBufferToSample(u_int8_t* pFrameBuffer, u_int8_t nBy { nSample = (static_cast(pFrameBuffer[2]) << 8) | (static_cast(pFrameBuffer[1]) << 16) | (static_cast(pFrameBuffer[0]) << 24); } + else if(nBytesPerSample == 4) + { //@todo need to check which 3 of the 4 we uses + nSample = (static_cast(pFrameBuffer[3]) << 8) | (static_cast(pFrameBuffer[2]) << 16) | (static_cast(pFrameBuffer[1]) << 24); + } return static_cast(nSample)/ 2147483648.0; } -void RtpThread::AddFrame(const wxString& sEndpoint, unsigned long nSSRC, const timeval& timePresentation, unsigned long nFrameSize, u_int8_t* pFrameBuffer, -u_int8_t nBytesPerSample, const timeval& timeTransmission, -unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExtension_t* pExt) +void RtpThread::AddFrame(std::shared_ptr pFrame) { - if(m_bClosing || m_Session.GetCurrentSubsession() == m_Session.lstSubsession.end() || m_Session.GetCurrentSubsession()->sSourceAddress != sEndpoint) + if(m_bClosing || m_Session.GetCurrentSubsession() == m_Session.lstSubsession.end() || m_nInputChannels==0) + { return; + } + + auto itGroup = m_mRedundantBuffers.find(pFrame->sGroup); + if(itGroup == m_mRedundantBuffers.end()) + { + itGroup = m_mRedundantBuffers.insert({pFrame->sGroup, std::list>()}).first; + m_mStreamUsage.try_emplace(pFrame->sGroup, 0); + } + itGroup->second.push_back(pFrame); + + auto itReceived = m_mFramesReceived.find(pFrame->sGroup); + if(itReceived == m_mFramesReceived.end()) + { + itReceived = m_mFramesReceived.try_emplace(pFrame->sGroup,0).first; + } + ++itReceived->second; + + //send out an rtpframe event 20 times a second... + + if(m_pHandler && itReceived->second%(14400 / pFrame->nFrameSize) == 0) + { + auto pEvent = new RtpFrameEvent(pFrame); + wxQueueEvent(m_pHandler, pEvent); + } + + HandleFrameAdded(); +} + +void RtpThread::WorkoutFirstFrame() +{ + //if we've not yet extracted from the buffer then get the one with the earliest transmission time + gettimeofday(&m_tvLastExtracted, nullptr); + size_t nMaxReceived = 0; + + for(const auto& pairBuffer : m_mRedundantBuffers) + { + nMaxReceived = std::max(nMaxReceived, pairBuffer.second.size()); + if(pairBuffer.second.empty() == false && Tv1LessThanTv2(pairBuffer.second.front()->timeTransmission, m_tvLastExtracted)) + { + m_nTimestamp = pairBuffer.second.front()->nTimestamp-1; + m_tvLastExtracted = pairBuffer.second.front()->timeTransmission; + } + } + if(nMaxReceived > m_nRedundantBufferQueue) //we don't move on from this until at least one stream has sent (10) frames + { + m_bFrameExtracted = true; + } +} + +void RtpThread::HandleFrameAdded() +{ + if(m_mRedundantBuffers.size() == 1) //no redundant frames so no point buffering + { + if(m_mRedundantBuffers.begin()->second.empty() == false) + { + ConvertFrameToTimedBuffer(m_mRedundantBuffers.begin()->second.front()); + m_mRedundantBuffers.begin()->second.pop_front(); + } + } + else if(m_bFrameExtracted == false) + { + WorkoutFirstFrame(); + } + else + { + WorkoutNextFrame(); + } +} - if(m_pCurrentBuffer == 0) +void RtpThread::WorkoutNextFrame() +{ + auto bExtracted = false; + for(const auto& pairBuffer : m_mRedundantBuffers) + { + for(auto itFrame = pairBuffer.second.begin(); itFrame != pairBuffer.second.end();) + { + if(Tv1LessThanTv2((*itFrame)->timeTransmission, m_tvLastExtracted)) + { //delete frame if transmitted earlier than the last one we extracted + auto itDelete = itFrame; + ++itFrame; + pairBuffer.second.erase(itFrame); + } + else if((*itFrame)->nTimestamp == m_nTimestamp+1) //this is the timestamp we want + { + if(!bExtracted) + { + m_tvLastExtracted = (*itFrame)->timeTransmission; + ConvertFrameToTimedBuffer(*itFrame); + bExtracted = true; + } + pairBuffer.second.erase(itFrame); + break; + } + else + { + ++itFrame; + } + } + } +} + +void RtpThread::ConvertFrameToTimedBuffer(std::shared_ptr pFrame) +{ + if(m_pCurrentBuffer == nullptr) { m_pCurrentBuffer = new float[m_nBufferSize*m_nInputChannels]; m_nSampleBufferSize = 0; @@ -288,16 +406,16 @@ unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExten double dOffset = 0.0; - for(int i = 0; i < nFrameSize; i+=nBytesPerSample) + for(int i = 0; i < pFrame->nFrameSize; i+=pFrame->nBytesPerSample) { - float dSample(ConvertFrameBufferToSample(&pFrameBuffer[i], nBytesPerSample)); + auto dSample = ConvertFrameBufferToSample(&(pFrame->pBuffer[i]), pFrame->nBytesPerSample); if(m_nSampleBufferSize == 0) { - m_dTransmission = timeTransmission.tv_sec + (static_cast(timeTransmission.tv_usec))/1000000.0; - m_dPresentation = (timePresentation.tv_sec + (static_cast(timePresentation.tv_usec))/1000000.0) - dOffset; + m_dTransmission = pFrame->timeTransmission.tv_sec + (static_cast(pFrame->timeTransmission.tv_usec))/1000000.0; + m_dPresentation = (pFrame->timePresentation.tv_sec + (static_cast(pFrame->timePresentation.tv_usec))/1000000.0) - dOffset; //is the timestamp what we'd expect?? - m_nTimestamp = nTimestamp; + m_nTimestamp = pFrame->nTimestamp; } else if(i%m_nInputChannels ==0) @@ -316,57 +434,31 @@ unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExten if(m_nSampleBufferSize == m_nBufferSize*m_nInputChannels) //filled up buffer { - timedbuffer* pTimedBuffer = new timedbuffer(m_nBufferSize*m_nInputChannels, ConvertDoubleToPairTime(m_dPresentation), m_nTimestamp, m_nInputChannels); + auto pTimedBuffer = new timedbuffer(m_nBufferSize*m_nInputChannels, ConvertDoubleToPairTime(m_dPresentation), m_nTimestamp, m_nInputChannels); pTimedBuffer->SetBuffer(m_pCurrentBuffer); pTimedBuffer->SetTransmissionTime(ConvertDoubleToPairTime(m_dTransmission)); - pTimedBuffer->SetDuration(nDuration); - AudioEvent* pEvent = new AudioEvent(pTimedBuffer, AudioEvent::RTP, m_nBufferSize, m_nSampleRate, false, false); + pTimedBuffer->SetDuration(pFrame->nFrameSize); + auto pEvent = new AudioEvent(pTimedBuffer, AudioEvent::RTP, m_nBufferSize, m_nSampleRate, false, false); wxQueueEvent(m_pHandler, pEvent); m_nSampleBufferSize = 0; } } - - - //QOS - if(m_nInputChannels*nBytesPerSample != 0) + if(m_nInputChannels*pFrame->nBytesPerSample != 0) { - unsigned int nExpectedDifference = nFrameSize/(m_nInputChannels*nBytesPerSample); - if(nExpectedDifference != nTimestampDifference) + auto nExpectedDifference = pFrame->nFrameSize/(m_nInputChannels*pFrame->nBytesPerSample); + if(nExpectedDifference != pFrame->nTimestampDifference) { m_nTimestampErrors++; - m_nTimestampErrorsTotal++; } } - - int nFramesPerSec = (m_nSampleRate*m_nInputChannels*nBytesPerSample)/nFrameSize; - + - timeval tvSub; - timersub(&timePresentation, &timeTransmission, &tvSub); - double dTSDF = (static_cast(tvSub.tv_sec)*1000000.0)+tvSub.tv_usec; - - if(m_dDelay0 == std::numeric_limits::lowest() || m_nTSDFCount == nFramesPerSec) - { - m_dTSDF = m_dTSDFMax-m_dTSDFMin; - m_dDelay0 = dTSDF; - - m_dTSDFMax = std::numeric_limits::lowest(); - m_dTSDFMin = std::numeric_limits::max(); - - m_nTSDFCount = 1; - - } - else - { - dTSDF -= m_dDelay0; - // dTSDF *= 1000000.0; - m_dTSDFMax = max(m_dTSDFMax, dTSDF); - m_dTSDFMin = min(m_dTSDFMin, dTSDF); - m_nTSDFCount++; - } + //keep track of which streams frames come from + ++m_mStreamUsage[pFrame->sGroup]; + ++m_nTotalFramesPlayed; } @@ -376,7 +468,7 @@ void RtpThread::StopStream() if(m_pRtspClient) { pmlLog(pml::LOG_INFO) << "RTP Client\tStop Stream "; - pmlLog(pml::LOG_TRACE) << "RTPThread::StopStream\t" << "Shutdown stream"; + pmlLog(pml::LOG_DEBUG) << "RTPThread::StopStream\t" << "Shutdown stream"; shutdownStream(m_pRtspClient, 0); m_pRtspClient = nullptr; } @@ -389,10 +481,25 @@ void RtpThread::StopStream() void RtpThread::QosUpdated(qosData* pData) { - + auto itStream = m_mStreamUsage.find(pData->sStream); + if(itStream != m_mStreamUsage.end()) + { + pData->nFramesUsed = itStream->second; + } + auto itReceived = m_mFramesReceived.find(pData->sStream); + if(itReceived != m_mFramesReceived.end()) + { + pData->nFramesReceived = itReceived->second; + } + auto itBuffer = m_mRedundantBuffers.find(pData->sStream); + if(itBuffer != m_mRedundantBuffers.end()) + { + pData->nBufferSize = itBuffer->second.size(); + } + pData->nTotalFrames = m_nTotalFramesPlayed; + pData->nTimestampErrors = m_nTimestampErrors; pData->nTimestampErrorsTotal = m_nTimestampErrorsTotal; - pData->dTSDF = m_dTSDF; if(m_pHandler) { wxCommandEvent* pEvent = new wxCommandEvent(wxEVT_QOS_UPDATED); @@ -407,6 +514,10 @@ void RtpThread::QosUpdated(qosData* pData) void RtpThread::PassSessionDetails(Smpte2110MediaSession* pSession) { + pmlLog(pml::LOG_DEBUG) << "RtpThread::PassSessionDetails"; + + //make the buffer queue the same size as the number of streams + m_Session = session(); m_Session.sName = wxString::FromUTF8(pSession->sessionName()); @@ -414,18 +525,19 @@ void RtpThread::PassSessionDetails(Smpte2110MediaSession* pSession) m_Session.sType = wxString::FromUTF8(pSession->mediaSessionType()); m_Session.refClock = pSession->GetRefClock(); m_Session.sDescription = wxString::FromUTF8(pSession->sessionDescription()); - m_Session.sGroups = pSession->GetGroupDup(); + m_Session.setGroups = pSession->GetGroups(); MediaSubsessionIterator iterSub(*pSession); - Smpte2110MediaSubsession* pSubsession = NULL; - while ((pSubsession = dynamic_cast(iterSub.next())) != NULL) + Smpte2110MediaSubsession* pSubsession = nullptr; + while ((pSubsession = dynamic_cast(iterSub.next())) != nullptr) { refclk clock = pSubsession->GetRefClock(); timeval tvEpoch = pSubsession->GetLastEpoch(); m_Session.lstSubsession.push_back(subsession(wxString::FromUTF8(pSubsession->sessionId()), wxString::FromUTF8(pSubsession->GetEndpoint()), + pSubsession->GetGroup(), wxString::FromUTF8(pSubsession->mediumName()), wxString::FromUTF8(pSubsession->codecName()), wxString::FromUTF8(pSubsession->protocolName()), @@ -436,9 +548,9 @@ void RtpThread::PassSessionDetails(Smpte2110MediaSession* pSession) tvEpoch, pSubsession->GetRefClock())); #ifdef PTPMONKEY - if(pSubsession->GetRefClock().sType.CmpNoCase(wxT("PTP")) == 0) + if(pSubsession->GetRefClock().sType.CmpNoCase("PTP") == 0) { - wxPtp::Get().RunDomain(std::string(m_sReceivingInterface.mb_str()), pSubsession->GetRefClock().nDomain); + wxPtp::Get().Run(std::string(m_sReceivingInterface.mb_str()), pSubsession->GetRefClock().nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); } #endif // PTPMONKEY @@ -494,7 +606,6 @@ void RtpThread::SetQosMeasurementIntervalMS(unsigned long nMilliseconds) unsigned long RtpThread::GetQosMeasurementIntervalMS() { - wxMutexLocker ml(m_mutex); return m_nQosMeasurementIntervalMS; } @@ -504,15 +615,13 @@ void RtpThread::MasterClockChanged() if(m_pSession) { MediaSubsessionIterator iter(*m_pSession); - Smpte2110MediaSubsession* subsession = NULL; - while ((subsession = dynamic_cast(iter.next())) != NULL) + Smpte2110MediaSubsession* subsession = nullptr; + while ((subsession = dynamic_cast(iter.next())) != nullptr) { - Aes67Source* pSource = dynamic_cast(subsession->readSource()); + auto pSource = dynamic_cast(subsession->readSource()); if(pSource) { - pSource->WorkoutLastEpoch(); - } } } diff --git a/pambase/rtpthread.h b/pambase/rtpthread.h index 91f5df49..98070c5e 100644 --- a/pambase/rtpthread.h +++ b/pambase/rtpthread.h @@ -12,7 +12,9 @@ #include "dlldefine.h" #include "aoipsourcemanager.h" #include - +#include +#include +#include struct qosData; class Smpte2110MediaSession; @@ -22,7 +24,7 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread public: RtpThread(wxEvtHandler* pHandler, const wxString& sReceivingInterface, const wxString& sProg, const AoIPSource& source, unsigned int nBufferSize, bool bSaveSDPOnly = false); void* Entry(); - void AddFrame(const wxString& sEndpoint, unsigned long nSSRC, const timeval& timePresentation, unsigned long nFrameSize, u_int8_t* pBuffer, u_int8_t nBits, const timeval& timeTransmission, unsigned int nTimestamp,unsigned int nDuration, int nTimestampDifference, mExtension_t* pExt); + void AddFrame(std::shared_ptr pFrame); void MasterClockChanged(); @@ -70,7 +72,13 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread timeval ConvertDoubleToPairTime(double dTime); + void CreateSink(Smpte2110MediaSubsession* pSubsession); + + void HandleFrameAdded(); + void ConvertFrameToTimedBuffer(std::shared_ptr pFrame); + void WorkoutFirstFrame(); + void WorkoutNextFrame(); wxEvtHandler* m_pHandler; wxString m_sProgName; @@ -82,18 +90,12 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread wxCondition* m_pCondition; wxString m_sReceivingInterface; - std::queue m_qBufferFrames; float* m_pCurrentBuffer; double m_dTransmission; double m_dPresentation; - timeval m_tvDelay0; - double m_dDelay0; - double m_dTSDFMax; - double m_dTSDFMin; - double m_dTSDF; - unsigned int m_nTSDFCount; + unsigned int m_nSampleRate; unsigned int m_nTimestampErrors; unsigned int m_nTimestampErrorsTotal; @@ -118,7 +120,13 @@ class PAMBASE_IMPEXPORT RtpThread : public wxThread unsigned long m_nQosMeasurementIntervalMS; - + std::map>> m_mRedundantBuffers; + std::map m_mStreamUsage; + std::map m_mFramesReceived; + uint64_t m_nTotalFramesPlayed = 0; + bool m_bFrameExtracted = false; + timeval m_tvLastExtracted; + size_t m_nRedundantBufferQueue = 10; }; @@ -126,5 +134,5 @@ DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_QOS_UPDATED,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION_CLOSED,-1) DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_SDP,-1) -DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RPT_SESSION_EPOCH,-1) +DECLARE_EXPORTED_EVENT_TYPE(PAMBASE_IMPEXPORT, wxEVT_RTP_SESSION_EPOCH,-1) diff --git a/pambase/rtsputil.cpp b/pambase/rtsputil.cpp index 2708cf1e..351fae8e 100644 --- a/pambase/rtsputil.cpp +++ b/pambase/rtsputil.cpp @@ -26,12 +26,6 @@ std::stringstream& operator<<(std::stringstream& ss, const MediaSubsession& subs } - -TaskToken qosMeasurementTimerTask = NULL; - -qosMeasurementRecord* g_pRecord = NULL; - - void continueAfterOPTIONS(RTSPClient* rtspClient, int resultCode, char* resultString) { if(resultCode == 0 && rtspClient != nullptr) @@ -130,40 +124,53 @@ void setupNextSubsession(RTSPClient* rtspClient) UsageEnvironment& env = rtspClient->envir(); // alias StreamClientState& scs = ((ourRTSPClient*)rtspClient)->scs; // alias + auto pSession = dynamic_cast(scs.session); + scs.subsession = scs.iter->next(); if (scs.subsession != NULL) { - if (!scs.subsession->initiate()) - { - pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to initiate the \"" << *scs.subsession << "\" subsession: " << env.getResultMsg();; - setupNextSubsession(rtspClient); // give up on this subsession; go to the next one - } - else + + auto pSubsession = dynamic_cast(scs.subsession); + + if((pSession->GetGroups().find(pSubsession->GetGroup()) != pSession->GetGroups().end())) // duplicate streams { - pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the \"" <sessionId()<< "\" subsession ("; - if (scs.subsession->rtcpIsMuxed()) + if (!pSubsession->initiate()) { - pmlLog(pml::LOG_DEBUG) << "client port " << scs.subsession->clientPortNum(); + pmlLog(pml::LOG_ERROR) << "RTP Client\tFailed to initiate the \"" << *pSubsession << "\" subsession: " << env.getResultMsg();; + setupNextSubsession(rtspClient); // give up on this subsession; go to the next one } else { - pmlLog(pml::LOG_DEBUG) << "client ports " << scs.subsession->clientPortNum() << "-" << scs.subsession->clientPortNum()+1; - } - pmlLog(pml::LOG_DEBUG) << " SubsessionId: " << scs.subsession->sessionId(); + pmlLog(pml::LOG_DEBUG) << "RTP Client\tInitiated the \"" <sessionId()<< "\" subsession ("; + if (pSubsession->rtcpIsMuxed()) + { + pmlLog(pml::LOG_DEBUG) << "client port " << pSubsession->clientPortNum(); + } + else + { + pmlLog(pml::LOG_DEBUG) << "client ports " << pSubsession->clientPortNum() << "-" << pSubsession->clientPortNum()+1; + } + pmlLog(pml::LOG_DEBUG) << " SubsessionId: " << pSubsession->sessionId(); - // Continue setting up this subsession, by sending a RTSP "SETUP" command: - rtspClient->sendSetupCommand(*scs.subsession, continueAfterSETUP, False, False); + // Continue setting up this subsession, by sending a RTSP "SETUP" command: + rtspClient->sendSetupCommand(*pSubsession, continueAfterSETUP, False, False); + } + return; + } + else + { + pmlLog(pml::LOG_DEBUG) << " subsession not in groups " << pSubsession->GetGroup(); + setupNextSubsession(rtspClient); // give up on this subsession; go to the next one } - return; } if(scs.sFirstSubSessionId.empty() == false) { //managed to setup at least 1 subsession - ourRTSPClient* pClient = dynamic_cast(rtspClient); + auto pClient = dynamic_cast(rtspClient); if(pClient) { - pClient->GetHandler()->PassSessionDetails(dynamic_cast(scs.session)); + pClient->GetHandler()->PassSessionDetails(pSession); // We've finished setting up all of the subsessions. Now, send a RTSP "PLAY" command to start the streaming: scs.duration = scs.session->playEndTime() - scs.session->playStartTime(); @@ -414,50 +421,20 @@ void beginQOSMeasurement(UsageEnvironment& env, MediaSession* session, RtpThread struct timeval startTime; gettimeofday(&startTime, NULL); nextQOSMeasurementUSecs = startTime.tv_sec*1000000 + startTime.tv_usec; - // qosMeasurementRecord* qosRecordTail = NULL; + MediaSubsessionIterator iter(*session); MediaSubsession* subsession; while ((subsession = iter.next()) != NULL) { - RTPSource* src = subsession->rtpSource(); - if (src != NULL) + auto pSubsession = dynamic_cast(subsession); + if(pSubsession) { - if(g_pRecord != NULL) - { - delete g_pRecord; - } - g_pRecord = new qosMeasurementRecord(startTime, src, env, pThread); - scheduleNextQOSMeasurement(); - break; + pSubsession->SetHandler(pThread); + pSubsession->ScheduleNextQOSMeasurement(); } } } -void scheduleNextQOSMeasurement() -{ - nextQOSMeasurementUSecs += g_pRecord->m_pThread->GetQosMeasurementIntervalMS()*1000; - struct timeval timeNow; - gettimeofday(&timeNow, NULL); - unsigned timeNowUSecs = timeNow.tv_sec*1000000 + timeNow.tv_usec; - int usecsToDelay = nextQOSMeasurementUSecs - timeNowUSecs; - - - qosMeasurementTimerTask = g_pRecord->m_pEnv->taskScheduler().scheduleDelayedTask(usecsToDelay, (TaskFunc*)periodicQOSMeasurement, (void*)NULL); - - - -} - -void periodicQOSMeasurement(UsageEnvironment& env, void* clientData) -{ - struct timeval timeNow; - gettimeofday(&timeNow, NULL); - - g_pRecord->periodicQOSMeasurement(timeNow); - - // Do this again later: - scheduleNextQOSMeasurement(); -} diff --git a/pambase/rtsputil.h b/pambase/rtsputil.h index f4254133..fd8bcf88 100644 --- a/pambase/rtsputil.h +++ b/pambase/rtsputil.h @@ -9,6 +9,7 @@ class RtpThread; class qosMeasurementRecord; +class Smpte2110MediaSubsessionl; static unsigned nextQOSMeasurementUSecs; @@ -38,6 +39,5 @@ void setupNextSubsession(RTSPClient* rtspClient); void shutdownStream(RTSPClient* rtspClient, int exitCode = 1); void beginQOSMeasurement(UsageEnvironment& env, MediaSession* session, RtpThread* pThread); -static void periodicQOSMeasurement(UsageEnvironment& env, void* clientData); // forward -static void scheduleNextQOSMeasurement(); + diff --git a/pambase/session.h b/pambase/session.h index 1135617a..c5a70749 100644 --- a/pambase/session.h +++ b/pambase/session.h @@ -6,6 +6,8 @@ #include #include #include +#include + extern const wxString CH_GROUP_ORDER[8]; extern const wxString CH_GROUP_TYPE[15]; @@ -55,25 +57,25 @@ struct PAMBASE_IMPEXPORT subsession enumChannel type; }; - subsession() : nPort(0), nSampleRate(0), nChannels(0), nSyncTimestamp(0){} - subsession(const wxString& sI, const wxString& sourceaddress, const wxString& medium, const wxString& codec, const wxString& protocol, - unsigned int port, unsigned int samplerate, const std::vector& channels, - unsigned int synctimestamp, const timeval& epoch, const refclk& clk) : - sId(sI), sSourceAddress(sourceaddress), sMedium(medium), sCodec(codec), sProtocol(protocol), nPort(port), nSampleRate(samplerate), nChannels(channels.size()), + subsession()=default; + subsession(const wxString& sI, const wxString& sourceaddress, const wxString& group, const wxString& medium, const wxString& codec, const wxString& protocol, unsigned int port, unsigned int samplerate, const std::vector& channels,unsigned int synctimestamp, const timeval& epoch, const refclk& clk) : + sId(sI), sSourceAddress(sourceaddress), sGroup(group), sMedium(medium), sCodec(codec), sProtocol(protocol), nPort(port), nSampleRate(samplerate), nChannels(channels.size()), vChannels(channels), nSyncTimestamp(synctimestamp), tvEpoch(epoch),refClock(clk){} wxString sId; wxString sSourceAddress; + wxString sGroup; wxString sMedium; wxString sCodec; wxString sProtocol; - unsigned int nPort; - unsigned int nSampleRate; - unsigned int nChannels; - + + unsigned int nPort = 0; + unsigned int nSampleRate = 0; + unsigned int nChannels = 0; + std::vector vChannels; - unsigned int nSyncTimestamp; + unsigned int nSyncTimestamp = 0; timeval tvEpoch; refclk refClock; @@ -81,9 +83,8 @@ struct PAMBASE_IMPEXPORT subsession struct PAMBASE_IMPEXPORT session { - session(const wxString& sRaw=wxEmptyString, const wxString& sn=wxEmptyString, const wxString& st=wxEmptyString, const wxString& sD=wxEmptyString, const wxString& sGr=wxEmptyString) : sRawSDP(sRaw), sName(sn), sType(st), sDescription(sD), sGroups(sGr), lstSubsession(std::list()) + session(const wxString& sRaw=wxEmptyString, const wxString& sn=wxEmptyString, const wxString& st=wxEmptyString, const wxString& sD=wxEmptyString, const std::set& groups={}) : sRawSDP(sRaw), sName(sn), sType(st), sDescription(sD), setGroups(groups), lstSubsession(std::list()) { - itCurrentSubsession = lstSubsession.end(); } @@ -105,7 +106,7 @@ struct PAMBASE_IMPEXPORT session wxString sName; wxString sType; wxString sDescription; - wxString sGroups; + std::set setGroups; refclk refClock; std::list lstSubsession; @@ -119,64 +120,48 @@ struct PAMBASE_IMPEXPORT session struct PAMBASE_IMPEXPORT qosData { qosData() : tsTime(0,0,0,0), - dkbits_per_second_min(-1.0), - dkbits_per_second_max(-1.0), - dkbits_per_second_Av(-1.0), - dkbits_per_second_Now(-1.0), - dkBytesTotal(-1.0), - dPacket_loss_fraction_min(-1.0), - dPacket_loss_fraction_max(-1.0), - dPacket_loss_fraction_av(-1.0), - nTotNumPacketsReceived(0), - dInter_packet_gap_ms_Now(-1.0), - dInter_packet_gap_ms_min(-1.0), - dInter_packet_gap_ms_av(-1.0), - dInter_packet_gap_ms_max(-1.0), - nTotNumPacketsLost(-1), - nBaseExtSeqNum(0), - nLastResetExtSeqNum(0), - nHighestExtSeqNum(0), - dJitter(-1.0), - nLastSR_NTPmsw(0), - nLastSR_NTPlsw(0), tvLastSR_Time{0,0}, - tvSync{0,0}, - nSSRC(0), - dTSDF(-1.0), - nTimestampErrors(0), - nTimestampErrorsTotal(0){} + tvSync{0,0} + {} wxTimeSpan tsTime; - double dkbits_per_second_min; - double dkbits_per_second_max; - double dkbits_per_second_Av; - double dkbits_per_second_Now; - double dkBytesTotal; - double dPacket_loss_fraction_min; - double dPacket_loss_fraction_max; - double dPacket_loss_fraction_av; - unsigned int nTotNumPacketsReceived; - - double dInter_packet_gap_ms_Now; - double dInter_packet_gap_ms_min; - double dInter_packet_gap_ms_av; - double dInter_packet_gap_ms_max; - int nTotNumPacketsLost; - - unsigned int nBaseExtSeqNum; - unsigned int nLastResetExtSeqNum; - unsigned int nHighestExtSeqNum; - double dJitter; - unsigned int nLastSR_NTPmsw; - unsigned int nLastSR_NTPlsw; + double dkbits_per_second_min = -1.0; + double dkbits_per_second_max = -1.0; + double dkbits_per_second_Av = -1.0; + double dkbits_per_second_Now = -1.0; + double dkBytesTotal = -1.0; + double dPacket_loss_fraction_min = -1.0; + double dPacket_loss_fraction_max = -1.0; + double dPacket_loss_fraction_av = -1.0; + unsigned int nTotNumPacketsReceived = 0; + + double dInter_packet_gap_ms_Now = -1.0; + double dInter_packet_gap_ms_min = -1.0; + double dInter_packet_gap_ms_av = -1.0; + double dInter_packet_gap_ms_max = -1.0; + int nTotNumPacketsLost = -1; + + unsigned int nBaseExtSeqNum = 0; + unsigned int nLastResetExtSeqNum = 0; + unsigned int nHighestExtSeqNum = 0; + double dJitter = -1.0; + unsigned int nLastSR_NTPmsw = 0; + unsigned int nLastSR_NTPlsw = 0; timeval tvLastSR_Time; timeval tvSync; - unsigned int nSSRC; - - double dTSDF; - unsigned int nTimestampErrors; - unsigned int nTimestampErrorsTotal; + unsigned int nSSRC = 0; + + double dTSDF = -1.0; + unsigned int nTimestampErrors = 0; + unsigned int nTimestampErrorsTotal = 0; + + wxString sStream; + uint64_t nFramesUsed = 0; + uint64_t nFramesReceived = 0; + uint64_t nTotalFrames = 0; + unsigned long nBufferSize = 0; + }; extern const std::map CH_GROUP_SIZE; diff --git a/pambase/smpte2110mediasession.cpp b/pambase/smpte2110mediasession.cpp index 6f3a3de2..fe542440 100644 --- a/pambase/smpte2110mediasession.cpp +++ b/pambase/smpte2110mediasession.cpp @@ -10,29 +10,20 @@ #include #include "wxptp.h" #include "log.h" - - -using namespace std; - -const wxString Smpte2110MediaSubsession::STR_SAMPLING[13] = { wxT("YCbCr-4:4:4"), wxT("YCbCr-4:2:2"), wxT("YCbCr-4:2:0"), wxT("CLYCbCr-4:4:4"), wxT("CLYCbCr-4:2:2"), wxT("CLYCbCr-4:2:0"), wxT("ICtCp-4:4:4"), wxT("ICtCp-4:2:2"), wxT("ICtCp-4:2:0"), wxT("RGB"), wxT("XYZ"), wxT("KEY"), wxT("Unknown")}; -const wxString Smpte2110MediaSubsession::STR_COLORIMETRY[8] = {wxT("BT601"), wxT("BT709"), wxT("BT2020"), wxT("BT2100"), wxT("ST2065-1"), wxT("ST2065-3"), wxT("XYZ"), wxT("Unspecified")}; -const wxString Smpte2110MediaSubsession::STR_TCS[10] = {wxT("SDR"), wxT("PQ"), wxT("HLG"), wxT("LINEAR"), wxT("BT2100LINPQ"), wxT("BT2100LINHLG"), wxT("ST2065-1"), wxT("ST2428-1"), wxT("DENSITY"), wxT("Unspecified")}; -const wxString Smpte2110MediaSubsession::STR_RANGE[3] = {wxT("Narrow"), wxT("FullProtect"), wxT("Full")}; -const wxString Smpte2110MediaSubsession::STR_PACKING[2] = {wxT("General"), wxT("Block")}; - +#include "rtsputil.h" +#include "threadpool.h" Smpte2110MediaSession* Smpte2110MediaSession::createNew(UsageEnvironment& env, char const* sdpDescription) { - Smpte2110MediaSession* newSession = new Smpte2110MediaSession(env); - if (newSession != NULL) + auto newSession = new Smpte2110MediaSession(env); + if (newSession != nullptr) { - newSession->initializeSMPTE_SDP(sdpDescription); if (!newSession->initializeWithSDP(sdpDescription)) { delete newSession; - return NULL; + return nullptr; } } @@ -41,7 +32,7 @@ Smpte2110MediaSession* Smpte2110MediaSession::createNew(UsageEnvironment& env, void Smpte2110MediaSession::initializeSMPTE_SDP(char const* sdpDescription) { - if (sdpDescription == NULL) + if (sdpDescription == nullptr) { return; } @@ -51,7 +42,7 @@ void Smpte2110MediaSession::initializeSMPTE_SDP(char const* sdpDescription) // Begin by processing all SDP lines until we see the first "m=" char const* sdpLine = sdpDescription; char const* nextSDPLine; - while (1) + while (true) { if (!parseSDPLine(sdpLine, nextSDPLine)) { @@ -170,11 +161,20 @@ Boolean Smpte2110MediaSession::parseSDPAttribute_Group(char const* sdpLine) size_t nFront = sSdp.find(sFind); if(nFront != wxNOT_FOUND) { + m_setGroups.clear(); + size_t nEnd = sSdp.find(wxT("\n"), nFront); nEnd -= nFront; - m_sGroups = sSdp.substr(nFront+sFind.length(), (nEnd-sFind.length())); + auto asGroups = wxStringTokenize(sSdp.substr(nFront+sFind.length(), (nEnd-sFind.length())), " "); + for(const auto& sGroup : asGroups) + { + m_setGroups.insert(sGroup); + } return True; } + + m_setGroups = {"0"}; + return False; } @@ -210,11 +210,9 @@ Boolean Smpte2110MediaSession::parseSDPAttribute_MaxPTime(char const* sdpLine) } -Smpte2110MediaSession::Smpte2110MediaSession(UsageEnvironment& env) : MediaSession(env), - m_dPackageMs(0), - m_dMaxPackageMs(0) +Smpte2110MediaSession::Smpte2110MediaSession(UsageEnvironment& env) : MediaSession(env) { - + m_setGroups = {"0"}; } @@ -226,25 +224,9 @@ MediaSubsession* Smpte2110MediaSession::createNewMediaSubsession() } -Smpte2110MediaSubsession::Smpte2110MediaSubsession(MediaSession& parent) : MediaSubsession(parent), - m_nSyncTime(0), - m_nFirstTimestamp(0), - m_dClockDeviation(0), - m_dPackageMs(0), - m_dMaxPackageMs(0), - m_nSampling(0), - m_nDepth(0), - m_bFloating(false), - m_nWidth(0), - m_nHeight(0), - m_nColorimetry(0), - m_nPackingMode(0), - m_bInterlaced(false), - m_bSegmented(false), - m_nTCS(0), - m_nRange(0), - m_bMaxUdp(false), - m_channels(0) +Smpte2110MediaSubsession::Smpte2110MediaSubsession(MediaSession& parent) : MediaSubsession(parent), +m_sGroup("0"), +m_qos(this) { } @@ -266,33 +248,21 @@ Boolean Smpte2110MediaSubsession::createSourceObjects(int useSpecialRTPoffset) parseSDPAttribute_Mid(); //Group if any - if (strcmp(fCodecName, "L16") == 0 || strcmp(fCodecName, "L24") == 0) // 16 or 24-bit linear audio (RFC 3190) + if (strcmp(fCodecName, "L16") == 0 || strcmp(fCodecName, "L24") == 0 || strcmp(fCodecName, "AM824") == 0) // 16 or 24-bit linear audio (RFC 3190) or 2110-31 { m_sEndpoint = wxString::FromUTF8(fConnectionEndpointName); - char* mimeType = new char[strlen(mediumName()) + strlen(codecName()) + 2] ; + auto mimeType = new char[strlen(mediumName()) + strlen(codecName()) + 2] ; sprintf(mimeType, "%s/%s", mediumName(), codecName()); fReadSource = fRTPSource = Aes67Source::createNew(env(), fRTPSocket, fRTPPayloadFormat, fRTPTimestampFrequency, mimeType, 0,FALSE, m_nSyncTime); delete[] mimeType; - + + pmlLog() << "-------------- " << fNumChannels << "----------------------"; m_channels.resize(fNumChannels); parseSDPAttribute_Channels(); //Channel mapping if any return TRUE; } - else if(strcmp(fCodecName,"RAW") == 0) - { - AnalyzeAttributes(); - - m_sEndpoint = wxString::FromUTF8(fConnectionEndpointName); - - char* mimeType = new char[strlen(mediumName()) + strlen(codecName()) + 2] ; - sprintf(mimeType, "%s/%s", mediumName(), codecName()); - fReadSource = fRTPSource = RawVideoSource::createNew(env(), fRTPSocket, fRTPPayloadFormat, fRTPTimestampFrequency, mimeType, 0,FALSE, m_nSyncTime); - delete[] mimeType; - - return TRUE; - } else { env().setResultMsg("RTP payload format unknown or not supported"); @@ -523,7 +493,7 @@ void Smpte2110MediaSubsession::parseSDPAttribute_ExtMap() unsigned long nId; sExt.BeforeFirst(wxT(' ')).ToULong(&nId); - m_mExtHeader.insert(make_pair(nId, sExt.AfterFirst(wxT(' ')))); + m_mExtHeader.insert({nId, sExt.AfterFirst(' ')}); } } @@ -542,220 +512,22 @@ void Smpte2110MediaSubsession::parseSDPAttribute_Mid() } } -map::const_iterator Smpte2110MediaSubsession::GetExtHeaderBegin() const +std::map::const_iterator Smpte2110MediaSubsession::GetExtHeaderBegin() const { return m_mExtHeader.begin(); } -map::const_iterator Smpte2110MediaSubsession::GetExtHeaderEnd() const +std::map::const_iterator Smpte2110MediaSubsession::GetExtHeaderEnd() const { return m_mExtHeader.end(); } -map::const_iterator Smpte2110MediaSubsession::GetExtHeader(unsigned long nId) const +std::map::const_iterator Smpte2110MediaSubsession::GetExtHeader(unsigned long nId) const { return m_mExtHeader.find(nId); } - - - -int Smpte2110MediaSubsession::GetSampling() -{ - return m_nSampling; -} - -unsigned char Smpte2110MediaSubsession::GetDepth() -{ - return m_nDepth; -} - -bool Smpte2110MediaSubsession::AreSamplesInteger() -{ - return !m_bFloating; -} - -unsigned int Smpte2110MediaSubsession::GetWidth() -{ - return m_nWidth; -} - -unsigned int Smpte2110MediaSubsession::GetHeight() -{ - return m_nHeight; -} - -pair Smpte2110MediaSubsession::GetExactFrameRate() -{ - return m_pairFrameRate; -} - -int Smpte2110MediaSubsession::GetColorimetry() -{ - return m_nColorimetry; -} - -int Smpte2110MediaSubsession::GetPackingMode() -{ - return m_nPackingMode; -} - -wxString Smpte2110MediaSubsession::GetSSN() -{ - return m_sSSN; -} - -bool Smpte2110MediaSubsession::IsInterlaced() -{ - return m_bInterlaced; -} - -bool Smpte2110MediaSubsession::IsSegmented() -{ - return m_bSegmented; -} - -int Smpte2110MediaSubsession::GetTCS() -{ - return m_nTCS; -} - -int Smpte2110MediaSubsession::GetRange() -{ - return m_nRange; -} - -bool Smpte2110MediaSubsession::UseMaxUDP() -{ - return m_bMaxUdp; -} - -pair Smpte2110MediaSubsession::GetAspectRatio() -{ - return m_pairAspectRatio; -} - - -void Smpte2110MediaSubsession::AnalyzeAttributes() -{ - wxString str(wxString::FromUTF8(attrVal_str("sampling"))); - for(m_nSampling = 0; m_nSampling < 12; m_nSampling++) - { - if(str.CmpNoCase(STR_SAMPLING[m_nSampling]) == 0) - break; - } - env() << "Sampling: " << STR_SAMPLING[m_nSampling] << "\n"; - - str = wxString::FromUTF8(attrVal_str("depth")); - if(str.CmpNoCase(wxT("16f")) == 0) - { - m_nDepth = 16; - m_bFloating = true; - } - else - { - m_bFloating = false; - unsigned long nChar; - str.ToULong(&nChar); - m_nDepth = nChar; - } - env() << "Depth: " << m_nDepth; - if(m_bFloating) - { - env() << "f"; - } - env() << "\n"; - - m_nWidth = attrVal_int("width"); - m_nHeight = attrVal_int("height"); - - env() << "Resolution: " << (int)m_nWidth << "x" << (int)m_nHeight << "\n"; - - str = wxString::FromUTF8(attrVal_str("exactframerate")); - str.BeforeFirst(wxT('/')).ToULong(&m_pairFrameRate.first); - if(str.AfterFirst(wxT('/')) == wxEmptyString) - { - m_pairFrameRate.second = 1; - } - else - { - str.AfterFirst(wxT('/')).ToULong(&m_pairFrameRate.second); - } - env() << "Frame Rate: " << (int)m_pairFrameRate.first << "/" << (int)m_pairFrameRate.second << "\n"; - - str = wxString::FromUTF8(attrVal_str("colorimetry")); - for(m_nColorimetry = 0; m_nColorimetry < 7; m_nColorimetry++) - { - if(str.CmpNoCase(STR_COLORIMETRY[m_nColorimetry]) == 0) - break; - } - - env() << "Colorimetry:" << STR_COLORIMETRY[m_nColorimetry] << "\n"; - - str = wxString::FromUTF8(attrVal_str("pm")); - if(str.CmpNoCase(wxT("2110GPM")) == 0) - { - m_nPackingMode = GPM; - } - else - { - m_nPackingMode = BPM; - } - env() << "Packing:" << STR_PACKING[m_nPackingMode] << "\n"; - - m_sSSN = wxString::FromUTF8(attrVal_str("ssn")); - env() << "SSN:" << m_sSSN << "\n"; - - m_bInterlaced = (fAttributeTable->Lookup("interlace") != NULL); - m_bSegmented = (fAttributeTable->Lookup("segmented") != NULL); - m_bMaxUdp = (fAttributeTable->Lookup("maxudp") != NULL); - - - str = wxString::FromUTF8(attrVal_str("tcs")); - for(m_nTCS = 0; m_nTCS < 9; m_nTCS++) - { - if(str.CmpNoCase(STR_TCS[m_nTCS]) == 0) - break; - } - env() << "TCS:" << STR_TCS[m_nTCS] << "(" << str << ")\n"; - - str = wxString::FromUTF8(attrVal_str("range")); - for(m_nRange = 0; m_nRange < 3; m_nRange++) - { - if(str.CmpNoCase(STR_RANGE[m_nRange]) == 0) - break; - } - if(m_nRange == 3) - { - m_nRange = NARROW; - } - - env() << "RANGE:" << STR_RANGE[m_nRange] << "\n"; - - - str = wxString::FromUTF8(attrVal_str("par")); - if(str != wxEmptyString) - { - str.BeforeFirst(wxT(':')).ToULong(&m_pairAspectRatio.first); - if(str.AfterFirst(wxT(':')) == wxEmptyString) - { - m_pairAspectRatio.second = 1; - } - else - { - str.AfterFirst(wxT(':')).ToULong(&m_pairAspectRatio.second); - } - } - else - { - m_pairAspectRatio.first = 1; - m_pairAspectRatio.second = 1; - } - env() << "Pixel Aspect Radio: " << (int)m_pairAspectRatio.first << ":" << (int)m_pairAspectRatio.second << "\n"; - - } - bool Smpte2110MediaSubsession::SetChannelGrouping(size_t& nChannel, const subsession::channelGrouping& grouping) { if(nChannel < m_channels.size()) @@ -845,3 +617,33 @@ void Smpte2110MediaSubsession::parseSDPAttribute_Channels() } +static void periodicQOSMeasurement(void* clientData) +{ + auto pSubsession = reinterpret_cast(clientData); + pSubsession->PeriodicQOSMeasurement(); +} + + +void Smpte2110MediaSubsession::PeriodicQOSMeasurement() +{ + struct timeval timeNow; + gettimeofday(&timeNow, NULL); + + m_qos.periodicQOSMeasurement(timeNow); + + // Do this again later: + ScheduleNextQOSMeasurement(); +} + +void Smpte2110MediaSubsession::ScheduleNextQOSMeasurement() +{ + nextQOSMeasurementUSecs += m_qos.GetQosMeasurementIntervalMS()*1000; + + int usecsToDelay = m_qos.GetQosMeasurementIntervalMS()*1000; + m_qosMeasurementTimerTask = env().taskScheduler().scheduleDelayedTask(usecsToDelay, (TaskFunc*)periodicQOSMeasurement, (void*)this); + if(m_qosMeasurementTimerTask == nullptr) + { + pmlLog(pml::LOG_ERROR) << "Smpte2110MediaSubsession::ScheduleNextQOSMeasurement - FAILED"; + } + +} diff --git a/pambase/smpte2110mediasession.h b/pambase/smpte2110mediasession.h index 7049c95e..331aa454 100644 --- a/pambase/smpte2110mediasession.h +++ b/pambase/smpte2110mediasession.h @@ -5,6 +5,8 @@ #include "session.h" #include #include +#include "qos.h" + class Smpte2110MediaSubsession; @@ -35,11 +37,13 @@ class Smpte2110MediaSession : public MediaSession return m_dMaxPackageMs; } - const wxString& GetGroupDup() const + const std::set& GetGroups() const { - return m_sGroups; + return m_setGroups; } + + protected: @@ -57,7 +61,7 @@ class Smpte2110MediaSession : public MediaSession wxString m_sRawSDP; - wxString m_sGroups; + std::set m_setGroups; refclk m_refclk; double m_dPackageMs; double m_dMaxPackageMs; @@ -91,47 +95,26 @@ class Smpte2110MediaSubsession : public MediaSubsession return m_dMaxPackageMs; } + const wxString& GetGroup() const { return m_sGroup; } + std::map::const_iterator GetExtHeaderBegin() const; std::map::const_iterator GetExtHeaderEnd() const; std::map::const_iterator GetExtHeader(unsigned long nId) const; - int GetSampling(); - unsigned char GetDepth(); - bool AreSamplesInteger(); - unsigned int GetWidth(); - unsigned int GetHeight(); - std::pair GetExactFrameRate(); - int GetColorimetry(); - int GetPackingMode(); - wxString GetSSN(); - bool IsInterlaced(); - bool IsSegmented(); - int GetTCS(); - int GetRange(); - bool UseMaxUDP(); - std::pair GetAspectRatio(); - - - enum Sampling{YCbCr_444, YCbCr_422, YCbCr_420, CLYCbCr_444, CLYCbCr_422, CLYCbCr_420, ICtCp_444, ICtCp_422, ICtCp_420, RGB_, XYZ, KEY, UNKNOWN}; - enum Colorimetry{C_BT601, C_BT709, BC_T2020, C_BT2100, C_ST2065_1, C_ST2065_3, C_XYZ, C_UNSPECIFIED}; - enum TCS{SDR, PQ, HLG, LINEAR, BT2100LINPQ, BT2100LINHLG, ST2065_1, ST2428_1, DENSITY, UNSPECIFIED}; - enum Range{NARROW, FULLPROTECT, FULL}; - enum Packing{GPM, BPM}; + void SetHandler(RtpThread* pThread) { m_qos.SetHandler(pThread);} + + const std::vector& GetChannelGrouping() const { return m_channels;} + const qosMeasurementRecord& GetQoS() const { return m_qos;} - const std::vector& GetChannelGrouping() const { return m_channels;} + void ScheduleNextQOSMeasurement(); + void PeriodicQOSMeasurement(); - static const wxString STR_SAMPLING[13]; - static const wxString STR_COLORIMETRY[8]; - static const wxString STR_TCS[10]; - static const wxString STR_RANGE[3]; - static const wxString STR_PACKING[2]; + UsageEnvironment& GetEnv() { return env(); } protected: - void AnalyzeAttributes(); - friend class Smpte2110MediaSession; - Smpte2110MediaSubsession(MediaSession& parent); + explicit Smpte2110MediaSubsession(MediaSession& parent); virtual Boolean createSourceObjects(int useSpecialRTPoffset); bool SetChannelGrouping(size_t& nChannel, const subsession::channelGrouping& grouping); @@ -146,38 +129,26 @@ class Smpte2110MediaSubsession : public MediaSubsession void parseSDPAttribute_Mid(); void parseSDPAttribute_Channels(); - unsigned long m_nSyncTime; - unsigned int m_nFirstTimestamp; + + + unsigned long m_nSyncTime = 0; + unsigned int m_nFirstTimestamp = 0; wxString m_sEndpoint; - double m_dClockDeviation; + double m_dClockDeviation = 0.0; refclk m_refclk; - double m_dPackageMs; - double m_dMaxPackageMs; + double m_dPackageMs = 0.0; + double m_dMaxPackageMs = 0.0; std::map m_mExtHeader; wxString m_sGroup; - - - int m_nSampling; - unsigned char m_nDepth; - bool m_bFloating; - unsigned long m_nWidth; - unsigned long m_nHeight; - std::pair m_pairFrameRate; - int m_nColorimetry; - int m_nPackingMode; - wxString m_sSSN; - bool m_bInterlaced; - bool m_bSegmented; - int m_nTCS; - int m_nRange; - bool m_bMaxUdp; - std::pair m_pairAspectRatio; - + std::vector m_channels; + + qosMeasurementRecord m_qos; + TaskToken m_qosMeasurementTimerTask = nullptr; }; diff --git a/pambase/timemanager.cpp b/pambase/timemanager.cpp index e94d9e97..0894567e 100644 --- a/pambase/timemanager.cpp +++ b/pambase/timemanager.cpp @@ -108,12 +108,12 @@ bool TimeManager::PtpSyncFrequency() { m_nPtpSamples++; - auto pLocal = wxPtp::Get().GetLocalClock(m_nPtpDomain); + auto pLocal = wxPtp::Get().GetLocalClock(); if(pLocal) { StopCurrentSync(); - auto pMaster = wxPtp::Get().GetSyncMasterClock(m_nPtpDomain); + auto pMaster = wxPtp::Get().GetSyncMasterClock(); auto offset = pLocal->GetOffset(ptpmonkey::PtpV2Clock::CURRENT);//DoubleToTime(dEstimate); //store the PTP details for use by NMOS etc @@ -150,7 +150,7 @@ bool TimeManager::PtpSyncFrequency() clock_gettime(CLOCK_REALTIME, &tv); pmlLog() << "PTP: Current time now: " << ctime(&tv.tv_sec); } - wxPtp::Get().ResetLocalClockStats(m_nPtpDomain); + wxPtp::Get().ResetLocalClockStats(); m_nPtpSamples = 0; m_bPtpLock = false; } @@ -182,7 +182,7 @@ bool TimeManager::PtpSyncFrequency() return false; } */ - wxPtp::Get().ResetLocalClockStats(m_nPtpDomain); + wxPtp::Get().ResetLocalClockStats(); m_nPtpSamples = 0; std::thread th([this]{ @@ -226,14 +226,14 @@ bool TimeManager::TrySyncToPtp() { m_nPtpSamples++; - auto pLocal = wxPtp::Get().GetLocalClock(m_nPtpDomain); + auto pLocal = wxPtp::Get().GetLocalClock(); if(pLocal) { StopCurrentSync(); - auto pMaster = wxPtp::Get().GetSyncMasterClock(m_nPtpDomain); + auto pMaster = wxPtp::Get().GetSyncMasterClock(); auto offset = pLocal->GetOffset(ptpmonkey::PtpV2Clock::CURRENT);//DoubleToTime(dEstimate); @@ -246,8 +246,6 @@ bool TimeManager::TrySyncToPtp() offset += utc; } - pmlLog(pml::LOG_TRACE) << "TimeManager::SyncToPTP\t" << (m_bUseTai ? "TAI" : "UTC") << "\tOffset=" << offset.count(); - if(abs(std::chrono::duration_cast(offset).count()) > 500) { if(m_nPtpSamples > 1) //first stat is often 37s out @@ -270,7 +268,7 @@ bool TimeManager::TrySyncToPtp() clock_gettime(CLOCK_REALTIME, &tv); pmlLog() << "PTP: Current time now: " << ctime(&tv.tv_sec); } - wxPtp::Get().ResetLocalClockStats(m_nPtpDomain); + wxPtp::Get().ResetLocalClockStats(); m_nPtpSamples = 0; m_bPtpLock = false; } @@ -279,7 +277,6 @@ bool TimeManager::TrySyncToPtp() if(!m_bPtpLock && m_nPtpSamples < m_nMinSamplSize) // { //waiting for more info - pmlLog(pml::LOG_TRACE) << "TimeManager::SyncToPTP\t" << "waiting for more info"; return true; } @@ -304,7 +301,7 @@ bool TimeManager::TrySyncToPtp() pmlLog(pml::LOG_ERROR) << "Failed to set frequency " < TimeManager::GetNtpTracking() void TimeManager::OnPtpClockRemoved(wxCommandEvent& event) { - if(wxPtp::Get().GetSyncMasterClock(m_nPtpDomain) == nullptr && m_eCurrentSync == SYNC_PTP) + if(wxPtp::Get().GetSyncMasterClock() == nullptr && m_eCurrentSync == SYNC_PTP) { pmlLog() << "PTP Sync Master disappeared."; DoSync(); diff --git a/pambase/wmbutton.cpp b/pambase/wmbutton.cpp index 581a6e7d..228774fd 100644 --- a/pambase/wmbutton.cpp +++ b/pambase/wmbutton.cpp @@ -245,7 +245,10 @@ void wmButton::OnLeftDClick(wxMouseEvent& event) void wmButton::OnLeftDown(wxMouseEvent& event) { - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } // m_pScroller->MouseDown(event.GetPosition()); diff --git a/pambase/wmkeyboard.cpp b/pambase/wmkeyboard.cpp index 4be31c44..628fe72a 100644 --- a/pambase/wmkeyboard.cpp +++ b/pambase/wmkeyboard.cpp @@ -99,7 +99,10 @@ void wmKeyboard::OnSize(wxSizeEvent& event) void wmKeyboard::OnLeftDown(wxMouseEvent& event) { - CaptureMouse(); + if(!HasCapture()) + { + CaptureMouse(); + } m_itDown = m_lstButtons.end(); for(list - 5,300 - 144,20 - #FFFFFF - #0000FF - - - - 150,300 + 5,260 144,20 #FFFFFF #0000FF - 295,300 + 150,260 144,20 #FFFFFF #0000FF - 5,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 150,321 + 5,281 144,25 #008000 #FFFFFF @@ -240,166 +218,7 @@ - 295,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - - - - #000000 - - - 5,10 - 199,20 - #FFFFFF - #0000FF - - - - 5,31 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 205,10 - 74,20 - #FFFFFF - #0000FF - - - - 205,31 - 74,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 280,10 - 100,20 - #FFFFFF - #0000FF - - - - 280,31 - 100,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 381,10 - 59,20 - #FFFFFF - #0000FF - - - - 441,10 - 158,20 - #FFFFFF - #0000FF - - - - 381,31 - 59,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 441,31 - 158,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,70 - 144,20 - #FFFFFF - #0000FF - - - - 150,70 - 189,20 - #FFFFFF - #0000FF - - - - 340,70 - 199,20 - #FFFFFF - #0000FF - - - - 540,70 - 55,20 - #FFFFFF - #0000FF - - - - 5,91 + 150,281 144,25 #008000 #FFFFFF @@ -412,106 +231,17 @@ Consolas - - - 150,91 - 189,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 540,91 - 55,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 340,91 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,130 - 149,20 - #FFFFFF - #0000FF - - 155,130 - 149,20 - #FFFFFF - #0000FF - - - - 5,185 - 165,20 + 5,320 + 160,20 #FFFFFF #0000FF - - - 5,151 - 149,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - 155,151 - 149,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,206 - 165,25 + 5,341 + 160,25 #008000 #FFFFFF @@ -523,82 +253,17 @@ Consolas - - - 171,185 - 165,20 - #FFFFFF - #0000FF - - - - 337,185 - 100,20 - #FFFFFF - #0000FF - - 5,240 - 166,20 - #FFFFFF - #0000FF - - - - 5,300 - 144,20 - #FFFFFF - #0000FF - - - - 150,300 - 144,20 - #FFFFFF - #0000FF - - - - 450,300 - 144,20 + 166,320 + 167,20 #FFFFFF #0000FF - - - 5,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 150,321 - 144,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - + - 450,321 - 144,25 + 166,341 + 167,25 #008000 #FFFFFF @@ -610,427 +275,8 @@ Consolas - - - 238,240 - 100,20 - #FFFFFF - #0000FF - - - - 171,206 - 165,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 337,206 - 100,25 - #9B0000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,261 - 166,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 238,261 - 100,25 - #9B0000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - - - - #000000 - - - 5,5 - 194,20 - #FFFFFF - #0000FF - - - - 200,5 - 199,20 - #FFFFFF - #0000FF - - - - 400,5 - 195,20 - #FFFFFF - #0000FF - - - - 5,26 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,26 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,26 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,60 - 194,20 - #FFFFFF - #0000FF - - - - 200,60 - 199,20 - #FFFFFF - #0000FF - - - - 400,60 - 195,20 - #FFFFFF - #0000FF - - - - 5,81 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,81 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,81 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,115 - 194,20 - #FFFFFF - #0000FF - - - - 200,115 - 199,20 - #FFFFFF - #0000FF - - - - 400,115 - 195,20 - #FFFFFF - #0000FF - - - - 5,136 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,136 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,136 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,170 - 194,20 - #FFFFFF - #0000FF - - - - 200,170 - 199,20 - #FFFFFF - #0000FF - - - - 400,170 - 195,20 - #FFFFFF - #0000FF - - - - 5,191 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,191 - 199,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,191 - 195,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 5,225 - 194,20 - #FFFFFF - #0000FF - - - - 400,225 - 194,20 - #FFFFFF - #008040 - - - - 5,246 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 200,225 - 194,20 - #FFFFFF - #0000FF - - - - 200,246 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - - 400,246 - 194,25 - #008000 - #FFFFFF - - 10 - - bold - 0 - swiss - Consolas - - - - 0,280 - 600,160 - #000000 - - $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE),1,10,0); - levelgraph.h - 1 - - 0,0 - 600,160 - #0000FF - #000000 - 50,-1 - - - + diff --git a/plugins/aoip info/wxsmith/pnlQos.wxs b/plugins/aoip info/wxsmith/pnlQos.wxs new file mode 100644 index 00000000..7b8af349 --- /dev/null +++ b/plugins/aoip info/wxsmith/pnlQos.wxs @@ -0,0 +1,476 @@ + + + + #000000 + 1 + 1 + + 0,280 + 600,160 + #000000 + + $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE)); + histogram.h + 1 + + 0,0 + 600,160 + 1 + #0000FF + #000000 + 50,-1 + + + $(THIS) = new $(CLASS)($(PARENT),$(ID), $(POS),$(SIZE)); + historygraph.h + 1 + + 0,0 + 600,160 + #0000FF + #000000 + 50,-1 + + + + + 146,246 + 109,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + #800000 + 262,246 + 140,25 + #008000 + #FFFFFF + + + + + #800000 + 403,246 + 70,25 + #008000 + #FFFFFF + + + + + #800000 + 474,246 + 60,25 + #008000 + #FFFFFF + + + + + + #800000 + 535,246 + 60,25 + #008000 + #FFFFFF + + + + + + 146,225 + 109,20 + #FFFFFF + #0000FF + + + + 5,246 + 140,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 262,225 + 333,20 + #FFFFFF + #008040 + + + + 5,225 + 140,20 + #FFFFFF + #0000FF + + + + 450,191 + 147,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 301,191 + 147,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,191 + 147,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 153,191 + 147,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 450,170 + 147,20 + #FFFFFF + #0000FF + + + + 301,170 + 147,20 + #FFFFFF + #0000FF + + + + 5,170 + 147,20 + #FFFFFF + #0000FF + + + + 153,170 + 147,20 + #FFFFFF + #0000FF + + + + 400,136 + 195,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 200,136 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,136 + 194,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 400,115 + 195,20 + #FFFFFF + #0000FF + + + + 200,115 + 199,20 + #FFFFFF + #0000FF + + + + 5,115 + 194,20 + #FFFFFF + #0000FF + + + + 450,81 + 147,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 301,81 + 148,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,81 + 147,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 153,81 + 147,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 301,60 + 148,20 + #FFFFFF + #0000FF + + + + 450,60 + 147,20 + #FFFFFF + #0000FF + + + + 5,60 + 147,20 + #FFFFFF + #0000FF + + + + 153,60 + 147,20 + #FFFFFF + #0000FF + + + + 500,26 + 100,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 400,26 + 99,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,26 + 132,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 138,26 + 130,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 269,26 + 132,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 500,5 + 100,20 + #FFFFFF + #0000FF + + + + 400,5 + 99,20 + #FFFFFF + #0000FF + + + + 5,5 + 132,20 + #FFFFFF + #0000FF + + + + 138,5 + 130,20 + #FFFFFF + #0000FF + + + + 269,5 + 130,20 + #FFFFFF + #0000FF + + + diff --git a/plugins/aoip info/wxsmith/pnlSubsession.wxs b/plugins/aoip info/wxsmith/pnlSubsession.wxs new file mode 100644 index 00000000..dd5c84bc --- /dev/null +++ b/plugins/aoip info/wxsmith/pnlSubsession.wxs @@ -0,0 +1,404 @@ + + + + #000000 + 1 + 1 + + + 5,10 + 199,20 + #FFFFFF + #0000FF + + + + 5,31 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 205,10 + 74,20 + #FFFFFF + #0000FF + + + + 205,31 + 74,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 280,10 + 100,20 + #FFFFFF + #0000FF + + + + 280,31 + 100,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 381,10 + 59,20 + #FFFFFF + #0000FF + + + + 441,10 + 158,20 + #FFFFFF + #0000FF + + + + 381,31 + 59,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 441,31 + 158,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,70 + 144,20 + #FFFFFF + #0000FF + + + + 150,70 + 189,20 + #FFFFFF + #0000FF + + + + 340,70 + 199,20 + #FFFFFF + #0000FF + + + + 540,70 + 55,20 + #FFFFFF + #0000FF + + + + 5,91 + 144,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 150,91 + 189,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 540,91 + 55,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 340,91 + 199,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,130 + 160,20 + #FFFFFF + #0000FF + + + + 166,130 + 160,20 + #FFFFFF + #0000FF + + + + 400,130 + 80,20 + #FFFFFF + #0000FF + + + + 485,130 + 110,20 + #FFFFFF + #0000FF + + + + 5,185 + 160,20 + #FFFFFF + #0000FF + + + + 5,151 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 166,151 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 400,151 + 80,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 485,151 + 110,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 5,206 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 166,185 + 160,20 + #FFFFFF + #0000FF + + + + 327,185 + 100,20 + #FFFFFF + #0000FF + + + + 5,240 + 144,20 + #FFFFFF + #0000FF + + + + 150,240 + 144,20 + #FFFFFF + #0000FF + + + + 5,261 + 144,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 150,261 + 144,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 166,206 + 160,25 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + + 327,206 + 100,25 + #9B0000 + #FFFFFF + + 10 + + bold + 0 + swiss + Consolas + + + + diff --git a/plugins/channel delay/CMakeLists.txt b/plugins/channel delay/CMakeLists.txt index 2a87906a..f72f07a2 100644 --- a/plugins/channel delay/CMakeLists.txt +++ b/plugins/channel delay/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(channeldelay LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -20,7 +20,7 @@ add_library(channeldelay MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAM find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -37,9 +37,10 @@ target_link_libraries(channeldelay ${wxWidgets_LIBRARIES}) target_link_libraries(channeldelay optimized pambase debug pambased) target_link_libraries(channeldelay optimized pamfft debug pamfftd) +set_target_properties(channeldelay PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS channeldelay LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS channeldelay LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/correlation/CMakeLists.txt b/plugins/correlation/CMakeLists.txt index 19665b56..ffaa5a35 100644 --- a/plugins/correlation/CMakeLists.txt +++ b/plugins/correlation/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(correlation LANGUAGES CXX VERSION 0.1.0) @@ -22,7 +22,7 @@ add_library(correlation MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -41,7 +41,9 @@ target_link_libraries(correlation optimized pambase debug pambased) target_link_libraries(correlation optimized pamlevel debug pamleveld) +set_target_properties(correlation PROPERTIES CXX_STANDARD 17) + #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS correlation LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS correlation LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/distortion/CMakeLists.txt b/plugins/distortion/CMakeLists.txt index e8d00a33..be1183fb 100644 --- a/plugins/distortion/CMakeLists.txt +++ b/plugins/distortion/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(distortion LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -22,7 +22,7 @@ add_library(distortion MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME} find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -39,9 +39,10 @@ target_link_libraries(distortion ${wxWidgets_LIBRARIES}) target_link_libraries(distortion optimized pambase debug pambased) target_link_libraries(distortion optimized pamfft debug pamfftd) +set_target_properties(distortion PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS distortion LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS distortion LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/fft/CMakeLists.txt b/plugins/fft/CMakeLists.txt index 63db9701..cce13798 100644 --- a/plugins/fft/CMakeLists.txt +++ b/plugins/fft/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(fft LANGUAGES CXX VERSION 1.2.0) execute_process(COMMAND ${CMAKE_COMMAND} -DNAMESPACE=${PROJECT_NAME} -DMAJOR=${PROJECT_VERSION_MAJOR} -DMINOR=${PROJECT_VERSION_MINOR} -DPATCH=${PROJECT_VERSION_PATCH} -P ${CMAKE_SOURCE_DIR}/version.cmake) @@ -23,7 +23,7 @@ add_library(fft MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versio find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -40,10 +40,11 @@ target_link_libraries(fft ${wxWidgets_LIBRARIES}) target_link_libraries(fft optimized pambase debug pambased) target_link_libraries(fft optimized pamfft debug pamfftd) +set_target_properties(fft PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS fft LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS fft LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/fftdiff/CMakeLists.txt b/plugins/fftdiff/CMakeLists.txt index 23eba7d4..ddf48231 100644 --- a/plugins/fftdiff/CMakeLists.txt +++ b/plugins/fftdiff/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.5 FATAL_ERROR) +cmake_minimum_required(VERSION 3.16 FATAL_ERROR) project(car LANGUAGES CXX VERSION 1.1.0) @@ -20,7 +20,7 @@ add_library(car MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versio find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -38,8 +38,9 @@ target_link_libraries(car optimized pambase debug pambased) target_link_libraries(car optimized pamfft debug pamfftd) +set_target_properties(car PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS car LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS car LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/fftphase/CMakeLists.txt b/plugins/fftphase/CMakeLists.txt index 3f276313..c9ce4413 100644 --- a/plugins/fftphase/CMakeLists.txt +++ b/plugins/fftphase/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(fftphase MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -42,11 +42,11 @@ target_link_libraries(fftphase optimized pambase debug pambased) target_link_libraries(fftphase optimized pamfft debug pamfftd) target_link_libraries(fftphase optimized restgoose debug restgoosed) - +set_target_properties(fftphase PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS fftphase LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS fftphase LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/identify/CMakeLists.txt b/plugins/identify/CMakeLists.txt index cf8eda74..81f11bca 100644 --- a/plugins/identify/CMakeLists.txt +++ b/plugins/identify/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(identify MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,8 +33,9 @@ target_compile_options(identify PRIVATE ${flags}) target_link_libraries(identify ${wxWidgets_LIBRARIES}) target_link_libraries(identify optimized pambase debug pambased) +set_target_properties(identify PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS identify LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS identify LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/levels/CMakeLists.txt b/plugins/levels/CMakeLists.txt index 12e76032..136856c9 100644 --- a/plugins/levels/CMakeLists.txt +++ b/plugins/levels/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(levels MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -34,8 +34,9 @@ target_compile_options(levels PRIVATE ${flags}) target_link_libraries(levels ${wxWidgets_LIBRARIES}) target_link_libraries(levels optimized pambase debug pambased) +set_target_properties(levels PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS levels LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS levels LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/lineup/CMakeLists.txt b/plugins/lineup/CMakeLists.txt index 44468af7..bce73ecf 100644 --- a/plugins/lineup/CMakeLists.txt +++ b/plugins/lineup/CMakeLists.txt @@ -20,7 +20,7 @@ add_library(lineup MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -37,9 +37,10 @@ target_link_libraries(lineup ${wxWidgets_LIBRARIES}) target_link_libraries(lineup optimized pambase debug pambased) target_link_libraries(lineup optimized pamfft debug pamfftd) target_link_libraries(lineup optimized pamlevel debug pamleveld) +set_target_properties(lineup PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS lineup LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS lineup LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/lissajou/CMakeLists.txt b/plugins/lissajou/CMakeLists.txt index f1714d40..570f8ed6 100644 --- a/plugins/lissajou/CMakeLists.txt +++ b/plugins/lissajou/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(lissajou MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,12 +32,14 @@ else() endif() target_compile_options(lissajou PRIVATE ${flags}) +set_target_properties(lissajou PROPERTIES CXX_STANDARD 17) + #target_link_libraries(lissajou ${wxWidgets_LIBRARIES}) #target_link_libraries(lissajou optimized pambase debug pambased) #target_link_libraries(lissajou optimized pamfft debug pamfftd) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS lissajou LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS lissajou LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/meters/CMakeLists.txt b/plugins/meters/CMakeLists.txt index bbb6b8cd..3c054eec 100644 --- a/plugins/meters/CMakeLists.txt +++ b/plugins/meters/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(meters MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,9 +33,9 @@ target_compile_options(meters PRIVATE ${flags}) target_link_libraries(meters ${wxWidgets_LIBRARIES}) target_link_libraries(meters optimized pambase debug pambased) - +set_target_properties(meters PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS meters LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS meters LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/noiseGenerator/CMakeLists.txt b/plugins/noiseGenerator/CMakeLists.txt index 3910f3cc..1f30630e 100644 --- a/plugins/noiseGenerator/CMakeLists.txt +++ b/plugins/noiseGenerator/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(noiseGenerator MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_N find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,9 +33,9 @@ target_compile_options(noiseGenerator PRIVATE ${flags}) target_link_libraries(noiseGenerator ${wxWidgets_LIBRARIES}) target_link_libraries(noiseGenerator optimized pambase debug pambased) - +set_target_properties(noiseGenerator PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS noiseGenerator LIBRARY DESTINATION /usr/local/lib/pam2/generator) + install(TARGETS noiseGenerator LIBRARY DESTINATION lib/pam2/generator) endif() diff --git a/plugins/peak count/CMakeLists.txt b/plugins/peak count/CMakeLists.txt index e3c77d09..df9f5c41 100644 --- a/plugins/peak count/CMakeLists.txt +++ b/plugins/peak count/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(peakcount MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,9 +33,9 @@ target_compile_options(peakcount PRIVATE ${flags}) target_link_libraries(peakcount ${wxWidgets_LIBRARIES}) target_link_libraries(peakcount optimized pambase debug pambased) - +set_target_properties(peakcount PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS peakcount LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS peakcount LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/peak log/CMakeLists.txt b/plugins/peak log/CMakeLists.txt index 0cff24e1..2522e49e 100644 --- a/plugins/peak log/CMakeLists.txt +++ b/plugins/peak log/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(peaklog MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ve find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -34,9 +34,10 @@ target_link_libraries(peaklog ${wxWidgets_LIBRARIES}) target_link_libraries(peaklog optimized pambase debug pambased) target_link_libraries(peaklog optimized restgoose debug restgoosed) target_link_libraries(peaklog optimized pml_log debug pml_logd) +set_target_properties(peaklog PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS peaklog LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS peaklog LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/polarscope/CMakeLists.txt b/plugins/polarscope/CMakeLists.txt index 25879b54..1b9e6faf 100644 --- a/plugins/polarscope/CMakeLists.txt +++ b/plugins/polarscope/CMakeLists.txt @@ -18,7 +18,7 @@ target_link_libraries(polarscope optimized pamfft debug pamfftd) find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -33,10 +33,10 @@ target_compile_options(polarscope PRIVATE ${flags}) target_link_libraries(polarscope ${wxWidgets_LIBRARIES}) target_link_libraries(polarscope optimized pambase debug pambased) - +set_target_properties(polarscope PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS polarscope LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS polarscope LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/ptp/CMakeLists.txt b/plugins/ptp/CMakeLists.txt index f79106d5..112916a3 100644 --- a/plugins/ptp/CMakeLists.txt +++ b/plugins/ptp/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(ptp MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versio find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -34,9 +34,9 @@ target_compile_options(ptp PRIVATE ${flags}) target_link_libraries(ptp ${wxWidgets_LIBRARIES}) target_link_libraries(ptp optimized pambase debug pambased) - +set_target_properties(ptp PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS ptp LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS ptp LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/ptp/grandmaster.xpm b/plugins/ptp/grandmaster.xpm new file mode 100644 index 00000000..0bbfc63f --- /dev/null +++ b/plugins/ptp/grandmaster.xpm @@ -0,0 +1,44 @@ +/* XPM */ +static char * grandmaster_xpm[] = { +"32 16 25 1", +" c None", +". c #F70000", +"+ c #F60000", +"@ c #F50000", +"# c #F30000", +"$ c #F40000", +"% c #F00000", +"& c #EA0000", +"* c #EF0000", +"= c #ED0000", +"- c #EE0000", +"; c #E10000", +"> c #EC0000", +", c #EB0000", +"' c #DD0000", +") c #E40000", +"! c #DA0000", +"~ c #DC0000", +"{ c #DB0000", +"] c #D70000", +"^ c #E90000", +"/ c #D60000", +"( c #F20000", +"_ c #F10000", +": c #CB0000", +" ", +" ......... ....+ ..... ", +" ........... ..... ..... ", +" .....+++@+.+ .....+ @..... ", +" .... ...... ...... ", +".... ......# ...... ", +".... ...+..+ @..$... ", +".... @+@@@@ ...%@..#..@&... ", +".... +..... ...* .....= ... ", +".... -%#... ...= +.... ;... ", +"....@ ... ...> ,...% '... ", +" ....% )... ..., ... !... ", +" +........... ...& ~{ ]... ", +" $.......... ...^ /... ", +" $@$$#(*! _((; :%%% ", +" "}; diff --git a/plugins/ptp/ptpbuilder.cpp b/plugins/ptp/ptpbuilder.cpp index d1224604..74b2d2d4 100644 --- a/plugins/ptp/ptpbuilder.cpp +++ b/plugins/ptp/ptpbuilder.cpp @@ -13,6 +13,7 @@ ptpBuilder::ptpBuilder() : MonitorPluginBuilder() { RegisterForSettingsUpdates(this); + Settings::Get().AddHandler(this, "Time", "PTP_Domain"); Connect(wxID_ANY, wxEVT_SETTING_CHANGED, (wxObjectEventFunction)&ptpBuilder::OnSettingChanged); @@ -23,7 +24,7 @@ ptpBuilder::ptpBuilder() : MonitorPluginBuilder() void ptpBuilder::SetAudioData(const timedbuffer* pBuffer) { -// m_pMeter->SetAudioData(pBuffer); + } wxWindow* ptpBuilder::CreateMonitorPanel(wxWindow* pParent) @@ -37,7 +38,7 @@ wxWindow* ptpBuilder::CreateMonitorPanel(wxWindow* pParent) list ptpBuilder::CreateOptionPanels(wxWindow* pParent) { list lstOptionPanels; - lstOptionPanels.push_back(std::make_pair("Options", new pnlOptions(pParent, this))); + //lstOptionPanels.push_back(std::make_pair("Options", new pnlOptions(pParent, this))); //@todo create and return all the option panels return lstOptionPanels; } @@ -77,6 +78,10 @@ void ptpBuilder::OnSettingChanged(SettingEvent& event) { m_pMeter->ResetStats(); } + else if(event.GetKey() == "PTP_Domain") + { + m_pMeter->SetDomain(event.GetValue(0l)); + } } diff --git a/plugins/ptp/ptppanel.cpp b/plugins/ptp/ptppanel.cpp index 79d86bc0..36c171fe 100644 --- a/plugins/ptp/ptppanel.cpp +++ b/plugins/ptp/ptppanel.cpp @@ -18,8 +18,14 @@ #include //*) +#include "syncmaster.xpm" +#include "grandmaster.xpm" +#include "slave.xpm" + //(*IdInit(ptpPanel) +const long ptpPanel::ID_M_PLBL80 = wxNewId(); const long ptpPanel::ID_M_PLST1 = wxNewId(); +const long ptpPanel::ID_M_PLBL79 = wxNewId(); const long ptpPanel::ID_M_PLBL1 = wxNewId(); const long ptpPanel::ID_M_PLBL2 = wxNewId(); const long ptpPanel::ID_M_PLBL3 = wxNewId(); @@ -95,6 +101,8 @@ const long ptpPanel::ID_M_PLBL59 = wxNewId(); const long ptpPanel::ID_M_PLBL63 = wxNewId(); const long ptpPanel::ID_M_PLBL60 = wxNewId(); const long ptpPanel::ID_M_PLBL64 = wxNewId(); +const long ptpPanel::ID_M_PBTN29 = wxNewId(); +const long ptpPanel::ID_M_PBTN5 = wxNewId(); const long ptpPanel::ID_PANEL8 = wxNewId(); const long ptpPanel::ID_PANEL14 = wxNewId(); const long ptpPanel::ID_M_PLBL45 = wxNewId(); @@ -111,7 +119,9 @@ const long ptpPanel::ID_M_PLBL78 = wxNewId(); const long ptpPanel::ID_HISTORY_GRAPH = wxNewId(); const long ptpPanel::ID_M_PLBL68 = wxNewId(); const long ptpPanel::ID_M_PLST5 = wxNewId(); +const long ptpPanel::ID_M_PBTN8 = wxNewId(); const long ptpPanel::ID_M_PBTN3 = wxNewId(); +const long ptpPanel::ID_M_PBTN7 = wxNewId(); const long ptpPanel::ID_M_PBTN4 = wxNewId(); const long ptpPanel::ID_PANEL15 = wxNewId(); const long ptpPanel::ID_M_PLBL53 = wxNewId(); @@ -123,17 +133,14 @@ const long ptpPanel::ID_M_PLST2 = wxNewId(); const long ptpPanel::ID_M_PLBL66 = wxNewId(); const long ptpPanel::ID_M_PLST3 = wxNewId(); const long ptpPanel::ID_M_PBTN1 = wxNewId(); +const long ptpPanel::ID_M_PBTN6 = wxNewId(); const long ptpPanel::ID_M_PBTN2 = wxNewId(); const long ptpPanel::ID_PANEL16 = wxNewId(); const long ptpPanel::ID_M_PSWP2 = wxNewId(); //*) -const wxColour ptpPanel::CLR_MASTER = wxColour(50,128,50); -const wxColour ptpPanel::CLR_MASTER_SELECTED = wxColour(150,228,150); -const wxColour ptpPanel::CLR_SYNC_MASTER = wxColour(50,50,128); -const wxColour ptpPanel::CLR_SYNC_MASTER_SELECTED = wxColour(150,150,228); -const wxColour ptpPanel::CLR_SLAVE = wxColour(50,50,50); -const wxColour ptpPanel::CLR_SLAVE_SELECTED = wxColour(150,150,150); +const wxColour ptpPanel::CLR_CLOCK = wxColour(50,50,150); +const wxColour ptpPanel::CLR_CLOCK_SELECTED = wxColour(150,150,250); using namespace ptpmonkey; @@ -149,7 +156,7 @@ END_EVENT_TABLE() ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const wxPoint& pos,const wxSize& size) : pmPanel(), m_pBuilder(pBuilder), - m_nDomain(0), + m_nDomain(Settings::Get().Read("Time", "PTP_Domain", 0)), m_pClock(nullptr), m_pLocalClock(nullptr), m_mAccuracy({ { ptpAnnounce::ACC_25NS, "Within 25ns"}, @@ -200,41 +207,55 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_pSwpMain->SetPageNameStyle(0); m_ppnlInfo = new wxPanel(m_pSwpMain, ID_PANEL14, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL14")); m_ppnlInfo->SetBackgroundColour(wxColour(0,0,0)); - m_plstClocks = new wmList(m_ppnlInfo, ID_M_PLST1, wxPoint(605,5), wxSize(190,470), wmList::STYLE_SELECT, 1, wxSize(-1,-1), 1, wxSize(-1,-1)); + m_pLbl10 = new wmLabel(m_ppnlInfo, ID_M_PLBL80, _("Clocks"), wxPoint(605,5), wxSize(190,25), 0, _T("ID_M_PLBL80")); + m_pLbl10->SetBorderState(uiRect::BORDER_NONE); + m_pLbl10->GetUiRect().SetGradient(wxWEST); + m_pLbl10->SetForegroundColour(wxColour(255,255,255)); + m_pLbl10->SetBackgroundColour(wxColour(128,128,192)); + wxFont m_pLbl10Font(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_pLbl10->SetFont(m_pLbl10Font); + m_plstClocks = new wmList(m_ppnlInfo, ID_M_PLST1, wxPoint(605,35), wxSize(190,440), wmList::STYLE_SELECT, 1, wxSize(-1,-1), 1, wxSize(-1,-1)); m_plstClocks->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND)); m_plstClocks->SetButtonColour(wxColour(wxT("#000000"))); m_plstClocks->SetSelectedButtonColour(wxColour(wxT("#FF8000"))); - m_ptitleIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL1, _("Port Identitiy"), wxPoint(5,5), wxSize(100,25), 0, _T("ID_M_PLBL1")); + m_plblDomain = new wmLabel(m_ppnlInfo, ID_M_PLBL79, _("Domain:"), wxPoint(5,5), wxSize(280,25), 0, _T("ID_M_PLBL79")); + m_plblDomain->SetBorderState(uiRect::BORDER_NONE); + m_plblDomain->GetUiRect().SetGradient(wxWEST); + m_plblDomain->SetForegroundColour(wxColour(255,255,255)); + m_plblDomain->SetBackgroundColour(wxColour(128,128,192)); + wxFont m_plblDomainFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_plblDomain->SetFont(m_plblDomainFont); + m_ptitleIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL1, _("Port Identitiy"), wxPoint(5,33), wxSize(100,25), 0, _T("ID_M_PLBL1")); m_ptitleIdentity->SetBorderState(uiRect::BORDER_FLAT); m_ptitleIdentity->GetUiRect().SetGradient(wxWEST); m_ptitleIdentity->SetForegroundColour(wxColour(255,255,255)); m_ptitleIdentity->SetBackgroundColour(wxColour(92,122,224)); - m_ptitleAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL2, _("Address"), wxPoint(5,35), wxSize(100,25), 0, _T("ID_M_PLBL2")); + m_ptitleAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL2, _("Address"), wxPoint(5,61), wxSize(100,25), 0, _T("ID_M_PLBL2")); m_ptitleAddress->SetBorderState(uiRect::BORDER_NONE); m_ptitleAddress->GetUiRect().SetGradient(wxWEST); m_ptitleAddress->SetForegroundColour(wxColour(255,255,255)); m_ptitleAddress->SetBackgroundColour(wxColour(92,122,224)); - m_ptitleState = new wmLabel(m_ppnlInfo, ID_M_PLBL3, _("State"), wxPoint(5,65), wxSize(100,25), 0, _T("ID_M_PLBL3")); + m_ptitleState = new wmLabel(m_ppnlInfo, ID_M_PLBL3, _("State"), wxPoint(5,89), wxSize(100,25), 0, _T("ID_M_PLBL3")); m_ptitleState->SetBorderState(uiRect::BORDER_NONE); m_ptitleState->GetUiRect().SetGradient(wxWEST); m_ptitleState->SetForegroundColour(wxColour(255,255,255)); m_ptitleState->SetBackgroundColour(wxColour(92,122,224)); - m_plblIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL12, wxEmptyString, wxPoint(105,5), wxSize(180,25), 0, _T("ID_M_PLBL12")); + m_plblIdentity = new wmLabel(m_ppnlInfo, ID_M_PLBL12, wxEmptyString, wxPoint(105,33), wxSize(180,25), 0, _T("ID_M_PLBL12")); m_plblIdentity->SetBorderState(uiRect::BORDER_DOWN); m_plblIdentity->GetUiRect().SetGradient(0); m_plblIdentity->SetForegroundColour(wxColour(0,0,0)); m_plblIdentity->SetBackgroundColour(wxColour(255,255,255)); - m_pblAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL13, wxEmptyString, wxPoint(105,35), wxSize(180,25), 0, _T("ID_M_PLBL13")); + m_pblAddress = new wmLabel(m_ppnlInfo, ID_M_PLBL13, wxEmptyString, wxPoint(105,61), wxSize(180,25), 0, _T("ID_M_PLBL13")); m_pblAddress->SetBorderState(uiRect::BORDER_DOWN); m_pblAddress->GetUiRect().SetGradient(0); m_pblAddress->SetForegroundColour(wxColour(0,0,0)); m_pblAddress->SetBackgroundColour(wxColour(255,255,255)); - m_plblState = new wmLabel(m_ppnlInfo, ID_M_PLBL14, wxEmptyString, wxPoint(105,65), wxSize(180,25), 0, _T("ID_M_PLBL14")); + m_plblState = new wmLabel(m_ppnlInfo, ID_M_PLBL14, wxEmptyString, wxPoint(105,89), wxSize(180,25), 0, _T("ID_M_PLBL14")); m_plblState->SetBorderState(uiRect::BORDER_DOWN); m_plblState->GetUiRect().SetGradient(0); m_plblState->SetForegroundColour(wxColour(0,0,0)); m_plblState->SetBackgroundColour(wxColour(255,255,255)); - m_ppnlAnnouncements = new wxPanel(m_ppnlInfo, ID_PANEL1, wxPoint(5,95), wxSize(280,275), wxTAB_TRAVERSAL, _T("ID_PANEL1")); + m_ppnlAnnouncements = new wxPanel(m_ppnlInfo, ID_PANEL1, wxPoint(5,135), wxSize(280,275), wxTAB_TRAVERSAL, _T("ID_PANEL1")); m_ppnlAnnouncements->SetBackgroundColour(wxColour(0,0,0)); m_ptitleAnnouncements = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL30, _("Announcements"), wxPoint(0,0), wxSize(280,25), 0, _T("ID_M_PLBL30")); m_ptitleAnnouncements->SetBorderState(uiRect::BORDER_NONE); @@ -243,117 +264,117 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_ptitleAnnouncements->SetBackgroundColour(wxColour(98,219,101)); wxFont m_ptitleAnnouncementsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); m_ptitleAnnouncements->SetFont(m_ptitleAnnouncementsFont); - m_ptitleAnnRate = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL24, _("Rate"), wxPoint(0,30), wxSize(70,25), 0, _T("ID_M_PLBL24")); + m_ptitleAnnRate = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL24, _("Rate"), wxPoint(0,28), wxSize(70,25), 0, _T("ID_M_PLBL24")); m_ptitleAnnRate->SetBorderState(uiRect::BORDER_NONE); m_ptitleAnnRate->GetUiRect().SetGradient(wxWEST); m_ptitleAnnRate->SetForegroundColour(wxColour(255,255,255)); m_ptitleAnnRate->SetBackgroundColour(wxColour(92,122,224)); - m_plblAnnRate = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL25, wxEmptyString, wxPoint(70,30), wxSize(70,25), 0, _T("ID_M_PLBL25")); + m_plblAnnRate = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL25, wxEmptyString, wxPoint(70,28), wxSize(70,25), 0, _T("ID_M_PLBL25")); m_plblAnnRate->SetBorderState(uiRect::BORDER_DOWN); m_plblAnnRate->GetUiRect().SetGradient(0); m_plblAnnRate->SetForegroundColour(wxColour(0,0,0)); m_plblAnnRate->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleCount = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL26, _("Count"), wxPoint(140,30), wxSize(70,25), 0, _T("ID_M_PLBL26")); + m_ptitleCount = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL26, _("Count"), wxPoint(140,28), wxSize(70,25), 0, _T("ID_M_PLBL26")); m_ptitleCount->SetBorderState(uiRect::BORDER_NONE); m_ptitleCount->GetUiRect().SetGradient(wxWEST); m_ptitleCount->SetForegroundColour(wxColour(255,255,255)); m_ptitleCount->SetBackgroundColour(wxColour(92,122,224)); - m_plblAnnCount = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL27, wxEmptyString, wxPoint(210,30), wxSize(70,25), 0, _T("ID_M_PLBL27")); + m_plblAnnCount = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL27, wxEmptyString, wxPoint(210,28), wxSize(70,25), 0, _T("ID_M_PLBL27")); m_plblAnnCount->SetBorderState(uiRect::BORDER_DOWN); m_plblAnnCount->GetUiRect().SetGradient(0); m_plblAnnCount->SetForegroundColour(wxColour(0,0,0)); m_plblAnnCount->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleUtc = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL4, _("UTC Offset"), wxPoint(140,90), wxSize(70,25), 0, _T("ID_M_PLBL4")); + m_ptitleUtc = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL4, _("UTC Offset"), wxPoint(140,84), wxSize(70,25), 0, _T("ID_M_PLBL4")); m_ptitleUtc->SetBorderState(uiRect::BORDER_NONE); m_ptitleUtc->GetUiRect().SetGradient(wxWEST); m_ptitleUtc->SetForegroundColour(wxColour(255,255,255)); m_ptitleUtc->SetBackgroundColour(wxColour(92,122,224)); - m_plblUTC = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL15, wxEmptyString, wxPoint(210,90), wxSize(70,25), 0, _T("ID_M_PLBL15")); + m_plblUTC = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL15, wxEmptyString, wxPoint(210,84), wxSize(70,25), 0, _T("ID_M_PLBL15")); m_plblUTC->SetBorderState(uiRect::BORDER_DOWN); m_plblUTC->GetUiRect().SetGradient(0); m_plblUTC->SetForegroundColour(wxColour(0,0,0)); m_plblUTC->SetBackgroundColour(wxColour(255,255,255)); - m_ptitlePriority1 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL5, _("Priority 1"), wxPoint(0,60), wxSize(70,25), 0, _T("ID_M_PLBL5")); + m_ptitlePriority1 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL5, _("Priority 1"), wxPoint(0,56), wxSize(70,25), 0, _T("ID_M_PLBL5")); m_ptitlePriority1->SetBorderState(uiRect::BORDER_NONE); m_ptitlePriority1->GetUiRect().SetGradient(wxWEST); m_ptitlePriority1->SetForegroundColour(wxColour(255,255,255)); m_ptitlePriority1->SetBackgroundColour(wxColour(92,122,224)); - m_plblPriority1 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL16, wxEmptyString, wxPoint(70,60), wxSize(70,25), 0, _T("ID_M_PLBL16")); + m_plblPriority1 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL16, wxEmptyString, wxPoint(70,56), wxSize(70,25), 0, _T("ID_M_PLBL16")); m_plblPriority1->SetBorderState(uiRect::BORDER_DOWN); m_plblPriority1->GetUiRect().SetGradient(0); m_plblPriority1->SetForegroundColour(wxColour(0,0,0)); m_plblPriority1->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleClass = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL7, _("Class"), wxPoint(140,60), wxSize(70,25), 0, _T("ID_M_PLBL7")); + m_ptitleClass = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL7, _("Class"), wxPoint(140,56), wxSize(70,25), 0, _T("ID_M_PLBL7")); m_ptitleClass->SetBorderState(uiRect::BORDER_NONE); m_ptitleClass->GetUiRect().SetGradient(wxWEST); m_ptitleClass->SetForegroundColour(wxColour(255,255,255)); m_ptitleClass->SetBackgroundColour(wxColour(92,122,224)); - m_plblClass = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL17, wxEmptyString, wxPoint(210,60), wxSize(70,25), 0, _T("ID_M_PLBL17")); + m_plblClass = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL17, wxEmptyString, wxPoint(210,56), wxSize(70,25), 0, _T("ID_M_PLBL17")); m_plblClass->SetBorderState(uiRect::BORDER_DOWN); m_plblClass->GetUiRect().SetGradient(0); m_plblClass->SetForegroundColour(wxColour(0,0,0)); m_plblClass->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleAccuracy = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL8, _("Accuracy"), wxPoint(0,90), wxSize(70,25), 0, _T("ID_M_PLBL8")); + m_ptitleAccuracy = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL8, _("Accuracy"), wxPoint(0,84), wxSize(70,25), 0, _T("ID_M_PLBL8")); m_ptitleAccuracy->SetBorderState(uiRect::BORDER_NONE); m_ptitleAccuracy->GetUiRect().SetGradient(wxWEST); m_ptitleAccuracy->SetForegroundColour(wxColour(255,255,255)); m_ptitleAccuracy->SetBackgroundColour(wxColour(92,122,224)); - m_plblAccuracy = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL18, _("Unknown"), wxPoint(70,90), wxSize(70,25), 0, _T("ID_M_PLBL18")); + m_plblAccuracy = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL18, _("Unknown"), wxPoint(70,84), wxSize(70,25), 0, _T("ID_M_PLBL18")); m_plblAccuracy->SetBorderState(uiRect::BORDER_DOWN); m_plblAccuracy->GetUiRect().SetGradient(0); m_plblAccuracy->SetForegroundColour(wxColour(0,0,0)); m_plblAccuracy->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleVariance = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL9, _("Variance"), wxPoint(0,120), wxSize(70,25), 0, _T("ID_M_PLBL9")); + m_ptitleVariance = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL9, _("Variance"), wxPoint(0,112), wxSize(70,25), 0, _T("ID_M_PLBL9")); m_ptitleVariance->SetBorderState(uiRect::BORDER_NONE); m_ptitleVariance->GetUiRect().SetGradient(wxWEST); m_ptitleVariance->SetForegroundColour(wxColour(255,255,255)); m_ptitleVariance->SetBackgroundColour(wxColour(92,122,224)); - m_plblVariance = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL19, wxEmptyString, wxPoint(70,120), wxSize(70,25), 0, _T("ID_M_PLBL19")); + m_plblVariance = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL19, wxEmptyString, wxPoint(70,112), wxSize(70,25), 0, _T("ID_M_PLBL19")); m_plblVariance->SetBorderState(uiRect::BORDER_DOWN); m_plblVariance->GetUiRect().SetGradient(0); m_plblVariance->SetForegroundColour(wxColour(0,0,0)); m_plblVariance->SetBackgroundColour(wxColour(255,255,255)); - m_ptitlePriority2 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL6, _("Priority 2"), wxPoint(140,120), wxSize(70,25), 0, _T("ID_M_PLBL6")); + m_ptitlePriority2 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL6, _("Priority 2"), wxPoint(140,112), wxSize(70,25), 0, _T("ID_M_PLBL6")); m_ptitlePriority2->SetBorderState(uiRect::BORDER_NONE); m_ptitlePriority2->GetUiRect().SetGradient(wxWEST); m_ptitlePriority2->SetForegroundColour(wxColour(255,255,255)); m_ptitlePriority2->SetBackgroundColour(wxColour(92,122,224)); - m_plblPriority2 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL20, wxEmptyString, wxPoint(210,120), wxSize(70,25), 0, _T("ID_M_PLBL20")); + m_plblPriority2 = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL20, wxEmptyString, wxPoint(210,112), wxSize(70,25), 0, _T("ID_M_PLBL20")); m_plblPriority2->SetBorderState(uiRect::BORDER_DOWN); m_plblPriority2->GetUiRect().SetGradient(0); m_plblPriority2->SetForegroundColour(wxColour(0,0,0)); m_plblPriority2->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleSteps = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL11, _("Steps"), wxPoint(0,150), wxSize(70,25), 0, _T("ID_M_PLBL11")); + m_ptitleSteps = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL11, _("Steps"), wxPoint(0,140), wxSize(70,25), 0, _T("ID_M_PLBL11")); m_ptitleSteps->SetBorderState(uiRect::BORDER_NONE); m_ptitleSteps->GetUiRect().SetGradient(wxWEST); m_ptitleSteps->SetForegroundColour(wxColour(255,255,255)); m_ptitleSteps->SetBackgroundColour(wxColour(92,122,224)); - m_plblSteps = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL21, wxEmptyString, wxPoint(70,150), wxSize(70,25), 0, _T("ID_M_PLBL21")); + m_plblSteps = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL21, wxEmptyString, wxPoint(70,140), wxSize(70,25), 0, _T("ID_M_PLBL21")); m_plblSteps->SetBorderState(uiRect::BORDER_DOWN); m_plblSteps->GetUiRect().SetGradient(0); m_plblSteps->SetForegroundColour(wxColour(0,0,0)); m_plblSteps->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleSource = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL10, _("Source"), wxPoint(140,150), wxSize(70,25), 0, _T("ID_M_PLBL10")); + m_ptitleSource = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL10, _("Source"), wxPoint(140,140), wxSize(70,25), 0, _T("ID_M_PLBL10")); m_ptitleSource->SetBorderState(uiRect::BORDER_NONE); m_ptitleSource->GetUiRect().SetGradient(wxWEST); m_ptitleSource->SetForegroundColour(wxColour(255,255,255)); m_ptitleSource->SetBackgroundColour(wxColour(92,122,224)); - m_plblTitleMaster = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL35, _("Master"), wxPoint(0,180), wxSize(70,25), 0, _T("ID_M_PLBL35")); + m_plblTitleMaster = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL35, _("Master"), wxPoint(0,168), wxSize(70,25), 0, _T("ID_M_PLBL35")); m_plblTitleMaster->SetBorderState(uiRect::BORDER_NONE); m_plblTitleMaster->GetUiRect().SetGradient(wxWEST); m_plblTitleMaster->SetForegroundColour(wxColour(255,255,255)); m_plblTitleMaster->SetBackgroundColour(wxColour(92,122,224)); - m_plblMasterId = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL39, wxEmptyString, wxPoint(70,180), wxSize(210,25), 0, _T("ID_M_PLBL39")); + m_plblMasterId = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL39, wxEmptyString, wxPoint(70,168), wxSize(210,25), 0, _T("ID_M_PLBL39")); m_plblMasterId->SetBorderState(uiRect::BORDER_DOWN); m_plblMasterId->GetUiRect().SetGradient(0); m_plblMasterId->SetForegroundColour(wxColour(0,0,0)); m_plblMasterId->SetBackgroundColour(wxColour(255,255,255)); - m_plblSource = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL22, wxEmptyString, wxPoint(210,150), wxSize(70,25), 0, _T("ID_M_PLBL22")); + m_plblSource = new wmLabel(m_ppnlAnnouncements, ID_M_PLBL22, wxEmptyString, wxPoint(210,140), wxSize(70,25), 0, _T("ID_M_PLBL22")); m_plblSource->SetBorderState(uiRect::BORDER_DOWN); m_plblSource->GetUiRect().SetGradient(0); m_plblSource->SetForegroundColour(wxColour(0,0,0)); m_plblSource->SetBackgroundColour(wxColour(255,255,255)); - m_ppnlAnnounceFlags = new pnlFlags(m_ppnlAnnouncements, ID_PANEL9, wxPoint(0,210), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL9")); + m_ppnlAnnounceFlags = new pnlFlags(m_ppnlAnnouncements, ID_PANEL9, wxPoint(0,196), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL9")); m_pswp = new wmSwitcherPanel(m_ppnlInfo, ID_M_PSWP1, wxPoint(295,5), wxSize(280,280), wmSwitcherPanel::STYLE_NOSWIPE|wmSwitcherPanel::STYLE_NOANIMATION, _T("ID_M_PSWP1")); m_pswp->SetPageNameStyle(0); m_pswp->SetBackgroundColour(wxColour(0,0,0)); @@ -368,28 +389,28 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_ptitleSync->SetBackgroundColour(wxColour(98,219,101)); wxFont m_ptitleSyncFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); m_ptitleSync->SetFont(m_ptitleSyncFont); - m_ptitleSyncRate = new wmLabel(m_ppnlSync, ID_M_PLBL31, _("Rate"), wxPoint(0,30), wxSize(50,25), 0, _T("ID_M_PLBL31")); + m_ptitleSyncRate = new wmLabel(m_ppnlSync, ID_M_PLBL31, _("Rate"), wxPoint(0,28), wxSize(50,25), 0, _T("ID_M_PLBL31")); m_ptitleSyncRate->SetBorderState(uiRect::BORDER_NONE); m_ptitleSyncRate->GetUiRect().SetGradient(wxWEST); m_ptitleSyncRate->SetForegroundColour(wxColour(255,255,255)); m_ptitleSyncRate->SetBackgroundColour(wxColour(92,122,224)); - m_plblSyncRate = new wmLabel(m_ppnlSync, ID_M_PLBL32, wxEmptyString, wxPoint(50,30), wxSize(50,25), 0, _T("ID_M_PLBL32")); + m_plblSyncRate = new wmLabel(m_ppnlSync, ID_M_PLBL32, wxEmptyString, wxPoint(50,28), wxSize(50,25), 0, _T("ID_M_PLBL32")); m_plblSyncRate->SetBorderState(uiRect::BORDER_DOWN); m_plblSyncRate->GetUiRect().SetGradient(0); m_plblSyncRate->SetForegroundColour(wxColour(0,0,0)); m_plblSyncRate->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleSyncCount = new wmLabel(m_ppnlSync, ID_M_PLBL33, _("Count"), wxPoint(100,30), wxSize(50,25), 0, _T("ID_M_PLBL33")); + m_ptitleSyncCount = new wmLabel(m_ppnlSync, ID_M_PLBL33, _("Count"), wxPoint(100,28), wxSize(50,25), 0, _T("ID_M_PLBL33")); m_ptitleSyncCount->SetBorderState(uiRect::BORDER_NONE); m_ptitleSyncCount->GetUiRect().SetGradient(wxWEST); m_ptitleSyncCount->SetForegroundColour(wxColour(255,255,255)); m_ptitleSyncCount->SetBackgroundColour(wxColour(92,122,224)); - m_plblSyncCount = new wmLabel(m_ppnlSync, ID_M_PLBL34, wxEmptyString, wxPoint(150,30), wxSize(130,25), 0, _T("ID_M_PLBL34")); + m_plblSyncCount = new wmLabel(m_ppnlSync, ID_M_PLBL34, wxEmptyString, wxPoint(150,28), wxSize(130,25), 0, _T("ID_M_PLBL34")); m_plblSyncCount->SetBorderState(uiRect::BORDER_DOWN); m_plblSyncCount->GetUiRect().SetGradient(0); m_plblSyncCount->SetForegroundColour(wxColour(0,0,0)); m_plblSyncCount->SetBackgroundColour(wxColour(255,255,255)); - m_ppnlSyncFlags = new pnlFlags(m_ppnlSync, ID_PANEL10, wxPoint(0,60), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL10")); - m_ppnlFollowUp = new wxPanel(m_ppnlMaster, ID_PANEL3, wxPoint(0,135), wxSize(280,125), wxTAB_TRAVERSAL, _T("ID_PANEL3")); + m_ppnlSyncFlags = new pnlFlags(m_ppnlSync, ID_PANEL10, wxPoint(0,56), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL10")); + m_ppnlFollowUp = new wxPanel(m_ppnlMaster, ID_PANEL3, wxPoint(0,130), wxSize(280,125), wxTAB_TRAVERSAL, _T("ID_PANEL3")); m_ppnlFollowUp->SetBackgroundColour(wxColour(0,0,0)); m_ptitleFollowUp = new wmLabel(m_ppnlFollowUp, ID_M_PLBL28, _("Follow Up"), wxPoint(0,0), wxSize(280,25), 0, _T("ID_M_PLBL28")); m_ptitleFollowUp->SetBorderState(uiRect::BORDER_NONE); @@ -398,27 +419,27 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_ptitleFollowUp->SetBackgroundColour(wxColour(98,219,101)); wxFont m_ptitleFollowUpFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); m_ptitleFollowUp->SetFont(m_ptitleFollowUpFont); - m_ptitleFollowRate = new wmLabel(m_ppnlFollowUp, ID_M_PLBL29, _("Rate"), wxPoint(0,30), wxSize(50,25), 0, _T("ID_M_PLBL29")); + m_ptitleFollowRate = new wmLabel(m_ppnlFollowUp, ID_M_PLBL29, _("Rate"), wxPoint(0,28), wxSize(50,25), 0, _T("ID_M_PLBL29")); m_ptitleFollowRate->SetBorderState(uiRect::BORDER_NONE); m_ptitleFollowRate->GetUiRect().SetGradient(wxWEST); m_ptitleFollowRate->SetForegroundColour(wxColour(255,255,255)); m_ptitleFollowRate->SetBackgroundColour(wxColour(92,122,224)); - m_plblFollowRate = new wmLabel(m_ppnlFollowUp, ID_M_PLBL36, wxEmptyString, wxPoint(50,30), wxSize(50,25), 0, _T("ID_M_PLBL36")); + m_plblFollowRate = new wmLabel(m_ppnlFollowUp, ID_M_PLBL36, wxEmptyString, wxPoint(50,28), wxSize(50,25), 0, _T("ID_M_PLBL36")); m_plblFollowRate->SetBorderState(uiRect::BORDER_DOWN); m_plblFollowRate->GetUiRect().SetGradient(0); m_plblFollowRate->SetForegroundColour(wxColour(0,0,0)); m_plblFollowRate->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleFollowCount = new wmLabel(m_ppnlFollowUp, ID_M_PLBL37, _("Count"), wxPoint(100,30), wxSize(50,25), 0, _T("ID_M_PLBL37")); + m_ptitleFollowCount = new wmLabel(m_ppnlFollowUp, ID_M_PLBL37, _("Count"), wxPoint(100,28), wxSize(50,25), 0, _T("ID_M_PLBL37")); m_ptitleFollowCount->SetBorderState(uiRect::BORDER_NONE); m_ptitleFollowCount->GetUiRect().SetGradient(wxWEST); m_ptitleFollowCount->SetForegroundColour(wxColour(255,255,255)); m_ptitleFollowCount->SetBackgroundColour(wxColour(92,122,224)); - m_plblFollowCount = new wmLabel(m_ppnlFollowUp, ID_M_PLBL38, wxEmptyString, wxPoint(150,30), wxSize(130,25), 0, _T("ID_M_PLBL38")); + m_plblFollowCount = new wmLabel(m_ppnlFollowUp, ID_M_PLBL38, wxEmptyString, wxPoint(150,28), wxSize(130,25), 0, _T("ID_M_PLBL38")); m_plblFollowCount->SetBorderState(uiRect::BORDER_DOWN); m_plblFollowCount->GetUiRect().SetGradient(0); m_plblFollowCount->SetForegroundColour(wxColour(0,0,0)); m_plblFollowCount->SetBackgroundColour(wxColour(255,255,255)); - m_ppnlFollowFlags = new pnlFlags(m_ppnlFollowUp, ID_PANEL11, wxPoint(0,60), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL11")); + m_ppnlFollowFlags = new pnlFlags(m_ppnlFollowUp, ID_PANEL11, wxPoint(0,56), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL11")); m_ppnlSlave = new wxPanel(m_pswp, ID_PANEL6, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL6")); m_ppnlSlave->SetBackgroundColour(wxColour(0,0,0)); m_ppnlRequests = new wxPanel(m_ppnlSlave, ID_PANEL4, wxPoint(0,0), wxSize(280,165), wxTAB_TRAVERSAL, _T("ID_PANEL4")); @@ -430,38 +451,38 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_ptitleDelay->SetBackgroundColour(wxColour(98,219,101)); wxFont m_ptitleDelayFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); m_ptitleDelay->SetFont(m_ptitleDelayFont); - m_ptitleDelayRate = new wmLabel(m_ppnlRequests, ID_M_PLBL41, _("Rate"), wxPoint(0,30), wxSize(70,25), 0, _T("ID_M_PLBL41")); + m_ptitleDelayRate = new wmLabel(m_ppnlRequests, ID_M_PLBL41, _("Rate"), wxPoint(0,28), wxSize(70,25), 0, _T("ID_M_PLBL41")); m_ptitleDelayRate->SetBorderState(uiRect::BORDER_NONE); m_ptitleDelayRate->GetUiRect().SetGradient(wxWEST); m_ptitleDelayRate->SetForegroundColour(wxColour(255,255,255)); m_ptitleDelayRate->SetBackgroundColour(wxColour(92,122,224)); - m_plblDelayRate = new wmLabel(m_ppnlRequests, ID_M_PLBL42, wxEmptyString, wxPoint(70,30), wxSize(70,25), 0, _T("ID_M_PLBL42")); + m_plblDelayRate = new wmLabel(m_ppnlRequests, ID_M_PLBL42, wxEmptyString, wxPoint(70,28), wxSize(70,25), 0, _T("ID_M_PLBL42")); m_plblDelayRate->SetBorderState(uiRect::BORDER_DOWN); m_plblDelayRate->GetUiRect().SetGradient(0); m_plblDelayRate->SetForegroundColour(wxColour(0,0,0)); m_plblDelayRate->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleDelayCount = new wmLabel(m_ppnlRequests, ID_M_PLBL43, _("Count"), wxPoint(140,30), wxSize(70,25), 0, _T("ID_M_PLBL43")); + m_ptitleDelayCount = new wmLabel(m_ppnlRequests, ID_M_PLBL43, _("Count"), wxPoint(140,28), wxSize(70,25), 0, _T("ID_M_PLBL43")); m_ptitleDelayCount->SetBorderState(uiRect::BORDER_NONE); m_ptitleDelayCount->GetUiRect().SetGradient(wxWEST); m_ptitleDelayCount->SetForegroundColour(wxColour(255,255,255)); m_ptitleDelayCount->SetBackgroundColour(wxColour(92,122,224)); - m_plblDelayCount = new wmLabel(m_ppnlRequests, ID_M_PLBL44, wxEmptyString, wxPoint(210,30), wxSize(70,25), 0, _T("ID_M_PLBL44")); + m_plblDelayCount = new wmLabel(m_ppnlRequests, ID_M_PLBL44, wxEmptyString, wxPoint(210,28), wxSize(70,25), 0, _T("ID_M_PLBL44")); m_plblDelayCount->SetBorderState(uiRect::BORDER_DOWN); m_plblDelayCount->GetUiRect().SetGradient(0); m_plblDelayCount->SetForegroundColour(wxColour(0,0,0)); m_plblDelayCount->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleDelayMech = new wmLabel(m_ppnlRequests, ID_M_PLBL46, _("Mechanism"), wxPoint(0,60), wxSize(70,25), 0, _T("ID_M_PLBL46")); + m_ptitleDelayMech = new wmLabel(m_ppnlRequests, ID_M_PLBL46, _("Mechanism"), wxPoint(0,56), wxSize(70,25), 0, _T("ID_M_PLBL46")); m_ptitleDelayMech->SetBorderState(uiRect::BORDER_NONE); m_ptitleDelayMech->GetUiRect().SetGradient(wxWEST); m_ptitleDelayMech->SetForegroundColour(wxColour(255,255,255)); m_ptitleDelayMech->SetBackgroundColour(wxColour(92,122,224)); - m_plblDelayMech = new wmLabel(m_ppnlRequests, ID_M_PLBL47, wxEmptyString, wxPoint(70,60), wxSize(210,25), 0, _T("ID_M_PLBL47")); + m_plblDelayMech = new wmLabel(m_ppnlRequests, ID_M_PLBL47, wxEmptyString, wxPoint(70,56), wxSize(210,25), 0, _T("ID_M_PLBL47")); m_plblDelayMech->SetBorderState(uiRect::BORDER_DOWN); m_plblDelayMech->GetUiRect().SetGradient(0); m_plblDelayMech->SetForegroundColour(wxColour(0,0,0)); m_plblDelayMech->SetBackgroundColour(wxColour(255,255,255)); - m_ppnlRequestFlags = new pnlFlags(m_ppnlRequests, ID_PANEL13, wxPoint(0,90), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL13")); - m_ppnlResponses = new wxPanel(m_ppnlSlave, ID_PANEL7, wxPoint(0,160), wxSize(280,124), wxTAB_TRAVERSAL, _T("ID_PANEL7")); + m_ppnlRequestFlags = new pnlFlags(m_ppnlRequests, ID_PANEL13, wxPoint(0,84), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL13")); + m_ppnlResponses = new wxPanel(m_ppnlSlave, ID_PANEL7, wxPoint(0,152), wxSize(280,124), wxTAB_TRAVERSAL, _T("ID_PANEL7")); m_ppnlResponses->SetBackgroundColour(wxColour(0,0,0)); m_ptitleDelayResponses = new wmLabel(m_ppnlResponses, ID_M_PLBL48, _("Delay Responses Received"), wxPoint(0,0), wxSize(280,25), 0, _T("ID_M_PLBL48")); m_ptitleDelayResponses->SetBorderState(uiRect::BORDER_NONE); @@ -470,30 +491,30 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_ptitleDelayResponses->SetBackgroundColour(wxColour(98,219,101)); wxFont m_ptitleDelayResponsesFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); m_ptitleDelayResponses->SetFont(m_ptitleDelayResponsesFont); - m_ptitleResponseRate = new wmLabel(m_ppnlResponses, ID_M_PLBL49, _("Rate"), wxPoint(0,30), wxSize(70,25), 0, _T("ID_M_PLBL49")); + m_ptitleResponseRate = new wmLabel(m_ppnlResponses, ID_M_PLBL49, _("Rate"), wxPoint(0,28), wxSize(70,25), 0, _T("ID_M_PLBL49")); m_ptitleResponseRate->SetBorderState(uiRect::BORDER_NONE); m_ptitleResponseRate->GetUiRect().SetGradient(wxWEST); m_ptitleResponseRate->SetForegroundColour(wxColour(255,255,255)); m_ptitleResponseRate->SetBackgroundColour(wxColour(92,122,224)); - m_plblResponseRate = new wmLabel(m_ppnlResponses, ID_M_PLBL50, wxEmptyString, wxPoint(70,30), wxSize(70,25), 0, _T("ID_M_PLBL50")); + m_plblResponseRate = new wmLabel(m_ppnlResponses, ID_M_PLBL50, wxEmptyString, wxPoint(70,28), wxSize(70,25), 0, _T("ID_M_PLBL50")); m_plblResponseRate->SetBorderState(uiRect::BORDER_DOWN); m_plblResponseRate->GetUiRect().SetGradient(0); m_plblResponseRate->SetForegroundColour(wxColour(0,0,0)); m_plblResponseRate->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleResponseCount = new wmLabel(m_ppnlResponses, ID_M_PLBL51, _("Count"), wxPoint(140,30), wxSize(70,25), 0, _T("ID_M_PLBL51")); + m_ptitleResponseCount = new wmLabel(m_ppnlResponses, ID_M_PLBL51, _("Count"), wxPoint(140,28), wxSize(70,25), 0, _T("ID_M_PLBL51")); m_ptitleResponseCount->SetBorderState(uiRect::BORDER_NONE); m_ptitleResponseCount->GetUiRect().SetGradient(wxWEST); m_ptitleResponseCount->SetForegroundColour(wxColour(255,255,255)); m_ptitleResponseCount->SetBackgroundColour(wxColour(92,122,224)); - m_plblResponseCount = new wmLabel(m_ppnlResponses, ID_M_PLBL52, wxEmptyString, wxPoint(210,30), wxSize(70,25), 0, _T("ID_M_PLBL52")); + m_plblResponseCount = new wmLabel(m_ppnlResponses, ID_M_PLBL52, wxEmptyString, wxPoint(210,28), wxSize(70,25), 0, _T("ID_M_PLBL52")); m_plblResponseCount->SetBorderState(uiRect::BORDER_DOWN); m_plblResponseCount->GetUiRect().SetGradient(0); m_plblResponseCount->SetForegroundColour(wxColour(0,0,0)); m_plblResponseCount->SetBackgroundColour(wxColour(255,255,255)); - m_ppnlResponseFlags = new pnlFlags(m_ppnlResponses, ID_PANEL12, wxPoint(0,60), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL12")); + m_ppnlResponseFlags = new pnlFlags(m_ppnlResponses, ID_PANEL12, wxPoint(0,56), wxSize(280,64), wxTAB_TRAVERSAL, _T("ID_PANEL12")); m_pswp->AddPage(m_ppnlMaster, _("Master"), false); m_pswp->AddPage(m_ppnlSlave, _("Slave"), false); - m_ppnlLocal = new wxPanel(m_ppnlInfo, ID_PANEL8, wxPoint(295,290), wxSize(280,175), wxTAB_TRAVERSAL, _T("ID_PANEL8")); + m_ppnlLocal = new wxPanel(m_ppnlInfo, ID_PANEL8, wxPoint(295,280), wxSize(280,205), wxTAB_TRAVERSAL, _T("ID_PANEL8")); m_ppnlLocal->SetBackgroundColour(wxColour(0,0,0)); m_ptitlePam = new wmLabel(m_ppnlLocal, ID_M_PLBL54, _("PAM"), wxPoint(0,0), wxSize(280,25), 0, _T("ID_M_PLBL54")); m_ptitlePam->SetBorderState(uiRect::BORDER_NONE); @@ -502,56 +523,68 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_ptitlePam->SetBackgroundColour(wxColour(217,138,100)); wxFont m_ptitlePamFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); m_ptitlePam->SetFont(m_ptitlePamFont); - m_ptitleTime = new wmLabel(m_ppnlLocal, ID_M_PLBL55, _("Time"), wxPoint(0,30), wxSize(50,25), 0, _T("ID_M_PLBL55")); + m_ptitleTime = new wmLabel(m_ppnlLocal, ID_M_PLBL55, _("Time"), wxPoint(0,27), wxSize(50,25), 0, _T("ID_M_PLBL55")); m_ptitleTime->SetBorderState(uiRect::BORDER_NONE); m_ptitleTime->GetUiRect().SetGradient(wxWEST); m_ptitleTime->SetForegroundColour(wxColour(255,255,255)); m_ptitleTime->SetBackgroundColour(wxColour(92,122,224)); - m_plblTime = new wmLabel(m_ppnlLocal, ID_M_PLBL56, wxEmptyString, wxPoint(50,30), wxSize(230,25), 0, _T("ID_M_PLBL56")); + m_plblTime = new wmLabel(m_ppnlLocal, ID_M_PLBL56, wxEmptyString, wxPoint(50,27), wxSize(230,25), 0, _T("ID_M_PLBL56")); m_plblTime->SetBorderState(uiRect::BORDER_DOWN); m_plblTime->GetUiRect().SetGradient(0); m_plblTime->SetForegroundColour(wxColour(0,0,0)); m_plblTime->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleOffsetAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL57, L"Offset: x\u0304", wxPoint(0,60), wxSize(100,25), 0, _T("ID_M_PLBL57")); + m_ptitleOffsetAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL57, _("Offset: Average"), wxPoint(0,56), wxSize(100,25), 0, _T("ID_M_PLBL57")); m_ptitleOffsetAverage->SetBorderState(uiRect::BORDER_NONE); m_ptitleOffsetAverage->GetUiRect().SetGradient(wxWEST); m_ptitleOffsetAverage->SetForegroundColour(wxColour(255,255,255)); m_ptitleOffsetAverage->SetBackgroundColour(wxColour(92,122,224)); - m_plblOffsetAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL61, wxEmptyString, wxPoint(100,60), wxSize(180,25), 0, _T("ID_M_PLBL61")); + m_plblOffsetAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL61, wxEmptyString, wxPoint(100,56), wxSize(180,25), 0, _T("ID_M_PLBL61")); m_plblOffsetAverage->SetBorderState(uiRect::BORDER_DOWN); m_plblOffsetAverage->GetUiRect().SetGradient(0); m_plblOffsetAverage->SetForegroundColour(wxColour(0,0,0)); m_plblOffsetAverage->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleOffsetRange = new wmLabel(m_ppnlLocal, ID_M_PLBL58, L"Offset: \u03c3 \u03c3\u2093\u0304", wxPoint(0,90), wxSize(100,25), 0, _T("ID_M_PLBL58")); + m_ptitleOffsetRange = new wmLabel(m_ppnlLocal, ID_M_PLBL58, _("Offset: Range"), wxPoint(0,84), wxSize(100,25), 0, _T("ID_M_PLBL58")); m_ptitleOffsetRange->SetBorderState(uiRect::BORDER_NONE); m_ptitleOffsetRange->GetUiRect().SetGradient(wxWEST); m_ptitleOffsetRange->SetForegroundColour(wxColour(255,255,255)); m_ptitleOffsetRange->SetBackgroundColour(wxColour(92,122,224)); - m_plblOffsetRange = new wmLabel(m_ppnlLocal, ID_M_PLBL62, wxEmptyString, wxPoint(100,90), wxSize(180,25), 0, _T("ID_M_PLBL62")); + m_plblOffsetRange = new wmLabel(m_ppnlLocal, ID_M_PLBL62, wxEmptyString, wxPoint(100,84), wxSize(180,25), 0, _T("ID_M_PLBL62")); m_plblOffsetRange->SetBorderState(uiRect::BORDER_DOWN); m_plblOffsetRange->GetUiRect().SetGradient(0); m_plblOffsetRange->SetForegroundColour(wxColour(0,0,0)); m_plblOffsetRange->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleDelayAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL59, L"Delay: x\u0304", wxPoint(0,120), wxSize(100,25), 0, _T("ID_M_PLBL59")); + m_ptitleDelayAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL59, _("Delay: Average"), wxPoint(0,112), wxSize(100,25), 0, _T("ID_M_PLBL59")); m_ptitleDelayAverage->SetBorderState(uiRect::BORDER_NONE); m_ptitleDelayAverage->GetUiRect().SetGradient(wxWEST); m_ptitleDelayAverage->SetForegroundColour(wxColour(255,255,255)); m_ptitleDelayAverage->SetBackgroundColour(wxColour(92,122,224)); - m_plblDelayAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL63, wxEmptyString, wxPoint(100,120), wxSize(180,25), 0, _T("ID_M_PLBL63")); + m_plblDelayAverage = new wmLabel(m_ppnlLocal, ID_M_PLBL63, wxEmptyString, wxPoint(100,112), wxSize(180,25), 0, _T("ID_M_PLBL63")); m_plblDelayAverage->SetBorderState(uiRect::BORDER_DOWN); m_plblDelayAverage->GetUiRect().SetGradient(0); m_plblDelayAverage->SetForegroundColour(wxColour(0,0,0)); m_plblDelayAverage->SetBackgroundColour(wxColour(255,255,255)); - m_ptitleDelayRange = new wmLabel(m_ppnlLocal, ID_M_PLBL60, L"Delay: \u03c3 \u03c3\u2093\u0304", wxPoint(0,150), wxSize(100,25), 0, _T("ID_M_PLBL60")); + m_ptitleDelayRange = new wmLabel(m_ppnlLocal, ID_M_PLBL60, _("Delay: Range"), wxPoint(0,140), wxSize(100,25), 0, _T("ID_M_PLBL60")); m_ptitleDelayRange->SetBorderState(uiRect::BORDER_NONE); m_ptitleDelayRange->GetUiRect().SetGradient(wxWEST); m_ptitleDelayRange->SetForegroundColour(wxColour(255,255,255)); m_ptitleDelayRange->SetBackgroundColour(wxColour(92,122,224)); - m_plblDelayRange = new wmLabel(m_ppnlLocal, ID_M_PLBL64, wxEmptyString, wxPoint(100,150), wxSize(180,25), 0, _T("ID_M_PLBL64")); + m_plblDelayRange = new wmLabel(m_ppnlLocal, ID_M_PLBL64, wxEmptyString, wxPoint(100,140), wxSize(180,25), 0, _T("ID_M_PLBL64")); m_plblDelayRange->SetBorderState(uiRect::BORDER_DOWN); m_plblDelayRange->GetUiRect().SetGradient(0); m_plblDelayRange->SetForegroundColour(wxColour(0,0,0)); m_plblDelayRange->SetBackgroundColour(wxColour(255,255,255)); + m_pbtnGraphs = new wmButton(m_ppnlLocal, ID_M_PBTN29, _("Graphs"), wxPoint(5,168), wxSize(130,30), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN29")); + m_pbtnGraphs->SetForegroundColour(wxColour(0,128,0)); + m_pbtnGraphs->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_pbtnGraphsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_pbtnGraphs->SetFont(m_pbtnGraphsFont); + m_pbtnGraphs->SetColourSelected(wxColour(wxT("#800000"))); + m_pbtnHistogram = new wmButton(m_ppnlLocal, ID_M_PBTN5, _("Histogram"), wxPoint(145,168), wxSize(130,30), wmButton::STYLE_NORMAL, wxDefaultValidator, _T("ID_M_PBTN5")); + m_pbtnHistogram->SetForegroundColour(wxColour(0,128,0)); + m_pbtnHistogram->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_pbtnHistogramFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_pbtnHistogram->SetFont(m_pbtnHistogramFont); + m_pbtnHistogram->SetColourSelected(wxColour(wxT("#800000"))); m_ppnlGraphs = new wxPanel(m_pSwpMain, ID_PANEL15, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL15")); m_ppnlGraphs->SetBackgroundColour(wxColour(0,0,0)); m_plblGraphTitle = new wmLabel(m_ppnlGraphs, ID_M_PLBL45, wxEmptyString, wxPoint(0,0), wxSize(800,30), 0, _T("ID_M_PLBL45")); @@ -561,63 +594,63 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_plblGraphTitle->SetBackgroundColour(wxColour(91,149,57)); wxFont m_plblGraphTitleFont(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Arial"),wxFONTENCODING_DEFAULT); m_plblGraphTitle->SetFont(m_plblGraphTitleFont); - m_pLbl5 = new wmLabel(m_ppnlGraphs, ID_M_PLBL69, "y=", wxPoint(0,30), wxSize(20,30), 0, _T("ID_M_PLBL69")); + m_pLbl5 = new wmLabel(m_ppnlGraphs, ID_M_PLBL69, _("Current:"), wxPoint(0,30), wxSize(50,30), 0, _T("ID_M_PLBL69")); m_pLbl5->SetBorderState(uiRect::BORDER_NONE); m_pLbl5->GetUiRect().SetGradient(0); m_pLbl5->SetForegroundColour(wxColour(255,255,255)); m_pLbl5->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl5Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl5->SetFont(m_pLbl5Font); - m_plblCurrent = new wmLabel(m_ppnlGraphs, ID_M_PLBL74, wxEmptyString, wxPoint(20,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL74")); + m_plblCurrent = new wmLabel(m_ppnlGraphs, ID_M_PLBL74, wxEmptyString, wxPoint(50,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL74")); m_plblCurrent->SetBorderState(uiRect::BORDER_NONE); m_plblCurrent->GetUiRect().SetGradient(0); m_plblCurrent->SetForegroundColour(wxColour(186,254,167)); m_plblCurrent->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblCurrentFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblCurrent->SetFont(m_plblCurrentFont); - m_pLbl6 = new wmLabel(m_ppnlGraphs, ID_M_PLBL70, L"y\u0304=", wxPoint(140,30), wxSize(20,30), 0, _T("ID_M_PLBL70")); + m_pLbl6 = new wmLabel(m_ppnlGraphs, ID_M_PLBL70, _("Mean:"), wxPoint(140,30), wxSize(50,30), 0, _T("ID_M_PLBL70")); m_pLbl6->SetBorderState(uiRect::BORDER_NONE); m_pLbl6->GetUiRect().SetGradient(0); m_pLbl6->SetForegroundColour(wxColour(255,255,255)); m_pLbl6->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl6Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl6->SetFont(m_pLbl6Font); - m_plblMean = new wmLabel(m_ppnlGraphs, ID_M_PLBL75, wxEmptyString, wxPoint(160,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL75")); + m_plblMean = new wmLabel(m_ppnlGraphs, ID_M_PLBL75, wxEmptyString, wxPoint(190,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL75")); m_plblMean->SetBorderState(uiRect::BORDER_NONE); m_plblMean->GetUiRect().SetGradient(0); m_plblMean->SetForegroundColour(wxColour(186,254,167)); m_plblMean->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblMeanFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblMean->SetFont(m_plblMeanFont); - m_pLbl7 = new wmLabel(m_ppnlGraphs, ID_M_PLBL71, L"\u03c3=", wxPoint(280,30), wxSize(20,30), 0, _T("ID_M_PLBL71")); + m_pLbl7 = new wmLabel(m_ppnlGraphs, ID_M_PLBL71, _("SD:"), wxPoint(280,30), wxSize(50,30), 0, _T("ID_M_PLBL71")); m_pLbl7->SetBorderState(uiRect::BORDER_NONE); m_pLbl7->GetUiRect().SetGradient(0); m_pLbl7->SetForegroundColour(wxColour(255,255,255)); m_pLbl7->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl7Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl7->SetFont(m_pLbl7Font); - m_plblDeviation = new wmLabel(m_ppnlGraphs, ID_M_PLBL76, wxEmptyString, wxPoint(300,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL76")); + m_plblDeviation = new wmLabel(m_ppnlGraphs, ID_M_PLBL76, wxEmptyString, wxPoint(330,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL76")); m_plblDeviation->SetBorderState(uiRect::BORDER_NONE); m_plblDeviation->GetUiRect().SetGradient(0); m_plblDeviation->SetForegroundColour(wxColour(186,254,167)); m_plblDeviation->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblDeviationFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblDeviation->SetFont(m_plblDeviationFont); - m_pLbl8 = new wmLabel(m_ppnlGraphs, ID_M_PLBL72, L"\u03b2\u0302=", wxPoint(420,30), wxSize(20,30), 0, _T("ID_M_PLBL72")); + m_pLbl8 = new wmLabel(m_ppnlGraphs, ID_M_PLBL72, _("Slope:"), wxPoint(420,30), wxSize(50,30), 0, _T("ID_M_PLBL72")); m_pLbl8->SetBorderState(uiRect::BORDER_NONE); m_pLbl8->GetUiRect().SetGradient(0); m_pLbl8->SetForegroundColour(wxColour(255,255,255)); m_pLbl8->SetBackgroundColour(wxColour(0,0,0)); wxFont m_pLbl8Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl8->SetFont(m_pLbl8Font); - m_plblSlope = new wmLabel(m_ppnlGraphs, ID_M_PLBL77, wxEmptyString, wxPoint(440,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL77")); + m_plblSlope = new wmLabel(m_ppnlGraphs, ID_M_PLBL77, wxEmptyString, wxPoint(470,30), wxSize(80,30), wxALIGN_LEFT, _T("ID_M_PLBL77")); m_plblSlope->SetBorderState(uiRect::BORDER_NONE); m_plblSlope->GetUiRect().SetGradient(0); m_plblSlope->SetForegroundColour(wxColour(186,254,167)); m_plblSlope->SetBackgroundColour(wxColour(0,0,0)); wxFont m_plblSlopeFont(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_plblSlope->SetFont(m_plblSlopeFont); - m_pLbl9 = new wmLabel(m_ppnlGraphs, ID_M_PLBL73, L"\u03b1\u0302+\u03b2\u0302x=", wxPoint(560,30), wxSize(50,30), 0, _T("ID_M_PLBL73")); + m_pLbl9 = new wmLabel(m_ppnlGraphs, ID_M_PLBL73, _("Est:"), wxPoint(560,30), wxSize(50,30), 0, _T("ID_M_PLBL73")); m_pLbl9->SetBorderState(uiRect::BORDER_NONE); m_pLbl9->GetUiRect().SetGradient(0); m_pLbl9->SetForegroundColour(wxColour(255,255,255)); @@ -641,8 +674,18 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_pLbl4->SetFont(m_pLbl4Font); m_plstGraphData = new wmList(m_ppnlGraphs, ID_M_PLST5, wxPoint(70,443), wxSize(120,34), wmList::STYLE_SELECT, 0, wxSize(-1,30), 2, wxSize(-1,-1)); m_plstGraphData->SetBackgroundColour(wxColour(0,0,0)); - m_pbtnGraphClear = new wmButton(m_ppnlGraphs, ID_M_PBTN3, _("Clear All"), wxPoint(600,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN3")); - m_pbtnGraphOptions = new wmButton(m_ppnlGraphs, ID_M_PBTN4, _("Menu"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN4")); + m_pbtnClearStats = new wmButton(m_ppnlGraphs, ID_M_PBTN8, _("Clear All"), wxPoint(498,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN8")); + m_pbtnGraphClear = new wmButton(m_ppnlGraphs, ID_M_PBTN3, _("Clear All"), wxPoint(570,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN3")); + m_pbtnGraphHisto = new wmButton(m_ppnlGraphs, ID_M_PBTN7, _("Histo"), wxPoint(649,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN7")); + m_pbtnGraphHisto->SetForegroundColour(wxColour(0,128,0)); + m_pbtnGraphHisto->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_pbtnGraphHistoFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_pbtnGraphHisto->SetFont(m_pbtnGraphHistoFont); + m_pbtnGraphOptions = new wmButton(m_ppnlGraphs, ID_M_PBTN4, _("Info"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN4")); + m_pbtnGraphOptions->SetForegroundColour(wxColour(0,128,0)); + m_pbtnGraphOptions->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_pbtnGraphOptionsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_pbtnGraphOptions->SetFont(m_pbtnGraphOptionsFont); m_ppnlHistograms = new wxPanel(m_pSwpMain, ID_PANEL16, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL16")); m_ppnlHistograms->SetBackgroundColour(wxColour(0,0,0)); m_plblHistogramTitle = new wmLabel(m_ppnlHistograms, ID_M_PLBL53, wxEmptyString, wxPoint(0,0), wxSize(800,30), 0, _T("ID_M_PLBL53")); @@ -662,43 +705,66 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_pLbl3->SetFont(m_pLbl3Font); m_plstHistogramData = new wmList(m_ppnlHistograms, ID_M_PLST4, wxPoint(70,443), wxSize(120,34), wmList::STYLE_SELECT, 0, wxSize(-1,30), 2, wxSize(-1,-1)); m_plstHistogramData->SetBackgroundColour(wxColour(0,0,0)); - m_pLbl1 = new wmLabel(m_ppnlHistograms, ID_M_PLBL65, _("Granularity"), wxPoint(200,445), wxSize(60,30), 0, _T("ID_M_PLBL65")); + m_pLbl1 = new wmLabel(m_ppnlHistograms, ID_M_PLBL65, _("Granularity"), wxPoint(195,445), wxSize(60,30), 0, _T("ID_M_PLBL65")); m_pLbl1->SetBorderState(uiRect::BORDER_NONE); m_pLbl1->GetUiRect().SetGradient(0); m_pLbl1->SetForegroundColour(wxColour(255,255,255)); m_pLbl1->SetBackgroundColour(wxColour(91,149,57)); wxFont m_pLbl1Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl1->SetFont(m_pLbl1Font); - m_plstHistogramGranularity = new wmList(m_ppnlHistograms, ID_M_PLST2, wxPoint(260,443), wxSize(120,34), 0, 0, wxSize(-1,30), 3, wxSize(-1,-1)); + m_plstHistogramGranularity = new wmList(m_ppnlHistograms, ID_M_PLST2, wxPoint(255,443), wxSize(120,34), 0, 0, wxSize(-1,30), 3, wxSize(-1,-1)); m_plstHistogramGranularity->SetBackgroundColour(wxColour(0,0,0)); - m_pLbl2 = new wmLabel(m_ppnlHistograms, ID_M_PLBL66, _("Resolution"), wxPoint(400,445), wxSize(60,30), 0, _T("ID_M_PLBL66")); + m_pLbl2 = new wmLabel(m_ppnlHistograms, ID_M_PLBL66, _("Resolution"), wxPoint(380,445), wxSize(60,30), 0, _T("ID_M_PLBL66")); m_pLbl2->SetBorderState(uiRect::BORDER_NONE); m_pLbl2->GetUiRect().SetGradient(0); m_pLbl2->SetForegroundColour(wxColour(255,255,255)); m_pLbl2->SetBackgroundColour(wxColour(91,149,57)); wxFont m_pLbl2Font(8,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL,false,_T("Tahoma"),wxFONTENCODING_DEFAULT); m_pLbl2->SetFont(m_pLbl2Font); - m_plstHistogramResolution = new wmList(m_ppnlHistograms, ID_M_PLST3, wxPoint(460,443), wxSize(120,34), 0, 0, wxSize(-1,30), 3, wxSize(-1,-1)); + m_plstHistogramResolution = new wmList(m_ppnlHistograms, ID_M_PLST3, wxPoint(440,443), wxSize(120,34), 0, 0, wxSize(-1,30), 3, wxSize(-1,-1)); m_plstHistogramResolution->SetBackgroundColour(wxColour(0,0,0)); - m_pbtnHistogramClear = new wmButton(m_ppnlHistograms, ID_M_PBTN1, _("Clear All"), wxPoint(600,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN1")); - m_pbtnOptions = new wmButton(m_ppnlHistograms, ID_M_PBTN2, _("Menu"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN2")); + m_pbtnHistogramClear = new wmButton(m_ppnlHistograms, ID_M_PBTN1, _("Clear All"), wxPoint(570,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN1")); + m_pbtnHistGraphs = new wmButton(m_ppnlHistograms, ID_M_PBTN6, _("Graphs"), wxPoint(649,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN6")); + m_pbtnHistGraphs->SetForegroundColour(wxColour(0,128,0)); + m_pbtnHistGraphs->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_pbtnHistGraphsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_pbtnHistGraphs->SetFont(m_pbtnHistGraphsFont); + m_pbtnOptions = new wmButton(m_ppnlHistograms, ID_M_PBTN2, _("Info"), wxPoint(720,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN2")); + m_pbtnOptions->SetForegroundColour(wxColour(0,128,0)); + m_pbtnOptions->SetBackgroundColour(wxColour(255,255,255)); + wxFont m_pbtnOptionsFont(10,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT); + m_pbtnOptions->SetFont(m_pbtnOptionsFont); m_pSwpMain->AddPage(m_ppnlInfo, _("Info"), false); m_pSwpMain->AddPage(m_ppnlGraphs, _("Graphs"), false); m_pSwpMain->AddPage(m_ppnlHistograms, _("Histograms"), false); Connect(ID_M_PLST1,wxEVT_LIST_SELECTED,(wxObjectEventFunction)&ptpPanel::OnlstClocksSelected); + Connect(ID_M_PBTN29,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnGraphsClick); + Connect(ID_M_PBTN5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnHistogramClick); Connect(ID_M_PLST5,wxEVT_LIST_SELECTED,(wxObjectEventFunction)&ptpPanel::OnlstDataSelected); + Connect(ID_M_PBTN8,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnClearStatsClick); Connect(ID_M_PBTN3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnClearClick); + Connect(ID_M_PBTN7,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnHistogramClick); Connect(ID_M_PBTN4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnOptionsClick); Connect(ID_M_PLST4,wxEVT_LIST_SELECTED,(wxObjectEventFunction)&ptpPanel::OnlstDataSelected); Connect(ID_M_PLST2,wxEVT_LIST_SELECTED,(wxObjectEventFunction)&ptpPanel::OnlstHistogramGranularitySelected); Connect(ID_M_PLST3,wxEVT_LIST_SELECTED,(wxObjectEventFunction)&ptpPanel::OnlstHistogramResolutionSelected); Connect(ID_M_PBTN1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnClearClick); + Connect(ID_M_PBTN6,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnGraphsClick); Connect(ID_M_PBTN2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnOptionsClick); //*) - m_pbtnClearStats = new wmButton(m_ppnlGraphs, wxNewId(), _("Clear Stats"), wxPoint(520,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN3")); - Connect(m_pbtnClearStats->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnClearStatsClick); + m_ptitleOffsetAverage->SetLabel(L"Offset: x\u0304"); + m_ptitleOffsetRange->SetLabel(L"Offset: \u03c3 \u03c3\u2093\u0304"); + m_ptitleDelayAverage->SetLabel(L"Delay: x\u0304"); + m_ptitleDelayRange->SetLabel(L"Delay: \u03c3 \u03c3\u2093\u0304"); + m_pLbl6->SetLabel(L"y\u0304="); + m_pLbl7->SetLabel(L"\u03c3="); + m_pLbl8->SetLabel(L"\u03b2\u0302="); + m_pLbl9->SetLabel(L"\u03b1\u0302+\u03b2\u0302x="); + + //m_pbtnClearStats = new wmButton(m_ppnlGraphs, wxNewId(), _("Clear Stats"), wxPoint(520,445), wxSize(70,30), 0, wxDefaultValidator, _T("ID_M_PBTN3")); + //Connect(m_pbtnClearStats->GetId(),wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&ptpPanel::OnbtnClearStatsClick); m_ptitleOffsetAverage->SetTextAlign(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); m_ptitleOffsetRange->SetTextAlign(wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); @@ -731,7 +797,7 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_offset = 0.0; - + m_plstClocks->SetBitmapAlign(wxALIGN_TOP | wxALIGN_RIGHT); m_timer.SetOwner(this, wxNewId()); Connect(m_timer.GetId(), wxEVT_TIMER, (wxObjectEventFunction)&ptpPanel::OnTimer); @@ -776,6 +842,8 @@ ptpPanel::ptpPanel(wxWindow* parent, ptpBuilder* pBuilder, wxWindowID id,const w m_pHistoryGraph->Bind(wxEVT_LEFT_UP, &ptpPanel::OnLeftUp, this);\ ConnectLeftUp(this); + m_plblDomain->SetLabel(wxString::Format("Domain: %u", m_nDomain)); + } void ptpPanel::ConnectLeftUp(wxWindow* pParent) @@ -838,7 +906,7 @@ void ptpPanel::OnLeftUp(wxMouseEvent& event) void ptpPanel::OnlstClocksSelected(wxCommandEvent& event) { m_sSelectedClock = event.GetString(); - m_pClock = wxPtp::Get().GetPtpClock(m_nDomain, m_sSelectedClock.AfterFirst('\n')); + m_pClock = wxPtp::Get().GetPtpClock(m_sSelectedClock.AfterFirst('\n')); ShowClockDetails(); } @@ -864,7 +932,8 @@ void ptpPanel::OnClockUpdated(wxCommandEvent& event) void ptpPanel::OnClockRemoved(wxCommandEvent& event) { wxString sClock(m_dbMac.GetVendor(event.GetString())+event.GetString()); - if(m_sSelectedClock == sClock) { + if(m_sSelectedClock == sClock) + { ClearClockDetails(); } m_plstClocks->DeleteButton(m_plstClocks->FindButton(sClock)); @@ -891,8 +960,16 @@ void ptpPanel::OnClockMaster(wxCommandEvent& event) size_t nButton = m_plstClocks->FindButton(sClock); if(nButton != wmList::NOT_FOUND) { - m_plstClocks->SetButtonColour(nButton, CLR_MASTER); - m_plstClocks->SetSelectedButtonColour(nButton, CLR_MASTER_SELECTED); + auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(); + if(pSyncMaster && pSyncMaster->GetId() == sClock) + { + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(syncmaster_xpm)); + } + else + { + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(grandmaster_xpm)); + } + m_plstClocks->Update(); } ClockWebsocketMessage(event.GetString(), "Master"); } @@ -909,8 +986,7 @@ void ptpPanel::OnClockSlave(wxCommandEvent& event) size_t nButton = m_plstClocks->FindButton(sClock); if(nButton != wmList::NOT_FOUND) { - m_plstClocks->SetButtonColour(nButton, CLR_SLAVE); - m_plstClocks->SetSelectedButtonColour(nButton, CLR_SLAVE_SELECTED); + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(slave_xpm)); } ClockWebsocketMessage(event.GetString(), "Slave"); } @@ -929,31 +1005,24 @@ void ptpPanel::ShowClockDetails() m_pswp->ChangeSelection(m_pClock->IsSyncMaster() ? "Master" : "Slave"); - wxColour clrNormal(CLR_SLAVE); - wxColour clrSelected(CLR_SLAVE_SELECTED); - if(m_pClock->IsGrandMaster()) - { - m_plblState->SetLabel("Grand Master"); - clrNormal = CLR_MASTER; - clrSelected = CLR_MASTER_SELECTED; - } - else if(m_pClock->IsSyncMaster()) - { - m_plblState->SetLabel("Sync Master"); - clrNormal = CLR_SYNC_MASTER; - clrSelected = CLR_SYNC_MASTER_SELECTED; - } - else - { - m_plblState->SetLabel("Slave"); - } - - size_t nButton = m_plstClocks->FindButton(m_sSelectedClock); - - if(nButton != wmList::NOT_FOUND) - { - m_plstClocks->SetButtonColour(nButton, clrNormal); - m_plstClocks->SetSelectedButtonColour(nButton, clrSelected); + size_t nButton = m_plstClocks->FindButton(m_sSelectedClock); + if(nButton != wmList::NOT_FOUND) + { + if(m_pClock->IsGrandMaster()) + { + m_plblState->SetLabel("Grand Master"); + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(grandmaster_xpm)); + } + else if(m_pClock->IsSyncMaster()) + { + m_plblState->SetLabel("Sync Master"); + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(syncmaster_xpm)); + } + else + { + m_plblState->SetLabel("Slave"); + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(slave_xpm)); + } } @@ -1002,7 +1071,7 @@ void ptpPanel::ShowClockDetails() m_ppnlSyncFlags->ShowFlags(m_pClock->GetFlags(ptpV2Header::SYNC)); m_ppnlFollowFlags->ShowFlags(m_pClock->GetFlags(ptpV2Header::FOLLOW_UP)); - m_plblMasterId->SetLabel(wxPtp::Get().GetMasterClockId(m_nDomain)); + m_plblMasterId->SetLabel(wxPtp::Get().GetMasterClockId()); } else { @@ -1026,7 +1095,7 @@ void ptpPanel::ShowTime() { if(m_pLocalClock) { - auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(m_nDomain); + auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(); if(pSyncMaster) { @@ -1093,7 +1162,7 @@ void ptpPanel::ShowTime() void ptpPanel::UpdateGraphLabels() { - auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(m_nDomain); + auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(); if(pSyncMaster && m_pLocalClock) { @@ -1203,12 +1272,12 @@ void ptpPanel::OnTimer(wxTimerEvent& event) Connect(wxID_ANY, wxEVT_CLOCK_MSG_DELAY_REQUEST,(wxObjectEventFunction)&ptpPanel::OnClockMessage); Connect(wxID_ANY, wxEVT_CLOCK_MSG_DELAY_RESPONSE,(wxObjectEventFunction)&ptpPanel::OnClockMessage); - wxPtp::Get().RunDomain(Settings::Get().Read("AoIP_Settings", "Interface", "eth0"), m_nDomain); + wxPtp::Get().Run(Settings::Get().Read("AoIP_Settings", "Interface", "eth0"), m_nDomain, Settings::Get().Read("Time", "Ptp_Mode", 0) ? ptpmonkey::Mode::HYBRID : ptpmonkey::Mode::MULTICAST); - for(auto itClock = wxPtp::Get().GetClocksBegin(m_nDomain); itClock != wxPtp::Get().GetClocksEnd(m_nDomain); ++itClock) - { - AddClock(wxString(itClock->first)); + for(const auto& [sClock, pClock] : wxPtp::Get().GetClocks()) + { + AddClock(wxString(sClock)); } } } @@ -1219,29 +1288,26 @@ void ptpPanel::AddClock(wxString sClock) if(m_plstClocks->FindButton(sClock) == wmList::NOT_FOUND) { - wxColour clrNormal(CLR_SLAVE); - wxColour clrSelected(CLR_SLAVE_SELECTED); - if(wxPtp::Get().GetMasterClockId(m_nDomain) == sClock) + wxBitmap bmp(slave_xpm); + if(wxPtp::Get().GetMasterClockId() == sClock) { - clrNormal = CLR_MASTER; - clrSelected = CLR_MASTER_SELECTED; + bmp = wxBitmap(grandmaster_xpm); } else { - std::shared_ptr pSyncMaster = wxPtp::Get().GetSyncMasterClock(m_nDomain); + auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(); if(pSyncMaster && pSyncMaster->GetId() == sClock) { - clrNormal = CLR_SYNC_MASTER; - clrSelected = CLR_SYNC_MASTER_SELECTED; + bmp = wxBitmap(syncmaster_xpm); } } - size_t nButton = m_plstClocks->AddButton(sClock, wxNullBitmap, 0, wmList::wmENABLED, clrNormal); - m_plstClocks->SetSelectedButtonColour(nButton, clrSelected); + size_t nButton = m_plstClocks->AddButton(sClock, bmp, 0, wmList::wmENABLED, CLR_CLOCK); + m_plstClocks->SetSelectedButtonColour(nButton, CLR_CLOCK_SELECTED); } if(m_pLocalClock == nullptr) { - m_pLocalClock = wxPtp::Get().GetLocalClock(m_nDomain); + m_pLocalClock = wxPtp::Get().GetLocalClock(); } } @@ -1250,9 +1316,9 @@ void ptpPanel::OnClockMessage(wxCommandEvent& event) wxString sClock(m_dbMac.GetVendor(event.GetString())+event.GetString()); if(sClock == m_sSelectedClock) { - ShowClockDetails(); } + UpdateListBitmaps(); ClockMessageWebsocketMessage(event.GetString()); } @@ -1298,7 +1364,7 @@ void ptpPanel::OnbtnClearClick(wxCommandEvent& event) void ptpPanel::OnbtnOptionsClick(wxCommandEvent& event) { - m_pBuilder->Maximize(false); + ChangeView("Info"); } void ptpPanel::OnlstHistogramGranularitySelected(wxCommandEvent& event) @@ -1320,7 +1386,7 @@ void ptpPanel::ResetStats() { if(m_pLocalClock) { - wxPtp::Get().ResetLocalClockStats(m_nDomain); + wxPtp::Get().ResetLocalClockStats(); } m_pBuilder->WriteSetting("reset",0); } @@ -1349,15 +1415,15 @@ void ptpPanel::ClockMessageWebsocketMessage(const wxString& sClock) { Json::Value jsClock; jsClock["action"] = "Message"; - auto pClock = wxPtp::Get().GetPtpClock(m_nDomain, sClock); + auto pClock = wxPtp::Get().GetPtpClock(sClock); if(pClock) { jsClock["id"] = pClock->GetClockId(); jsClock["address"] = pClock->GetIpAddress(); jsClock["vendor"] = m_dbMac.GetVendor(sClock).ToStdString(); - std::shared_ptr pSyncMaster = wxPtp::Get().GetSyncMasterClock(m_nDomain); - if(wxPtp::Get().GetMasterClockId(m_nDomain) == sClock || (pSyncMaster && pSyncMaster->GetId() == sClock)) + std::shared_ptr pSyncMaster = wxPtp::Get().GetSyncMasterClock(); + if(wxPtp::Get().GetMasterClockId() == sClock || (pSyncMaster && pSyncMaster->GetId() == sClock)) { jsClock["master"] = true; jsClock["sync"]["count"] = Json::UInt64(pClock->GetCount(ptpV2Header::SYNC)); @@ -1436,7 +1502,7 @@ void ptpPanel::ClockWebsocketMessage(const wxString& sClock, const wxString& sTy void ptpPanel::TimeWebsocketMessage() { - auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(m_nDomain); + auto pSyncMaster = wxPtp::Get().GetSyncMasterClock(); if(m_pLocalClock && m_pBuilder->WebsocketsActive() && pSyncMaster) { @@ -1477,4 +1543,49 @@ void ptpPanel::TimeWebsocketMessage() } } +void ptpPanel::SetDomain(unsigned char nDomain) +{ + if(m_nDomain != nDomain) + { + m_nDomain = nDomain; + m_plblDomain->SetLabel(wxString::Format("Domain: %u", m_nDomain)); + } +} + +void ptpPanel::OnbtnGraphsClick(wxCommandEvent& event) +{ + ChangeView("Graphs"); +} + +void ptpPanel::OnbtnHistogramClick(wxCommandEvent& event) +{ + ChangeView("Histograms"); +} + +void ptpPanel::UpdateListBitmaps() +{ + for(size_t nButton = 0; nButton < m_plstClocks->GetItemCount(); nButton++) + { + auto pClock = wxPtp::Get().GetPtpClock(m_plstClocks->GetButtonText(nButton).AfterFirst('\n')); + if(pClock) + { + if(pClock->IsSyncMaster()) + { + if(pClock->IsGrandMaster()) + { + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(grandmaster_xpm)); + } + else + { + pmlLog() << pClock->GetId() << " : " << pClock->GetGrandmasterClockId(); + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(syncmaster_xpm)); + } + } + else + { + m_plstClocks->SetButtonBitmap(nButton, wxBitmap(slave_xpm)); + } + } + } +} diff --git a/plugins/ptp/ptppanel.h b/plugins/ptp/ptppanel.h index e391a19d..80be6374 100644 --- a/plugins/ptp/ptppanel.h +++ b/plugins/ptp/ptppanel.h @@ -61,10 +61,16 @@ class ptpPanel: public pmPanel pnlFlags* m_ppnlRequestFlags; pnlFlags* m_ppnlResponseFlags; pnlFlags* m_ppnlSyncFlags; + wmButton* m_pbtnClearStats; wmButton* m_pbtnGraphClear; + wmButton* m_pbtnGraphHisto; wmButton* m_pbtnGraphOptions; + wmButton* m_pbtnGraphs; + wmButton* m_pbtnHistGraphs; + wmButton* m_pbtnHistogram; wmButton* m_pbtnHistogramClear; wmButton* m_pbtnOptions; + wmLabel* m_pLbl10; wmLabel* m_pLbl1; wmLabel* m_pLbl2; wmLabel* m_pLbl3; @@ -86,6 +92,7 @@ class ptpPanel: public pmPanel wmLabel* m_plblDelayRange; wmLabel* m_plblDelayRate; wmLabel* m_plblDeviation; + wmLabel* m_plblDomain; wmLabel* m_plblFollowCount; wmLabel* m_plblFollowRate; wmLabel* m_plblGraphTitle; @@ -163,8 +170,6 @@ class ptpPanel: public pmPanel wxPanel* m_ppnlSync; //*) - wmButton* m_pbtnClearStats; - /** @brief Called when there is some audio data to pass to the meter * @param pBuffer const pointer to the timedbuffer containing the audio data @@ -181,10 +186,13 @@ class ptpPanel: public pmPanel **/ void OutputChannels(const std::vector& vChannels); + void SetDomain(unsigned char nDomain); protected: //(*Identifiers(ptpPanel) + static const long ID_M_PLBL80; static const long ID_M_PLST1; + static const long ID_M_PLBL79; static const long ID_M_PLBL1; static const long ID_M_PLBL2; static const long ID_M_PLBL3; @@ -260,6 +268,8 @@ class ptpPanel: public pmPanel static const long ID_M_PLBL63; static const long ID_M_PLBL60; static const long ID_M_PLBL64; + static const long ID_M_PBTN29; + static const long ID_M_PBTN5; static const long ID_PANEL8; static const long ID_PANEL14; static const long ID_M_PLBL45; @@ -276,7 +286,9 @@ class ptpPanel: public pmPanel static const long ID_HISTORY_GRAPH; static const long ID_M_PLBL68; static const long ID_M_PLST5; + static const long ID_M_PBTN8; static const long ID_M_PBTN3; + static const long ID_M_PBTN7; static const long ID_M_PBTN4; static const long ID_PANEL15; static const long ID_M_PLBL53; @@ -288,6 +300,7 @@ class ptpPanel: public pmPanel static const long ID_M_PLBL66; static const long ID_M_PLST3; static const long ID_M_PBTN1; + static const long ID_M_PBTN6; static const long ID_M_PBTN2; static const long ID_PANEL16; static const long ID_M_PSWP2; @@ -295,6 +308,8 @@ class ptpPanel: public pmPanel void OnLeftUp(wxMouseEvent& event); + + private: //(*Handlers(ptpPanel) @@ -304,9 +319,11 @@ class ptpPanel: public pmPanel void OnbtnOptionsClick(wxCommandEvent& event); void OnlstHistogramGranularitySelected(wxCommandEvent& event); void OnlstHistogramResolutionSelected(wxCommandEvent& event); + void OnbtnGraphsClick(wxCommandEvent& event); + void OnbtnHistogramClick(wxCommandEvent& event); + void OnbtnClearStatsClick(wxCommandEvent& event); //*) - void OnbtnClearStatsClick(wxCommandEvent& event); void OnTimer(wxTimerEvent& event); @@ -327,6 +344,7 @@ class ptpPanel: public pmPanel wxString ConvertRate(unsigned char nRate); void UpdateGraphLabels(); + void UpdateListBitmaps(); void ClockWebsocketMessage(const wxString& sClock, const wxString& sType); void ClockMessageWebsocketMessage(const wxString& sClock); @@ -351,12 +369,8 @@ class ptpPanel: public pmPanel double m_offset; wxString m_sGraph; - static const wxColour CLR_MASTER; - static const wxColour CLR_MASTER_SELECTED; - static const wxColour CLR_SYNC_MASTER; - static const wxColour CLR_SYNC_MASTER_SELECTED; - static const wxColour CLR_SLAVE; - static const wxColour CLR_SLAVE_SELECTED; + static const wxColour CLR_CLOCK; + static const wxColour CLR_CLOCK_SELECTED; DECLARE_EVENT_TABLE() }; diff --git a/plugins/ptp/slave.xpm b/plugins/ptp/slave.xpm new file mode 100644 index 00000000..61b4cd63 --- /dev/null +++ b/plugins/ptp/slave.xpm @@ -0,0 +1,21 @@ +/* XPM */ +static char * slave_xpm[] = { +"32 16 2 1", +" c None", +". c #000000", +" ... ", +" ......... ", +" .......... ", +" ... . ", +" ... ", +" .... ", +" ........ ", +" ......... ", +" ....... ", +" ..... ", +" .... ", +" .. ... ", +" .......... ", +" ......... ", +" ", +" "}; diff --git a/plugins/ptp/syncmaster.xpm b/plugins/ptp/syncmaster.xpm new file mode 100644 index 00000000..d878013c --- /dev/null +++ b/plugins/ptp/syncmaster.xpm @@ -0,0 +1,39 @@ +/* XPM */ +static char * syncmaster_xpm[] = { +"32 16 20 1", +" c None", +". c #880000", +"+ c #870000", +"@ c #860000", +"# c #830000", +"$ c #820000", +"% c #810000", +"& c #7B0000", +"* c #850000", +"= c #800000", +"- c #840000", +"; c #790000", +"> c #7F0000", +", c #770000", +"' c #7E0000", +") c #760000", +"! c #750000", +"~ c #740000", +"{ c #780000", +"] c #6D0000", +" ", +" ........ ..... ..... ", +" ......... ..... ..... ", +"..... +.. ...... +..... ", +".... ...... ...... ", +".... ......@ ...... ", +"......++ ...+..+ +..@... ", +" ........+ ...#+..@..+ ... ", +" ........@ ...$ .....% ... ", +" @..... ...% +.... &... ", +" *... ...= %...- ;... ", +".+ *... ...> ... ,... ", +"..........* ...' )) !... ", +".........+ ...' ~... ", +" ++++@@# ---{ ]--- ", +" "}; diff --git a/plugins/ptp/wxsmith/ptppanel.wxs b/plugins/ptp/wxsmith/ptppanel.wxs index 46d4b9ab..21160822 100644 --- a/plugins/ptp/wxsmith/ptppanel.wxs +++ b/plugins/ptp/wxsmith/ptppanel.wxs @@ -10,21 +10,51 @@ #000000 + + + wxWEST + 605,5 + 190,25 + #FFFFFF + #8080C0 + + 10 + + bold + 0 + swiss + + - + #FF8000 - 605,5 - 190,470 + 605,35 + 190,440 wxSYS_COLOUR_BACKGROUND + + + wxWEST + 5,5 + 280,25 + #FFFFFF + #8080C0 + + 10 + + bold + 0 + swiss + + uiRect::BORDER_FLAT wxWEST - 5,5 + 5,33 100,25 #FFFFFF #5C7AE0 @@ -32,7 +62,7 @@ wxWEST - 5,35 + 5,61 100,25 #FFFFFF #5C7AE0 @@ -40,7 +70,7 @@ wxWEST - 5,65 + 5,89 100,25 #FFFFFF #5C7AE0 @@ -48,7 +78,7 @@ uiRect::BORDER_DOWN - 105,5 + 105,33 180,25 #000000 #FFFFFF @@ -56,7 +86,7 @@ uiRect::BORDER_DOWN - 105,35 + 105,61 180,25 #000000 #FFFFFF @@ -64,13 +94,13 @@ uiRect::BORDER_DOWN - 105,65 + 105,89 180,25 #000000 #FFFFFF - 5,95 + 5,135 280,275 #000000 @@ -91,7 +121,7 @@ wxWEST - 0,30 + 0,28 70,25 #FFFFFF #5C7AE0 @@ -99,7 +129,7 @@ uiRect::BORDER_DOWN - 70,30 + 70,28 70,25 #000000 #FFFFFF @@ -107,7 +137,7 @@ wxWEST - 140,30 + 140,28 70,25 #FFFFFF #5C7AE0 @@ -115,7 +145,7 @@ uiRect::BORDER_DOWN - 210,30 + 210,28 70,25 #000000 #FFFFFF @@ -123,7 +153,7 @@ wxWEST - 140,90 + 140,84 70,25 #FFFFFF #5C7AE0 @@ -131,7 +161,7 @@ uiRect::BORDER_DOWN - 210,90 + 210,84 70,25 #000000 #FFFFFF @@ -139,7 +169,7 @@ wxWEST - 0,60 + 0,56 70,25 #FFFFFF #5C7AE0 @@ -147,7 +177,7 @@ uiRect::BORDER_DOWN - 70,60 + 70,56 70,25 #000000 #FFFFFF @@ -155,7 +185,7 @@ wxWEST - 140,60 + 140,56 70,25 #FFFFFF #5C7AE0 @@ -163,7 +193,7 @@ uiRect::BORDER_DOWN - 210,60 + 210,56 70,25 #000000 #FFFFFF @@ -171,7 +201,7 @@ wxWEST - 0,90 + 0,84 70,25 #FFFFFF #5C7AE0 @@ -179,7 +209,7 @@ uiRect::BORDER_DOWN - 70,90 + 70,84 70,25 #000000 #FFFFFF @@ -187,7 +217,7 @@ wxWEST - 0,120 + 0,112 70,25 #FFFFFF #5C7AE0 @@ -195,7 +225,7 @@ uiRect::BORDER_DOWN - 70,120 + 70,112 70,25 #000000 #FFFFFF @@ -203,7 +233,7 @@ wxWEST - 140,120 + 140,112 70,25 #FFFFFF #5C7AE0 @@ -211,7 +241,7 @@ uiRect::BORDER_DOWN - 210,120 + 210,112 70,25 #000000 #FFFFFF @@ -219,7 +249,7 @@ wxWEST - 0,150 + 0,140 70,25 #FFFFFF #5C7AE0 @@ -227,7 +257,7 @@ uiRect::BORDER_DOWN - 70,150 + 70,140 70,25 #000000 #FFFFFF @@ -235,7 +265,7 @@ wxWEST - 140,150 + 140,140 70,25 #FFFFFF #5C7AE0 @@ -243,7 +273,7 @@ wxWEST - 0,180 + 0,168 70,25 #FFFFFF #5C7AE0 @@ -251,7 +281,7 @@ uiRect::BORDER_DOWN - 70,180 + 70,168 210,25 #000000 #FFFFFF @@ -259,13 +289,13 @@ uiRect::BORDER_DOWN - 210,150 + 210,140 70,25 #000000 #FFFFFF - 0,210 + 0,196 280,64 @@ -299,7 +329,7 @@ wxWEST - 0,30 + 0,28 50,25 #FFFFFF #5C7AE0 @@ -307,7 +337,7 @@ uiRect::BORDER_DOWN - 50,30 + 50,28 50,25 #000000 #FFFFFF @@ -315,7 +345,7 @@ wxWEST - 100,30 + 100,28 50,25 #FFFFFF #5C7AE0 @@ -323,18 +353,18 @@ uiRect::BORDER_DOWN - 150,30 + 150,28 130,25 #000000 #FFFFFF - 0,60 + 0,56 280,64 - 0,135 + 0,130 280,125 #000000 @@ -355,7 +385,7 @@ wxWEST - 0,30 + 0,28 50,25 #FFFFFF #5C7AE0 @@ -363,7 +393,7 @@ uiRect::BORDER_DOWN - 50,30 + 50,28 50,25 #000000 #FFFFFF @@ -371,7 +401,7 @@ wxWEST - 100,30 + 100,28 50,25 #FFFFFF #5C7AE0 @@ -379,13 +409,13 @@ uiRect::BORDER_DOWN - 150,30 + 150,28 130,25 #000000 #FFFFFF - 0,60 + 0,56 280,64 @@ -417,7 +447,7 @@ wxWEST - 0,30 + 0,28 70,25 #FFFFFF #5C7AE0 @@ -425,7 +455,7 @@ uiRect::BORDER_DOWN - 70,30 + 70,28 70,25 #000000 #FFFFFF @@ -433,7 +463,7 @@ wxWEST - 140,30 + 140,28 70,25 #FFFFFF #5C7AE0 @@ -441,7 +471,7 @@ uiRect::BORDER_DOWN - 210,30 + 210,28 70,25 #000000 #FFFFFF @@ -449,7 +479,7 @@ wxWEST - 0,60 + 0,56 70,25 #FFFFFF #5C7AE0 @@ -457,18 +487,18 @@ uiRect::BORDER_DOWN - 70,60 + 70,56 210,25 #000000 #FFFFFF - 0,90 + 0,84 280,64 - 0,160 + 0,152 280,124 #000000 @@ -489,7 +519,7 @@ wxWEST - 0,30 + 0,28 70,25 #FFFFFF #5C7AE0 @@ -497,7 +527,7 @@ uiRect::BORDER_DOWN - 70,30 + 70,28 70,25 #000000 #FFFFFF @@ -505,7 +535,7 @@ wxWEST - 140,30 + 140,28 70,25 #FFFFFF #5C7AE0 @@ -513,13 +543,13 @@ uiRect::BORDER_DOWN - 210,30 + 210,28 70,25 #000000 #FFFFFF - 0,60 + 0,56 280,64 @@ -528,8 +558,8 @@ - 295,290 - 280,175 + 295,280 + 280,205 #000000 @@ -549,7 +579,7 @@ wxWEST - 0,30 + 0,27 50,25 #FFFFFF #5C7AE0 @@ -557,7 +587,7 @@ uiRect::BORDER_DOWN - 50,30 + 50,27 230,25 #000000 #FFFFFF @@ -565,7 +595,7 @@ wxWEST - 0,60 + 0,56 100,25 #FFFFFF #5C7AE0 @@ -573,7 +603,7 @@ uiRect::BORDER_DOWN - 100,60 + 100,56 180,25 #000000 #FFFFFF @@ -581,7 +611,7 @@ wxWEST - 0,90 + 0,84 100,25 #FFFFFF #5C7AE0 @@ -589,7 +619,7 @@ uiRect::BORDER_DOWN - 100,90 + 100,84 180,25 #000000 #FFFFFF @@ -597,7 +627,7 @@ wxWEST - 0,120 + 0,112 100,25 #FFFFFF #5C7AE0 @@ -605,7 +635,7 @@ uiRect::BORDER_DOWN - 100,120 + 100,112 180,25 #000000 #FFFFFF @@ -613,7 +643,7 @@ wxWEST - 0,150 + 0,140 100,25 #FFFFFF #5C7AE0 @@ -621,11 +651,45 @@ uiRect::BORDER_DOWN - 100,150 + 100,140 180,25 #000000 #FFFFFF + + + #800000 + 5,168 + 130,30 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + + + + + + + #800000 + 145,168 + 130,30 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + + + + @@ -837,16 +901,46 @@ + + + 498,445 + 70,30 + + - 600,445 + 570,445 70,30 + + + 649,445 + 70,30 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + + + - + 720,445 70,30 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + @@ -877,6 +971,7 @@ 0,30 800,410 + #000000 @@ -906,7 +1001,7 @@ - 200,445 + 195,445 60,30 #FFFFFF #5B9539 @@ -924,14 +1019,14 @@ -1,30 3 - 260,443 + 255,443 120,34 #000000 - 400,445 + 380,445 60,30 #FFFFFF #5B9539 @@ -949,21 +1044,45 @@ -1,30 3 - 460,443 + 440,443 120,34 #000000 - 600,445 + 570,445 70,30 + + + 649,445 + 70,30 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + + + - + 720,445 70,30 + #008000 + #FFFFFF + + 10 + + bold + 0 + swiss + diff --git a/plugins/r128/CMakeLists.txt b/plugins/r128/CMakeLists.txt index 1270316e..639e8c0c 100644 --- a/plugins/r128/CMakeLists.txt +++ b/plugins/r128/CMakeLists.txt @@ -18,7 +18,7 @@ add_library(r128 MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_versi find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -35,9 +35,9 @@ target_link_libraries(r128 ${wxWidgets_LIBRARIES}) target_link_libraries(r128 optimized pambase debug pambased) target_link_libraries(r128 optimized pamlevel debug pamleveld) target_link_libraries(r128 optimized pamfft debug pamfftd) - +set_target_properties(r128 PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS r128 LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS r128 LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/radar/CMakeLists.txt b/plugins/radar/CMakeLists.txt index 48d24190..dfba7f47 100644 --- a/plugins/radar/CMakeLists.txt +++ b/plugins/radar/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(radar MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_vers find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,10 @@ target_compile_options(radar PRIVATE ${flags}) target_link_libraries(radar ${wxWidgets_LIBRARIES}) target_link_libraries(radar optimized pambase debug pambased) +set_target_properties(radar PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS radar LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS radar LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/record/CMakeLists.txt b/plugins/record/CMakeLists.txt index 844a475f..03935488 100644 --- a/plugins/record/CMakeLists.txt +++ b/plugins/record/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(record MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_ver find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,9 @@ target_compile_options(record PRIVATE ${flags}) target_link_libraries(record ${wxWidgets_LIBRARIES}) target_link_libraries(record optimized pambase debug pambased) - +set_target_properties(record PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS record LIBRARY DESTINATION /usr/local/lib/pam2/test) + install(TARGETS record LIBRARY DESTINATION lib/pam2/test) endif() diff --git a/plugins/scope/CMakeLists.txt b/plugins/scope/CMakeLists.txt index 4d824cdd..d8f1cf3a 100644 --- a/plugins/scope/CMakeLists.txt +++ b/plugins/scope/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(scope MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_vers find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,10 @@ target_compile_options(scope PRIVATE ${flags}) target_link_libraries(scope ${wxWidgets_LIBRARIES}) target_link_libraries(scope optimized pambase debug pambased) +set_target_properties(scope PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS scope LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS scope LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/spectogram/CMakeLists.txt b/plugins/spectogram/CMakeLists.txt index 44592d5c..8dfeab49 100644 --- a/plugins/spectogram/CMakeLists.txt +++ b/plugins/spectogram/CMakeLists.txt @@ -21,7 +21,7 @@ add_library(spectogram MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME} find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive") if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -37,9 +37,10 @@ target_compile_options(spectogram PRIVATE ${flags}) target_link_libraries(spectogram ${wxWidgets_LIBRARIES}) target_link_libraries(spectogram optimized pambase debug pambased) target_link_libraries(spectogram optimized pamfft debug pamfftd) +set_target_properties(spectogram PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS spectogram LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS spectogram LIBRARY DESTINATION lib/pam2/monitor) endif() diff --git a/plugins/waveform/CMakeLists.txt b/plugins/waveform/CMakeLists.txt index 0762551e..e4e4c949 100644 --- a/plugins/waveform/CMakeLists.txt +++ b/plugins/waveform/CMakeLists.txt @@ -17,7 +17,7 @@ add_library(waveform MODULE ${SOURCES} ${CMAKE_BINARY_DIR}/src/${PROJECT_NAME}_v find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) -list(APPEND flags "-fPIC" "-Wall" "-fpermissive" "-std=c++14") +list(APPEND flags "-fPIC" "-Wall" "-fpermissive" ) if(CMAKE_BUILD_TYPE MATCHES Release) list(APPEND flags "-O3") @@ -32,9 +32,10 @@ target_compile_options(waveform PRIVATE ${flags}) target_link_libraries(waveform ${wxWidgets_LIBRARIES}) target_link_libraries(waveform optimized pambase debug pambased) +set_target_properties(waveform PROPERTIES CXX_STANDARD 17) #linux specific if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - install(TARGETS waveform LIBRARY DESTINATION /usr/local/lib/pam2/monitor) + install(TARGETS waveform LIBRARY DESTINATION lib/pam2/monitor) endif()