Commit b7a88dcb authored by vonWenckstern's avatar vonWenckstern
Browse files

Merge branch 'MvW-Grammar-Extension' into 'master'

Mv w grammar extension

See merge request !11
parents 35ddefb1 b56dd4ba
Pipeline #72928 passed with stage
in 2 minutes and 39 seconds
......@@ -30,7 +30,7 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc</artifactId>
<version>0.1.5-SNAPSHOT</version>
<version>0.1.6-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
......@@ -43,8 +43,8 @@
<se-commons.version>1.7.7</se-commons.version>
<mc.grammars.assembly.version>0.0.6-SNAPSHOT</mc.grammars.assembly.version>
<languages.version>4.0.1-SNAPSHOT</languages.version>
<struct.version>0.0.14-SNAPSHOT</struct.version>
<Common-MontiCar.version>0.0.14-SNAPSHOT</Common-MontiCar.version>
<struct.version>0.0.17-SNAPSHOT</struct.version>
<Common-MontiCar.version>0.0.17-SNAPSHOT</Common-MontiCar.version>
<tagging.version>0.0.6</tagging.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
......
......@@ -97,7 +97,7 @@ public class ExpandedComponentInstanceTest extends AbstractSymtabTest {
}
/* TODO add more tests*/
// @Ignore
@Ignore("fix type, the type is Q and not RangeType")
@Test
public void testSubGenericInstance() throws Exception {
Scope symTab = createSymTab("src/test/resources/symtab");
......
......@@ -34,6 +34,7 @@ import de.monticore.symboltable.Scope;
import de.se_rwth.commons.logging.Log;
import org.jscience.mathematics.number.Rational;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import java.util.ArrayList;
......@@ -74,7 +75,7 @@ public class SymtabTest extends AbstractSymtabTest {
* <p>
* }
*/
//@Ignore
@Ignore("fix type, the type is Q and not SIUnitRangesType")
@Test
public void testSIUnitRangeSimpleUnit() {
Scope symTab = createSymTab("src/test/resources");
......@@ -106,6 +107,7 @@ public class SymtabTest extends AbstractSymtabTest {
* <p>
* }
*/
@Ignore("fix type, the type is Q and not SIUnitRangesType")
@Test
public void testSIUnitRangeMultiUnit() {
Scope symTab = createSymTab("src/test/resources");
......@@ -171,6 +173,7 @@ public class SymtabTest extends AbstractSymtabTest {
* ports in [ -oo km : 45 km)] distance;
* }
*/
@Ignore("fix type, the type is Q and not SIUnitRangesType")
@Test
public void testSIUnitRangeNoLowerBounds() {
Scope symTab = createSymTab("src/test/resources");
......@@ -199,6 +202,7 @@ public class SymtabTest extends AbstractSymtabTest {
* ports in (0 m : oo m) distance;
* }
*/
@Ignore("fix type, the type is Q and not SIUnitRangesType")
@Test
public void testSIUnitRangeNoUpperBounds() {
Scope symTab = createSymTab("src/test/resources");
......
package a;
component SteeringAngleCalculator{
ports in Q(-90°:90°) x[2],
in Q(-180°:180°) y[2],
in Q(-90°:90°) gpsX,
in Q(-180°:180°) gpsY,
in Q(-180°:180°) orientation,
in Q(-180°:180°) currentSteeringAngle,
in Q(-180°:180°) minSteeringAngle,
in Q(-180°:180°) maxSteeringAngle,
out Q(-180°:180°) newSteeringAngle;
ports in (-90°:90°) x[2],
in (-180°:180°) y[2],
in (-90°:90°) gpsX,
in (-180°:180°) gpsY,
in (-180°:180°) orientation,
in (-180°:180°) currentSteeringAngle,
in (-180°:180°) minSteeringAngle,
in (-180°:180°) maxSteeringAngle,
out (-180°:180°) newSteeringAngle;
}
\ No newline at end of file
package autocart.navigation;
component PathPlaner(Q(0:1:oo) n){
component PathPlaner((0:1:oo) n){
port
in Q(-1:1:oo) destination,
in Q(-1:1:oo) start,
in (-1:1:oo) destination,
in (-1:1:oo) start,
in Q^{n,n} distMatrix,
in Q(-1:1:n) curPathIndex,
in Q(-1:1:n) prevPathIndex,
out Q(-1:1:n) nextPathIndex;
in (-1:1:n) curPathIndex,
in (-1:1:n) prevPathIndex,
out (-1:1:n) nextPathIndex;
}
\ No newline at end of file
......@@ -4,8 +4,8 @@ import fas.demo_fas_Fkt_m.brakeAssistant_m.Brake_Booster;
component BrakeAssistant {
port
in Z(0:255) BrakeForce_pedal_pc,
out Z(0:255) BrakeForceBoosted_pc;
in (0:255) BrakeForce_pedal_pc,
out (0:255) BrakeForceBoosted_pc;
instance Brake_Booster brake;
......
......@@ -12,14 +12,14 @@ component Distronic {
in B CC_active_b,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_ms,
in (0m:1m:200m) Distance_Object_m,
in Z(0:255) Distance_stat,
in (0:255) Distance_stat,
in (0m/s:0.28m/s:1820.39m/s) V_Obj_rel_kmh,
in B FTS_active_b,
in (0m:200m) FTS_Abstand_soll_m,
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
out (0:255) BrakeForce_Distronic_pc,
out (0:255) Decelerator_pc;
instance SwitchB<Z(0:255)> switch1, switch2, switch3, switch4, switch5, switch6;
instance SwitchB<(0:255)> switch1, switch2, switch3, switch4, switch5, switch6;
instance And and1, and2, and3, and4, and5;
instance Not<Boolean> not1, not2;
instance Distronic_Enabled dist_Enabled;
......
......@@ -13,14 +13,14 @@ component Distronic_edited {
in B CC_active_b,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_ms,
in (0m:1m:200m) Distance_Object_m,
in Z(0:255) Distance_stat,
in (0:255) Distance_stat,
in (0m/s:0.28m/s:1820.39m/s) V_Obj_rel_kmh,
in B FTS_active_b,
in (0m:200m) FTS_Abstand_soll_m,
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
out (0:255) BrakeForce_Distronic_pc,
out (0:255) Decelerator_pc;
instance SwitchB<Z(0:255)> switch1, switch2, switch3, switch4, switch5, switch6;
instance SwitchB<(0:255)> switch1, switch2, switch3, switch4, switch5, switch6;
instance And and1, and2, and3, and4, and5;
instance Not<Boolean> not1, not2;
instance Distronic_Enabled dist_Enabled;
......
......@@ -9,13 +9,13 @@ component EmergencyBrake {
in (0m:1m:200m) Distance_Object_m,
in (0m/s:0.28m/s:1820.39m/s) V_Obj_rel_ms,
in B cond,
out Z(0:255) BrakeForce_Emergency_pc,
out (0:255) BrakeForce_Emergency_pc,
out B Acusti_warn_b;
instance EmergencyBrake_Function eBrake_Function;
instance SwitchB<Z(0:255)> switch1;
instance SwitchB<(0:255)> switch1;
instance SwitchB<Boolean> switch2;
instance Memory<Z(0:255)>(0) mem1;
instance Memory<(0:255)>(0) mem1;
instance Memory<Boolean>(false) mem2;
connect V_Vehicle_ms -> eBrake_Function.V_Vehicle_ms;
......
......@@ -6,23 +6,23 @@ component FAS {
port
in B ParkingBrake_b,
// Winkel BrakeForce_pedal = (0°:0.2°:45°), codiert in 8-bit
in Z(0:255) BrakeForce_pedal_pc, // BRMS_STATUS
in (0:255) BrakeForce_pedal_pc, // BRMS_STATUS
// Winkel Accelaration_pedal = (0°:0.2°:45°)
in Z(0:255) Accelaration_pedal_pc, // GAS_STATUS
in (0:255) Accelaration_pedal_pc, // GAS_STATUS
in B CruiseControl_b,
in B Limiter_b,
in Z(0:7) LeverUp_stat, // TMP_POS
in Z(0:7) LeverDown_stat, // TMP_POS
in (0:7) LeverUp_stat, // TMP_POS
in (0:7) LeverDown_stat, // TMP_POS
// Geschwindigkeit = (0km/h:0.1km/h:6553.4km/h)
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh, // R_Fahrzeuggeschwindigkeit_kmh
in Z(0:255) V_Sign_kmh, // R_TrafficSign, 8-bit Datenstruktur
in (0:255) V_Sign_kmh, // R_TrafficSign, 8-bit Datenstruktur
in B Sign_b,
in Z(0:255) Distance_stat, // RDR_DETECT, 8-bit Datenstruktur
in (0:255) Distance_stat, // RDR_DETECT, 8-bit Datenstruktur
in (0m/s:2.8m/s:1820.39m/s) V_Obj_rel_kmh,
in (0m:1m:200m) Distance_Object_m, // siehe: RDR_DETECT
out B CC_active_b,
out Z(0:255) Accelaration_pc,
out Z(0:255) BrakeForce_pc,
out (0:255) Accelaration_pc,
out (0:255) BrakeForce_pc,
out (0m/s:2.8m/s:1820.39m/s) CCSetValue_kmh,
out (0m/s:2.8m/s:1820.39m/s) LimiterSetValue_kmh,
out B Limiter_active_b,
......
......@@ -6,11 +6,11 @@ import fas.demo_fas_Fkt_m.lim_m.Limiter_Function;
component Limiter {
port
in B Limiter_b,
in Z(0:255) Accelaration_pedal_pc,
in (0:255) Accelaration_pedal_pc,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh,
in Z(0:7) LeverUp_stat,
in Z(0:7) LeverDown_stat,
in Z(0:255) V_Sign_kmh,
in (0:7) LeverUp_stat,
in (0:7) LeverDown_stat,
in (0:255) V_Sign_kmh,
in B Sign_b,
out (0m/s:0.28m/s:1820.39m/s) VMax_kmh,
out B Limiter_active_b,
......
......@@ -6,11 +6,11 @@ import fas.demo_fas_Fkt_m.lim_m.Limiter_Function_edited;
component Limiter_edited {
port
in B Limiter_b,
in Z(0:255) Accelaration_pedal_pc,
in (0:255) Accelaration_pedal_pc,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh,
in Z(0:7) LeverUp_stat,
in Z(0:7) LeverDown_stat,
in Z(0:255) V_Sign_kmh,
in (0:7) LeverUp_stat,
in (0:7) LeverDown_stat,
in (0:255) V_Sign_kmh,
in B Sign_b,
in B Enable,
out (0m/s:0.28m/s:1820.39m/s) VMax_kmh,
......
......@@ -6,13 +6,13 @@ import fas.demo_fas_Fkt_m.tem_m.Tempomat_Function;
component Tempomat {
port
in B ParkingBrake_b,
in Z(0:255) BrakeForce_pedal_pc,
in (0:255) BrakeForce_pedal_pc,
in B CruiseControl_b,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh,
in B Limiter_b,
in B FTS_active_b,
in Z(0:7) LeverUp_Stat,
in Z(0:7) LeverDown_Stat,
in (0:7) LeverUp_Stat,
in (0:7) LeverDown_Stat,
out (0m/s:0.28m/s:1820.39m/s) V_CC_delta_kmh,
out B CC_active_b;
......
......@@ -6,13 +6,13 @@ import fas.demo_fas_Fkt_m.tem_m.Tempomat_Function_edited;
component Tempomat_edited {
port
in B ParkingBrake_b,
in Z(0:255) BrakeForce_pedal_pc,
in (0:255) BrakeForce_pedal_pc,
in B CruiseControl_b,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh,
in B Limiter_b,
in B FTS_active_b,
in Z(0:7) LeverUp_Stat,
in Z(0:7) LeverDown_Stat,
in (0:7) LeverUp_Stat,
in (0:7) LeverDown_Stat,
in B Enable,
out (0m/s:0.28m/s:1820.39m/s) V_CC_delta_kmh,
out B CC_active_b;
......
......@@ -4,27 +4,27 @@ import fas.basicLibrary.*;
component VelocityControl {
port
in Z(0:255) BrakeForceBoosted_pc,
in (0:255) BrakeForceBoosted_pc,
in (-1820.39m/s:0.28m/s:1820.39m/s) V_CC_delta_kmh,
in (0m/s:0.28m/s:1820.39m/s) VMax_kmh,
in Z(0:255) Accelaration_pedal_pc,
in (0:255) Accelaration_pedal_pc,
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_kmh,
in Z(0:255) BrakeForce_pedal_pc,
in Z(0:255) BrakeForce_Distronic_pc,
in Z(0:255) Decelerator_pc,
in Z(0:255) BrakeForce_Emergency_pc,
out Z(0:255) Accelaration_pc,
out Z(0:255) BrakeForce_pc;
in (0:255) BrakeForce_pedal_pc,
in (0:255) BrakeForce_Distronic_pc,
in (0:255) Decelerator_pc,
in (0:255) BrakeForce_Emergency_pc,
out (0:255) Accelaration_pc,
out (0:255) BrakeForce_pc;
instance Saturation<(-1820.39m/s:0.28m/s:1820.39m/s)> sat1, sat2;
instance LookUpM<(0m/s:0.28m/s:1820.39m/s),Z(0:100)> look1,look2;
instance Max<Z(0:255)> max1;
instance Max<Z(0:255),5> max2;
instance SwitchB<Z(0:255)> switch1;
instance SwitchM<Z(0:255)> switch2, switch3;
instance LookUpM<(0m/s:0.28m/s:1820.39m/s),(0:100)> look1,look2;
instance Max<(0:255)> max1;
instance Max<(0:255),5> max2;
instance SwitchB<(0:255)> switch1;
instance SwitchM<(0:255)> switch2, switch3;
instance Greater<(0m/s:0.28m/s:1820.39m/s)> greater1, greater2;
instance And and1;
instance MultDiv<Z(0:255)> mul;
instance MultDiv<(0:255)> mul;
connect Decelerator_pc -> mul.in1;
connect V_Vehicle_kmh -> greater1.in1;
......
......@@ -5,11 +5,11 @@ import fas.basicLibrary.*;
component Brake_Booster {
port
in Z(0:255) BrakeForce_pedal_pc,
out Z(0:255) BrakeForceBoosted_pc;
in (0:255) BrakeForce_pedal_pc,
out (0:255) BrakeForceBoosted_pc;
instance GreaterEquals<Z(0:255)> greaterEq;
instance SwitchB<Z(0:255)> switch1;
instance GreaterEquals<(0:255)> greaterEq;
instance SwitchB<(0:255)> switch1;
connect BrakeForce_pedal_pc -> greaterEq.in1, switch1.in3;
connect 70 /*demo_fas_BrakeBooster_Threshold*/ -> greaterEq.in2;
......
......@@ -4,8 +4,8 @@ import fas.basicLibrary.*;
component Distronic_Deactive {
port
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
out (0:255) BrakeForce_Distronic_pc,
out (0:255) Decelerator_pc;
connect 0 -> BrakeForce_Distronic_pc;
connect 100 -> Decelerator_pc;
......
......@@ -4,8 +4,8 @@ import fas.basicLibrary.*;
component Distronic_Disabled {
port
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
out (0:255) BrakeForce_Distronic_pc,
out (0:255) Decelerator_pc;
connect 0 -> BrakeForce_Distronic_pc;
......
......@@ -6,16 +6,16 @@ component Distronic_Enabled {
port
in (0m/s:0.28m/s:1820.39m/s) V_Vehicle_ms,
in (0m:200m) Distance_Object_m,
in Z(0:255) Distance_stat,
in (0:255) Distance_stat,
in (-1820.39m/s:0.28m/s:1820.39m/s) V_Obj_rel_kmh,
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
out (0:255) BrakeForce_Distronic_pc,
out (0:255) Decelerator_pc;
instance SwitchMultiport<Q(0:255),3> switch1;
instance SwitchB<Z(0:255)> switch2;
instance SwitchMultiport<(0:255),3> switch1;
instance SwitchB<(0:255)> switch2;
instance Multiplication<(0m/s:0.28m/s:1820.39m/s)> mult1, mult2, mult3;
instance PlusMinusPlus<(-oo:d:oo)> pmp1;
instance LookUpM<(-1820.39m/s:0.28m/s:1820.39m/s),Z(0:255)> look1, look2, look3, look4, look5;
instance LookUpM<(-1820.39m/s:0.28m/s:1820.39m/s),(0:255)> look1, look2, look3, look4, look5;
instance Smaller<(0m:200m)> smaller1;
connect Distance_stat -> switch1.in1;
......
......@@ -7,14 +7,14 @@ component Distronic_FTS_Enabled {
in (0m:200m) Distance_Object_m,
in (0m:200m) FTS_Abstand_soll_m,
in (-1820.39m/s:0.28m/s:1820.39m/s) V_Obj_rel_kmh,
out Z(0:255) BrakeForce_Distronic_pc,
out Z(0:255) Decelerator_pc;
out (0:255) BrakeForce_Distronic_pc,
out (0:255) Decelerator_pc;
instance PlusMinus<(0m:200m)> plusMinus1;
instance LookUpM<(-1820.39m/s:0.28m/s:1820.39m/s),Z(0:255)> look1, look2;
instance LookUpM<(-1820.39m/s:0.28m/s:1820.39m/s),(0:255)> look1, look2;
instance Smaller<(0m:200m)> smaller1;
instance Multiplication<Z(0:255)> mult1;
instance SwitchB<Z(0:255)> switch1;
instance Multiplication<(0:255)> mult1;
instance SwitchB<(0:255)> switch1;
connect Distance_Object_m -> smaller1.in1, plusMinus1.in1;
connect FTS_Abstand_soll_m -> plusMinus1.in2;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment