Skip to content
Permalink
Browse files

add defaults, restore danish Z21

  • Loading branch information...
silverailscolo committed Aug 10, 2019
1 parent 6e03b2e commit 1949abb1dfec5c779ddda42bcc38bd0cbb165103
@@ -55,7 +55,7 @@ public String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
activeSerialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {
@@ -182,6 +182,11 @@ public boolean status() {
return new int[]{9600};
}

@Override
public int defaultBaudIndex() {
return 0;
}

private boolean opened = false;
InputStream serialStream = null;

@@ -47,7 +47,7 @@ public String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
// find the baud rate value, configure comm options
int baud = currentBaudNumber(mBaudRate);
@@ -184,6 +184,11 @@ public DataOutputStream getOutputStream() {
return new int[]{115200};
}

@Override
public int defaultBaudIndex() {
return 0;
}

InputStream serialStream = null;

/**
@@ -186,6 +186,11 @@ public boolean status() {
return new int[]{19200};
}

@Override
public int defaultBaudIndex() {
return 0;
}

// private control members
private boolean opened = false;
InputStream serialInStream = null;
@@ -47,7 +47,7 @@ public String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
activeSerialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {
@@ -163,6 +163,11 @@ public boolean status() {
return new int[]{9600};
}

@Override
public int defaultBaudIndex() {
return 0;
}

// private control members
private boolean opened = false;
InputStream serialStream = null;
@@ -189,6 +189,11 @@ public boolean status() {
return new int[]{16600};
}

@Override
public int defaultBaudIndex() {
return 0;
}

/**
* Set the second port option. Only to be used after construction, but
* before the openPort call
@@ -47,7 +47,7 @@ public String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
activeSerialPort.setSerialPortParams(currentBaudNumber(getCurrentBaudRate()), SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_ODD);
} catch (UnsupportedCommOperationException e) {
@@ -146,7 +146,7 @@ public boolean status() {
*/
@Override
public String[] validBaudRates() {
return new String[]{"38,400 bps"};//IN18N
return new String[]{"38,400 bps"}; //IN18N
}

/**
@@ -157,6 +157,11 @@ public boolean status() {
return new int[]{38400};
}

@Override
public int defaultBaudIndex() {
return 0;
}

// private control members
private boolean opened = false;
InputStream serialStream = null;
@@ -50,7 +50,7 @@ public String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
activeSerialPort.setSerialPortParams(19200, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {
@@ -169,6 +169,11 @@ public boolean status() {
return new int[]{19200};
}

@Override
public int defaultBaudIndex() {
return 0;
}

private boolean opened = false;
InputStream serialStream = null;

@@ -0,0 +1,30 @@
## z21Bundle_da.properties
# Danish translation by Sonny Hansen
# Properties listing translatable text for z21 objects.

Z21MonitorTitle = Z21 Monitor
Z21TrafficTitle = Z21 Trafik

# Z21 message text translation strings
Z21MessageStringSerialNoRequest = Z21 Serie Nummer Anmodning
Z21MessageStringVersionRequest = Z21 Versions Anmodning
Z21MessageXpressNetTunnelRequest = XpressNet Tunnel Meddelelse: {0}

# Z21 Reply text translation strings
# Note: some values contain formatting between pairs of {}'s so do NOT translate the word "number"
Z21ReplyStringSerialNo = Z21 Serie Nummer Svar. Serie Nummer: {0,number}
Z21ReplyStringVersion = Z21 Versions Svar. Hardware Version: 0x{0} Software Version: {1,number,#.##}
Z21XpressNetTunnelReply = XpressNet Tunnel Svar: {0}

# z21.swing items, similar are in z21ActionListBundle
Z21ConfigToolMenuItem = Z21 Konfigurations V\u00e6rkt\u00f8j
SendZ21MessageTitle = Send Z21 Meddelelse

# can sensor feedback values. TODO
Z21_CAN_INPUT_STATUS_FREE_WITH= Free, with voltage
Z21_CAN_INPUT_STATUS_FREE_WITHOUT = Free, without voltage
Z21_CAN_INPUT_STATUS_BUSY_WITH = Busy, with voltage
Z21_CAN_INPUT_STATUS_BUSY_WITHOUT = Busy, without voltage
Z21_CAN_INPUT_STATUS_OVERLOAD_1 = Busy, Overload 1
Z21_CAN_INPUT_STATUS_OVERLOAD_2 = Busy, Overload 2
Z21_CAN_INPUT_STATUS_OVERLOAD_3 = Busy, Overload 3
@@ -81,7 +81,7 @@ public synchronized String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
// find the baud rate value, configure comm options
int baud = currentBaudNumber(mBaudRate);
@@ -192,6 +192,11 @@ public boolean status() {
return new int[]{9600};
}

@Override
public int defaultBaudIndex() {
return 0;
}

/**
* {@inheritDoc}
* This currently does nothing, as there's only one
@@ -83,7 +83,7 @@ public String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
activeSerialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {
@@ -205,6 +205,11 @@ public DataOutputStream getOutputStream() {
return new int[]{9600};
}

@Override
public int defaultBaudIndex() {
return 0;
}

InputStream serialStream = null;

/**
@@ -55,7 +55,7 @@ public String openPort(String portName, String appName) {
return handlePortBusy(p, portName, log);
}

// try to set it for comunication via SerialDriver
// try to set it for communication via SerialDriver
try {
activeSerialPort.setSerialPortParams(9600, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
} catch (UnsupportedCommOperationException e) {
@@ -172,6 +172,11 @@ public boolean status() {
return new int[]{9600};
}

@Override
public int defaultBaudIndex() {
return 0;
}

private boolean opened = false;
InputStream serialStream = null;

0 comments on commit 1949abb

Please sign in to comment.
You can’t perform that action at this time.