repositories
/
des2015.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update language'
[des2015.git]
/
dsl
/
xtend
/
src
/
robots
/
missions
/
generator
/
TaskDSLGenerator.xtend
diff --git
a/dsl/xtend/src/robots/missions/generator/TaskDSLGenerator.xtend
b/dsl/xtend/src/robots/missions/generator/TaskDSLGenerator.xtend
index
d4f6915
..
06f9654
100644
(file)
--- a/
dsl/xtend/src/robots/missions/generator/TaskDSLGenerator.xtend
+++ b/
dsl/xtend/src/robots/missions/generator/TaskDSLGenerator.xtend
@@
-22,7
+22,7
@@
class TaskDSLGenerator implements IGenerator {
var root = resource.allContents.head as Robot;
if(root != null){
fsa.generateFile("nl/ru/des/Constants.java", makeConstants(root));
var root = resource.allContents.head as Robot;
if(root != null){
fsa.generateFile("nl/ru/des/Constants.java", makeConstants(root));
-
//
fsa.generateFile("nl/ru/des/Behaviours.java", makeBehaviours(root.behaviour));
+ fsa.generateFile("nl/ru/des/Behaviours.java", makeBehaviours(root.behaviour));
//fsa.generateFile("nl/ru/des/Missions.java", makeMissions(root.mission));
}
}
//fsa.generateFile("nl/ru/des/Missions.java", makeMissions(root.mission));
}
}
@@
-60,13
+60,14
@@
public class Missions{
package nl.ru.des;
import lejos.hardware.motor.EV3LargeRegulatedMotor;
package nl.ru.des;
import lejos.hardware.motor.EV3LargeRegulatedMotor;
+import nl.ru.des.sensors.SensorCollector;
public class Behaviours{
«FOR b : list»
public static class «b.name»Behaviour extends BasicBehaviour {
public «b.name»Behaviour(SensorCollector sensors, EV3LargeRegulatedMotor rightMotor,
public class Behaviours{
«FOR b : list»
public static class «b.name»Behaviour extends BasicBehaviour {
public «b.name»Behaviour(SensorCollector sensors, EV3LargeRegulatedMotor rightMotor,
- EV3LargeRegulatedMotor leftMotor,
ColorMemory colors
){
- super(sensors, rightMotor, leftMotor,
colors
);
+ EV3LargeRegulatedMotor leftMotor,
EV3LargeRegulatedMotor measMotor
){
+ super(sensors, rightMotor, leftMotor,
measMotor
);
}
«IF b.tc != null»
@Override public boolean takeControl(){
}
«IF b.tc != null»
@Override public boolean takeControl(){
@@
-83,6
+84,8
@@
public class Behaviours{
«a.whichMotor.d.toString()»Motor.setSpeed(«a.spd»);
«ENDIF»
«a.whichMotor.d.toString()»Motor.«a.dir.d.toString()»();
«a.whichMotor.d.toString()»Motor.setSpeed(«a.spd»);
«ENDIF»
«a.whichMotor.d.toString()»Motor.«a.dir.d.toString()»();
+ «ELSEIF a.measureWhat != null»
+ «a.measureWhat.d.toString()»Measure();
«ELSE»
time = System.currentTimeMillis();
while(!suppressed«IF a.time.time > 0» && System.currentTimeMillis()-time>«a.time.time»«ENDIF»){
«ELSE»
time = System.currentTimeMillis();
while(!suppressed«IF a.time.time > 0» && System.currentTimeMillis()-time>«a.time.time»«ENDIF»){