Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,17 @@ pip install openmc-plotter
From a directory containing an OpenMC model run:

```console
openmc-plotter
$ openmc-plotter -d <path_to_openmc_model_dir>
```

or simply run

```console
$ openmc-plotter
```

from the directory containing the model.

Once the viewer has opened, press `?` to view a variety of keyboard shortcuts.

![shortcuts](./screenshots/shortcuts.png)
Expand Down
16 changes: 15 additions & 1 deletion openmc_plotter/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env python3
#!/usr/bin/env python

from argparse import ArgumentParser
from pathlib import Path
from threading import Thread
import os
import signal
import sys

Expand All @@ -11,6 +13,18 @@
from .main_window import MainWindow, _openmcReload

def main():
ap = ArgumentParser(description='OpenMC Plotter GUI')
ap.add_argument('-d', '--model-directory', default=os.curdir,
help='Location of model dir (default is current dir)')

args = ap.parse_args()

os.chdir(args.model_directory)

run_app()


def run_app():
path_icon = str(Path(__file__).parent / 'assets/openmc_logo.png')
path_splash = str(Path(__file__).parent / 'assets/splash.png')

Expand Down
1 change: 1 addition & 0 deletions openmc_plotter/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def _openmcReload():
# initialize geometry (for volume calculation)
openmc.lib.settings.output_summary = False
openmc.lib.init(["-c"])
openmc.lib.settings.verbosity = 1

class MainWindow(QMainWindow):
def __init__(self, font=QtGui.QFontMetrics(QtGui.QFont()), screen_size=QtCore.QSize()):
Expand Down