Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
10,612 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
PROJECT(PendulumWindowPlugin) | ||
|
||
# Add the plugin | ||
|
||
ADD_PLUGIN(PendulumWindow | ||
SOURCES | ||
../../i18ninterface.cpp | ||
../../plugininfo.cpp | ||
../../plugininterface.cpp | ||
../../windowinterface.cpp | ||
|
||
src/pendulumwindowplugin.cpp | ||
src/pendulumwindowwindow.cpp | ||
HEADERS_MOC | ||
src/pendulumwindowplugin.h | ||
src/pendulumwindowwindow.h | ||
UIS | ||
src/pendulumwindowwindow.ui | ||
PLUGINS | ||
ZincWidget | ||
) |
22 changes: 22 additions & 0 deletions
22
src/plugins/simulation/PendulumWindow/i18n/PendulumWindow_fr.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!DOCTYPE TS> | ||
<TS version="2.1" language="fr_FR" sourcelanguage="en_GB"> | ||
<context> | ||
<name>OpenCOR::PendulumWindow::PendulumWindowPlugin</name> | ||
<message> | ||
<source>Pendulum</source> | ||
<translation>Pendule</translation> | ||
</message> | ||
<message> | ||
<source>Show/hide the Pendulum window</source> | ||
<translation>Montrer/cacher la fenêtre Pendule</translation> | ||
</message> | ||
</context> | ||
<context> | ||
<name>PendulumWindowWindow</name> | ||
<message> | ||
<source>Pendulum</source> | ||
<translation>Pendule</translation> | ||
</message> | ||
</context> | ||
</TS> |
5 changes: 5 additions & 0 deletions
5
src/plugins/simulation/PendulumWindow/res/PendulumWindow_i18n.qrc.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/"> | ||
<file alias="${PLUGIN_NAME}_fr">${PROJECT_BUILD_DIR}/${PLUGIN_NAME}_fr.qm</file> | ||
</qresource> | ||
</RCC> |
5 changes: 5 additions & 0 deletions
5
src/plugins/simulation/PendulumWindow/res/PendulumWindow_ui.qrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<RCC> | ||
<qresource prefix="/PendulumWindow"> | ||
<file>data.csv</file> | ||
</qresource> | ||
</RCC> |
10,002 changes: 10,002 additions & 0 deletions
10,002
src/plugins/simulation/PendulumWindow/res/data.csv
Large diffs are not rendered by default.
Oops, something went wrong.
184 changes: 184 additions & 0 deletions
184
src/plugins/simulation/PendulumWindow/src/pendulumwindowplugin.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
/******************************************************************************* | ||
Copyright (C) The University of Auckland | ||
OpenCOR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenCOR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
|
||
//============================================================================== | ||
// Pendulum window plugin | ||
//============================================================================== | ||
|
||
#include "coreguiutils.h" | ||
#include "pendulumwindowplugin.h" | ||
#include "pendulumwindowwindow.h" | ||
|
||
//============================================================================== | ||
|
||
#include <QMainWindow> | ||
|
||
//============================================================================== | ||
|
||
namespace OpenCOR { | ||
namespace PendulumWindow { | ||
|
||
//============================================================================== | ||
|
||
PLUGININFO_FUNC PendulumWindowPluginInfo() | ||
{ | ||
Descriptions descriptions; | ||
|
||
descriptions.insert("en", QString::fromUtf8("a plugin to test the pendulum model.")); | ||
descriptions.insert("fr", QString::fromUtf8("une extension pour tester le modèle du pendule.")); | ||
|
||
return new PluginInfo(PluginInfo::Simulation, true, false, | ||
QStringList() << "ZincWidget", | ||
descriptions); | ||
} | ||
|
||
//============================================================================== | ||
// I18n interface | ||
//============================================================================== | ||
|
||
void PendulumWindowPlugin::retranslateUi() | ||
{ | ||
// Retranslate our Pendulum window action | ||
|
||
retranslateAction(mPendulumWindowAction, | ||
tr("Pendulum"), | ||
tr("Show/hide the Pendulum window")); | ||
|
||
// Retranslate our Pendulum window | ||
|
||
mPendulumWindowWindow->retranslateUi(); | ||
} | ||
|
||
//============================================================================== | ||
// Plugin interface | ||
//============================================================================== | ||
|
||
bool PendulumWindowPlugin::definesPluginInterfaces() | ||
{ | ||
// We don't handle this interface... | ||
|
||
return false; | ||
} | ||
|
||
//============================================================================== | ||
|
||
bool PendulumWindowPlugin::pluginInterfacesOk(const QString &pFileName, | ||
QObject *pInstance) | ||
{ | ||
Q_UNUSED(pFileName); | ||
Q_UNUSED(pInstance); | ||
|
||
// We don't handle this interface... | ||
|
||
return false; | ||
} | ||
|
||
//============================================================================== | ||
|
||
void PendulumWindowPlugin::initializePlugin() | ||
{ | ||
// Create an action to show/hide our web browser window | ||
|
||
mPendulumWindowAction = Core::newAction(true, Core::mainWindow()); | ||
|
||
// Create our web browser window | ||
|
||
mPendulumWindowWindow = new PendulumWindowWindow(Core::mainWindow()); | ||
} | ||
|
||
//============================================================================== | ||
|
||
void PendulumWindowPlugin::finalizePlugin() | ||
{ | ||
// We don't handle this interface... | ||
} | ||
|
||
//============================================================================== | ||
|
||
void PendulumWindowPlugin::pluginsInitialized(const Plugins &pLoadedPlugins) | ||
{ | ||
Q_UNUSED(pLoadedPlugins); | ||
|
||
// We don't handle this interface... | ||
} | ||
|
||
//============================================================================== | ||
|
||
void PendulumWindowPlugin::loadSettings(QSettings *pSettings) | ||
{ | ||
Q_UNUSED(pSettings); | ||
|
||
// We don't handle this interface... | ||
} | ||
|
||
//============================================================================== | ||
|
||
void PendulumWindowPlugin::saveSettings(QSettings *pSettings) const | ||
{ | ||
Q_UNUSED(pSettings); | ||
|
||
// We don't handle this interface... | ||
} | ||
|
||
//============================================================================== | ||
|
||
void PendulumWindowPlugin::handleUrl(const QUrl &pUrl) | ||
{ | ||
Q_UNUSED(pUrl); | ||
|
||
// We don't handle this interface... | ||
} | ||
|
||
//============================================================================== | ||
// Window interface | ||
//============================================================================== | ||
|
||
Qt::DockWidgetArea PendulumWindowPlugin::windowDefaultDockArea() const | ||
{ | ||
// Return our default dock area | ||
|
||
return Qt::RightDockWidgetArea; | ||
} | ||
|
||
//============================================================================== | ||
|
||
QAction * PendulumWindowPlugin::windowAction() const | ||
{ | ||
// Return our window action | ||
|
||
return mPendulumWindowAction; | ||
} | ||
|
||
//============================================================================== | ||
|
||
QDockWidget * PendulumWindowPlugin::windowWidget() const | ||
{ | ||
// Return our window widget | ||
|
||
return mPendulumWindowWindow; | ||
} | ||
|
||
//============================================================================== | ||
|
||
} // namespace PendulumWindow | ||
} // namespace OpenCOR | ||
|
||
//============================================================================== | ||
// End of file | ||
//============================================================================== |
77 changes: 77 additions & 0 deletions
77
src/plugins/simulation/PendulumWindow/src/pendulumwindowplugin.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/******************************************************************************* | ||
Copyright (C) The University of Auckland | ||
OpenCOR is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenCOR is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*******************************************************************************/ | ||
|
||
//============================================================================== | ||
// Pendulum window plugin | ||
//============================================================================== | ||
|
||
#pragma once | ||
|
||
//============================================================================== | ||
|
||
#include "i18ninterface.h" | ||
#include "plugininfo.h" | ||
#include "plugininterface.h" | ||
#include "windowinterface.h" | ||
|
||
//============================================================================== | ||
|
||
namespace OpenCOR { | ||
namespace PendulumWindow { | ||
|
||
//============================================================================== | ||
|
||
PLUGININFO_FUNC PendulumWindowPluginInfo(); | ||
|
||
//============================================================================== | ||
|
||
class PendulumWindowWindow; | ||
|
||
//============================================================================== | ||
|
||
class PendulumWindowPlugin : public QObject, public I18nInterface, | ||
public PluginInterface, public WindowInterface | ||
{ | ||
Q_OBJECT | ||
|
||
Q_PLUGIN_METADATA(IID "OpenCOR.PendulumWindowPlugin" FILE "pendulumwindowplugin.json") | ||
|
||
Q_INTERFACES(OpenCOR::I18nInterface) | ||
Q_INTERFACES(OpenCOR::PluginInterface) | ||
Q_INTERFACES(OpenCOR::WindowInterface) | ||
|
||
public: | ||
#include "i18ninterface.inl" | ||
#include "plugininterface.inl" | ||
#include "windowinterface.inl" | ||
|
||
private: | ||
QAction *mPendulumWindowAction; | ||
|
||
PendulumWindowWindow *mPendulumWindowWindow; | ||
}; | ||
|
||
//============================================================================== | ||
|
||
} // namespace PendulumWindow | ||
} // namespace OpenCOR | ||
|
||
//============================================================================== | ||
// End of file | ||
//============================================================================== |
3 changes: 3 additions & 0 deletions
3
src/plugins/simulation/PendulumWindow/src/pendulumwindowplugin.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"Keys": [ "PendulumWindowPlugin" ] | ||
} |
Oops, something went wrong.