Skip to content

Commit

Permalink
updated CMakeLists.txt to include new weather files, get rid of old o…
Browse files Browse the repository at this point in the history
…nes, removed unused icons, removed pointInputDelegate and pointDataModel as they are not used anymore, cleaned up cli.
  • Loading branch information
tfinney9 committed Jun 29, 2018
1 parent 561d483 commit 8438083
Show file tree
Hide file tree
Showing 17 changed files with 218 additions and 851 deletions.
27 changes: 24 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -356,20 +356,41 @@ if(VERBOSE_CMAKE)
endif(VERBOSE_CMAKE)

# install target related files
set(etc_files mackay.tif
set(etc_files missoula_valley.tif
example_lcp.lcp
example_lcp.prj
cli_domainAverage.cfg
cli_domainAverage_diurnal.cfg
cli_pointInitialization_diurnal.cfg
cli_wxModelInitialization_diurnal.cfg
cli_momentumSolver_diurnal.cfg
mackay_wx_stations.csv)
cli_momentumSolver_diurnal.cfg)
foreach(f ${etc_files})
install(FILES ${PROJECT_SOURCE_DIR}/data/${f} DESTINATION
etc/windninja/example-files COMPONENT apps)
endforeach(f ${etc_files})

#add weather station files to example files
set(wx_station_current_files WXSTATIONS-2018-06-25-1237-missoula_valley/missoula_valley_stations_4.csv
WXSTATIONS-2018-06-25-1237-missoula_valley/KMSO-2018-06-25_1237-0.csv
WXSTATIONS-2018-06-25-1237-missoula_valley/PNTM8-2018-06-25_1237-2.csv
WXSTATIONS-2018-06-25-1237-missoula_valley/TR266-2018-06-25_1237-3.csv
WXSTATIONS-2018-06-25-1237-missoula_valley/TS934-2018-06-25_1237-1.csv)
foreach(f ${wx_station_current_files})
install(FILES ${PROJECT_SOURCE_DIR}/data/${f} DESTINATION
etc/windninja/example-files/WXSTATIONS-2018-06-25-1237-missoula_valley COMPONENT apps)
endforeach(f ${wx_station_current_files})

#add weather station time series files
set(wx_station_ts_files WXSTATIONS-MDT-2018-06-20-2128-2018-06-21-2128-missoula_valley/missoula_valley_stations_4.csv
WXSTATIONS-MDT-2018-06-20-2128-2018-06-21-2128-missoula_valley/KMSO-MDT-2018-06-20_2128-2018-06-21_2128-0.csv
WXSTATIONS-MDT-2018-06-20-2128-2018-06-21-2128-missoula_valley/PNTM8-MDT-2018-06-20_2128-2018-06-21_2128-2.csv
WXSTATIONS-MDT-2018-06-20-2128-2018-06-21-2128-missoula_valley/TR266-MDT-2018-06-20_2128-2018-06-21_2128-3.csv
WXSTATIONS-MDT-2018-06-20-2128-2018-06-21-2128-missoula_valley/TS934-MDT-2018-06-20_2128-2018-06-21_2128-1.csv)
foreach(f ${wx_station_ts_files})
install(FILES ${PROJECT_SOURCE_DIR}/data/${f} DESTINATION
etc/windninja/example-files/WXSTATIONS-MDT-2018-06-20-2128-2018-06-21-2128-missoula_valley COMPONENT apps)
endforeach(f ${wx_station_ts_files})

