From 2c3cfd21a8fa5fe46ee6d2f7c6185988396b0691 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 14 Feb 2022 20:51:18 +0100 Subject: [PATCH] fixes --- Car.py | 4 ++-- main.py | 3 +++ mainLoop.py | 6 ++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Car.py b/Car.py index 1489415..1854649 100644 --- a/Car.py +++ b/Car.py @@ -69,8 +69,8 @@ class Car: def conduite(self,vmax,leader,dt): if(leader is None): - self.v=vmax - return + vleader=self.v + bleader=self.b else: vleader=leader.v # vitesse de la voiture leader bleader=leader.b diff --git a/main.py b/main.py index 65d3183..7b66001 100644 --- a/main.py +++ b/main.py @@ -44,6 +44,9 @@ class MainWindow(QMainWindow): if e.key() == Qt.Key_Escape or e.key() == Qt.Key_Q: self.close() + elif e.key() == Qt.Key_S: + self.mainLoop.quickLoad() + if __name__ == "__main__": app = QApplication() diff --git a/mainLoop.py b/mainLoop.py index fb95668..8c43701 100644 --- a/mainLoop.py +++ b/mainLoop.py @@ -36,5 +36,11 @@ class mainLoop(): if(self.map.isLoaded()): self.controller.prepareRoute() + def quickLoad(self): + self.map.fromPath("test2.net.xml") + self.painter.generateTransform() + self.controller.fromPath("test5.rou.xml") + self.controller.prepareRoute() + def addInfosDisplay(self, widget): self.controller.setInfoWidget(widget)