In der Zeit vom 27.05.19 16 Uhr bis zum 28.05.19 10 Uhr steht die GitLab Instanz der RWTH Aachen nicht zur Verfügung. Es findet ein Umzug des angeschlossenen Storage Systems statt, so dass in der genannten Zeit keine Repositories angelegt, gelöscht oder verändert werden können. Wir bitten um Ihr Verständnis. // In the time from 27.05.19 16 o'clock to 28.05.19 10 o'clock the GitLab instance of the RWTH Aachen is not available. The connected storage system will be moved so that no repositories can be created, deleted or changed during this time. We ask for your understanding.

...
 
Commits (2)
#pragma once
#include "Vehicle.hpp"
#include <string>
#include <string_view>
class MapAppAPIWrapper;
......
......@@ -27,8 +27,9 @@ private:
void extractJunctionAndDraw(std::istream &is, MapAppAPIWrapper &mapApp);
/// Required format:
/// `nameJunctionA` `nameJunctionB` `nameLaneAToB` `nameLaneBToA` `length in km`
/// `speedLimit in {1,2,3}` `noPassing` `coordinateCount` `coordinates...`
/// `nameJunctionA` `nameJunctionB` `nameLaneAToB` `nameLaneBToA`
/// `length in km` `speedLimit in {1,2,3}` `noPassing` `coordinateCount`
/// `coordinates...`
void extractRoadAndDraw(std::istream &is, MapAppAPIWrapper &mapApp);
/// Required format:
......
......@@ -14,8 +14,8 @@ void Junction::connect(const std::weak_ptr<Junction> &junctionA,
const bool noPassing) {
Lane laneAToB(laneAToBName, laneBToAName, length, speedLimit, noPassing,
junctionB);
Lane laneBToA(std::move(laneBToAName), std::move(laneAToBName), length, speedLimit, noPassing,
junctionA);
Lane laneBToA(std::move(laneBToAName), std::move(laneAToBName), length,
speedLimit, noPassing, junctionA);
junctionA.lock()->outboundLanes.push_back(std::move(laneAToB));
junctionB.lock()->outboundLanes.push_back(std::move(laneBToA));
}
......
#include "MapAppAPIWrapper.hpp"
#include "pi2-view.h"
#include <pi2-view.h>
#include <string_view>
#include <vector>
......
......@@ -10,7 +10,8 @@ void Vehicle::process(const double time, const double maximumDistanceOnLane,
if (!parking) {
const auto possibleDistance = maximumDistanceOnLane - getDistanceOnLane();
const auto potentialDistance = (time - timeOfLastProcessing) * getSpeed(speedLimit);
const auto potentialDistance =
(time - timeOfLastProcessing) * getSpeed(speedLimit);
const auto deltaDistance = std::min(possibleDistance, potentialDistance);
distanceOnLane += deltaDistance;
odometer += deltaDistance;
......@@ -25,8 +26,9 @@ void Vehicle::resetDistanceOnLane() { distanceOnLane = 0; }
Vehicle::Vehicle(std::string name, const double topSpeed,
const double timeOfStart, const double time)
: Named(std::move(name)), topSpeed(topSpeed), odometer(0), distanceOnLane(0), parking(true),
timeOfStart(timeOfStart), timeOfLastProcessing(time) {}
: Named(std::move(name)), topSpeed(topSpeed), odometer(0),
distanceOnLane(0), parking(true), timeOfStart(timeOfStart),
timeOfLastProcessing(time) {}
double Vehicle::getTopSpeed() const { return topSpeed; }
......
......@@ -3,7 +3,6 @@
#include <chrono>
#include <fstream>
#include <gsl/span>
#include <gsl/string_span>
#include <iostream>
#include <ratio>
#include <string>
......
#pragma once
#include <Drawable.hpp>
#include "Drawable.hpp"
#include <string>
#include <string_view>
#include <valarray>
#include <vector>
......
#pragma once
#include "DrawableJunction.hpp"
#include "DrawableRoad.hpp"
#include "DrawableVehicle.hpp"
#include "MapArea.hpp"
#include "glibmm/refptr.h"
#include "MapWindow.hpp"
#include <chrono>
#include <gtkmm/window.h>
#include <map>
#include <string>
#include <thread>
#include <valarray>
#include <vector>
namespace Glib {
template <class T_CppObject> class RefPtr;
}
namespace Gtk {
class Application;
class ComboBoxText;
class Label;
class ListBox;
class ListBoxRow;
} // namespace Gtk
}
class MapApp {
public:
......@@ -36,29 +29,7 @@ public:
void setTimeLabel(std::chrono::minutes time);
private:
static const std::vector<std::string> zoomLevels;
static Glib::RefPtr<Gtk::Application> app;
static std::thread thread;
void addOrReplaceVehicle(const std::string &vehicleName,
const std::string &laneName, double positionOnLane,
double speed, double remainingFuel, double red,
double green, double blue);
void onZoomEntryActivate();
void onZoomSelectionChanged();
void onVehicleRowSelected(Gtk::ListBoxRow *row);
void refreshVehicleLabels(const DrawableVehicle &vehicle);
void refreshArea(int x, int y, int width, int height);
void resizeWindow();
MapArea mapArea;
Gtk::Window win;
Gtk::ListBox *listBox;
Gtk::Label *timeLabel;
Gtk::Label *laneLabel;
Gtk::Label *lanePositionPercentageLabel;
Gtk::Label *speedLabel;
Gtk::Label *remainingFuelLabel;
Gtk::ComboBoxText *zoomComboBoxText;
std::vector<DrawableJunction> junctions;
std::vector<DrawableRoad> roads;
std::map<std::string, DrawableVehicle> nameVehicleMap;
MapWindow mapWindow;
};
#pragma once
#include "DrawableJunction.hpp"
#include "DrawableRoad.hpp"
#include "DrawableVehicle.hpp"
#include "MapArea.hpp"
#include <chrono>
#include <gtkmm/window.h>
#include <map>
#include <string>
#include <thread>
#include <valarray>
#include <vector>
namespace Glib {
template <class T_CppObject> class RefPtr;
}
namespace Gtk {
class Application;
class ComboBoxText;
class Label;
class ListBox;
class ListBoxRow;
} // namespace Gtk
class MapWindow : public Gtk::Window {
public:
MapWindow(std::string windowTitle);
virtual ~MapWindow();
void addJunction(double x, double y);
void addRoad(std::string laneThereName, std::string laneBackName,
std::vector<std::valarray<double>> coordinates);
void addOrReplaceBicycle(const std::string &vehicleName,
const std::string &laneName, double positionOnLane,
double speed);
void addOrReplaceCar(const std::string &vehicleName,
const std::string &laneName, double positionOnLane,
double speed, double remainingFuel);
void setTimeLabel(std::chrono::minutes time);
private:
static const std::vector<std::string> zoomLevels;
static Glib::RefPtr<Gtk::Application> app;
static std::thread thread;
void addOrReplaceVehicle(const std::string &vehicleName,
const std::string &laneName, double positionOnLane,
double speed, double remainingFuel, double red,
double green, double blue);
void onZoomEntryActivate();
void onZoomSelectionChanged();
void onVehicleRowSelected(Gtk::ListBoxRow *row);
void refreshVehicleLabels(const DrawableVehicle &vehicle);
void refreshArea(int x, int y, int width, int height);
void resizeWindow();
MapArea mapArea;
Gtk::ListBox *listBox;
Gtk::Label *timeLabel;
Gtk::Label *laneLabel;
Gtk::Label *lanePositionPercentageLabel;
Gtk::Label *speedLabel;
Gtk::Label *remainingFuelLabel;
Gtk::ComboBoxText *zoomComboBoxText;
std::vector<DrawableJunction> junctions;
std::vector<DrawableRoad> roads;
std::map<std::string, DrawableVehicle> nameVehicleMap;
};
......@@ -2,10 +2,11 @@ pi2_view_inc = include_directories('include')
pi2_view_src = files(
'src/Drawable.cpp',
'src/DrawableJunction.cpp',
'src/MapArea.cpp',
'src/MapApp.cpp',
'src/DrawableRoad.cpp',
'src/DrawableVehicle.cpp',
'src/MapApp.cpp',
'src/MapArea.cpp',
'src/MapWindow.cpp',
'src/pi2-view.cpp'
)
gnome = import('gnome')
......
#include "DrawableJunction.hpp"
#include "cairomm/context.h"
#include "cairomm/enums.h"
#include "cairomm/refptr.h"
#include <cairomm/context.h>
#include <cairomm/enums.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <vector>
......
#include "DrawableRoad.hpp"
#include "cairomm/context.h"
#include "cairomm/enums.h"
#include "cairomm/refptr.h"
#include <algorithm>
#include <cairomm/context.h>
#include <cairomm/enums.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <ext/alloc_traits.h>
#include <limits>
......
#include "DrawableVehicle.hpp"
#include "DrawableRoad.hpp"
#include "cairomm/context.h"
#include "cairomm/refptr.h"
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <utility>
......
This diff is collapsed.
......@@ -3,11 +3,11 @@
#include "DrawableJunction.hpp"
#include "DrawableRoad.hpp"
#include "DrawableVehicle.hpp"
#include "cairomm/refptr.h"
#include "gtkmm/widget.h"
#include <algorithm>
#include <cairomm/context.h>
#include <cairomm/refptr.h>
#include <cmath>
#include <gtkmm/widget.h>
const int MapArea::padding = 30;
......
This diff is collapsed.
......@@ -8,6 +8,7 @@
#include <gsl/pointers>
#include <gsl/span>
#include <gsl/string_span>
#include <string>
#include <valarray>
#include <vector>
......