Skip to content

Commit

Permalink
Serial port com verified as working. For some reason some packets are…
Browse files Browse the repository at this point in the history
… being dropped. This will be debugged later.
  • Loading branch information
Gregory W. Heckler committed Dec 15, 2008
1 parent 385af9f commit aedb101
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 32 deletions.
4 changes: 2 additions & 2 deletions acquisition/acquisition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ void Acquisition::Acquire()
{
int32 lcv;

IncStartTic();
IncStopTic();

switch(request.type)
{
Expand All @@ -616,7 +616,7 @@ void Acquisition::Acquire()
doAcqStrong(request.sv, request.mindopp, request.maxdopp);
}

IncStopTic();
IncStartTic();
}
/*----------------------------------------------------------------------------------------------*/

Expand Down
Binary file modified documentation/IS-GPS-SDR-100.odt
Binary file not shown.
8 changes: 4 additions & 4 deletions gui/gui.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxTE_LEFT|wxTE_MULTILINE</property>
<property name="style">wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
Expand Down Expand Up @@ -1009,7 +1009,7 @@
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxTE_LEFT|wxTE_MULTILINE</property>
<property name="style">wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
Expand Down Expand Up @@ -1053,7 +1053,7 @@
<property name="proportion">2</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Task</property>
<property name="label">Task Health</property>
<property name="minimum_size"></property>
<property name="name">sTask</property>
<property name="orient">wxVERTICAL</property>
Expand All @@ -1078,7 +1078,7 @@
<property name="permission">protected</property>
<property name="pos"></property>
<property name="size"></property>
<property name="style">wxTE_LEFT|wxTE_MULTILINE</property>
<property name="style">wxTE_LEFT|wxTE_MULTILINE|wxTE_NO_VSCROLL</property>
<property name="subclass"></property>
<property name="tooltip"></property>
<property name="value"></property>
Expand Down
8 changes: 4 additions & 4 deletions gui/gui_classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -141,17 +141,17 @@ 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 );

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 );
Expand Down
5 changes: 4 additions & 1 deletion gui/gui_pseudo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ void GUI_Pseudo::render(wxDC& dc)
SPS_M *pNav = &p->sps;
Channel_M *pchan;
Pseudorange_M *ps;
double cr;

wxTextAttr text;
wxString str, str2;
int32 lcv, lcv2, start, stop, lines;

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"));
Expand All @@ -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);
}
Expand Down
43 changes: 27 additions & 16 deletions gui/gui_toplevel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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())
{
Expand All @@ -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);
}

}
/*----------------------------------------------------------------------------------------------*/

Expand Down
1 change: 1 addition & 0 deletions includes/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*----------------------------------------------------------------------------------------------*/


Expand Down
7 changes: 5 additions & 2 deletions main/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
17 changes: 17 additions & 0 deletions objects/threaded_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
/*----------------------------------------------------------------------------------------------*/

6 changes: 3 additions & 3 deletions objects/threaded_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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

};

Expand Down

0 comments on commit aedb101

Please sign in to comment.