[New] PlcAddressGenerator doesn't require action2 for virtualBoolean anymore
This commit is contained in:
parent
9b29266d89
commit
f474c07d46
|
@ -4,6 +4,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
|||
import static li.strolch.model.xml.StrolchXmlHelper.parseToMap;
|
||||
import static li.strolch.plc.model.PlcConstants.*;
|
||||
import static li.strolch.utils.helper.StringHelper.isEmpty;
|
||||
import static li.strolch.utils.helper.StringHelper.isNotEmpty;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
|
@ -323,8 +324,6 @@ public class PlcAddressGenerator {
|
|||
Resource telegramR;
|
||||
|
||||
if (connection.startsWith("virtualBoolean.")) {
|
||||
if (isEmpty(action2))
|
||||
throw new IllegalStateException("action2 missing for: " + record);
|
||||
|
||||
// telegram for action1
|
||||
telegramR = telegramT.getClone();
|
||||
|
@ -349,6 +348,7 @@ public class PlcAddressGenerator {
|
|||
+ " for connection " + connection);
|
||||
|
||||
// telegram for action2
|
||||
if (isNotEmpty(action2)) {
|
||||
key = resource + "-" + action2;
|
||||
keyName = resource + " - " + action2;
|
||||
telegramR = telegramT.getClone();
|
||||
|
@ -368,10 +368,12 @@ public class PlcAddressGenerator {
|
|||
telegramR.addParameter(valueP);
|
||||
|
||||
add(exportList, telegramR);
|
||||
logicalDevice.getRelationsParam(PARAM_TELEGRAMS, true).addValueIfNotContains(telegramR.getId());
|
||||
logger.info("Added Virtual Boolean PlcTelegram " + telegramR.getId() + " " + telegramR.getName()
|
||||
logicalDevice.getRelationsParam(PARAM_TELEGRAMS, true)
|
||||
.addValueIfNotContains(telegramR.getId());
|
||||
logger.info(
|
||||
"Added Virtual Boolean PlcTelegram " + telegramR.getId() + " " + telegramR.getName()
|
||||
+ " for connection " + connection);
|
||||
|
||||
}
|
||||
} else if (connection.startsWith("virtualString.")) {
|
||||
|
||||
// telegram for action1
|
||||
|
|
Loading…
Reference in New Issue