Skip to content

Commit

Permalink
Merge pull request #7446 from silverailscolo/eb-table-enable
Browse files Browse the repository at this point in the history
Import OBlocks (from Blocks)
  • Loading branch information
bobjacobsen committed Oct 12, 2019
2 parents c403671 + f1fbdb7 commit 6372997
Show file tree
Hide file tree
Showing 24 changed files with 793 additions and 495 deletions.
38 changes: 16 additions & 22 deletions java/src/jmri/Block.java
Expand Up @@ -228,7 +228,6 @@ public void setReporter(Reporter reporter) {
_reporter.addPropertyChangeListener(_reporterListener = (PropertyChangeEvent e) -> {
handleReporterChange(e);
});

}
}

Expand Down Expand Up @@ -300,7 +299,7 @@ public boolean hasPath(Path p) {
}

/**
* Get a copy of the list of Paths
* Get a copy of the list of Paths.
*
* @return the paths or an empty list
*/
Expand Down Expand Up @@ -562,12 +561,8 @@ public boolean equals(Object obj) {
return false;
} else {
Block b = (Block) obj;

if (!b.getSystemName().equals(this.getSystemName())) {
return false;
}
return b.getSystemName().equals(this.getSystemName());
}
return true;
}

@Override
Expand All @@ -590,7 +585,7 @@ public int hashCode() {
private PropertyChangeListener _reporterListener = null;
private boolean _reportingCurrent = false;

private Path pListOfPossibleEntrancePaths[] = null;
private Path[] pListOfPossibleEntrancePaths = null;
private int cntOfPossibleEntrancePaths = 0;

void resetCandidateEntrancePaths() {
Expand Down Expand Up @@ -667,9 +662,8 @@ void handleReporterChange(PropertyChangeEvent e) {
*/
public void goingInactive() {
log.debug("Block {} goes UNOCCUPIED", getDisplayName());
int currPathCnt = paths.size();
for (int i = 0; i < currPathCnt; i++) {
Block b = paths.get(i).getBlock();
for (Path path : paths) {
Block b = path.getBlock();
if (b != null) {
b.setAsEntryBlockIfPossible(this);
}
Expand Down Expand Up @@ -698,11 +692,11 @@ public void goingActive() {
Path next = null;
// get statuses of everything once
int currPathCnt = paths.size();
Path pList[] = new Path[currPathCnt];
boolean isSet[] = new boolean[currPathCnt];
boolean isActive[] = new boolean[currPathCnt];
int pDir[] = new int[currPathCnt];
int pFromDir[] = new int[currPathCnt];
Path[] pList = new Path[currPathCnt];
boolean[] isSet = new boolean[currPathCnt];
boolean[] isActive = new boolean[currPathCnt];
int[] pDir = new int[currPathCnt];
int[] pFromDir = new int[currPathCnt];
for (int i = 0; i < currPathCnt; i++) {
pList[i] = paths.get(i);
isSet[i] = pList[i].checkPathSet();
Expand Down Expand Up @@ -766,7 +760,7 @@ public void goingActive() {
Path.decodeDirection(getDirection()));
} else if (next == null) {
log.error("unexpected next==null processing block {}", getDisplayName());
} else if (next.getBlock() == null) {
} else {
log.error("unexpected next.getBlock()=null processing block {}", getDisplayName());
}
break;
Expand Down Expand Up @@ -834,11 +828,11 @@ public Path findFromPath() {
Path next = null;
// get statuses of everything once
int currPathCnt = paths.size();
Path pList[] = new Path[currPathCnt];
boolean isSet[] = new boolean[currPathCnt];
boolean isActive[] = new boolean[currPathCnt];
int pDir[] = new int[currPathCnt];
int pFromDir[] = new int[currPathCnt];
Path[] pList = new Path[currPathCnt];
boolean[] isSet = new boolean[currPathCnt];
boolean[] isActive = new boolean[currPathCnt];
int[] pDir = new int[currPathCnt];
int[] pFromDir = new int[currPathCnt];
for (int i = 0; i < currPathCnt; i++) {
pList[i] = paths.get(i);
isSet[i] = pList[i].checkPathSet();
Expand Down
17 changes: 9 additions & 8 deletions java/src/jmri/BlockManager.java
Expand Up @@ -15,7 +15,7 @@
import jmri.managers.AbstractManager;

/**
* Basic Implementation of a BlockManager.
* Basic implementation of a BlockManager.
* <p>
* Note that this does not enforce any particular system naming convention.
* <p>
Expand Down Expand Up @@ -74,7 +74,7 @@ public void setSavedPathInfo(boolean save) {
}

/**
* Method to create a new Block only if it does not exist
* Create a new Block, only if it does not exist.
*
* @param systemName the system name
* @param userName the user name
Expand Down Expand Up @@ -112,7 +112,7 @@ public Block createNewBlock(@Nonnull String systemName, @CheckForNull String use
}

/**
* Method to create a new Block using an automatically incrementing system
* Create a new Block using an automatically incrementing system
* name.
*
* @param userName the user name for the new block
Expand Down Expand Up @@ -155,7 +155,7 @@ public Block provideBlock(@Nonnull String name) {
}

/**
* Method to get an existing Block. First looks up assuming that name is a
* Get an existing Block. First looks up assuming that name is a
* User Name. If this fails looks up assuming that name is a System Name. If
* both fail, returns null.
*
Expand Down Expand Up @@ -197,7 +197,7 @@ public Block getByDisplayName(@Nonnull String key) {
return (retv);
}

String defaultSpeed = "Normal";
private String defaultSpeed = "Normal";

/**
* @param speed the speed
Expand Down Expand Up @@ -236,7 +236,7 @@ public String getBeanTypeHandled(boolean plural) {
}

/**
* Returns a list of blocks which the supplied roster entry appears to be
* Get a list of blocks which the supplied roster entry appears to be
* occupying. A block is assumed to contain this roster entry if its value
* is the RosterEntry itself, or a string with the entry's id or dcc
* address.
Expand Down Expand Up @@ -304,7 +304,7 @@ public void propertyChange(PropertyChangeEvent e) {
}

/**
* Returns the amount of time since the layout was last powered up,
* Get the amount of time since the layout was last powered up,
* in milliseconds. If the layout has not been powered up as far as
* JMRI knows it returns a very long time indeed.
*
Expand All @@ -318,7 +318,8 @@ public long timeSinceLastLayoutPowerOn() {
}

@Override
public Block provide(String name) throws IllegalArgumentException {
@Nonnull
public Block provide(@Nonnull String name) throws IllegalArgumentException {
return provideBlock(name);
}

Expand Down
4 changes: 2 additions & 2 deletions java/src/jmri/Path.java
Expand Up @@ -133,8 +133,8 @@ public boolean checkPathSet() {
return true;
}
// check the status of all BeanSettings
for (int i = 0; i < _beans.size(); i++) {
if (!(_beans.get(i)).check()) {
for (BeanSetting bean : _beans) {
if (!bean.check()) {
return false;
}
}
Expand Down
10 changes: 8 additions & 2 deletions java/src/jmri/jmrit/beantable/OBlockTableBundle.properties
Expand Up @@ -32,14 +32,20 @@ OpenSignalMenu = Show Signal Table
OpenBlockPathMenu = Open Block-Path Table
OpenBlockPathTurnoutMenu = Open Block-Path-Turnout Table
OpenPathMenu = Open "{0}" Path Table
OpenTurnoutMenu = Open "{0}" Path-Turnout Tables...
OpenTurnoutMenu = Open "{0}" Path-Turnout Tables
OpenPathTurnoutMenu = Open "{0}" Turnout Table
ImportBlocksMenu = Import Blocks as Occupancy Blocks
ImportNoBlocks = No Blocks to convert
ImportBlockConfirm = Default OBlock system name prefix: {0}.\nImport all {1} Blocks to OBlocks?
ImportBlockComplete = Finished importing {0} Blocks to {1} Occupancy Blocks, Portals and Paths.\n\
Please review and complete the OPaths, especially around turnouts.
AddBlockPrompt = Enter a Block System or User Name into the blank (last) row of the table to add an Occupancy Block
AddPortalPrompt = Enter a Portal Name into the blank (last) row of the table to add a Portal
AddSignalPrompt = Enter a SignalMast or SignalHead Name into the blank (last) row of the table to add a Signal
AddPathPrompt = Enter a Path Name into the blank (last) row of the table to add a Path
AddTurnoutPrompt= Enter a Turnout Name into the last row
SuppressWarning = Suppress Warnings and Error Messages
ShowWarning = Show Warnings and Error Messages
LabelItemName = System or User Name
InfoTitle = Informational note:

Expand Down Expand Up @@ -75,7 +81,7 @@ PrintXRef = Print OBlock/Portal Cross Reference
AddPathFailed = Failed to add Path {0}
BlockPathsConflict = Paths using this Portal traverse to block "{1}". If the Block is changed\nto "{0}", the paths in Block "{1}" using this portal will become spurs.\nIf you make this change, please verify path connections in blocks {0} and {1}.
BlockPortalConflict = No Portal named "{0}" is found in Block "{1}". Do you want to\ncreate a new portal called "{0}" for Block "{1}"?
CreateDuplBlockErr = Duplicate name. Block "{0}" has already been defined.
CreateDuplBlockErr = Duplicate name. Block "{0}" has already been defined.
DeletePathConfirm = Do you want to delete path "{0}"?
DeletePortalConfirm = Deleting a Portal will also delete all Paths\nusing the portal. Do you want to delete "{0}"?
DeleteTurnoutConfirm = Do you want to delete Turnout?
Expand Down
Expand Up @@ -36,7 +36,7 @@ OpenXRefMenu = Mostra Refer\u00e8ncies Creuades de Block-Portal
OpenSignalMenu = Mostra Taula de Senyals
OpenBlockPathMenu = Obre Taules Bloc-Cam\u00ed
OpenBlockPathTurnoutMenu = Obre Taules Bloc-Cam\u00ed-Agulla
OpenPathMenu = Obre la Taula de Cam\u00ed "{0}"
OpenPathMenu = Obre la Taula de Cam\u00ed "{0}"
OpenTurnoutMenu = Obre Taula Cam\u00ed-Agulla "{0}"
OpenPathTurnoutMenu = Obre la Taula d'Agulla "{0}"
AddBlockPrompt = Entra el Nom d'Usuari o de Sistema d'un Bloc a l'\u00faltima fila de la taula per afegir una Ocupaci\u00f3 d'un Bloc
Expand Down
4 changes: 2 additions & 2 deletions java/src/jmri/jmrit/beantable/OBlockTableBundle_cs.properties
Expand Up @@ -22,7 +22,7 @@ Last = Posledn\u00ed
PermissionCol = Povolen\u00ed?
Permissive = Permisivn\u00ed
Absolute = Absolutn\u00ed
WarrantCol = P\u0159id\u011bleno k
WarrantCol = P\u0159id\u011bleno k
SpeedCol = Rychlostn\u00ed stupe\u0148
ButtonEditTO = V\u00fdhybky
OpenMenu = Tabulky
Expand All @@ -33,7 +33,7 @@ OpenSignalMenu = Zobrazit tabulku n\u00e1v\u011bstidel
OpenBlockPathMenu = Otev\u0159\u00edt tabulku Blok-Cesta
OpenBlockPathTurnoutMenu = Otev\u0159\u00edt tabulku Blok-Cesta-V\u00fdhybka
OpenPathMenu = Otev\u0159\u00edt "{0}" tabulka Cesta
OpenTurnoutMenu = Otev\u0159\u00edt "{0}" tabulky Cesta- V\u00fdhybka...
OpenTurnoutMenu = Otev\u0159\u00edt "{0}" tabulky Cesta- V\u00fdhybka
OpenPathTurnoutMenu = Otev\u0159\u00edt "{0}" tabulka V\u00fdhybka
AddBlockPrompt = Zadejte syst\u00e9mov\u00fd nebo u\u017eivatelsk\u00fd n\u00e1zev Bloku do pr\u00e1zdn\u00e9ho (posledn\u00edho) \u0159\u00e1dku tabulky pro p\u0159id\u00e1n\u00ed Bloku obsazen\u00ed
AddPortalPrompt = Zadejte n\u00e1zev Port\u00e1lu do pr\u00e1zdn\u00e9ho (posledn\u00edho) \u0159\u00e1dku tabulky pro p\u0159id\u00e1n\u00ed Port\u00e1lu
Expand Down
Expand Up @@ -31,7 +31,7 @@ OpenSignalMenu = Show Signal Table
OpenBlockPathMenu = Open Block-Path Table
OpenBlockPathTurnoutMenu = Open Block-Path-Turnout Table
OpenPathMenu = Open "{0}" Path Table
OpenTurnoutMenu = Open "{0}" Path-Turnout Tables...
OpenTurnoutMenu = Open "{0}" Path-Turnout Tables
OpenPathTurnoutMenu = Open "{0}" Turnout Table
AddBlockPrompt = Enter a Block System or User Name into the blank (last) row of the table to add an Occupancy Block
AddPortalPrompt = Enter a Portal Name into the blank (last) row of the table to add a Portal
Expand Down
Expand Up @@ -31,7 +31,7 @@ OpenSignalMenu=Zeige Signaltabelle
OpenBlockPathMenu=\u00d6ffne Pfadetabelle
OpenBlockPathTurnoutMenu=\u00d6ffne Weichentabelle f\u00fcr Pfad
OpenPathMenu=\u00d6ffne Pfadetabelle "{0}"
OpenTurnoutMenu=\u00d6ffne "{0}" Pfad-Weichentabellen...
OpenTurnoutMenu=\u00d6ffne "{0}" Pfad-Weichentabellen
OpenPathTurnoutMenu=\u00d6ffne "{0}" Weichentabelle...
AddBlockPrompt=Gebe System- oder Nutzernamen des Blockes ein in der untere (leere) Spalte der Tabelle um ein Besetzmeldeblock hinzu zu f\u00fcgen
AddPortalPrompt=Gebe neuen Portalnamen ein in der untere (leere) Spalte der Tabelle um ein Portal hinzu zu f\u00fcgen
Expand Down
Expand Up @@ -30,7 +30,7 @@ OpenPortalMenu = Afficher Tableau Portail
OpenXRefMenu = Afficher R\u00e9f\u00e9rence Crois\u00e9e Canton-Portail
OpenSignalMenu = Montrer le Tableau Feux de Signalisation
OpenBlockPathMenu = Ouvrir des Tableaux Canton-Chemin ...
OpenBlockPathTurnoutMenu = Ouvrir des Tableau Canton-Chemin-Aiguillage ...
OpenBlockPathTurnoutMenu = Ouvrir des Tableau Canton-Chemin-Aiguillage
OpenPathMenu = Ouvrir "{0}" Tableau de Chemin
OpenTurnoutMenu = Ouvrir "{0}" Tableaux Chemin-Aiguillage ...
OpenPathTurnoutMenu = Ouvrir "{0}" Tableau Aiguillage
Expand Down
Expand Up @@ -32,7 +32,7 @@ OpenSignalMenu = Mostra Tabella Segnali
OpenBlockPathMenu = Apri Tabella Blocchi-Percorsi
OpenBlockPathTurnoutMenu = Apri Tabella Blocchi-Percorsi-Scambi
OpenPathMenu = Apri Tabella Percorso "{0}"
OpenTurnoutMenu = Apri Tabella Scambi per Percorso "{0}"...
OpenTurnoutMenu = Apri Tabella Scambi per Percorso "{0}"
OpenPathTurnoutMenu = Apri Tabella Scambi "{0}"
AddBlockPrompt = Inserire un sistema di blocco o il nome utente nella ultima riga della tabella per aggiungere un blocco Occupazione
AddPortalPrompt = Immettere un nome Portale nel l'ultima riga della tabella per aggiungere un Portale
Expand Down
107 changes: 107 additions & 0 deletions java/src/jmri/jmrit/beantable/OBlockTableBundle_nl.properties
@@ -0,0 +1,107 @@
# OBlockTableBundle_nl.properties
#
# Dutch properties for the jmri.jmrit.OBlockTableAction GUI elements

TitleOBlocks = Bezetmeldblokken, Portalen and Paden
TitleBlockTable = Bezetmeldblokken
TitlePortalTable = Portalen
TitleSignalTable = Seinen
TitleBlockPathTable = Paden bij Bezetmeldblok "{0}"
TitlePathTurnoutTable = Wissels bij "{1}" in Blok "{0}"
TitleBlockPortalXRef = Blok-Portaal Koppeltabel
ButtonEditPath = Paden
ErrorSensorCol = Foutmelder
ReporterCol = Melder
units = in/cm
in = inch
cm = cm
RepCurrentCol = Reporteer?
Current = Huidig
Last = Laatste
PermissionCol = Permit?
Permissive = Permissief
Absolute = Absoluut
WarrantCol = Toegewezen aan
SpeedCol = Snelheidsstap
ButtonEditTO = Wissels
OpenMenu = Tabellen
OpenBlockMenu = Toon Bezetmelderblokkentabel
OpenPortalMenu = Toon Portalentabel
OpenXRefMenu = Toon Blok-Portaal Koppeltabel
OpenSignalMenu = Toon Seinentabel
OpenBlockPathMenu = Toon Blokken-Paden-tabel
OpenBlockPathTurnoutMenu = Toon Blokken-Paden-Wissels-tabel
OpenPathMenu = "{0}" Padentabel
OpenTurnoutMenu = Open "{0}" Paden-Wisseltabellen
OpenPathTurnoutMenu = "{0}" Wisseltabel
ImportBlocksMenu = Importeer Blokken als Bezetmeldblokken
ImportNoBlocks = Geen Blokken gevonden om te importeren
ImportBlockConfirm = OBlock systeemnaam prefix: {0}.\nAlle {1} Blokken importeren als Bezetmeldblokken?
ImportBlockComplete = Import van {0} Blokken naar {1} Bezetmeldblokken, Portalen en Paden voltooid.\n\
Controleer en completeer Paden, speciaal bij Wissels.
AddBlockPrompt = Voer in de lege (onderste) regel een Systeem- of Gebruikersnaam in om een Bezetmeldblok toe te voegen
AddPortalPrompt = Voer in de lege (onderste) regel een Portaalnaam in om een Portaal toe te voegen
AddSignalPrompt = Voer in de lege (onderste) regel de naam van een Seinmast of -Schild om een Sein toe te voegen
AddPathPrompt = Voer in de lege (onderste) regel een Padnaam in om een nieuw Pad toe te voegen
AddTurnoutPrompt= Voer in de lege (onderste) regel de naam in van een Wissel
SuppressWarning = Onderdruk Waarschuwingen en Foutmeldingen
ShowWarning = Toon Waarschuwingen en Foutmeldingen
LabelItemName = Systeem- on Gebruikersnaam
InfoTitle = Informatie

FromBlockName = Van (Aanrij) Blok
PortalName = Naam Portaal
ThroughPortal = (Door) Portaal
BlockName = Naam Blok
ToBlockName = Naar (Beveiligd) Blok

Offset = Verschuif
SignalName = Naam Sein
FromPortal = Van Portal
PathName = Naam Pad
ToPortal = Naar Portal
ColumnSetting = Wisselinstelling

#Oblock states
Dark = Onverlicht
Occupied = Bezet
Unoccupied = Vrij
Inconsistent = Inconsistent
Allocated = Toegewezen
Running = Positie Rijtoestemming
OutOfService = Buiten Gebruik
TrackError = Fout in Route
UnDefined = ???

PrintOBlockTable= Druk Bezetmeldblokkentabel af...
PrintPortalTable= Druk Portalentabel af...
PrintSignalTable= Druk Seinentabel af...
PrintXRef = Druk Blok-Portaal Koppeltabel af...

AddPathFailed = Kon Pad {0} niet aanmaken
BlockPathsConflict = Paden via dir Portaal lopen via Blok "{1}". Als het Blok wordt gewijzigd in\n"{0}", dan worden deze Paden in Blok "{1}" kopsporen.\n\
Als je deze wijziging doorvoert, controleer dan de Padverbindingen in de Blokken {0} en {1}.
BlockPortalConflict = Geen Portaal genaamd "{0}" gevonden in Blok "{1}". Wil je een nieuw Portaal\ngenaamd "{0}" aanmaken bij Blok "{1}"?
CreateDuplBlockErr = Dubbele naam. Bezetmeldblok "{0}" bestaat al.
DeletePathConfirm = Pad "{0}" verwijderen?
DeletePortalConfirm = Als je een Portaal verwijdert dan worden ook\nalle Paden door dat Portaal gewist.\nPortaal "{0}" verwijderen?
DeleteTurnoutConfirm = Wil je de Wissel verwijderen?
DuplPathName = Dubbele naam. Pad "{0}" bestaat al.
DuplPortalName = Dubbele naam. Portal "{0}" bestaat al.
DuplSignalName = Sein "{0}" is al in gebruik voor de beveiliging van Blok "{1}"\nvia Portaal "{2}" uit Bezetmeldblok "{3}".
DuplProtection = Blok "{0}" via Portaal "{1}" uit\nBlok "{2}" wordt al beveiligd door Sein "{3}".
NoSuchBlock = Er bestaat geen Blok genaamd "{0}".
NoSuchPortalName = Er bestaat geen Portaal genaamd "{0}".
NoSuchPortal = Geen Portaal gevonden tussen Blokken "{0}" en "{1}".
NoSuchSensorErr = Er bestaat geen Terugmelder genaamd "{0}".
NoSuchReporterErr = Er bestaat geen Melder genaamd "{0}".
NoSuchSignal = Er bestaat geen Seinmast/-schild genaamd "{0}".
NoSuchTurnout = Er bestaat geen Wissel genaamd "{0}".
TurnoutMustBeSet= Wissel moet in stand "{0}" of "{1}" staan.
PortalBlockConflict = Portaal "{0}" is niet gekoppeld aan Blok "{1}".
PortalNameConflict = Portaal "{0}" kan niet worden gewijzigd omdat het in gebruik is\nin Paden en Blokken. Klik op [Verwijder] en voeg een nieuw Portaal toe.
PortalNeedsBlock = Portaal "{0}" dient aan beide zijden een Blok te bevatten.
SametoFromBlock = Portaal kan niet aan beide zijden Blok "{0}" bevatten.\n(het Portaal zou nergens naar toe leiden.)
DelayTriggerTime = Verschuif het snelheidomslagpunt eerder(+) of later(-). {0} is geen bruikbare waarde.
SignalDirection = Portaal "{0}" bevat Blokken "{1}" en "{2}".\nWelke is het Aanrijblok en welke is het Beveiligde?
BadNumber = {0} is geen getal.

0 comments on commit 6372997

Please sign in to comment.