Skip to content
Snippets Groups Projects
Commit bef8174e authored by u214892's avatar u214892
Browse files

#69 enhanced output

parent 0db89d48
No related branches found
No related tags found
No related merge requests found
...@@ -358,17 +358,17 @@ class PILSVG(PILGL): ...@@ -358,17 +358,17 @@ class PILSVG(PILGL):
"NN SS": "Bahnhof_#d50000_Gleis_vertikal.svg"} "NN SS": "Bahnhof_#d50000_Gleis_vertikal.svg"}
# Dict of rail cell images indexed by binary transitions # Dict of rail cell images indexed by binary transitions
self.dPilRail = self.loadSVGs(dRailFiles, rotate=True, backgroundImage="Background_rail.svg", dPilRailFiles = self.loadSVGs(dRailFiles, rotate=True, backgroundImage="Background_rail.svg",
whitefilter="Background_white_filter.svg") whitefilter="Background_white_filter.svg")
# Load the target files (which have rails and transitions of their own) # Load the target files (which have rails and transitions of their own)
# They are indexed by (binTrans, iAgent), ie a tuple of the binary transition and the agent index # They are indexed by (binTrans, iAgent), ie a tuple of the binary transition and the agent index
dPilRail2 = self.loadSVGs(dTargetFiles, rotate=False, agent_colors=self.ltAgentColors, dPilTargetFiles = self.loadSVGs(dTargetFiles, rotate=False, agent_colors=self.ltAgentColors,
backgroundImage="Background_rail.svg", backgroundImage="Background_rail.svg",
whitefilter="Background_white_filter.svg") whitefilter="Background_white_filter.svg")
# Merge them with the regular rails. # Merge them with the regular rails.
# https://stackoverflow.com/questions/38987/how-to-merge-two-dictionaries-in-a-single-expression # https://stackoverflow.com/questions/38987/how-to-merge-two-dictionaries-in-a-single-expression
self.dPilRail = {**self.dPilRail, **dPilRail2} self.dPilRail = {**dPilRailFiles, **dPilTargetFiles}
def loadSVGs(self, dDirFile, rotate=False, agent_colors=False, backgroundImage=None, whitefilter=None): def loadSVGs(self, dDirFile, rotate=False, agent_colors=False, backgroundImage=None, whitefilter=None):
dPil = {} dPil = {}
...@@ -445,13 +445,13 @@ class PILSVG(PILGL): ...@@ -445,13 +445,13 @@ class PILSVG(PILGL):
self.drawImageRC(pilTrack, (row, col)) self.drawImageRC(pilTrack, (row, col))
else: else:
print("Illegal rail:", row, col, format(binTrans, "#018b")[2:]) print("Illegal rail:", row, col, format(binTrans, "#018b")[2:], binTrans)
else: else:
if (binTrans, iTarget) in self.dPilRail: if (binTrans, iTarget) in self.dPilRail:
pilTrack = self.dPilRail[(binTrans, iTarget)] pilTrack = self.dPilRail[(binTrans, iTarget)]
self.drawImageRC(pilTrack, (row, col)) self.drawImageRC(pilTrack, (row, col))
else: else:
print("Illegal target rail:", row, col, format(binTrans, "#018b")[2:]) print("Illegal target rail:", row, col, format(binTrans, "#018b")[2:], (binTrans, iTarget))
if isSelected: if isSelected:
svgBG = self.pilFromSvgFile("svg", "Selected_Target.svg") svgBG = self.pilFromSvgFile("svg", "Selected_Target.svg")
......
...@@ -98,7 +98,9 @@ deps = ...@@ -98,7 +98,9 @@ deps =
commands = commands =
; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths ; run tests from subfolder to ensure that resources are accessed via resources and not via relative paths
sh -c 'mkdir -p {envtmpdir}/6f59bc68108c3895b1828abdd04b9a06' sh -c 'mkdir -p {envtmpdir}/6f59bc68108c3895b1828abdd04b9a06'
sh -c 'jupyter nbextension install --py --sys-prefix widgetsnbextension'
sh -c 'jupyter nbextension enable --py --sys-prefix widgetsnbextension' sh -c 'jupyter nbextension enable --py --sys-prefix widgetsnbextension'
sh -c 'jupyter nbextension install --py --sys-prefix jpy_canvas'
sh -c 'jupyter nbextension enable --py --sys-prefix jpy_canvas' sh -c 'jupyter nbextension enable --py --sys-prefix jpy_canvas'
; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463 ; https://stackoverflow.com/questions/35545402/how-to-run-an-ipynb-jupyter-notebook-from-terminal/35545463
sh -c 'ls notebooks/*.ipynb | xargs -n 1 jupyter nbconvert --to python' sh -c 'ls notebooks/*.ipynb | xargs -n 1 jupyter nbconvert --to python'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment