From 4158fbded6511c77c15cf19d672140f0a138670f Mon Sep 17 00:00:00 2001 From: SzittyaPetro Date: Mon, 11 Mar 2024 15:58:08 +0100 Subject: [PATCH 1/2] Readme modified --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e26e034fc..182f9e06d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ This is a sample application for the verification laboratory. ## Getting started +* ~~underlined comment~~ * The application is implemented in Java. * The project can be built using [Gradle](https://gradle.org/) or [Maven](https://maven.apache.org/) (currently **Maven** is preferred). * [JUnit](https://junit.org/junit5/) is used for tests. @@ -12,15 +13,15 @@ This is a sample application for the verification laboratory. Clone the repository and execute Maven to build the application: ``` -mvn compile +mvn compile ``` - +*Compile the project with Maven* To compile and run tests also execute: ``` -mvn test +mvn test ``` - +**Run the test with Maven** (That will be enough to know for the current exercises. If you are more interested, see [this](https://github.com/ftsrg-edu/swsv-labs/wiki/0b-Build-tools) short guide about Maven.) ### Gradle From 34d2493000435caf069bd19aa5d76c7a84af1d16 Mon Sep 17 00:00:00 2001 From: SzittyaPetro Date: Mon, 11 Mar 2024 16:30:21 +0100 Subject: [PATCH 2/2] implementing feature --- .../hu/bme/mit/train/controller/TrainControllerImpl.java | 5 +++++ .../java/hu/bme/mit/train/interfaces/TrainController.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/train-controller/src/main/java/hu/bme/mit/train/controller/TrainControllerImpl.java b/train-controller/src/main/java/hu/bme/mit/train/controller/TrainControllerImpl.java index 06649d278..7a2f165b5 100644 --- a/train-controller/src/main/java/hu/bme/mit/train/controller/TrainControllerImpl.java +++ b/train-controller/src/main/java/hu/bme/mit/train/controller/TrainControllerImpl.java @@ -2,6 +2,8 @@ import hu.bme.mit.train.interfaces.TrainController; +import java.util.Date; + public class TrainControllerImpl implements TrainController { private int step = 0; @@ -45,5 +47,8 @@ private void enforceSpeedLimit() { public void setJoystickPosition(int joystickPosition) { this.step = joystickPosition; } + @Override + public void setEmergencyBrake(boolean EmergencyBrake){referenceSpeed=0;} + } diff --git a/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainController.java b/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainController.java index c8adca066..9ce0209f9 100644 --- a/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainController.java +++ b/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainController.java @@ -2,6 +2,8 @@ public interface TrainController { + Table tachograph= HashBasedTable.create(); + void followSpeed(); int getReferenceSpeed(); @@ -10,4 +12,6 @@ public interface TrainController { void setJoystickPosition(int joystickPosition); + public void setEmergencyBrake(boolean EmergencyBrake); + }