Skip to content

Commit

Permalink
Fix coredump in previous commit -- initializer was incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
keesverruijt committed Sep 11, 2017
1 parent b2b77f1 commit a3ccf20
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ SET(TITLE_NAME BR24Radar)
SET(CPACK_PACKAGE_CONTACT "[email protected]")
SET(VERSION_MAJOR "3")
#SET(CMAKE_BUILD_TYPE Debug)
SET(VERSION_MINOR "910")
SET(VERSION_MINOR "911")
SET(VERSION_PATCH "0")
SET(VERSION_DATE "2017-09-10")
SET(VERSION_DATE "2017-09-11")

INCLUDE("cmake/PluginConfigure.cmake")

Expand Down
18 changes: 18 additions & 0 deletions src/GuardZone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,24 @@ PLUGIN_BEGIN_NAMESPACE

#undef TEST_GUARD_ZONE_LOCATION

GuardZone::GuardZone(br24radar_pi *pi, RadarInfo* ri, int zone)
{
m_pi = pi;
m_ri = ri;
m_log_name = wxString::Format(wxT("BR24radar_pi: Radar %c GuardZone %d:"), m_ri->m_radar + 'A', zone + 1);
m_type = GZ_CIRCLE;
m_start_bearing = 0;
m_end_bearing = 0;
m_inner_range = 0;
m_outer_range = 0;
m_arpa_on = 0;
m_alarm_on = 0;
m_show_time = 0;
CLEAR_STRUCT(arpa_update_time);
ResetBogeys();
}


void GuardZone::ProcessSpoke(SpokeBearing angle, UINT8* data, UINT8* hist, size_t len, int range) {
size_t range_start = m_inner_range * RETURNS_PER_LINE / range; // Convert from meters to 0..511
size_t range_end = m_outer_range * RETURNS_PER_LINE / range; // Convert from meters to 0..511
Expand Down
18 changes: 1 addition & 17 deletions src/GuardZone.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,7 @@ class GuardZone {
return m_bogey_count;
};

GuardZone(br24radar_pi *pi, int radar, int zone) {
m_pi = pi;
m_ri = m_pi->m_radar[radar];
m_log_name = wxString::Format(wxT("BR24radar_pi: Radar %c GuardZone %d:"), radar + 'A', zone + 1);
m_type = GZ_CIRCLE;
m_start_bearing = 0;
m_end_bearing = 0;
m_inner_range = 0;
m_outer_range = 0;
m_arpa_on = 0;
m_alarm_on = 0;
m_show_time = 0;
for (int angle = 0; angle < LINES_PER_ROTATION; angle++) {
arpa_update_time[angle] = 0;
}
ResetBogeys();
}
GuardZone(br24radar_pi *pi, RadarInfo* ri, int zone);

~GuardZone() { LOG_VERBOSE(wxT("%s destroyed"), m_log_name.c_str()); }

Expand Down
2 changes: 1 addition & 1 deletion src/RadarInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ RadarInfo::RadarInfo(br24radar_pi *pi, int radar) {

m_arpa = new RadarArpa(m_pi, this);
for (size_t z = 0; z < GUARD_ZONES; z++) {
m_guard_zone[z] = new GuardZone(m_pi, radar, z);
m_guard_zone[z] = new GuardZone(m_pi, this, z);
}
}

Expand Down

0 comments on commit a3ccf20

Please sign in to comment.