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
Binary file added codegen/data/static_info_222_meshing.pickle
Binary file not shown.
Binary file added codegen/data/static_info_222_solver.pickle
Binary file not shown.
23 changes: 17 additions & 6 deletions codegen/tuigen.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import os
from pathlib import Path
import pickle
import platform
import shutil
import string
Expand Down Expand Up @@ -310,15 +311,25 @@ def _write_doc_for_menu(self, menu, doc_dir: Path, heading, class_name) -> None:
def generate(self) -> None:
Path(self._tui_file).parent.mkdir(exist_ok=True)
with open(self._tui_file, "w", encoding="utf8") as self.__writer:
info = PyMenu(self._service, self._main_menu.path).get_static_info()
self._populate_menu(self._main_menu, info)
self.session.exit()
if self._tui_file == _SOLVER_TUI_FILE:
self._write_code_to_tui_file('"""Fluent Solver TUI Commands"""\n')
self._main_menu.doc = "Fluent solver main menu."
mode = "meshing" if self._tui_file == _MESHING_TUI_FILE else "solver"
if self.session.get_fluent_version() == "22.2.0":
with open(
os.path.join(
_THIS_DIRNAME, "data", f"static_info_222_{mode}.pickle"
),
"rb",
) as f:
self._main_menu = pickle.load(f)
else:
info = PyMenu(self._service, self._main_menu.path).get_static_info()
self._populate_menu(self._main_menu, info)
self.session.exit()
if mode == "meshing":
self._write_code_to_tui_file('"""Fluent Meshing TUI Commands"""\n')
self._main_menu.doc = "Fluent meshing main menu."
else:
self._write_code_to_tui_file('"""Fluent Solver TUI Commands"""\n')
self._main_menu.doc = "Fluent solver main menu."
self._write_code_to_tui_file(
"#\n"
"# This is an auto-generated file. DO NOT EDIT!\n"
Expand Down