addcom working on train-control unit interactions
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>de.srsoftware</groupId>
|
<groupId>de.srsoftware</groupId>
|
||||||
<artifactId>web4rail</artifactId>
|
<artifactId>web4rail</artifactId>
|
||||||
<version>0.5.3</version>
|
<version>0.5.4</version>
|
||||||
<name>Web4Rail</name>
|
<name>Web4Rail</name>
|
||||||
<description>Java Model Railway Control</description>
|
<description>Java Model Railway Control</description>
|
||||||
<url>https://github.com/StephanRichter/Web4Rail</url>
|
<url>https://github.com/StephanRichter/Web4Rail</url>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const DIV = 'DIV';
|
|||||||
const SVG = 'svg';
|
const SVG = 'svg';
|
||||||
const PLAN = '#plan';
|
const PLAN = '#plan';
|
||||||
const POST = 'POST';
|
const POST = 'POST';
|
||||||
|
const CU = 'cu';
|
||||||
var selected = null;
|
var selected = null;
|
||||||
var mode = null;
|
var mode = null;
|
||||||
|
|
||||||
@@ -48,6 +49,11 @@ function closeWindows(){
|
|||||||
$('.window').remove();
|
$('.window').remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function connectCu(){
|
||||||
|
console.log("connectCU");
|
||||||
|
return request({realm:CU,action:"connect"});
|
||||||
|
}
|
||||||
|
|
||||||
function dropClass(data){
|
function dropClass(data){
|
||||||
var parts = data.split(" ");
|
var parts = data.split(" ");
|
||||||
for (var i=1; i<parts.length; i++) $('#'+parts[0]).removeClass(parts[i]);
|
for (var i=1; i<parts.length; i++) $('#'+parts[0]).removeClass(parts[i]);
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package de.srsoftware.web4rail;
|
package de.srsoftware.web4rail;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.BufferedWriter;
|
||||||
|
import java.io.FileReader;
|
||||||
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@@ -7,6 +11,7 @@ import java.util.HashMap;
|
|||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@@ -26,6 +31,7 @@ public class ControlUnit extends Thread{
|
|||||||
private static final int OK = 200;
|
private static final int OK = 200;
|
||||||
private static final String HOST = "host";
|
private static final String HOST = "host";
|
||||||
private static final String PORT = "port";
|
private static final String PORT = "port";
|
||||||
|
private static final String BUS = "bus";
|
||||||
|
|
||||||
private class Reply{
|
private class Reply{
|
||||||
private long secs;
|
private long secs;
|
||||||
@@ -89,7 +95,14 @@ public class ControlUnit extends Thread{
|
|||||||
writeln("GO"); // switch mode
|
writeln("GO"); // switch mode
|
||||||
reply = new Reply(scanner);
|
reply = new Reply(scanner);
|
||||||
if (reply.code != OK) throw new IOException("Handshake failed: "+reply);
|
if (reply.code != OK) throw new IOException("Handshake failed: "+reply);
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject json() {
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put(HOST, host);
|
||||||
|
json.put(PORT, port);
|
||||||
|
json.put(BUS, bus);
|
||||||
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws InterruptedException {
|
public static void main(String[] args) throws InterruptedException {
|
||||||
@@ -109,7 +122,12 @@ public class ControlUnit extends Thread{
|
|||||||
Fieldset fieldset = new Fieldset(t("Server connection"));
|
Fieldset fieldset = new Fieldset(t("Server connection"));
|
||||||
new Input(HOST,host).addTo(new Label(t("Hostname"))).addTo(fieldset);
|
new Input(HOST,host).addTo(new Label(t("Hostname"))).addTo(fieldset);
|
||||||
new Input(PORT,port).attr("type", "numeric").addTo(new Label(t("Port"))).addTo(fieldset);
|
new Input(PORT,port).attr("type", "numeric").addTo(new Label(t("Port"))).addTo(fieldset);
|
||||||
return new Button(t("Save")).addTo(fieldset).addTo(form).addTo(win);
|
new Input(BUS,bus).attr("type", "numeric").addTo(new Label(t("Bus"))).addTo(fieldset);
|
||||||
|
new Button(t("Save")).addTo(fieldset).addTo(form).addTo(win);
|
||||||
|
|
||||||
|
fieldset = new Fieldset("Actions");
|
||||||
|
new Button(t("Connect"),"connectCu();").addTo(fieldset).addTo(win);
|
||||||
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void queue(String command) {
|
public void queue(String command) {
|
||||||
@@ -120,7 +138,7 @@ public class ControlUnit extends Thread{
|
|||||||
* Should close the server connection and establish new server connection
|
* Should close the server connection and establish new server connection
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private ControlUnit restart() {
|
public ControlUnit restart() {
|
||||||
end();
|
end();
|
||||||
start();
|
start();
|
||||||
return this;
|
return this;
|
||||||
@@ -144,6 +162,12 @@ public class ControlUnit extends Thread{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void save(String filename) throws IOException {
|
||||||
|
BufferedWriter file = new BufferedWriter(new FileWriter(filename));
|
||||||
|
file.write(json()+"\n");
|
||||||
|
file.close();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* send command to Server
|
* send command to Server
|
||||||
* @param command
|
* @param command
|
||||||
@@ -191,7 +215,17 @@ public class ControlUnit extends Thread{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void update(HashMap<String, String> params) {
|
public void update(HashMap<String, String> params) {
|
||||||
// TODO Auto-generated method stub
|
if (params.containsKey(HOST)) host = params.get(HOST);
|
||||||
|
if (params.containsKey(PORT)) port = Integer.parseInt(params.get(PORT));
|
||||||
|
if (params.containsKey(BUS)) bus = Integer.parseInt(params.get(BUS));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void load(String filename) throws IOException {
|
||||||
|
BufferedReader file = new BufferedReader(new FileReader(filename));
|
||||||
|
JSONObject json = new JSONObject(file.readLine());
|
||||||
|
file.close();
|
||||||
|
if (json.has(PORT)) port = json.getInt(PORT);
|
||||||
|
if (json.has(BUS)) bus = json.getInt(BUS);
|
||||||
|
if (json.has(HOST)) host = json.getString(HOST);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ public class Plan {
|
|||||||
public static final String REALM_ROUTE = "route";
|
public static final String REALM_ROUTE = "route";
|
||||||
public static final String REALM_TILE = "tile";
|
public static final String REALM_TILE = "tile";
|
||||||
public static final String REALM_CAR = "car";
|
public static final String REALM_CAR = "car";
|
||||||
|
private static final String ACTION_CONNECT = "connect";
|
||||||
|
|
||||||
public HashMap<String,Tile> tiles = new HashMap<String,Tile>();
|
public HashMap<String,Tile> tiles = new HashMap<String,Tile>();
|
||||||
private HashSet<Block> blocks = new HashSet<Block>();
|
private HashSet<Block> blocks = new HashSet<Block>();
|
||||||
@@ -193,6 +194,15 @@ public class Plan {
|
|||||||
return tile.click();
|
return tile.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Object connect(HashMap<String, String> params) throws IOException {
|
||||||
|
if (params.containsKey(REALM)) switch (params.get(REALM)) {
|
||||||
|
case REALM_CU:
|
||||||
|
controlUnit.restart();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return html();
|
||||||
|
}
|
||||||
|
|
||||||
private Object cuProps(HashMap<String, String> params) {
|
private Object cuProps(HashMap<String, String> params) {
|
||||||
return controlUnit.properties();
|
return controlUnit.properties();
|
||||||
}
|
}
|
||||||
@@ -271,22 +281,28 @@ public class Plan {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Plan load(String filename) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
|
public static Plan load(String filename) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
|
||||||
|
Plan plan = new Plan();
|
||||||
try {
|
try {
|
||||||
Car.loadAll(filename+".cars");
|
Car.loadAll(filename+".cars",plan);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.debug("Was not able to load cars!",e);
|
LOG.warn("Was not able to load cars!",e);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Train.loadAll(filename+".trains");
|
Train.loadAll(filename+".trains");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.debug("Was not able to load trains!",e);
|
LOG.warn("Was not able to load trains!",e);
|
||||||
}
|
}
|
||||||
Plan plan = new Plan();
|
|
||||||
Tile.loadAll(filename+".plan",plan);
|
Tile.loadAll(filename+".plan",plan);
|
||||||
try {
|
try {
|
||||||
Route.loadAll(filename+".routes",plan);
|
Route.loadAll(filename+".routes",plan);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.debug("Was not able to load routes!",e);
|
LOG.warn("Was not able to load routes!",e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
plan.controlUnit.load(filename+".cu");
|
||||||
|
plan.controlUnit.start();
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOG.warn("Was not able to load control unit settings!",e);
|
||||||
}
|
}
|
||||||
return plan;
|
return plan;
|
||||||
}
|
}
|
||||||
@@ -401,6 +417,8 @@ public class Plan {
|
|||||||
return carAction(params);
|
return carAction(params);
|
||||||
case ACTION_CLICK:
|
case ACTION_CLICK:
|
||||||
return click(get(params.get(Tile.ID),true));
|
return click(get(params.get(Tile.ID),true));
|
||||||
|
case ACTION_CONNECT:
|
||||||
|
return connect(params);
|
||||||
case ACTION_CU_PROPS:
|
case ACTION_CU_PROPS:
|
||||||
return cuProps(params);
|
return cuProps(params);
|
||||||
case ACTION_ANALYZE:
|
case ACTION_ANALYZE:
|
||||||
@@ -479,6 +497,7 @@ public class Plan {
|
|||||||
Tile.saveAll(tiles,name+".plan");
|
Tile.saveAll(tiles,name+".plan");
|
||||||
Train.saveAll(name+".trains"); // refers to cars, blocks
|
Train.saveAll(name+".trains"); // refers to cars, blocks
|
||||||
Route.saveAll(routes.values(),name+".routes"); // refers to tiles
|
Route.saveAll(routes.values(),name+".routes"); // refers to tiles
|
||||||
|
controlUnit.save(name+".cu");
|
||||||
return t("Plan saved as \"{}\".",name);
|
return t("Plan saved as \"{}\".",name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -606,4 +625,8 @@ public class Plan {
|
|||||||
public void warn(Contact contact) {
|
public void warn(Contact contact) {
|
||||||
stream(t("Warning: {}",t("Ghost train @ {}",contact)));
|
stream(t("Warning: {}",t("Ghost train @ {}",contact)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void queue(String command) {
|
||||||
|
controlUnit.queue(command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class Car {
|
|||||||
public int length;
|
public int length;
|
||||||
private String stockId = "";
|
private String stockId = "";
|
||||||
private Train train;
|
private Train train;
|
||||||
|
protected Plan plan;
|
||||||
|
|
||||||
public Car(String name) {
|
public Car(String name) {
|
||||||
this(name,null);
|
this(name,null);
|
||||||
@@ -84,7 +85,7 @@ public class Car {
|
|||||||
return new Tag(tagClass).clazz("link").attr("onclick","car("+id+",'"+Car.SHOW+"')").content(name());
|
return new Tag(tagClass).clazz("link").attr("onclick","car("+id+",'"+Car.SHOW+"')").content(name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadAll(String filename) throws IOException {
|
public static void loadAll(String filename, Plan plan) throws IOException {
|
||||||
cars.clear();
|
cars.clear();
|
||||||
BufferedReader file = new BufferedReader(new FileReader(filename));
|
BufferedReader file = new BufferedReader(new FileReader(filename));
|
||||||
String line = file.readLine();
|
String line = file.readLine();
|
||||||
@@ -93,23 +94,29 @@ public class Car {
|
|||||||
String name = json.getString(Car.NAME);
|
String name = json.getString(Car.NAME);
|
||||||
String id = json.getString(Car.ID);
|
String id = json.getString(Car.ID);
|
||||||
Car car = json.has(Locomotive.LOCOMOTIVE) ? new Locomotive(name, id) : new Car(name,id);
|
Car car = json.has(Locomotive.LOCOMOTIVE) ? new Locomotive(name, id) : new Car(name,id);
|
||||||
car.load(json);
|
car.load(json).plan(plan);
|
||||||
|
|
||||||
line = file.readLine();
|
line = file.readLine();
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void load(JSONObject json) {
|
protected Car load(JSONObject json) {
|
||||||
if (json.has(ID)) id = json.getString(ID);
|
if (json.has(ID)) id = json.getString(ID);
|
||||||
if (json.has(LENGTH)) length = json.getInt(LENGTH);
|
if (json.has(LENGTH)) length = json.getInt(LENGTH);
|
||||||
if (json.has(STOCK_ID)) stockId = json.getString(STOCK_ID);
|
if (json.has(STOCK_ID)) stockId = json.getString(STOCK_ID);
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
String name(){
|
String name(){
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Car plan(Plan plan) {
|
||||||
|
this.plan = plan;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public Tag propertyForm() {
|
public Tag propertyForm() {
|
||||||
Form form = new Form();
|
Form form = new Form();
|
||||||
new Input(Plan.ACTION, Plan.ACTION_UPDATE).hideIn(form);
|
new Input(Plan.ACTION, Plan.ACTION_UPDATE).hideIn(form);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ import de.srsoftware.web4rail.tags.Radio;
|
|||||||
public class Locomotive extends Car {
|
public class Locomotive extends Car {
|
||||||
|
|
||||||
public enum Protocol{
|
public enum Protocol{
|
||||||
DCC14,DCC27,DCC28,DCC128,MOTO;
|
DCC14,DCC27,DCC28,DCC128,MOTO,FLEISCH,SELECTRIX,ZIMO;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String REVERSE = "reverse";
|
private static final String REVERSE = "reverse";
|
||||||
@@ -28,6 +28,7 @@ public class Locomotive extends Car {
|
|||||||
private boolean reverse = false;
|
private boolean reverse = false;
|
||||||
private Protocol proto = Protocol.DCC128;
|
private Protocol proto = Protocol.DCC128;
|
||||||
private int address = 3;
|
private int address = 3;
|
||||||
|
private boolean init = false;
|
||||||
|
|
||||||
public Locomotive(String name) {
|
public Locomotive(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
@@ -36,6 +37,32 @@ public class Locomotive extends Car {
|
|||||||
public Locomotive(String name, String id) {
|
public Locomotive(String name, String id) {
|
||||||
super(name,id);
|
super(name,id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
if (init) return;
|
||||||
|
String proto = null;
|
||||||
|
switch (this.proto) {
|
||||||
|
case FLEISCH:
|
||||||
|
proto = "F"; break;
|
||||||
|
case MOTO:
|
||||||
|
proto = "M 2 100 0"; break; // TODO: make configurable
|
||||||
|
case DCC14:
|
||||||
|
proto = "N 1 14 5"; break; // TODO: make configurable
|
||||||
|
case DCC27:
|
||||||
|
proto = "N 1 27 5"; break; // TODO: make configurable
|
||||||
|
case DCC28:
|
||||||
|
proto = "N 1 28 5"; break; // TODO: make configurable
|
||||||
|
case DCC128:
|
||||||
|
proto = "N 1 128 5"; break; // TODO: make configurable
|
||||||
|
case SELECTRIX:
|
||||||
|
proto = "S"; break;
|
||||||
|
case ZIMO:
|
||||||
|
proto = "Z"; break;
|
||||||
|
}
|
||||||
|
plan.queue("INIT {} GL "+address+" "+proto);
|
||||||
|
init = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject json() {
|
public JSONObject json() {
|
||||||
@@ -58,7 +85,7 @@ public class Locomotive extends Car {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void load(JSONObject json) {
|
protected Car load(JSONObject json) {
|
||||||
super.load(json);
|
super.load(json);
|
||||||
if (json.has(LOCOMOTIVE)) {
|
if (json.has(LOCOMOTIVE)) {
|
||||||
JSONObject loco = json.getJSONObject(LOCOMOTIVE);
|
JSONObject loco = json.getJSONObject(LOCOMOTIVE);
|
||||||
@@ -66,6 +93,7 @@ public class Locomotive extends Car {
|
|||||||
if (loco.has(PROTOCOL)) proto = Protocol.valueOf(loco.getString(PROTOCOL));
|
if (loco.has(PROTOCOL)) proto = Protocol.valueOf(loco.getString(PROTOCOL));
|
||||||
if (loco.has(ADDRESS)) address = loco.getInt(ADDRESS);
|
if (loco.has(ADDRESS)) address = loco.getInt(ADDRESS);
|
||||||
}
|
}
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Object manager() {
|
public static Object manager() {
|
||||||
@@ -104,6 +132,8 @@ public class Locomotive extends Car {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setSpeed(int v) {
|
public void setSpeed(int v) {
|
||||||
|
init();
|
||||||
|
plan.queue("SET {} GL "+address+" "+(reverse?1:0)+" "+v+" 128 0 0 0 0 0");
|
||||||
LOG.debug("{}.setSpeed({})",this,v);
|
LOG.debug("{}.setSpeed({})",this,v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -284,11 +284,11 @@ public class Train {
|
|||||||
if (block != null) {
|
if (block != null) {
|
||||||
new Tag("li").content(t("Current location: {}",block)).addTo(list);
|
new Tag("li").content(t("Current location: {}",block)).addTo(list);
|
||||||
Tag actions = new Tag("li").clazz().content(t("Actions: "));
|
Tag actions = new Tag("li").clazz().content(t("Actions: "));
|
||||||
new Tag("span").clazz("link").attr("onclick","train("+id+",'"+MODE_START+"')").content(" "+t("start")+" ").addTo(actions);
|
new Button(t("start"),"train("+id+",'"+MODE_START+"')").addTo(actions);
|
||||||
if (autopilot == null) {
|
if (autopilot == null) {
|
||||||
new Tag("span").attr("onclick","train("+id+",'"+MODE_AUTO+"')").content(" "+t("auto")+" ").addTo(actions);
|
new Button(t("auto"),"train("+id+",'"+MODE_AUTO+"')").addTo(actions);
|
||||||
} else {
|
} else {
|
||||||
new Tag("span").clazz("link").attr("onclick","train("+id+",'"+MODE_STOP+"')").content(" "+t("stop")+" ").addTo(actions);
|
new Button(t("stop"),"train("+id+",'"+MODE_STOP+"')").addTo(actions);
|
||||||
}
|
}
|
||||||
actions.addTo(list);
|
actions.addTo(list);
|
||||||
|
|
||||||
|
|||||||
@@ -11,5 +11,10 @@ public class Button extends Tag {
|
|||||||
attr("type", "submit");
|
attr("type", "submit");
|
||||||
content(text);
|
content(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Button(String text,String action) {
|
||||||
|
super("button");
|
||||||
|
attr("onclick",action).content(text);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.json.JSONObject;
|
|||||||
import de.srsoftware.tools.Tag;
|
import de.srsoftware.tools.Tag;
|
||||||
import de.srsoftware.web4rail.Connector;
|
import de.srsoftware.web4rail.Connector;
|
||||||
import de.srsoftware.web4rail.moving.Train;
|
import de.srsoftware.web4rail.moving.Train;
|
||||||
|
import de.srsoftware.web4rail.tags.Button;
|
||||||
import de.srsoftware.web4rail.tags.Checkbox;
|
import de.srsoftware.web4rail.tags.Checkbox;
|
||||||
import de.srsoftware.web4rail.tags.Input;
|
import de.srsoftware.web4rail.tags.Input;
|
||||||
import de.srsoftware.web4rail.tags.Label;
|
import de.srsoftware.web4rail.tags.Label;
|
||||||
@@ -83,7 +84,7 @@ public abstract class Block extends StretchableTile{
|
|||||||
if (train != null) {
|
if (train != null) {
|
||||||
new Tag("h4").content(t("Train:")).addTo(window);
|
new Tag("h4").content(t("Train:")).addTo(window);
|
||||||
train.link("span").addTo(window);
|
train.link("span").addTo(window);
|
||||||
new Tag("span").clazz("link").attr("onclick","train("+train.id+",'"+Train.MODE_START+"')").content(" - "+t("start")).addTo(window);
|
new Button(t("start"),"train("+train.id+",'"+Train.MODE_START+"')").addTo(window);
|
||||||
}
|
}
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,6 +303,12 @@ public abstract class Tile {
|
|||||||
case WEST:
|
case WEST:
|
||||||
new Tag("polygon").clazz("oneway").attr("points", "0,50 25,35 25,65").addTo(svg);
|
new Tag("polygon").clazz("oneway").attr("points", "0,50 25,35 25,65").addTo(svg);
|
||||||
break;
|
break;
|
||||||
|
case SOUTH:
|
||||||
|
new Tag("polygon").clazz("oneway").attr("points", "50,100 35,75 65,75").addTo(svg);
|
||||||
|
break;
|
||||||
|
case NORTH:
|
||||||
|
new Tag("polygon").clazz("oneway").attr("points", "50,0 35,25 65,25").addTo(svg);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user