Skip to content

Commit

Permalink
fix: tweak Logix names
Browse files Browse the repository at this point in the history
  • Loading branch information
rhwood committed Jun 8, 2020
1 parent 24a7123 commit 629e0fd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion java/src/jmri/jmrit/beantable/LRouteTableAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,8 @@ public void setValueAt(Object type, int r, int c) {
SET_TO_FLASHYELLOW, SET_TO_GREEN, SET_TO_FLASHGREEN};

private static String getLogixSystemPrefix() {
return InstanceManager.getDefault(LogixManager.class).getSystemPrefix() + ":RTX:";
// Note: RouteExportToLogix uses ":RTX:" which is right?
return InstanceManager.getDefault(LogixManager.class).getSystemNamePrefix() + ":RTX";
}

// should be private or package protected, but hey, its Logix! so its public
Expand Down
18 changes: 9 additions & 9 deletions java/src/jmri/jmrit/beantable/routetable/RouteExportToLogix.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
*/
public class RouteExportToLogix {

private final String LOGIX_SYS_NAME;
private final String CONDITIONAL_SYS_PREFIX;
private final String logixSysName;
private final String conditionalSysPrefix;
private final String systemName;
private final RouteManager routeManager;
private final LogixManager logixManager;
Expand All @@ -42,12 +42,12 @@ public class RouteExportToLogix {
this.conditionalManager = conditionalManager;

String logixPrefix = logixManager.getSystemNamePrefix();
LOGIX_SYS_NAME = logixPrefix + ":RTX:";
CONDITIONAL_SYS_PREFIX = LOGIX_SYS_NAME + "C";
logixSysName = logixPrefix + ":RTX:";
conditionalSysPrefix = logixSysName + "C";
}

public void export() {
String logixSystemName = LOGIX_SYS_NAME + systemName;
String logixSystemName = logixSysName + systemName;
Route route = routeManager.getBySystemName(systemName);
if(route == null ){
log.error("Route {} does not exist",systemName);
Expand Down Expand Up @@ -147,13 +147,13 @@ private void removeOldConditionalNames(Route route,Logix logix) {
for (char value : ch) {
hash += value;
}
String cSystemName = CONDITIONAL_SYS_PREFIX + "T" + hash;
String cSystemName = conditionalSysPrefix + "T" + hash;
removeConditionals(cSystemName, logix);
cSystemName = CONDITIONAL_SYS_PREFIX + "F" + hash;
cSystemName = conditionalSysPrefix + "F" + hash;
removeConditionals(cSystemName, logix);
cSystemName = CONDITIONAL_SYS_PREFIX + "A" + hash;
cSystemName = conditionalSysPrefix + "A" + hash;
removeConditionals(cSystemName, logix);
cSystemName = CONDITIONAL_SYS_PREFIX + "L" + hash;
cSystemName = conditionalSysPrefix + "L" + hash;
removeConditionals(cSystemName, logix);

int n = 0;
Expand Down

0 comments on commit 629e0fd

Please sign in to comment.