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

David #359

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

David #359

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1166774
README hozzáadás
Csongorcz Mar 11, 2024
38bac76
Merge pull request #2 from csongorczibulya33/newfeature
Csongorcz Mar 11, 2024
91c4c8d
README javitása
Csongorcz Mar 11, 2024
49ec0c5
README javitása újból
Csongorcz Mar 11, 2024
68a1e6f
Create maven.yml
Csongorcz Mar 11, 2024
9cb165d
vészfék implementálása
Csongorcz Mar 11, 2024
55f31f4
vészfék implementálása javitása
Csongorcz Mar 11, 2024
e836103
vészfék implementálása javitása2
Csongorcz Mar 11, 2024
177d67c
vészfék implementálása javitás3
Csongorcz Mar 11, 2024
cf3fd43
A branch változtatás
Csongorcz Mar 11, 2024
a8da6e7
B branch változtatás
Csongorcz Mar 11, 2024
ce0d1a4
konfliktus feloldása
Csongorcz Mar 11, 2024
9f289dd
Merge branch 'master' of https://github.com/csongorczibulya33/retelab
Csongorcz Mar 11, 2024
1ab2698
kod modositas
Csongorcz Mar 11, 2024
4b19a99
Merge branch 'master' of https://github.com/csongorczibulya33/retelab
Csongorcz Mar 11, 2024
52b2e39
kod kijavitása plusz uj teszt
Csongorcz Mar 11, 2024
a99f199
kod kijavitása plusz uj teszt2
Csongorcz Mar 11, 2024
1462fbf
kod kijavitása plusz uj teszt3
Csongorcz Mar 11, 2024
a4a9b95
tachograf
Csongorcz Mar 11, 2024
d2430e7
tachograf javitas
Csongorcz Mar 11, 2024
375ea2a
tachograf javitas2
Csongorcz Mar 11, 2024
c903bb7
tachograf javitas3
Csongorcz Mar 11, 2024
3eadbe6
tachograf javitas4
Csongorcz Mar 11, 2024
b32b854
fix referencia
NagyDavei Mar 25, 2024
fd2bcee
változatások a kérés szerint
NagyDavei Mar 25, 2024
95579f2
referenciasebbeseg javitasa
NagyDavei Mar 25, 2024
169793e
referenciasebbeseg kijavitása a javaslatok szerint
NagyDavei Mar 25, 2024
54edb59
referenciasebbeseg kijavitása a javaslatok szerint
NagyDavei Mar 25, 2024
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
35 changes: 35 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Java CI with Maven

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml

# Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
- name: Update dependency graph
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,14 @@ The figure below illustrates this behavior using an example.
1. As the joystick remains at a positive value, the reference speed is incremented again.
1. However, it reaches the speed limit so in the next step it is not incremented even though the joystick still has a positive value.
1. Later, the joystick is set to a negative position for one time unit, making the reference speed to decrease as well.


# Rete labor feladat A branch

