Skip to content

Commit df85c2b

Browse files
committed
- Update the MetaModel editor xml object when switching from text to diagram view
1 parent 0d87015 commit df85c2b

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

OMEdit/OMEditGUI/Editors/TLMEditor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ void TLMEditor::contentsHasChanged(int position, int charsRemoved, int charsAdde
6969
bool TLMEditor::validateMetaModelText()
7070
{
7171
if (mTextChanged) {
72+
mXmlDocument.setContent(getPlainTextEdit()->toPlainText());
7273
if (!emit focusOut()) {
7374
return false;
7475
} else {

OMEdit/OMEditGUI/MainWindow.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ void MainWindow::exportModelFigaro(LibraryTreeNode *pLibraryTreeNode)
916916
*/
917917
void MainWindow::fetchInterfaceData(LibraryTreeNode *pLibraryTreeNode)
918918
{
919+
/* if MetaModel text is changed manually by user then validate it before fetaching the interface data. */
919920
if (pLibraryTreeNode->getModelWidget()) {
920921
TLMEditor *pTLMEditor = dynamic_cast<TLMEditor*>(pLibraryTreeNode->getModelWidget()->getEditor());
921922
if (pTLMEditor && !pTLMEditor->validateMetaModelText()) {
@@ -962,6 +963,7 @@ void MainWindow::fetchInterfaceData(LibraryTreeNode *pLibraryTreeNode)
962963
*/
963964
void MainWindow::TLMSimulate(LibraryTreeNode *pLibraryTreeNode)
964965
{
966+
/* if MetaModel text is changed manually by user then validate it before starting the TLM co-simulation. */
965967
if (pLibraryTreeNode->getModelWidget()) {
966968
TLMEditor *pTLMEditor = dynamic_cast<TLMEditor*>(pLibraryTreeNode->getModelWidget()->getEditor());
967969
if (pTLMEditor && !pTLMEditor->validateMetaModelText()) {

0 commit comments

Comments
 (0)