Skip to content

Commit

Permalink
Added new events.
Browse files Browse the repository at this point in the history
Fixed changed materials and added new ones.
Fixes to HIDPI rendering.
  • Loading branch information
neotron committed Jun 15, 2018
1 parent 1ca9da0 commit 19aa285
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 86 deletions.
3 changes: 3 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/runConfigurations/EDPathFinder.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/runConfigurations/EDPathFinder_Win.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ include(QtCommon)

#set(CMAKE_VERBOSE_MAKEFILE YES)

project(EDPathFinder VERSION 1.4.1)
project(EDPathFinder VERSION 1.4.2)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Expand All @@ -27,7 +27,7 @@ set(CMAKE_USE_RELATIVE_PATHS ON)
set(RESOURCE_FOLDER resources)
set(ICON_NAME icon512)
set(COMPANY "David Hedbor")
set(COPYRIGHT "Copyright (c) 2016 David Hedbor. All rights reserved.")
set(COPYRIGHT "Copyright (c) 2016-2018 David Hedbor. All rights reserved.")
set(IDENTIFIER "org.hedbor.EDPathFinder")

file(GLOB_RECURSE RESOURCE_FILES resources/*.qrc)
Expand Down Expand Up @@ -76,7 +76,7 @@ if (UNIX)
file(GLOB_RECURSE MM_FILES src/*.mm)
else (MSVC)
set(WINTOAST "deps/wintoast/src/wintoastlib.cpp" "deps/wintoast/src/wintoastlib.h")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
link_libraries(${LINK_LIBS})
endif ()

Expand All @@ -93,11 +93,11 @@ add_executable(${PROJECT_NAME} ${OS_BUNDLE} # Expands to WIN32 or MACOS_BUNDLE d

add_executable(bodydistance tools/bodydistance/main.cpp src/Model/System.cpp src/Model/SystemLoader.cpp src/Routers/Tools/AStarRouter.cpp ${PATH_FINDER_SRC} ${RESOURCE_FILES})

if (WIN32)
#if (WIN32)
# copy dlls.
configure_file("deps/openssl/ssleay32.dll" "${PROJECT_BINARY_DIR}/" COPYONLY)
configure_file("deps/openssl/libeay32.dll" "${PROJECT_BINARY_DIR}/" COPYONLY)

add_custom_command(TARGET "${PROJECT_NAME}" POST_BUILD COMMAND "C:/User Programs/Qt/5.9.3/msvc2015_64/bin/windeployqt.exe" --verbose 1 "${PROJECT_NAME}.exe"
add_custom_command(TARGET "${PROJECT_NAME}" POST_BUILD COMMAND "C:/User Programs/Qt/5.11.0/msvc2017_64/bin/windeployqt.exe" --verbose 1 "${PROJECT_NAME}.exe"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}")
endif ()
#endif ()
59 changes: 29 additions & 30 deletions resources/dbdump.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Notifications/RouteProgressAnnouncer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void RouteProgressAnnouncer::handleEventSystemOnly(const JFile *journal, Event *
auto system = route[i][0];
if(system != route[arrivedAt][0]) {
nextSystem = system;
break;
break;
}
}

Expand Down
11 changes: 9 additions & 2 deletions src/Routers/BaseScanning/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ MainWindow::MainWindow(QWidget *parent)

_ui->minMats->setToolTip("Exclude settlements that can't provide at least this many of your wanted materials.");
_ui->dropProbability->setToolTip("Exclude matched materials if the probability quotient is lower than this. Note that some materials never have very high probability.");
layout()->setSizeConstraint(QLayout::SetFixedSize);
}

void MainWindow::restoreSettings() {
Expand Down Expand Up @@ -136,7 +137,7 @@ void MainWindow::buildLookupMap() {

void MainWindow::routeCalculated(const RouteResult &route) {
AbstractBaseWindow::routeCalculated(route);
auto viewer = new RouteViewer(route, this);
auto viewer = new RouteViewer(route, nullptr);
viewer->show();
}

Expand Down Expand Up @@ -317,6 +318,8 @@ void MainWindow::systemsLoaded(const SystemList &systems) {
connect(updater, &QThread::finished, updater, &QObject::deleteLater);
connect(updater, SIGNAL(newVersionAvailable(const Version &)), this, SLOT(showVersionUpdateDialog(const Version &)));
updater->start();

updateFilters();
}

void MainWindow::showVersionUpdateDialog(const Version &newVersion) {
Expand Down Expand Up @@ -354,7 +357,7 @@ int MainWindow::distanceSliderValue() const {
}

void MainWindow::onEventGeneric(Event *event) {
qDebug() << "Got event"<<event->obj();
// qDebug() << "Got event"<<event->obj();
auto journal(event->file());
const QString &commander = journal->commander();
if(commander.isEmpty()) {
Expand Down Expand Up @@ -444,17 +447,21 @@ void MainWindow::updateSystemForCommander(const QString &commander) {
void MainWindow::openMissionTool() {
auto tool = new CustomRouter(nullptr, _router, *_systems);
tool->show();
tool->hide();
tool->show();
}

void MainWindow::openExplorationTool() {
auto tool = new ValueRouter(nullptr, _router, _systems);
tool->show();
tool->adjustSize();
}

void MainWindow::openBearingCalculator() {
auto tool = new BearingCalculator();
tool->setModal(false);
tool->show();
tool->adjustSize();
}

void MainWindow::openPreferences() {
Expand Down
22 changes: 2 additions & 20 deletions src/Routers/BaseScanning/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,9 @@
<x>0</x>
<y>0</y>
<width>521</width>
<height>548</height>
<height>537</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>521</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>EDPathFinder</string>
</property>
Expand All @@ -32,12 +20,6 @@
<verstretch>100</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>521</width>
<height>0</height>
</size>
</property>
<property name="baseSize">
<size>
<width>450</width>
Expand Down Expand Up @@ -1008,7 +990,7 @@
<x>0</x>
<y>0</y>
<width>521</width>
<height>22</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuTools">
Expand Down
1 change: 1 addition & 0 deletions src/Routers/BaseScanning/RouteViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ void RouteViewer::updateSettlementInfo() {
}
_ui->imageList->setCurrentText(preferredMap);
loadOverviewImage(settlementType->imageNamed(preferredMap));

}

void RouteViewer::setFlag(const Settlement &settlement, QString key, SettlementFlags flag) {
Expand Down
23 changes: 10 additions & 13 deletions src/Routers/BaseScanning/RouteViewer.ui
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>1040</width>
<height>585</height>
</size>
</property>
<property name="windowTitle">
<string>Route Viewer</string>
</property>
<widget class="QWidget" name="centralwidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
Expand Down Expand Up @@ -64,8 +58,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>502</width>
<height>477</height>
<width>512</width>
<height>492</height>
</rect>
</property>
</widget>
Expand Down Expand Up @@ -225,7 +219,7 @@
<string/>
</property>
<property name="pixmap">
<pixmap>:/noimage.png</pixmap>
<pixmap resource="../../../resources/resources1.qrc">:/noimage.png</pixmap>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
Expand Down Expand Up @@ -831,7 +825,7 @@
<x>0</x>
<y>0</y>
<width>1040</width>
<height>22</height>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
Expand Down Expand Up @@ -880,7 +874,10 @@
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="../../../resources/resources1.qrc"/>
<include location="../../../resources/resources1.qrc"/>
</resources>
<connections>
<connection>
<sender>imageList</sender>
Expand Down
3 changes: 2 additions & 1 deletion src/Routers/Exploration/ValueRouter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ ValueRouter::ValueRouter(QWidget *parent, AStarRouter *router, SystemList *syste
connect(_systemResolverDestination, SIGNAL(systemLookupFailed(const QString &)), this, SLOT(systemCoordinatesRequestFailed(const QString &)));
connect(_systemResolverDestination, SIGNAL(systemLookupCompleted(const System &)), this, SLOT(updateSystemCoordinateDisplay(const System &)));
setAttribute(Qt::WA_DeleteOnClose, true);

updateFilters();
}

Expand Down Expand Up @@ -88,6 +87,8 @@ void ValueRouter::updateFilters() {
}

_ui->statusBar->showMessage(QString("Filter matches %1 systems.").arg(_filteredSystems.size()));
adjustSize();

}

void ValueRouter::onRouterCreated(TSPWorker *worker) {
Expand Down
32 changes: 28 additions & 4 deletions src/Routers/Exploration/ValueRouter.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,41 @@
<rect>
<x>0</x>
<y>0</y>
<width>465</width>
<height>510</height>
<width>371</width>
<height>530</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>371</width>
<height>530</height>
</size>
</property>
<property name="windowTitle">
<string>Exploration Router</string>
</property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>World Filters</string>
</property>
Expand Down Expand Up @@ -597,8 +621,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>465</width>
<height>22</height>
<width>371</width>
<height>21</height>
</rect>
</property>
</widget>
Expand Down
2 changes: 1 addition & 1 deletion src/Routers/Tools/TSPWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace operations_research {
}
}
}
qDebug() << "Waiting for completion of" << futures.size() << "futures";
//qDebug() << "Waiting for completion of" << futures.size() << "futures";
for(auto &pair: futures) {
pair.first.waitForFinished();
auto a = pair.second.first;
Expand Down
10 changes: 8 additions & 2 deletions src/Settings/Preferences.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@
<rect>
<x>0</x>
<y>0</y>
<width>618</width>
<height>226</height>
<width>521</width>
<height>160</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Preferences</string>
</property>
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ int main(int argc, char *argv[]) {
freopen_s(&fpe, "CONOUT$", "w", stderr);
}
#endif
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "true");
// qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "true");
QCoreApplication::setOrganizationName("NeoTron Software");
QCoreApplication::setApplicationName("EDPathFinder");

QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
qRegisterMetaType<RouteResult>();
qRegisterMetaType<SystemList>();
qRegisterMetaType<Version>();
Expand Down

0 comments on commit 19aa285

Please sign in to comment.