Commit 79c56b1c authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

added files src/turbopump.ui turbopump.pro src/turbopump.h src/turbopump.cpp src/main.cpp

parent 90f860ce
release_01: first release of the project "turbopump".
This is turbopump README file.
DEPENDENCIES:
Qt version >= 4.8
Qwt version 6
QTango version 6
SPECIAL REQUIREMENTS:
none
Tango devices used
------------------
TANGO HOST:
export TANGO_HOST=srv-tango-srf:20000
DEVICES:
pfe_f01/vacuum/ppm2_pfe_f01.01
pfe/vacuum/ppm2_pfe.01
Building
--------
qmake
make
./bin/turbopump-gui pfe_f01/vacuum/tmp500_pfe_f01.01
./bin/turbopump-gui pfe_f01/vacuum/tmp300_pfe_f01.01
./bin/turbopump-gui pfe_f01/vacuum/tmp80_pfe_f01.01
Main customer
-------------
Errors & Troubleshooting
------------------------
If you experience problems, please contact:
Giacomo <giacomo.strangolino@elettra.eu>
Thank you.
Sincrotrone Trieste s.c.p.a - ELETTRA Laboratory - Controls Group
#include <quapplication.h>
#include "turbopump.h"
// cumbia
#include <cumbiapool.h>
#include <cuthreadfactoryimpl.h>
#include <qthreadseventbridgefactory.h>
// cumbia
#define VERSION "1.0"
int main(int argc, char *argv[])
{
QuApplication qu_app( argc, argv );
qu_app.setOrganizationName("Elettra");
qu_app.setApplicationName("Turbopump");
QString version(VERSION);
qu_app.setApplicationVersion(version);
qu_app.setProperty("author", "Giacomo");
qu_app.setProperty("mail", "giacomo.strangolino@elettra.eu");
qu_app.setProperty("phone", "0403758073");
qu_app.setProperty("office", "T2PT025");
qu_app.setProperty("hwReferent", "$HW_REFERENT$"); /* name of the referent that provides the device server */
CumbiaPool *cu_p = new CumbiaPool();
Turbopump *w = new Turbopump(cu_p, NULL);
w->show();
// exec application loop
int ret = qu_app.exec();
// delete resources and return
delete w;
for(std::string n : cu_p->names())
if(cu_p->get(n))
delete cu_p->get(n);
return ret;
}
#include "turbopump.h"
#include "ui_turbopump.h"
// cumbia
#include <cumbiapool.h>
#include <cuserviceprovider.h>
#include <cumacros.h>
#include <quapps.h>
#include <qustring.h>
#include <quwatcher.h>
// cumbia
Turbopump::Turbopump(CumbiaPool *cumbia_pool, QWidget *parent) :
QWidget(parent)
{
// cumbia
CuModuleLoader mloader(cumbia_pool, &m_ctrl_factory_pool, &m_log_impl);
cu_pool = cumbia_pool;
ui = new Ui::Turbopump;
ui->setupUi(this, cu_pool, m_ctrl_factory_pool);
// mloader.modules() to get the list of loaded modules
// cumbia
// get device
QString de = ui->qulCurr->source().section('/', -2, -3);
printf("TurboPump: device %s\n", qstoc(de));
ui->ledNoErr->setSource("$1/ErrorCode");
ui->textErrCode->setSource("$1/ErrorCode");
}
Turbopump::~Turbopump()
{
delete ui;
}
#ifndef Turbopump_H
#define Turbopump_H
#include <QWidget>
// cumbia
#include <qulogimpl.h>
#include <cucontrolsfactorypool.h>
class CumbiaPool;
// cumbia
#include <quled.h>
#include <QPlainTextEdit>
namespace Ui {
class Turbopump;
}
class Turbopump : public QWidget
{
Q_OBJECT
public:
explicit Turbopump(CumbiaPool *cu_p, QWidget *parent = 0);
~Turbopump();
private:
Ui::Turbopump *ui;
// cumbia
CumbiaPool *cu_pool;
QuLogImpl m_log_impl;
CuControlsFactoryPool m_ctrl_factory_pool;
// cumbia
};
#endif // Turbopump_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Turbopump</class>
<widget class="QWidget" name="Turbopump">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>294</width>
<height>579</height>
</rect>
</property>
<property name="windowTitle">
<string>Turbopump</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="5" column="0" colspan="5">
<widget class="QGroupBox" name="gbLastErr">
<property name="title">
<string>Last Error</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="MyTextBox" name="textErrCode">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="4" column="1" colspan="4">
<widget class="QuButton" name="qubAck">
<property name="text">
<string>Acknowledge</string>
</property>
<property name="target">
<string>$1/ErrorAckn(true)</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="5">
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>TextLabel</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="6" column="3" colspan="2">
<widget class="QuButton" name="qubAck_2">
<property name="text">
<string>Initialize</string>
</property>
<property name="target">
<string>$1-&gt;Init</string>
</property>
</widget>
</item>
<item row="7" column="4">
<widget class="QuLabel" name="quLabel_2">
<property name="source">
<string>$1/State</string>
</property>
</widget>
</item>
<item row="7" column="0" colspan="4">
<widget class="QuLabel" name="quLabel">
<property name="source">
<string>$1/Status</string>
</property>
</widget>
</item>
<item row="6" column="0" colspan="3">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Communication</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0" colspan="5">
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string/>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="4" column="4">
<widget class="QuLabel" name="qulTemp">
<property name="source">
<string>$1/TempMotor</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QuLabel" name="qulFreq">
<property name="source">
<string>$1/ActualSpdHz</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>At Speed</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Temperature</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QuLed" name="ledAtSpeed">
<property name="source">
<string>$1/SpdSwPtAtt</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QuLabel" name="qulCurr">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="source">
<string>$1/DrvCurrent</string>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Frequency</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_10">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Current</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>No Error</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QWidget" name="widget" native="true"/>
</item>
<item row="0" column="2">
<widget class="MyLed" name="ledNoErr" native="true"/>
</item>
</layout>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Motor</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="0" colspan="5">
<widget class="QGroupBox" name="gbPowerSupply">
<property name="title">
<string>Power Supply</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QuButton" name="qubPSOn">
<property name="text">
<string>ON</string>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="QuButton" name="qubPSOff">
<property name="text">
<string>OFF</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>On</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QuLed" name="ledPSOn"/>
</item>
<item row="1" column="2">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Ok</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QuLed" name="ledPSOk"/>
</item>
</layout>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Error</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Gas Mode</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QuButton" name="quButton">
<property name="target">
<string>$1/GasMode(&amp;qucGasMode)</string>
</property>
</widget>
</item>
<item row="3" column="1" colspan="3">
<widget class="QuComboBox" name="qucGasMode">
<property name="target">
<string>$1/GasMode</string>
</property>
<property name="indexMode">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QuButton" name="qubStop">
<property name="text">
<string>Stop</string>
</property>
<property name="target">
<string>$1/MotorPump(false)</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QuButton" name="qubStart">
<property name="text">
<string>Start</string>
</property>
<property name="target">
<string>$1/MotorPump(true)</string>
</property>
</widget>
</item>
</layout>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>QuLabel</class>
<extends>QLabel</extends>
<header>qulabel.h</header>
</customwidget>
<customwidget>
<class>QuLed</class>
<extends>QWidget</extends>
<header>quled.h</header>
</customwidget>
<customwidget>
<class>QuComboBox</class>
<extends>QComboBox</extends>
<header>qucombobox.h</header>
</customwidget>
<customwidget>
<class>QuButton</class>
<extends>QPushButton</extends>
<header>qubutton.h</header>
</customwidget>
<customwidget>
<class>MyLed</class>
<extends>QWidget</extends>
<header>myled.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MyTextBox</class>
<extends>QPlainTextEdit</extends>
<header>mytextbox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
isEmpty(CUMBIA_ROOT) {
CUMBIA_ROOT=/usr/local/cumbia-libs
}
include($${CUMBIA_ROOT}/include/quapps/quapps.pri)
# CONFIG += debug | release
DEFINES += QT_NO_DEBUG_OUTPUT
# RESOURCES +=
SOURCES += src/main.cpp \
src/turbopump.cpp \
src/myled.cpp \
src/mytextbox.cpp
HEADERS += src/turbopump.h \
src/myled.h \
src/mytextbox.h
# cuuimake runs uic
# FORMS = src/turbopump.ui
# but we need to include ui_xxxx.h file amongst the headers
# in order to be recompiled when it changes
#
HEADERS += \
ui/ui_turbopump.h
# - ui: where to find cuuimake ui_*.h files
# since FORMS is not used
# - src: where to find headers included by
# ui_*.h (e.g. for custom widget promoted
# from the Qt designer)
#
INCLUDEPATH += ui src
TARGET = turbopump-gui
!wasm-emscripten {
TARGET = bin/$${TARGET}
} else {
TARGET = wasm/$${TARGET}
}
#
# make install works if INSTALL_DIR is given to qmake
#
!isEmpty(INSTALL_DIR) {
wasm-emscripten {
inst.files = wasm/*
} else {
inst.files = $${TARGET}
}
inst.path = $${INSTALL_DIR}
INSTALLS += inst
message("-")
message("INSTALLATION")
message(" execute `make install` to install 'turbopump' under $${INSTALL_DIR} ")
message("-")
} else {
message("-")
message("INSTALLATION")
message(" call qmake INSTALL_DIR=/usr/local/bin to install turbopump later with `make install` ")
message("-")
}
# unix:LIBS += -L. -lmylib
# unix:INCLUDEPATH += . ../../src
message("-")
message("NOTE")
message("You need to run cuuimake in order to build the project")
message("-")
message(" cuuimake --show-config to see cuuimake configuration options")
message(" cuuimake --configure to configure cuuimake")
message(" cuuimake -jN to execute cuuimake and then make -jN")
message(" cuuimake --make to run cuuimake and then make")
message("-")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment