Revision 68b23184
ID | 68b23184aa0f17dabaef999c99dd25e009fb3af5 |
Scoutsim: Added Sonar Toggle
Sonar display can now be toggled via Menu->Sim->Sonar
scout/scoutsim/src/sim_frame.cpp | ||
---|---|---|
103 | 103 |
wxBitmap lines_bitmap; |
104 | 104 |
wxBitmap walls_bitmap; |
105 | 105 |
path_bitmap.LoadFile(wxString::FromAscii(display_map_name.c_str())); |
106 |
sonar_on = TRUE; |
|
106 | 107 |
|
107 | 108 |
// Try to load the file; if it fails, make a new blank file |
108 | 109 |
if (!lines_bitmap.LoadFile(wxString::FromAscii(map_lines_name.c_str()))) |
... | ... | |
150 | 151 |
menuFile->Append(ID_QUIT, _("E&xit")); |
151 | 152 |
|
152 | 153 |
wxMenu *menuSim = new wxMenu; |
154 |
menuSim->Append(ID_SONAR, _("S&onar")); |
|
153 | 155 |
menuSim->Append(ID_CLEAR, _("&Clear")); |
154 | 156 |
|
155 | 157 |
wxMenu *menuView = new wxMenu; |
... | ... | |
268 | 270 |
clear(); |
269 | 271 |
} |
270 | 272 |
|
273 |
void SimFrame::showSonar(wxCommandEvent& WXUNUSED(event)) |
|
274 |
{ |
|
275 |
sonar_on = not sonar_on; |
|
276 |
clear(); |
|
277 |
} |
|
278 |
|
|
279 |
|
|
271 | 280 |
void SimFrame::showMap(wxCommandEvent& WXUNUSED(event)) |
272 | 281 |
{ |
273 | 282 |
display_map_name = map_base_name; |
... | ... | |
480 | 489 |
|
481 | 490 |
for (; it != end; ++it) |
482 | 491 |
{ |
483 |
it->second->update(0.016, path_dc,sonar_dc, |
|
492 |
it->second->update(0.016, path_dc,sonar_dc,sonar_on,
|
|
484 | 493 |
path_image, lines_image, walls_image, |
485 | 494 |
path_dc.GetBackground().GetColour(), |
486 | 495 |
sonar_dc.GetBackground().GetColour(), |
Also available in: Unified diff