@ -22,10 +23,12 @@ public class Locomotive extends Car implements Constants,Device{
@@ -22,10 +23,12 @@ public class Locomotive extends Car implements Constants,Device{
privatestaticfinalStringREVERSE="reverse";
publicstaticfinalStringLOCOMOTIVE="locomotive";
privatestaticfinalintVMAX=128;
privatebooleanreverse=false;
privateProtocolproto=Protocol.DCC128;
privateintaddress=3;
privateintspeed=0;
privatebooleanf1,f2,f3,f4;
privatebooleaninit=false;
publicLocomotive(Stringname){
@ -36,12 +39,12 @@ public class Locomotive extends Car implements Constants,Device{
@@ -36,12 +39,12 @@ public class Locomotive extends Car implements Constants,Device{
@ -50,6 +53,14 @@ public class Locomotive extends Car implements Constants,Device{
@@ -50,6 +53,14 @@ public class Locomotive extends Car implements Constants,Device{
returnloco.faster(-10);
caseACTION_STOP:
returnloco.stop();
caseACTION_TOGGLE_F1:
returnloco.toggleFunction(1);
caseACTION_TOGGLE_F2:
returnloco.toggleFunction(2);
caseACTION_TOGGLE_F3:
returnloco.toggleFunction(3);
caseACTION_TOGGLE_F4:
returnloco.toggleFunction(4);
caseACTION_TURN:
returnloco.turn();
}
@ -57,16 +68,53 @@ public class Locomotive extends Car implements Constants,Device{
@@ -57,16 +68,53 @@ public class Locomotive extends Car implements Constants,Device{
@ -160,6 +208,12 @@ public class Locomotive extends Car implements Constants,Device{
@@ -160,6 +208,12 @@ public class Locomotive extends Car implements Constants,Device{
@ -171,13 +225,18 @@ public class Locomotive extends Car implements Constants,Device{
@@ -171,13 +225,18 @@ public class Locomotive extends Car implements Constants,Device{