@ -45,7 +45,7 @@ Command to send to control unit\: : Kommando, welches zur Zentrale gesendet werd
@@ -45,7 +45,7 @@ Command to send to control unit\: : Kommando, welches zur Zentrale gesendet werd
Create action : Aktion erzeugen
Current location : Aufenthaltsort
Current location\: {} : Aufenthaltsort: {}
Current velocity\: {} km/h : Aktuelle Geschwindigkeit: {} km/h
Current velocity\: {} {} : Aktuelle Geschwindigkeit: {} {}
Delay : Verzögerung
DelayedAction : verzögerte Aktion
delete : entfernen
@ -76,7 +76,7 @@ if ({})\: : falls ({}):
@@ -76,7 +76,7 @@ if ({})\: : falls ({}):
@ -37,6 +37,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -37,6 +37,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@ -45,6 +46,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -45,6 +46,7 @@ public class Car extends BaseClass implements Comparable<Car>{
protectedStringstockId="";
privateTraintrain;
protectedPlanplan;
protectedintmaxSpeed=0;
publicCar(Stringname){
this(name,null);
@ -94,6 +96,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -94,6 +96,7 @@ public class Car extends BaseClass implements Comparable<Car>{
json.put(ID,id);
json.put(NAME,name);
json.put(LENGTH,length);
if(maxSpeed!=0)json.put(MAX_SPEED,maxSpeed);
json.put(STOCK_ID,stockId);
if(!tags.isEmpty())json.put(TAGS,tags);
returnjson;
@ -122,7 +125,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -122,7 +125,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@ -139,6 +142,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -139,6 +142,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@ -149,8 +153,8 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -149,8 +153,8 @@ public class Car extends BaseClass implements Comparable<Car>{
newTag("h4").content(t("known cars")).addTo(win);
newTag("p").content(t("Click on a name to edit the entry.")).addTo(win);
@ -163,6 +167,10 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -163,6 +167,10 @@ public class Car extends BaseClass implements Comparable<Car>{
returnwin;
}
publicintmaxSpeed(){
returnmaxSpeed;
}
Stringname(){
returnname;
}
@ -186,6 +194,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -186,6 +194,7 @@ public class Car extends BaseClass implements Comparable<Car>{
@ -235,8 +244,9 @@ public class Car extends BaseClass implements Comparable<Car>{
@@ -235,8 +244,9 @@ public class Car extends BaseClass implements Comparable<Car>{
@ -27,7 +27,6 @@ public class Locomotive extends Car implements Constants,Device{
@@ -27,7 +27,6 @@ public class Locomotive extends Car implements Constants,Device{
privatestaticfinalStringREVERSE="reverse";
publicstaticfinalStringLOCOMOTIVE="locomotive";
privatestaticfinalintVMAX=128;
privatebooleanreverse=false;
privateProtocolproto=Protocol.DCC128;
privateintaddress=3;
@ -96,7 +95,7 @@ public class Locomotive extends Car implements Constants,Device{
@@ -96,7 +95,7 @@ public class Locomotive extends Car implements Constants,Device{
@ -146,17 +145,12 @@ public class Locomotive extends Car implements Constants,Device{
@@ -146,17 +145,12 @@ public class Locomotive extends Car implements Constants,Device{
caseMOTO:
proto="M 2 100 0";break;// TODO: make configurable
caseDCC14:
proto="N 1 14 5";break;// TODO: make configurable
caseDCC27:
proto="N 1 27 5";break;// TODO: make configurable
caseDCC28:
proto="N 1 28 5";break;// TODO: make configurable
caseDCC128:
proto="N 1 128 5";break;// TODO: make configurable
proto="N 1 "+this.proto.steps+" 5";break;// TODO: make configurable
@ -182,8 +176,7 @@ public class Locomotive extends Car implements Constants,Device{
@@ -182,8 +176,7 @@ public class Locomotive extends Car implements Constants,Device{
JSONObjectloco=newJSONObject();
loco.put(REVERSE,reverse);
loco.put(PROTOCOL,proto);
loco.put(ADDRESS,address);
loco.put(ADDRESS,address);
json.put(LOCOMOTIVE,loco);
returnjson;
}
@ -214,14 +207,14 @@ public class Locomotive extends Car implements Constants,Device{
@@ -214,14 +207,14 @@ public class Locomotive extends Car implements Constants,Device{
newTag("p").content(t("Click on a name to edit the entry.")).addTo(win);
@ -246,6 +239,7 @@ public class Locomotive extends Car implements Constants,Device{
@@ -246,6 +239,7 @@ public class Locomotive extends Car implements Constants,Device{
@ -264,7 +258,8 @@ public class Locomotive extends Car implements Constants,Device{
@@ -264,7 +258,8 @@ public class Locomotive extends Car implements Constants,Device{
@ -274,11 +269,16 @@ public class Locomotive extends Car implements Constants,Device{
@@ -274,11 +269,16 @@ public class Locomotive extends Car implements Constants,Device{