1. Környezet kialakítása
2. Inicializálás
3. Markdown feladatok
4. *Github Flow* feladatok
5. Konfliktus **merge** esetén
6. CI feladatok
7. Külső függőségek hozzáadaása
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public class TrainControllerImpl implements TrainController {
private int referenceSpeed = 0;
private int speedLimit = 0;

public TrainControllerImpl(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ne randommal csináld

followSpeed();
}

@Override
public void followSpeed() {
if (referenceSpeed < 0) {
Expand Down Expand Up @@ -46,4 +50,8 @@ public void setJoystickPosition(int joystickPosition) {
this.step = joystickPosition;
}

@Override
public void emergencyBrake(){
referenceSpeed = 0;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hu/bme/mit/train/controller/TrainControllerImpl.class
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/cloud/Desktop/retelab/retelab/train-controller/src/main/java/hu/bme/mit/train/controller/TrainControllerImpl.java
7 changes: 7 additions & 0 deletions train-interfaces/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,11 @@
<groupId>hu.bme.mit.train</groupId>
<version>0.5.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.3-jre</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ public interface TrainController {

void setJoystickPosition(int joystickPosition);

void emergencyBrake();

}
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package hu.bme.mit.train.interfaces;
import com.google.common.collect.Table;
import java.time.LocalTime;
import com.google.common.collect.HashBasedTable;

public interface TrainSensor {

int getSpeedLimit();

void overrideSpeedLimit(int speedLimit);

void tachoGraf();

int size();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hu/bme/mit/train/interfaces/TrainController.class
hu/bme/mit/train/interfaces/TrainSensor.class
hu/bme/mit/train/interfaces/TrainUser.class
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/home/cloud/Desktop/retelab/retelab/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainUser.java
/home/cloud/Desktop/retelab/retelab/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainSensor.java
/home/cloud/Desktop/retelab/retelab/train-interfaces/src/main/java/hu/bme/mit/train/interfaces/TrainController.java
5 changes: 5 additions & 0 deletions train-sensor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,10 @@
<version>0.8.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>32.1.3-jre</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@
import hu.bme.mit.train.interfaces.TrainController;
import hu.bme.mit.train.interfaces.TrainSensor;
import hu.bme.mit.train.interfaces.TrainUser;
import com.google.common.collect.Table;
import java.time.LocalTime;
import com.google.common.collect.HashBasedTable;


public class TrainSensorImpl implements TrainSensor {

private TrainController controller;
private TrainUser user;
private int speedLimit = 5;
private Table<LocalTime, Integer, Integer> courseSeatTable;


public TrainSensorImpl(TrainController controller, TrainUser user) {
this.controller = controller;
this.user = user;
courseSeatTable = HashBasedTable.create();
}

@Override
Expand All @@ -26,4 +33,21 @@ public void overrideSpeedLimit(int speedLimit) {
controller.setSpeedLimit(speedLimit);
}

@Override
public void tachoGraf(){


courseSeatTable.put(LocalTime.now(), 10, 12);
}

public int size()
{
return courseSeatTable.size();
}

}





Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hu/bme/mit/train/sensor/TrainSensorImpl.class
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/cloud/Desktop/retelab/retelab/train-sensor/src/main/java/hu/bme/mit/train/sensor/TrainSensorImpl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hu/bme/mit/train/sensor/TrainSensorTest.class
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/cloud/Desktop/retelab/retelab/train-sensor/src/test/java/hu/bme/mit/train/sensor/TrainSensorTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="1" failures="0" name="hu.bme.mit.train.sensor.TrainSensorTest" time="0.016" 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/retelab/retelab"/>
<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"/>
<property name="path.separator" value=":"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<property name="sun.os.patch.level" value="unknown"/>
<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/retelab/retelab"/>
<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"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="/tmp"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Linux"/>
<property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
<property name="maven.conf" value="/usr/share/maven/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="55.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="4.15.0-206-generic"/>
<property name="library.jansi.path" value="/usr/share/maven/lib/jansi-native"/>
<property name="user.home" value="/home/cloud"/>
<property name="user.timezone" value="Europe/Budapest"/>
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.specification.version" value="11"/>
<property name="user.name" value="cloud"/>
<property name="java.class.path" value="/usr/share/maven/boot/plexus-classworlds-2.x.jar"/>
<property name="java.vm.specification.version" value="11"/>
<property name="sun.arch.data.model" value="64"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher test"/>
<property name="java.home" value="/usr/lib/jvm/java-11-openjdk-amd64"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="java.version" value="11.0.18"/>
<property name="securerandom.source" value="file:/dev/./urandom"/>
<property name="java.vendor" value="Ubuntu"/>
<property name="maven.home" value="/usr/share/maven"/>
<property name="file.separator" value="/"/>
<property name="java.version.date" value="2023-01-17"/>
<property name="java.vendor.url.bug" value="https://bugs.launchpad.net/ubuntu/+source/openjdk-lts"/>
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
<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.016"/>
</testsuite>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: hu.bme.mit.train.sensor.TrainSensorTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.177 sec
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package hu.bme.mit.train.system;

import java.time.LocalDate;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
Expand All @@ -9,6 +11,7 @@
import hu.bme.mit.train.interfaces.TrainUser;
import hu.bme.mit.train.system.TrainSystem;


public class TrainSystemTest {

TrainController controller;
Expand Down Expand Up @@ -50,5 +53,28 @@ public void OverridingJoystickPositionToNegative_SetsReferenceSpeedToZero() {
Assert.assertEquals(0, controller.getReferenceSpeed());
}

@Test
public void emergencyBrakeTest() {
user.overrideJoystickPosition(0);
Assert.assertEquals(0, controller.getReferenceSpeed());
}

@Test
public void Test() {
sensor.overrideSpeedLimit(10);

Assert.assertEquals(0, controller.getReferenceSpeed());
}

@Test
public void hetesFeladatTest() {
int meret = sensor.size();
Assert.assertEquals(0, meret);

sensor.tachoGraf();
int meret2 = sensor.size();
Assert.assertEquals(1, meret2);

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hu/bme/mit/train/system/TrainSystem.class
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/cloud/Desktop/retelab/retelab/train-system/src/main/java/hu/bme/mit/train/system/TrainSystem.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hu/bme/mit/train/system/TrainSystemTest.class
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/cloud/Desktop/retelab/retelab/train-system/src/test/java/hu/bme/mit/train/system/TrainSystemTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite tests="5" failures="0" name="hu.bme.mit.train.system.TrainSystemTest" time="0.054" 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/retelab/retelab"/>
<property name="java.vm.vendor" value="Ubuntu"/>
<property name="java.vendor.url" value="https://ubuntu.com/"/>
<property name="path.separator" value=":"/>
<property name="guice.disable.misplaced.annotation.check" value="true"/>
<property name="java.vm.name" value="OpenJDK 64-Bit Server VM"/>
<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/retelab/retelab"/>
<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"/>
<property name="java.awt.graphicsenv" value="sun.awt.X11GraphicsEnvironment"/>
<property name="os.arch" value="amd64"/>
<property name="java.io.tmpdir" value="/tmp"/>
<property name="line.separator" value="
"/>
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
<property name="os.name" value="Linux"/>
<property name="classworlds.conf" value="/usr/share/maven/bin/m2.conf"/>
<property name="sun.jnu.encoding" value="UTF-8"/>
<property name="java.library.path" value="/usr/java/packages/lib:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib"/>
<property name="maven.conf" value="/usr/share/maven/conf"/>
<property name="jdk.debug" value="release"/>
<property name="java.class.version" value="55.0"/>
<property name="java.specification.name" value="Java Platform API Specification"/>
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
<property name="os.version" value="4.15.0-206-generic"/>
<property name="library.jansi.path" value="/usr/share/maven/lib/jansi-native"/>
<property name="user.home" value="/home/cloud"/>
<property name="user.timezone" value="Europe/Budapest"/>
<property name="java.awt.printerjob" value="sun.print.PSPrinterJob"/>
<property name="file.encoding" value="UTF-8"/>
<property name="java.specification.version" value="11"/>
<property name="user.name" value="cloud"/>
<property name="java.class.path" value="/usr/share/maven/boot/plexus-classworlds-2.x.jar"/>
<property name="java.vm.specification.version" value="11"/>
<property name="sun.arch.data.model" value="64"/>
<property name="sun.java.command" value="org.codehaus.plexus.classworlds.launcher.Launcher test"/>
<property name="java.home" value="/usr/lib/jvm/java-11-openjdk-amd64"/>
<property name="user.language" value="en"/>
<property name="java.specification.vendor" value="Oracle Corporation"/>
<property name="awt.toolkit" value="sun.awt.X11.XToolkit"/>
<property name="java.vm.info" value="mixed mode, sharing"/>
<property name="java.version" value="11.0.18"/>
<property name="securerandom.source" value="file:/dev/./urandom"/>
<property name="java.vendor" value="Ubuntu"/>
<property name="maven.home" value="/usr/share/maven"/>
<property name="file.separator" value="/"/>
<property name="java.version.date" value="2023-01-17"/>
<property name="java.vendor.url.bug" value="https://bugs.launchpad.net/ubuntu/+source/openjdk-lts"/>
<property name="sun.cpu.endian" value="little"/>
<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.005"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="OverridingJoystickPosition_IncreasesReferenceSpeed" time="0"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="Test" time="0"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="hetesFeladatTest" time="0.049"/>
<testcase classname="hu.bme.mit.train.system.TrainSystemTest" name="emergencyBrakeTest" time="0"/>
</testsuite>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-------------------------------------------------------------------------------
Test set: hu.bme.mit.train.system.TrainSystemTest
-------------------------------------------------------------------------------
Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.178 sec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public int getJoystickPosition() {
public void overrideJoystickPosition(int joystickPosition) {
this.joystickPosition = joystickPosition;
controller.setJoystickPosition(joystickPosition);

}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hu/bme/mit/train/user/TrainUserImpl.class
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/home/cloud/Desktop/retelab/retelab/train-user/src/main/java/hu/bme/mit/train/user/TrainUserImpl.java