Skip to content

Commit

Permalink
- Integration with OMNotebook.
Browse files Browse the repository at this point in the history
- Interactive Simulation. (untested)
- updated OMEdit version to 1.7.0
- Lots of other updates.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@8259 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Mar 16, 2011
1 parent a54686c commit 99d7aed
Show file tree
Hide file tree
Showing 40 changed files with 2,068 additions and 654 deletions.
4 changes: 2 additions & 2 deletions OMEdit/OMEditGUI/BitmapAnnotation.h
Expand Up @@ -49,7 +49,7 @@ class BitmapAnnotation : public ShapeAnnotation
{
Q_OBJECT
public:
BitmapAnnotation(QString shape, Component *pParent = 0);
BitmapAnnotation(QString shape, Component *pParent);
BitmapAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
BitmapAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
QRectF boundingRect() const;
Expand Down Expand Up @@ -79,7 +79,7 @@ class BitmapWidget : public QDialog
{
Q_OBJECT
public:
BitmapWidget(BitmapAnnotation *pBitmapShape, MainWindow *parent = 0);
BitmapWidget(BitmapAnnotation *pBitmapShape, MainWindow *parent);

void setUpForm();
void show();
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/Component.cpp
Expand Up @@ -456,7 +456,7 @@ void Component::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
menu.addAction(pComponent->mpGraphicsView->mpResetRotation);
menu.addSeparator();
menu.addAction(pComponent->mpGraphicsView->mpDeleteIconAction);
if (pComponent->mType == StringHandler::DIAGRAM)
if (pComponent->mType == StringHandler::ICON)
{
menu.addSeparator();
menu.addAction(pComponent->mpIconAttributesAction);
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/DocumentationWidget.cpp
Expand Up @@ -82,7 +82,7 @@ void DocumentationWidget::show(QString className)
QString documentation = mpParentMainWindow->mpOMCProxy->getDocumentationAnnotation(className);
documentation = StringHandler::removeFirstLastCurlBrackets(documentation);
documentation = StringHandler::removeFirstLastQuotes(documentation);
if (!documentation.startsWith("<html>")) {
if (!documentation.startsWith("<html>", Qt::CaseInsensitive)) {
documentation = "<pre>" + documentation.replace("<","&lt;").replace(">","&gt;") + "</pre>";
}
documentation = documentation.replace("\\\"", "\"");
Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/DocumentationWidget.h
Expand Up @@ -46,7 +46,7 @@ class DocumentationWidget : public QWidget
private:

public:
DocumentationWidget(MainWindow *pParent = 0);
DocumentationWidget(MainWindow *pParent);
~DocumentationWidget();
void show(QString className);

Expand Down
2 changes: 1 addition & 1 deletion OMEdit/OMEditGUI/EllipseAnnotation.h
Expand Up @@ -43,7 +43,7 @@ class EllipseAnnotation : public ShapeAnnotation
{
Q_OBJECT
public:
EllipseAnnotation(QString shape, Component *pParent = 0);
EllipseAnnotation(QString shape, Component *pParent);
EllipseAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
EllipseAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
QRectF boundingRect() const;
Expand Down
27 changes: 24 additions & 3 deletions OMEdit/OMEditGUI/Helper.cpp
Expand Up @@ -34,7 +34,7 @@
#include "Helper.h"

QString Helper::applicationName = "OMEdit";
QString Helper::applicationVersion = "Version: 1.6.0";
QString Helper::applicationVersion = "Version: 1.7.0";
QString Helper::applicationIntroText = "OpenModelica Connection Editor";
// these two variables are set once we are connected to OMC......in OMCProxy::startServer().
QString Helper::OpenModelicaHome = QString();
Expand Down Expand Up @@ -73,8 +73,19 @@ qreal Helper::shapesStrokeWidth = 5.0;
QString Helper::modelicaLibrarySearchText = QString("Search Modelica Standard Library");
QString Helper::noItemFound = QString("Sorry, no items found");
QString Helper::running_Simulation = QString("Running Simulation");
QString Helper::starting_interactive_simulation_server = QString("Starting Interactive Simulation Server");
QString Helper::omi_network_address = QString("127.0.0.1");
quint16 Helper::omi_control_client_port = 10501;
quint16 Helper::omi_control_server_port = 10500;
quint16 Helper::omi_transfer_server_port = 10502;
QString Helper::omi_initialize_button_tooltip = QString("Initializes the interactive simulation.");
QString Helper::omi_start_button_tooltip = QString("Starts or continues the interactive simulation.");
QString Helper::omi_pause_button_tooltip = QString("Pauses the running interactive simulation.");
QString Helper::omi_stop_button_tooltip = QString("Stops the running interactive simulation and resets all values to the beginning.");
QString Helper::omi_shutdown_button_tooltip = QString("Shut down the running interactive simulation.");
QString Helper::omi_showlog_button_tooltip = QString("Shows the OMI Log Message Window.");

QString Helper::ModelicaSimulationMethods = "DASSL,DASSL2,Euler,Runge-Kutta";
QString Helper::ModelicaSimulationMethods = "DASSLOLD,DASSL,DASSL2,Euler,Runge-Kutta";
QString Helper::ModelicaSimulationOutputFormats = "mat,plt,csv,empty";

QString GUIMessages::getMessage(int type)
Expand Down Expand Up @@ -118,7 +129,9 @@ QString GUIMessages::getMessage(int type)
case ONLY_MODEL_ALLOWED:
return "This item is not a model.";
case UNABLE_TO_LOAD_FILE:
return "Error has occurred while loading the file. Unable to load the file.";
return "Error has occurred while loading the file%1. Unable to load the file.";
case UNABLE_TO_LOAD_MODEL:
return "Error has occurred while loading the model : \n%1.";
case DELETE_AND_LOAD:
return "Delete the existing models before loading the file.";
case REDEFING_EXISTING_MODELS:
Expand All @@ -139,6 +152,14 @@ QString GUIMessages::getMessage(int type)
return "The file '%1' has been removed outside %2. Do you want to keep it?";
case FILE_MODIFIED_MSG:
return "The file '%1' has been modified outside %2. Do you want to reload it?";
case CLOSE_INTERACTIVE_SIMULATION_TAB:
return "Are you sure you want to close '%1' interactive simulation?";
case INFO_CLOSE_INTERACTIVE_SIMULATION_TAB:
return "You can not recover this window once its closed.";
case INTERACTIVE_SIMULATION_RUNNIG:
return "You already have one interactive simulation running. Only one interactive simulaiton session is allowed at a time. \n\n Please shutdown the interactive simulation or close the interactive simulation tab before launching the new one.";
case SELECT_VARIABLE_FOR_OMI:
return "Please select a variable to plot before starting.";
default:
return "";
}
Expand Down
18 changes: 17 additions & 1 deletion OMEdit/OMEditGUI/Helper.h
Expand Up @@ -76,6 +76,17 @@ class Helper
static QString modelicaLibrarySearchText;
static QString noItemFound;
static QString running_Simulation;
static QString starting_interactive_simulation_server;
static QString omi_network_address;
static quint16 omi_control_client_port;
static quint16 omi_control_server_port;
static quint16 omi_transfer_server_port;
static QString omi_initialize_button_tooltip;
static QString omi_start_button_tooltip;
static QString omi_pause_button_tooltip;
static QString omi_stop_button_tooltip;
static QString omi_shutdown_button_tooltip;
static QString omi_showlog_button_tooltip;
};

class GUIMessages
Expand All @@ -102,6 +113,7 @@ class GUIMessages
DELETE_FAIL,
ONLY_MODEL_ALLOWED,
UNABLE_TO_LOAD_FILE,
UNABLE_TO_LOAD_MODEL,
DELETE_AND_LOAD,
REDEFING_EXISTING_MODELS,
INVALID_COMPONENT_ANNOTATIONS,
Expand All @@ -111,7 +123,11 @@ class GUIMessages
CHILD_MODEL_SAVE,
SEARCH_STRING_NOT_FOUND,
FILE_REMOVED_MSG,
FILE_MODIFIED_MSG
FILE_MODIFIED_MSG,
CLOSE_INTERACTIVE_SIMULATION_TAB,
INFO_CLOSE_INTERACTIVE_SIMULATION_TAB,
INTERACTIVE_SIMULATION_RUNNIG,
SELECT_VARIABLE_FOR_OMI
};

static QString getMessage(int type);
Expand Down

0 comments on commit 99d7aed

Please sign in to comment.