set(share_files date_time_zonespec.csv
tz_world.zip
landfire.zip
Expand Down
4 changes: 2 additions & 2 deletions data/cli_momentumSolver_diurnal.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
#

num_threads = 1
elevation_file = data/big_butte.tif
elevation_file = data/missoula_valley.tif
initialization_method = domainAverageInitialization
momentum_solver = true
number_of_iterations = 2000
mesh_choice = fine
mesh_choice = fine
time_zone = America/Denver
input_speed = 10.0
input_speed_units = mph
Expand Down
Binary file removed images/icons/transmit.png
Binary file not shown.
Binary file removed images/icons/transmit_blue.png
Binary file not shown.
Binary file removed images/icons/world.png
Binary file not shown.
4 changes: 0 additions & 4 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ set(NINJA_GUI_INCLUDES consoleDockWidget.h
outputHeightWidget.h
outputMetaData.h
pdfOutput.h
pointDataModel.h
pointInputDelegate.h
pointInput.h
shapeOutput.h
solvePage.h
Expand Down Expand Up @@ -82,9 +80,7 @@ set(NINJA_GUI_SOURCES cmake_gui.cpp
nativeSolverInput.cpp
ninjafoamInput.cpp
pdfOutput.cpp
pointDataModel.cpp
pointInput.cpp
pointInputDelegate.cpp
shapeOutput.cpp
solvePage.cpp
solveThread.cpp
Expand Down
51 changes: 14 additions & 37 deletions src/gui/mainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1907,12 +1907,12 @@ int mainWindow::solve()
int pointFormat = tree->point->simType;
std::vector<std::string> pointFileList = tree->point->stationFileList; //This is for the new way
std::string pointFile = tree->point->stationFileList[0]; //For Old Format, only can accept 1 file
std::vector<int> xStartTime = tree->point->startSeries;
std::vector<int> xEndTime = tree->point->endSeries;
int numTimeSteps = tree->point->numSteps->value();
bool useTimeList = tree->point->enableTimeseries;
bool writeStationKML = tree->point->writeStationKmlButton->isChecked();
bool writeStationCSV = tree->point->writeStationFileButton->isChecked();
std::vector<int> xStartTime = tree->point->startSeries; //Get the start time from pointInput
std::vector<int> xEndTime = tree->point->endSeries; //Get the Stop time from pointInput
int numTimeSteps = tree->point->numSteps->value(); //Get the number of steps from pointInput
bool useTimeList = tree->point->enableTimeseries; //Find out if its a timeseries run or not
bool writeStationKML = tree->point->writeStationKmlButton->isChecked(); //Write a kml file
bool writeStationCSV = tree->point->writeStationFileButton->isChecked(); //hidden for now

/*
* Note that pointFormat is not the same as stationFormat!
Expand Down Expand Up @@ -1971,9 +1971,7 @@ int mainWindow::solve()
QMessageBox::Ok | QMessageBox::Default);
disconnect(progressDialog, SIGNAL(canceled()), this,
SLOT(cancelSolve()));
setCursor(Qt::ArrowCursor);
setCursor(Qt::ArrowCursor);
tree->weather->checkForModelData();
setCursor(Qt::ArrowCursor); //Restart everything
progressDialog->cancel();
progressDialog->hide();
delete army;
Expand All @@ -1988,7 +1986,7 @@ int mainWindow::solve()
std::vector<int> formatVec;
std::vector<boost::posix_time::ptime> timeList;
CPLDebug("STATION_FETCH","NEW FORMAT...");
for (int i=0;i<pointFileList.size();i++)
for (int i=0;i<pointFileList.size();i++) //Get the file type for all selected stations
{
formatVec.push_back(wxStation::GetHeaderVersion(pointFileList[i].c_str()));
}
Expand Down Expand Up @@ -2030,8 +2028,6 @@ int mainWindow::solve()
disconnect(progressDialog, SIGNAL(canceled()), this,
SLOT(cancelSolve()));
setCursor(Qt::ArrowCursor);
setCursor(Qt::ArrowCursor);
tree->weather->checkForModelData();
progressDialog->cancel();
progressDialog->hide();
delete army;
Expand All @@ -2046,8 +2042,10 @@ int mainWindow::solve()
boost::posix_time::ptime noTime;
CPLDebug("STATION_FETCH","USING CURRENT WEATHER DATA...");
std::vector<int> xSingleTime = tree->point->diurnalTimeVec;
boost::posix_time::ptime singleTime = pointInitialization::generateSingleTimeObject(xSingleTime[0],xSingleTime[1],xSingleTime[2],xSingleTime[3],xSingleTime[4],timeZone);
timeList.push_back(singleTime);
boost::posix_time::ptime singleTime = pointInitialization::generateSingleTimeObject(xSingleTime[0],
xSingleTime[1],xSingleTime[2],
xSingleTime[3],xSingleTime[4],timeZone);
timeList.push_back(singleTime);
pointInitialization::storeFileNames(pointFileList);
try{ //try making the army with current data
army->makeStationArmy(timeList,timeZone,pointFileList[0],demFile,true,false);
Expand All @@ -2063,8 +2061,6 @@ int mainWindow::solve()
disconnect(progressDialog, SIGNAL(canceled()), this,
SLOT(cancelSolve()));
setCursor(Qt::ArrowCursor);
setCursor(Qt::ArrowCursor);
tree->weather->checkForModelData();
progressDialog->cancel();
progressDialog->hide();
delete army;
Expand Down Expand Up @@ -2105,7 +2101,7 @@ int mainWindow::solve()
}
const char *metaOpt = CPLGetConfigOption("FETCH_METADATA","FALSE");
if(metaOpt!="FALSE") //set a config option to get the metadata from the DEM
{ //There is also a button for this, that is hidden
{ //There is also a button for this, that is hidden (see stationFetchWidget)
writeToConsole("Fetching station metadata for DEM...");
QString demBase = QFileInfo(QString(demFile.c_str())).baseName();
QString demPath = QFileInfo(demFile.c_str()).absoluteDir().absolutePath()+"/";
Expand Down Expand Up @@ -2213,21 +2209,8 @@ int mainWindow::solve()
}
if( initMethod == WindNinjaInputs::pointInitializationFlag ) //Moved to makeStationArmy
{
// if( NINJA_SUCCESS != army->setWxStationFilename( i, pointFile ) )
// {
// QMessageBox::critical( this,
// tr("Invalid Point inititialization file" ),
// tr( "Invalid Point initialization file" ),
// QMessageBox::Ok | QMessageBox::Default );
// disconnect(progressDialog, SIGNAL(canceled()), this, SLOT(cancelSolve()));
// setCursor(Qt::ArrowCursor);
// tree->weather->checkForModelData();
// progressDialog->cancel();
// delete army;
// return false;
// }

}

else if( initMethod == WindNinjaInputs::domainAverageInitializationFlag )
{
//get speed
Expand Down Expand Up @@ -2305,12 +2288,6 @@ int mainWindow::solve()
}
else if( initMethod == WindNinjaInputs::pointInitializationFlag ) //Moved to makeStationArmy
{
// army->setDateTime( 0, tree->point->dateTimeEdit->date().year(),
// tree->point->dateTimeEdit->date().month(),
// tree->point->dateTimeEdit->date().day(),
// tree->point->dateTimeEdit->time().hour(),
// tree->point->dateTimeEdit->time().minute(),
// 0, timeZone );
army->setPosition( i, GDALCenterLat, GDALCenterLon );
}
}
Expand Down
154 changes: 0 additions & 154 deletions src/gui/pointDataModel.cpp

This file was deleted.

Loading

0 comments on commit 8438083

Please sign in to comment.