Skip to content

Commit

Permalink
apps/radar/Qucid - working on legacy params
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-dixon committed Feb 17, 2024
1 parent cdc45eb commit c762f83
Show file tree
Hide file tree
Showing 25 changed files with 2,007 additions and 3,898 deletions.
128 changes: 6 additions & 122 deletions codebase/apps/radar/src/Qucid/Args.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,24 +106,6 @@ int Args::parse (const int argc, const char **argv)
sprintf(tmp_str, "debug = DEBUG_EXTRA;");
TDRP_add_override(&override, tmp_str);

} else if (!strcmp(argv[i], "-check_ray_alloc")) {

sprintf(tmp_str, "check_ray_alloc = TRUE;");
TDRP_add_override(&override, tmp_str);

} else if (!strcmp(argv[i], "-sim_mode")) {

sprintf(tmp_str, "input_mode = SIMULATED_INPUT;");
TDRP_add_override(&override, tmp_str);

sprintf(tmp_str, "begin_in_archive_mode = FALSE;");
TDRP_add_override(&override, tmp_str);

} else if (!strcmp(argv[i], "-fmq_mode")) {

sprintf(tmp_str, "input_mode = DSR_FMQ_INPUT;");
TDRP_add_override(&override, tmp_str);

} else if (!strcmp(argv[i], "-color_scales")) {

if (i < argc - 1) {
Expand All @@ -133,26 +115,6 @@ int Args::parse (const int argc, const char **argv)
iret = -1;
}

} else if (!strcmp(argv[i], "-fmq_url")) {

if (i < argc - 1) {
sprintf(tmp_str, "input_fmq_url = \"%s\";", argv[++i]);
TDRP_add_override(&override, tmp_str);
} else {
iret = -1;
}

} else if (!strcmp(argv[i], "-max_range")) {

if (i < argc - 1) {
sprintf(tmp_str, "max_range_km = %s;", argv[++i]);
TDRP_add_override(&override, tmp_str);
sprintf(tmp_str, "set_max_range = TRUE;");
TDRP_add_override(&override, tmp_str);
} else {
iret = -1;
}

} else if (!strcmp(argv[i], "-instance")) {

if (i < argc - 1) {
Expand All @@ -166,39 +128,6 @@ int Args::parse (const int argc, const char **argv)
iret = -1;
}

} else if (!strcmp(argv[i], "-tcp_mode")) {

sprintf(tmp_str, "input_mode = IWRF_TCP_INPUT;");
TDRP_add_override(&override, tmp_str);

} else if (!strcmp(argv[i], "-tcp_host")) {

if (i < argc - 1) {
sprintf(tmp_str, "input_tcp_host = \"%s\";", argv[++i]);
TDRP_add_override(&override, tmp_str);
} else {
iret = -1;
}

} else if (!strcmp(argv[i], "-tcp_port")) {

if (i < argc - 1) {
sprintf(tmp_str, "input_tcp_port = %s;", argv[++i]);
TDRP_add_override(&override, tmp_str);
} else {
iret = -1;
}

} else if (!strcmp(argv[i], "-bscan")) {

sprintf(tmp_str, "display_mode = BSCAN_DISPLAY;");
TDRP_add_override(&override, tmp_str);

} else if (!strcmp(argv[i], "-polar")) {

sprintf(tmp_str, "display_mode = POLAR_DISPLAY;");
TDRP_add_override(&override, tmp_str);

} else if (!strcmp(argv[i], "-start_x")) {

if (i < argc - 1) {
Expand Down Expand Up @@ -271,40 +200,6 @@ int Args::parse (const int argc, const char **argv)
iret = -1;
}

} else if (!strcmp(argv[i], "-archive_url")) {

if (i < argc - 1) {
sprintf(tmp_str, "archive_data_url = \"%s\";", argv[++i]);
TDRP_add_override(&override, tmp_str);
sprintf(tmp_str, "begin_in_archive_mode = TRUE;");
TDRP_add_override(&override, tmp_str);
} else {
iret = -1;
}

} else if (!strcmp(argv[i], "-f")) {

if (i < argc - 1) {
// load up file list vector. Break at next arg which
// start with -
for (int j = i + 1; j < argc; j++) {
if (argv[j][0] == '-') {
break;
} else {
inputFileList.push_back(argv[j]);
}
}
sprintf(tmp_str, "begin_in_archive_mode = TRUE;");
TDRP_add_override(&override, tmp_str);
} else {
iret = -1;
}

if (inputFileList.size() < 1) {
cerr << "ERROR - with -f you must specify files to be read" << endl;
iret = -1;
}

} // if

} // i
Expand Down Expand Up @@ -403,32 +298,20 @@ void Args::_usage(ostream &out)
<< "options:\n"
<< " [ --, -h, -help, -man ] produce this list.\n"
<< " [ -archive_url ?] URL for data in archive mode\n"
<< " [ -bscan ] run in BSCAN mode\n"
<< " [ -check_ray_alloc ]\n"
<< " print out checks on number of ray allocation and frees\n"
<< " [ -color_scales ? ] specify color scale directory\n"
<< " [ -debug, -d ] print debug messages\n"
<< " [ -f ? ?] list of files to process in archive mode\n"
<< " [ -fmq_mode] set forces DSR_FMQ_INPUT mode\n"
<< " [ -fmq_url ?] set input fmq URL\n"
<< " [ -images_end_time \"yyyy mm dd hh mm ss\"]\n"
<< " set end time for image generation mode\n"
<< " [ -image_interval ?]\n"
<< " set image generation interval (secs)\n"
<< " [ -images_start_time \"yyyy mm dd hh mm ss\"]\n"
<< " set start time for image generation mode\n"
<< " [ -instance ?] set instance for procmap\n"
<< " [ -max_range ?] set max range in km\n"
<< " [ -polar ] run in POLAR (PPI/RHI) mode\n"
<< " [ -realtime] start in realtime mode\n"
<< " [ -sim_mode] SIMULATED_INPUT mode\n"
<< " [ -start_time \"yyyy mm dd hh mm ss\"]\n"
<< " set start time for archive mode\n"
<< " [ -start_x ? ] start x location of main window\n"
<< " [ -start_y ? ] start y location of main window\n"
<< " [ -tcp_mode] IWRF_TCP_INPUT mode\n"
<< " [ -tcp_host ?] set TCP server host\n"
<< " [ -tcp_port ?] set TCP server port\n"
<< " [ -time_span ?]\n"
<< " set time span (secs)\n"
<< " applies to bscan time width\n"
Expand All @@ -444,13 +327,14 @@ void Args::_usage(ostream &out)
<< " [ -vvv ? ] legacy CIDD verbose level\n"
<< " [ -proxy_url ?] use this proxy server for data requests\n"
<< " in the param file, and in HTML Mode will automatically\n"
<< " [ -start_height ?,?,?...] starts up at the first height, overiding the setting\n"
<< " [ -h ?,?,?...] starts up at the first height, overiding the setting\n"
<< " in the param file, and in HTML Mode will automatically\n"
<< " render each height in the list\n"
<< " [ -start_time ?] starts up in archive mode at this time\n"
<< " YYYYMMDDHHMM(SS - seconds optional\n"
<< " -t minus3600 starts in archive mode with the first frame 1 hour ago\n"
<< " ie. use -t minusX to start X seconds ago in archive mode\n"
<< " [ -t ?] starts up in archive mode at this time\n"
<< " YYYYMMDDHHMM(SS - seconds optional)\n"
<< " -t minus3600 starts in archive mode with the\n"
<< " first frame 1 hour ago\n"
<< " i.e. use -t minusX to start X seconds ago\n"
<< endl;

