Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pyside6 to build GUI. When launch Fluent with ui_mode="gui", my main window will be open twice. #3658

Open
2 tasks done
rachelzhang333 opened this issue Jan 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@rachelzhang333
Copy link

🔍 Before submitting the issue

  • I have searched among the existing issues
  • I am using a Python virtual environment

🐞 Description of the bug

I'm writing my GUI with pyside6. When I launch Fluent with ui_mode="gui", my GUI will be open twice. If I change the ui_mode to other selection, the issue will not occur. But I need to launch Fluent with GUI.

📝 Steps to reproduce

Step 1: Build mian.py as following

from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton
import ansys.fluent.core as pyfluent

class MyMainWindow(QMainWindow):
def init(self):
super().init()
btn=QPushButton("OK",self)
#btn.move(100,100)
btn.clicked.connect(self.on_btn_clicked)
self.show()

def on_btn_clicked(self):
    meshing = pyfluent.launch_fluent(precision="double", processor_count=4, mode="meshing", ui_mode="gui")

if name=="main":
app=QApplication([])
window=MyMainWindow()
window.show()
app.exec()

Step 2: Build setup.py as following

from cx_Freeze import setup, Executable
import sys

base = None

if sys.platform == 'win32':
base = "Win32GUI"

target=Executable(script="ui_mian.py", base=base)

setup(
name = "Python_GUI",
version = "0.1",
description = "Python GUI",
executables = [target]
)

Step 3: open cmd, and cd to target folder, run ''python setup.py build''

Step 4: Run the .exe. Click the button "OK", and the MyMainWindow GUI will be open twice.

💻 Which operating system are you using?

Windows

📀 Which ANSYS version are you using?

Fluent 2024R2

🐍 Which Python version are you using?

3.10

📦 Installed packages

about-time==4.2.1
alive-progress==3.1.5
altgraph==0.17.4
ansys-api-fluent==0.3.30
ansys-api-platform-instancemanagement==1.0.0b3
ansys-api-tools-filetransfer==0.1.0
ansys-fluent-core==0.27.0
ansys-fluent-parametric==0.10.0
ansys-fluent-visualization==0.15.0
ansys-platform-instancemanagement==1.1.1
ansys-tools-filetransfer==0.1.0
ansys-units==0.3.4
anyio==3.6.2
appdirs==1.4.4
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
arrow==1.2.3
asttokens==2.2.1
attrs==22.2.0
backcall==0.2.0
beartype==0.17.2
beautifulsoup4==4.12.0
bleach==6.0.0
certifi==2022.12.7
cffi==1.15.1
charset-normalizer==3.1.0
click==8.1.7
colorama==0.4.6
comm==0.1.3
contourpy==1.0.6
cx_Freeze==7.2.8
cx_Logging==3.2.1
cycler==0.11.0
debugpy==1.6.6
decorator==5.1.1
defusedxml==0.7.1
docker==7.1.0
et-xmlfile==1.1.0
executing==1.2.0
fastjsonschema==2.16.3
fonttools==4.38.0
fqdn==1.5.1
googleapis-common-protos==1.59.0
grapheme==0.6.0
grpcio==1.53.0
grpcio-health-checking==1.48.2
h5py==3.8.0
idna==3.4
imageio==2.27.0
importlib-metadata==6.1.0
ipykernel==6.22.0
ipython==8.12.0
ipython-genutils==0.2.0
ipywidgets==8.0.6
isoduration==20.11.0
jedi==0.18.2
Jinja2==3.1.2
joblib==1.4.2
jsonpointer==2.3
jsonschema==4.17.3
jupyter==1.0.0
jupyter-console==6.6.3
jupyter-events==0.6.3
jupyter_client==8.1.0
jupyter_core==5.3.0
jupyter_server==2.5.0
jupyter_server_terminals==0.4.4
jupyterlab-pygments==0.2.2
jupyterlab-widgets==3.0.7
kiwisolver==1.4.4
lief==0.16.2
lxml==4.9.2
MarkupSafe==2.1.2
matplotlib==3.10.0
matplotlib-inline==0.1.6
mistune==2.0.5
msgpack-python==0.5.6
nbclassic==0.5.4
nbclient==0.7.3
nbconvert==7.2.10
nbformat==5.8.0
nest-asyncio==1.5.6
nltk==3.9.1
notebook==6.5.3
notebook_shim==0.2.2
numpy==1.26.4
opencv-python==4.9.0.80
openpyxl==3.0.9
packaging==24.2
pandas==1.5.3
pandocfilters==1.5.0
parso==0.8.3
pdf2image==1.17.0
pefile==2023.2.7
pickleshare==0.7.5
Pillow==9.3.0
platformdirs==3.11.0
pooch==1.7.0
prometheus-client==0.16.0
prompt-toolkit==3.0.38
protobuf==3.20.3
protoc-gen-swagger==0.1.0
psutil==5.9.7
pure-eval==0.2.2
pycparser==2.21
pyfluent==0.2.1
Pygments==2.14.0
pyinstaller==6.3.0
pyinstaller-hooks-contrib==2024.0
pyparsing==3.0.9
pyrsistent==0.19.3
PySide6==6.7.3
PySide6_Addons==6.7.3
PySide6_Essentials==6.7.3
python-dateutil==2.8.2
python-json-logger==2.0.7
pytz==2022.1
pyvista==0.44.2
pyvistaqt==0.11.1
pywin32==306
pywin32-ctypes==0.2.2
pywinpty==2.0.10
PyYAML==6.0
pyzmq==25.0.2
qtconsole==5.4.2
QtPy==2.3.1
regex==2024.5.15
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
scipy==1.8.0
scooby==0.7.1
Send2Trash==1.8.0
shiboken6==6.7.3
six==1.16.0
sniffio==1.3.0
soupsieve==2.4
stack-data==0.6.2
terminado==0.17.1
tinycss2==1.2.1
tomli==2.2.1
tornado==6.2
tqdm==4.66.4
traitlets==5.9.0
typing_extensions==4.12.2
tzdata==2024.1
uri-template==1.2.0
urllib3==1.26.15
vtk==9.3.20230807rc0
wcwidth==0.2.6
webcolors==1.13
webencodings==0.5.1
websocket-client==1.5.1
widgetsnbextension==4.0.7
xlrd==2.0.1
zipp==3.15.0
@rachelzhang333 rachelzhang333 added the bug Something isn't working label Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant