diff --git a/acquisition/acquisition.cpp b/acquisition/acquisition.cpp index 489338a..025fe28 100755 --- a/acquisition/acquisition.cpp +++ b/acquisition/acquisition.cpp @@ -596,7 +596,7 @@ void Acquisition::Acquire() { int32 lcv; - IncStartTic(); + IncStopTic(); switch(request.type) { @@ -616,7 +616,7 @@ void Acquisition::Acquire() doAcqStrong(request.sv, request.mindopp, request.maxdopp); } - IncStopTic(); + IncStartTic(); } /*----------------------------------------------------------------------------------------------*/ diff --git a/documentation/IS-GPS-SDR-100.odt b/documentation/IS-GPS-SDR-100.odt index 75f06e1..6263ea9 100644 Binary files a/documentation/IS-GPS-SDR-100.odt and b/documentation/IS-GPS-SDR-100.odt differ diff --git a/gui/gui.fbp b/gui/gui.fbp index dce88ed..5a0d042 100755 --- a/gui/gui.fbp +++ b/gui/gui.fbp @@ -940,7 +940,7 @@ protected - wxTE_LEFT|wxTE_MULTILINE + wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL @@ -1009,7 +1009,7 @@ protected - wxTE_LEFT|wxTE_MULTILINE + wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL @@ -1053,7 +1053,7 @@ 2 wxID_ANY - Task + Task Health sTask wxVERTICAL @@ -1078,7 +1078,7 @@ protected - wxTE_LEFT|wxTE_MULTILINE + wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL diff --git a/gui/gui_classes.cpp b/gui/gui_classes.cpp index ea0852b..49c4ac7 100755 --- a/gui/gui_classes.cpp +++ b/gui/gui_classes.cpp @@ -131,7 +131,7 @@ iGUI_Toplevel::iGUI_Toplevel( wxWindow* parent, wxWindowID id, const wxString& t gUSRP = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_SMOOTH|wxGA_VERTICAL ); sUSRP->Add( gUSRP, 0, wxALL|wxEXPAND, 5 ); - tUSRP = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_MULTILINE ); + tUSRP = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL ); tUSRP->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Monospace") ) ); sUSRP->Add( tUSRP, 1, wxALL|wxEXPAND, 5 ); @@ -141,7 +141,7 @@ iGUI_Toplevel::iGUI_Toplevel( wxWindow* parent, wxWindowID id, const wxString& t wxStaticBoxSizer* sRS422; sRS422 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("RS422") ), wxVERTICAL ); - tRS422 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_MULTILINE ); + tRS422 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL ); tRS422->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Monospace") ) ); sRS422->Add( tRS422, 1, wxALL|wxEXPAND, 5 ); @@ -149,9 +149,9 @@ iGUI_Toplevel::iGUI_Toplevel( wxWindow* parent, wxWindowID id, const wxString& t sStatus->Add( sRS422, 1, wxEXPAND, 5 ); wxStaticBoxSizer* sTask; - sTask = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Task") ), wxVERTICAL ); + sTask = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Task Health") ), wxVERTICAL ); - tTask = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_MULTILINE ); + tTask = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL ); tTask->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Monospace") ) ); sTask->Add( tTask, 1, wxALL|wxEXPAND, 5 ); diff --git a/gui/gui_pseudo.cpp b/gui/gui_pseudo.cpp index 7651e5d..ae9164c 100755 --- a/gui/gui_pseudo.cpp +++ b/gui/gui_pseudo.cpp @@ -48,6 +48,7 @@ void GUI_Pseudo::render(wxDC& dc) SPS_M *pNav = &p->sps; Channel_M *pchan; Pseudorange_M *ps; + double cr; wxTextAttr text; wxString str, str2; @@ -55,6 +56,8 @@ void GUI_Pseudo::render(wxDC& dc) tPseudo->Clear(); + cr = pNav->clock_rate; + str.Printf(wxT("Ch# SV Pseudorange Residual PR Rate Residual\n")); tPseudo->AppendText(str); str.Printf(wxT(" (m) (m) (m/s) (m/s)\n")); @@ -72,7 +75,7 @@ void GUI_Pseudo::render(wxDC& dc) pNav->chanmap[lcv]+1, ps->meters, ps->residual, - ps->meters_rate - pNav->clock_rate, + ps->meters_rate - cr, ps->rate_residual); tPseudo->AppendText(str); } diff --git a/gui/gui_toplevel.cpp b/gui/gui_toplevel.cpp index fa9eff3..ca7190b 100755 --- a/gui/gui_toplevel.cpp +++ b/gui/gui_toplevel.cpp @@ -501,24 +501,24 @@ void GUI_Toplevel::render(wxDC& dc) pSerial->Unlock(); this_tic = pSerial->decoded_packet.tic; - if(this_tic != last_tic) - { - last_tic = this_tic; - /* Render FIFO Panel */ - renderFIFO(); + /* Render FIFO Panel */ + renderFIFO(); - /* Render RS422 Panel */ - renderRS422(); + /* Render RS422 Panel */ + renderRS422(); - /* Render Task Panel */ - renderTask(); + /* Render Task Panel */ + renderTask(); - str = status_str; - str2.Printf(wxT("Count: %d"),count++); - str += str2; + str = status_str; + str2.Printf(wxT("Count: %d"),count++); + str += str2; - SetStatusText(str); + SetStatusText(str); + + if(this_tic != last_tic) + { /* Render main window */ if(wMain != NULL) @@ -574,7 +574,7 @@ void GUI_Toplevel::renderFIFO() tUSRP->AppendText(str); str.Printf(wxT("AGC Overflws:\t%d\n"),p->overflw); tUSRP->AppendText(str); - str.Printf(wxT("FIFO Count:\t%d\n"),p->count); + str.Printf(wxT("FIFO Count:\t%d"),p->count); tUSRP->AppendText(str); } @@ -609,7 +609,7 @@ void GUI_Toplevel::renderRS422() tRS422->AppendText(str); kB_sec += .25 * (((float)bytes_sec/1024.0) - kB_sec); str.Printf(wxT("Serial Bandwidth:\t%.2f "),kB_sec); - str += wxT("kB/sec\n"); + str += wxT("kB/sec"); tRS422->AppendText(str); if(count % 10 == 0) @@ -652,7 +652,7 @@ void GUI_Toplevel::renderTask() str = wxT("-----------------------------------------------------------\n"); tTask->AppendText(str); - for(lcv = 0; lcv < MAX_TASKS; lcv++) + for(lcv = 0; lcv < MAX_TASKS-1; lcv++) { if(names[lcv].Len()) { @@ -666,6 +666,17 @@ void GUI_Toplevel::renderTask() } } + if(names[lcv].Len()) + { + str.Printf(wxT("%s %10d %6d %9d %9d"), + names[lcv].c_str(), + pTask->execution_tic[lcv], + pTask->stop_tic[lcv]-pTask->start_tic[lcv], + pTask->start_tic[lcv], + pTask->stop_tic[lcv]); + tTask->AppendText(str); + } + } /*----------------------------------------------------------------------------------------------*/ diff --git a/includes/globals.h b/includes/globals.h index d118687..81f6b28 100755 --- a/includes/globals.h +++ b/includes/globals.h @@ -57,6 +57,7 @@ EXTERN int32 gAcq_high; //!< This is set high when the acquisition is ac /*----------------------------------------------------------------------------------------------*/ EXTERN int32 grun; //!< Keep all the threads active (technically, this should be mutex protected, but eh, who cares? ) EXTERN Options_S gopt; //!< Global receiver options +EXTERN struct timeval starttime; //!< Get receiver start time /*----------------------------------------------------------------------------------------------*/ diff --git a/main/init.cpp b/main/init.cpp index 00ffaaf..f69d078 100755 --- a/main/init.cpp +++ b/main/init.cpp @@ -41,7 +41,7 @@ void usage(int32 argc, char* argv[]) fprintf(stderr, "[-v] be verbose \n"); fprintf(stderr, "[-n] ncurses OFF \n"); fprintf(stderr, "[-gui] run receiver with the GUI app over a named pipe\n"); - fprintf(stderr, "[-s] run receiver with the GUI app over a serial port\n"); + fprintf(stderr, "[-ser] run receiver with the GUI app over a serial port\n"); fprintf(stderr, "[-w] start receiver in warm start, using almanac and last good position\n"); fprintf(stderr, "[-u] run receiver with usrp-gps as child process\n"); fprintf(stderr, "\n"); @@ -204,7 +204,7 @@ void Parse_Arguments(int32 argc, char* argv[]) gopt.serial = 0; gopt.ncurses = 0; } - else if(strcmp(argv[lcv],"-s") == 0) + else if(strcmp(argv[lcv],"-ser") == 0) { gopt.serial = 1; gopt.gui = 0; @@ -291,6 +291,9 @@ int32 Object_Init(void) int32 lcv; int32 failed; + /* Get start of receiver */ + gettimeofday(&starttime, NULL); + /* Create Keyboard objec to handle user input */ pKeyboard = new Keyboard; diff --git a/objects/threaded_object.cpp b/objects/threaded_object.cpp index 7d18ef5..80b0cf4 100755 --- a/objects/threaded_object.cpp +++ b/objects/threaded_object.cpp @@ -58,3 +58,20 @@ Threaded_Object::~Threaded_Object() /*----------------------------------------------------------------------------------------------*/ +/*----------------------------------------------------------------------------------------------*/ +void Threaded_Object::IncStartTic() +{ + gettimeofday(&tv, NULL); + start_tic = 100*(tv.tv_sec - starttime.tv_sec) + (tv.tv_usec - starttime.tv_usec)/10000; +}; +/*----------------------------------------------------------------------------------------------*/ + + +/*----------------------------------------------------------------------------------------------*/ +void Threaded_Object::IncStopTic() +{ + gettimeofday(&tv, NULL); + stop_tic = 100*(tv.tv_sec - starttime.tv_sec) + (tv.tv_usec - starttime.tv_usec)/10000; +}; +/*----------------------------------------------------------------------------------------------*/ + diff --git a/objects/threaded_object.h b/objects/threaded_object.h index 16e26f1..8b84eab 100755 --- a/objects/threaded_object.h +++ b/objects/threaded_object.h @@ -42,7 +42,7 @@ class Threaded_Object uint32 stop_tic; //!< OS tic at end of function pthread_t thread; //!< For the thread pthread_mutex_t mutex; //!< Protect the following variable - + struct timeval tv; //!< To time the threads public: /* Default object methods */ @@ -62,8 +62,8 @@ class Threaded_Object uint32 GetStopTic(){return(stop_tic);}; //!< Get the Nucleus tic at end of function void IncExecTic(){execution_tic++;}; //!< Increment execution tic - void IncStartTic(){start_tic = 100*clock()/CLOCKS_PER_SEC;}; //!< Use OS method to set the start tic - void IncStopTic(){stop_tic = 100*clock()/CLOCKS_PER_SEC;}; //!< Use OS method to set the stop tic + void IncStartTic(); //!< Use OS method to set the start tic + void IncStopTic(); //!< Use OS method to set the stop tic };