Params::usage(out);
Expand Down
7 changes: 4 additions & 3 deletions codebase/apps/radar/src/Qucid/Args.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public:
// parse command line
// Returns 0 on success, -1 on failure

int parse (const int argc, const char **argv);
int parse(const int argc, const char **argv);

// get the legacy params file from the command line
// returns 0 on success, -1 on failure
Expand All @@ -75,11 +75,12 @@ public:
int getTdrpPrintMode(const int argc, const char **argv,
tdrp_print_mode_t &printMode);

// public data
// kay-value pairs for overriding TDRP params

tdrp_override_t override;
vector<string> inputFileList;

// get methods

bool usingLegacyParams() const { return _usingLegacyParams; }
string legacyParamsPath() const { return _legacyParamsPath; }

Expand Down
110 changes: 8 additions & 102 deletions codebase/apps/radar/src/Qucid/CartManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
#include "VertWidget.hh"
#include "VertWindow.hh"
#include "Params.hh"
#include "Reader.hh"
// #include "AllocCheck.hh"
// #include "BoundaryPointEditor.hh"

#include <string>
#include <cmath>
Expand Down Expand Up @@ -109,10 +106,9 @@ CartManager* CartManager::Instance()
// Constructor

CartManager::CartManager(const Params &params,
Reader *reader,
const vector<DisplayField *> &fields,
bool haveFilteredFields) :
DisplayManager(params, reader, fields, haveFilteredFields),
const vector<DisplayField *> &fields,
bool haveFilteredFields) :
DisplayManager(params, fields, haveFilteredFields),
// _sweepManager(params),
_vertWindowDisplayed(false)
{
Expand Down Expand Up @@ -913,57 +909,13 @@ void CartManager::_handleRealtimeData(QTimerEvent * event)
_horiz->setArchiveMode(false);
_vert->setArchiveMode(false);

// do nothing if freeze is on

if (_frozen) {
return;
}

if (event->timerId() == _beamTimerId && !_frozen) {

// get all available beams

while (true) {

// get the next ray from the reader queue
// responsibility for this ray memory passes to
// this (the master) thread

RadxRay *ray = _reader->getNextRay(_platform);
if (ray == NULL) {
break; // no pending rays
}

if (_params.debug >= Params::DEBUG_EXTRA) {
cerr << " Got a ray, time, el, az, nGates: "
<< DateTime::strm(ray->getTimeSecs()) << ", "
<< ray->getElevationDeg() << ", "
<< ray->getAzimuthDeg() << ", "
<< ray->getNGates() << endl;
}

// update the status panel

_updateStatusPanel(ray);

// draw the beam

if (_params.images_creation_mode !=
Params::CREATE_IMAGES_ON_REALTIME_SCHEDULE) {
_handleRay(_platform, ray);
}

} // while

}

}

