Skip to content

Conversation

@yungyuc
Copy link
Member

@yungyuc yungyuc commented Jul 16, 2022

A new Python sub-package modmesh.app is created to house application code (written in Python). At this point there are two of them: linear_wave (for the 1D CESE solver) and sample_mesh (for simple 2D/3D unstructured mesh).

The linear wave requires PySide6 because it uses matplotlib for visualization.

Two additional Python modules core and view are created.

ref #100

A new Python sub-package `modmesh.app` is created to house application code (written in Python).  At this point there are two of them: `linear_wave` (for the 1D CESE solver) and `sample_mesh` (for simple 2D/3D unstructured mesh).

The linear wave requires PySide6 because it uses matplotlib for visualization.

Two additional Python modules `core` and `view` are created.
@yungyuc yungyuc added the enhancement New feature or request label Jul 16, 2022
@yungyuc yungyuc self-assigned this Jul 16, 2022

friend root_base_type;

WrapRPythonText(pybind11::module & mod, char const * pyname, char const * pydoc)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expose the object and then the Python app can change the Python text widget

});
appMenu->addAction(app_linear_wave);

menuBar->addMenu(appMenu);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a menu for applications.

# line = mm.view.RLine(-1, -1, -1, -2, -2, -2, 0, 128, 128)
# print(line)
)""""));
m_text->setPlainText(QString(""));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the pytext object exposed, the code can be changed from Python.

win = ApplicationWindow()
win.show()
win.activateWindow()
# FIXME: This is a hack for PySide object lifecycle management.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not fully understand how PySide manages the lifecycle of the Qt objects it wraps. If I do not keep the object, it will go away and crashes.

@yungyuc yungyuc merged commit 304409c into solvcon:master Jul 16, 2022
@yungyuc yungyuc deleted the feature/python-app branch July 16, 2022 06:19
@tai271828
Copy link
Contributor

I am late to the party. I am very interested in this new feature. I will definitely give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants