Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ref speed mod #3

Merged
merged 2 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import hu.bme.mit.train.interfaces.TrainController;

public class TrainControllerImpl implements TrainController {
public class TrainControllerImpl implements TrainController, Runnable {

private int step = 0;
private int referenceSpeed = 0;
Expand Down Expand Up @@ -45,11 +45,24 @@ private void enforceSpeedLimit() {

@Override
public void setJoystickPosition(int joystickPosition) {
this.step = joystickPosition;
try {
this.step = joystickPosition;
Thread.sleep(200);
} catch (Exception e) {
System.out.println("thread exception");
}

}

@Override
public void emergencyBrake(){
this.referenceSpeed=0;
}


public void run(){
while(true){
followSpeed();
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/home/cloud/Desktop/mit2/base/train-controller/src/main/java/hu/bme/mit/train/controller/TrainControllerImpl.java
/home/cloud/Desktop/mit_3/base/train-controller/src/main/java/hu/bme/mit/train/controller/TrainControllerImpl.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/home/cloud/Desktop/mit2/base/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainUser.java
/home/cloud/Desktop/mit2/base/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainSensor.java
/home/cloud/Desktop/mit2/base/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainController.java
/home/cloud/Desktop/mit_3/base/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainUser.java
/home/cloud/Desktop/mit_3/base/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainSensor.java
/home/cloud/Desktop/mit_3/base/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainController.java
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/home/cloud/Desktop/mit2/base/train-sensor/src/main/java/hu/bme/mit/train/sensor/TrainSensorImpl.java
/home/cloud/Desktop/mit_3/base/train-sensor/src/main/java/hu/bme/mit/train/sensor/TrainSensorImpl.java
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/home/cloud/Desktop/mit2/base/train-sensor/src/test/java/hu/bme/mit/train/sensor/TrainSensorTest.java
/home/cloud/Desktop/mit_3/base/train-sensor/src/test/java/hu/bme/mit/train/sensor/TrainSensorTest.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="hu.bme.mit.train.sensor.TrainSensorTest" time="0.011" errors="0" skipped="0">
<testsuite tests="1" failures="0" name="hu.bme.mit.train.sensor.TrainSensorTest" time="0.003" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="11.0.18+10-post-Ubuntu-0ubuntu118.04.1"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-11-openjdk-amd64/lib"/>
<property name="maven.multiModuleProjectDirectory" value="/home/cloud/Desktop/mit2/base"/>
<property name="maven.multiModuleProjectDirectory" value="/home/cloud/Desktop/mit_3/base"/>
<property name="java.vm.vendor" value="Ubuntu"/>
<property name="java.vendor.url" value="https://ubuntu.com/"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
Expand All @@ -14,7 +14,7 @@
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="user.dir" value="/home/cloud/Desktop/mit2/base"/>
<property name="user.dir" value="/home/cloud/Desktop/mit_3/base"/>
<property name="java.vm.compressedOopsMode" value="32-bit"/>
<property name="java.runtime.version" value="11.0.18+10-post-Ubuntu-0ubuntu118.04.1"/>
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
Expand Down Expand Up @@ -60,5 +60,5 @@
<property name="sun.cpu.endian" value="little"/>
<property name="sun.cpu.isalist" value=""/>
</properties>
<testcase classname="hu.bme.mit.train.sensor.TrainSensorTest" name="ThisIsAnExampleTestStub" time="0.011"/>
<testcase classname="hu.bme.mit.train.sensor.TrainSensorTest" name="ThisIsAnExampleTestStub" time="0.003"/>
</testsuite>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: hu.bme.mit.train.sensor.TrainSensorTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.096 sec
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.169 sec
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
hu/bme/mit/train/system/TrainSystem.class
hu/bme/mit/train/system/Tachograph.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hu/bme/mit/train/system/TachographTest.class
hu/bme/mit/train/system/TrainSystemTest.class
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="hu.bme.mit.train.system.TachographTest" time="0.045" errors="0" skipped="0">
<testsuite tests="1" failures="0" name="hu.bme.mit.train.system.TachographTest" time="0.082" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="11.0.18+10-post-Ubuntu-0ubuntu118.04.1"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-11-openjdk-amd64/lib"/>
<property name="maven.multiModuleProjectDirectory" value="/home/cloud/Desktop/mit2/base"/>
<property name="maven.multiModuleProjectDirectory" value="/home/cloud/Desktop/mit_3/base"/>
<property name="java.vm.vendor" value="Ubuntu"/>
<property name="java.vendor.url" value="https://ubuntu.com/"/>
<property name="path.separator" value=":"/>
Expand All @@ -13,7 +13,7 @@
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value="unknown"/>
<property name="user.dir" value="/home/cloud/Desktop/mit2/base"/>
<property name="user.dir" value="/home/cloud/Desktop/mit_3/base"/>
<property name="java.vm.compressedOopsMode" value="32-bit"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="java.runtime.version" value="11.0.18+10-post-Ubuntu-0ubuntu118.04.1"/>
Expand Down Expand Up @@ -60,5 +60,5 @@
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.cpu.isalist" value=""/>
</properties>
<testcase classname="hu.bme.mit.train.system.TachographTest" name="EntryTest" time="0.045"/>
<testcase classname="hu.bme.mit.train.system.TachographTest" name="EntryTest" time="0.082"/>
</testsuite>
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="3" failures="0" name="hu.bme.mit.train.system.TrainSystemTest" time="0.003" errors="0" skipped="0">
<testsuite tests="3" failures="0" name="hu.bme.mit.train.system.TrainSystemTest" time="0.806" errors="0" skipped="0">
<properties>
<property name="java.runtime.name" value="OpenJDK Runtime Environment"/>
<property name="java.vm.version" value="11.0.18+10-post-Ubuntu-0ubuntu118.04.1"/>
<property name="sun.boot.library.path" value="/usr/lib/jvm/java-11-openjdk-amd64/lib"/>
<property name="maven.multiModuleProjectDirectory" value="/home/cloud/Desktop/mit2/base"/>
<property name="maven.multiModuleProjectDirectory" value="/home/cloud/Desktop/mit_3/base"/>
<property name="java.vm.vendor" value="Ubuntu"/>
<property name="java.vendor.url" value="https://ubuntu.com/"/>
<property name="path.separator" value=":"/>
Expand All @@ -13,7 +13,7 @@
<property name="user.country" value="US"/>
<property name="sun.java.launcher" value="SUN_STANDARD"/>
<property name="sun.os.patch.level" value="unknown"/>
<property name="user.dir" value="/home/cloud/Desktop/mit2/base"/>
<property name="user.dir" value="/home/cloud/Desktop/mit_3/base"/>
<property name="java.vm.compressedOopsMode" value="32-bit"/>
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
<property name="java.runtime.version" value="11.0.18+10-post-Ubuntu-0ubuntu118.04.1"/>
Expand Down Expand Up @@ -60,7 +60,7 @@
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<property name="sun.cpu.isalist" value=""/>
</properties>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="OverridingJoystickPositionToNegative_SetsReferenceSpeedToZero" time="0.001"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="NewTest" time="0.001"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="OverridingJoystickPosition_IncreasesReferenceSpeed" time="0.001"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="OverridingJoystickPositionToNegative_SetsReferenceSpeedToZero" time="0.404"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="NewTest" time="0.201"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="OverridingJoystickPosition_IncreasesReferenceSpeed" time="0.201"/>
</testsuite>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: hu.bme.mit.train.system.TachographTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.045 sec
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.087 sec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-------------------------------------------------------------------------------
Test set: hu.bme.mit.train.system.TrainSystemTest
-------------------------------------------------------------------------------
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.113 sec
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.955 sec
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/home/cloud/Desktop/mit2/base/train-user/src/main/java/hu/bme/mit/train/user/TrainUserImpl.java
/home/cloud/Desktop/mit_3/base/train-user/src/main/java/hu/bme/mit/train/user/TrainUserImpl.java