///////////////////////////////////////
// set input file list for archive mode

void CartManager::setArchiveFileList(const vector<string> &list,
bool fromCommandLine /* = true */)
bool fromCommandLine /* = true */)
{

if (fromCommandLine && list.size() > 0) {
Expand Down Expand Up @@ -1036,25 +988,6 @@ void CartManager::setArchiveFileList(const vector<string> &list,
int CartManager::loadArchiveFileList()

{
RadxTimeList timeList;
timeList.setDir(_params.archive_data_url);
timeList.setModeInterval(_archiveStartTime, _archiveEndTime);
timeList.compile();
_urlOK = true;

if (timeList.getPathList().size() < 1) {
cerr << "ERROR - CartManager::loadArchiveFileList() for dir:" << _params.archive_data_url << endl;
cerr << " Cannot load file list for url: "
<< _params.archive_data_url << endl;
cerr << " Start time: " << _archiveStartTime.getStr() << endl;
cerr << " End time: " << _archiveEndTime.getStr() << endl;
_urlOK = false;
return -1;

}

setArchiveFileList(timeList.getPathList(), false);

return 0;

}
Expand Down Expand Up @@ -1230,30 +1163,6 @@ void CartManager::_plotArchiveData()
cerr << " volume start time: " << _plotStartTime.asString() << endl;
}

// initialize plotting

_initialRay = true;

// handle the rays

const vector<RadxRay *> &rays = _vol.getRays();
if (rays.size() < 1) {
cerr << "ERROR - _plotArchiveData" << endl;
cerr << " No rays found" << endl;
return;
}

const vector<RadxSweep *> &sweeps = _vol.getSweeps();
if (sweeps.size() < 1) {
cerr << "ERROR - _plotArchiveData" << endl;
cerr << " No sweeps found" << endl;
return;
}

// clear the canvas

_clear();

// handle the rays

// const SweepManager::GuiSweep &gsweep = _sweepManager.getSelectedSweep();
Expand Down Expand Up @@ -1304,11 +1213,9 @@ void CartManager::_handleRay(RadxPlatform &platform, RadxRay *ray)

_nGates = ray->getNGates();
double maxRange = ray->getStartRangeKm() + _nGates * ray->getGateSpacingKm();
if (!_params.set_max_range && (maxRange > _maxRangeKm)) {
_maxRangeKm = maxRange;
_horiz->configureRange(_maxRangeKm);
_vert->configureRange(_maxRangeKm);
}
_maxRangeKm = maxRange;
_horiz->configureRange(_maxRangeKm);
_vert->configureRange(_maxRangeKm);

// create 2D field data vector

Expand Down Expand Up @@ -1696,7 +1603,6 @@ void CartManager::_freeze()
_frozen = true;
_freezeAct->setText("Unfreeze");
_freezeAct->setStatusTip(tr("Click to unfreeze display, or hit ESC"));
_initialRay = true;
}
}

Expand Down Expand Up @@ -2739,7 +2645,7 @@ void CartManager::_setRealtime(bool enabled)
void CartManager::_activateRealtimeRendering()
{
_nGates = 1000;
_maxRangeKm = _params.max_range_km;
_maxRangeKm = 1000;
_clear();
if (_horiz) {
_horiz->activateRealtimeRendering();
Expand Down
Loading

0 comments on commit c762f83

Please sign in to comment.