Commit e8e6d366 authored by Lucio Zambon's avatar Lucio Zambon
Browse files

Initial import

parent 28b86d43
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/progattenuator.cpp
HEADERS += src/progattenuator.h
# cuuimake runs uic
# FORMS = src/progattenuator.ui
# but we need to include ui_xxxx.h file amongst the headers
# in order to be recompiled when it changes
#
HEADERS += \
ui/ui_progattenuator.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 = progattenuator-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 'progattenuator' under $${INSTALL_DIR} ")
message("-")
} else {
message("-")
message("INSTALLATION")
message(" call qmake INSTALL_DIR=/usr/local/bin to install progattenuator 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("-")
#include <quapplication.h>
#include "progattenuator.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("Progattenuator");
QString version(VERSION);
qu_app.setApplicationVersion(version);
qu_app.setProperty("author", "lz");
qu_app.setProperty("mail", "$AU_EMAIL$");
qu_app.setProperty("phone", "$AU_PHONE$");
qu_app.setProperty("office", "$AU_OFFICE$");
qu_app.setProperty("hwReferent", "$HW_REFERENT$"); /* name of the referent that provides the device server */
CumbiaPool *cu_p = new CumbiaPool();
Progattenuator *w = new Progattenuator(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 "progattenuator.h"
#include "ui_progattenuator.h"
// cumbia
#include <cumbiapool.h>
#include <cuserviceprovider.h>
#include <cumacros.h>
#include <quapps.h>
// cumbia
Progattenuator::Progattenuator(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::Progattenuator;
ui->setupUi(this, cu_pool, m_ctrl_factory_pool);
// mloader.modules() to get the list of loaded modules
// cumbia
}
Progattenuator::~Progattenuator()
{
delete ui;
}
#ifndef Progattenuator_H
#define Progattenuator_H
#include <QWidget>
// cumbia
#include <qulogimpl.h>
#include <cucontrolsfactorypool.h>
class CumbiaPool;
// cumbia
namespace Ui {
class Progattenuator;
}
class Progattenuator : public QWidget
{
Q_OBJECT
public:
explicit Progattenuator(CumbiaPool *cu_p, QWidget *parent = 0);
~Progattenuator();
private:
Ui::Progattenuator *ui;
// cumbia
CumbiaPool *cu_pool;
QuLogImpl m_log_impl;
CuControlsFactoryPool m_ctrl_factory_pool;
// cumbia
};
#endif // Progattenuator_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>Progattenuator</class>
<widget class="QWidget" name="Progattenuator">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>450</width>
<height>380</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>380</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>450</width>
<height>380</height>
</size>
</property>
<property name="windowTitle">
<string>Progattenuator</string>
</property>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>7</x>
<y>24</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Attenuation 1</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QuLabel" name="quLabel">
<property name="geometry">
<rect>
<x>170</x>
<y>10</y>
<width>120</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="source">
<string>usa/diagnostics/pat_usa.01/Attenuation1</string>
</property>
</widget>
<widget class="QuApplyNumeric" name="quApplyNum">
<property name="geometry">
<rect>
<x>300</x>
<y>10</y>
<width>141</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="maximum">
<double>31.000000000000000</double>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="integerDigits" stdset="0">
<number>2</number>
</property>
<property name="decimalDigits" stdset="0">
<number>0</number>
</property>
<property name="buttonText">
<string>apply</string>
</property>
<property name="numericFont">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="target">
<string>usa/diagnostics/pat_usa.01/Attenuation1</string>
</property>
</widget>
<widget class="QLabel" name="label_2">
<property name="geometry">
<rect>
<x>7</x>
<y>74</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Attenuation 2</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QuLabel" name="quLabel_2">
<property name="geometry">
<rect>
<x>170</x>
<y>60</y>
<width>120</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="source">
<string>usa/diagnostics/pat_usa.01/Attenuation2</string>
</property>
</widget>
<widget class="QuApplyNumeric" name="quApplyNum_2">
<property name="geometry">
<rect>
<x>300</x>
<y>60</y>
<width>141</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="maximum">
<double>31.000000000000000</double>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="integerDigits" stdset="0">
<number>2</number>
</property>
<property name="decimalDigits" stdset="0">
<number>0</number>
</property>
<property name="buttonText">
<string>apply</string>
</property>
<property name="numericFont">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="target">
<string>usa/diagnostics/pat_usa.01/Attenuation2</string>
</property>
</widget>
<widget class="QLabel" name="label_3">
<property name="geometry">
<rect>
<x>7</x>
<y>124</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Attenuation 3</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QuLabel" name="quLabel_3">
<property name="geometry">
<rect>
<x>170</x>
<y>110</y>
<width>120</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="source">
<string>usa/diagnostics/pat_usa.01/Attenuation3</string>
</property>
</widget>
<widget class="QuApplyNumeric" name="quApplyNum_3">
<property name="geometry">
<rect>
<x>300</x>
<y>110</y>
<width>141</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="maximum">
<double>31.000000000000000</double>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="integerDigits" stdset="0">
<number>2</number>
</property>
<property name="decimalDigits" stdset="0">
<number>0</number>
</property>
<property name="buttonText">
<string>apply</string>
</property>
<property name="numericFont">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="target">
<string>usa/diagnostics/pat_usa.01/Attenuation3</string>
</property>
</widget>
<widget class="QLabel" name="label_4">
<property name="geometry">
<rect>
<x>7</x>
<y>174</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>Attenuation 4</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QuLabel" name="quLabel_4">
<property name="geometry">
<rect>
<x>170</x>
<y>160</y>
<width>120</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="source">
<string>usa/diagnostics/pat_usa.01/Attenuation4</string>
</property>
</widget>
<widget class="QuApplyNumeric" name="quApplyNum_4">
<property name="geometry">
<rect>
<x>300</x>
<y>160</y>
<width>141</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="maximum">
<double>31.000000000000000</double>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="integerDigits" stdset="0">
<number>2</number>
</property>
<property name="decimalDigits" stdset="0">
<number>0</number>
</property>
<property name="buttonText">
<string>apply</string>
</property>
<property name="numericFont">
<font>
<pointsize>13</pointsize>
</font>
</property>
<property name="target">
<string>usa/diagnostics/pat_usa.01/Attenuation4</string>
</property>
</widget>
<widget class="QuLabel" name="quLabel_5">
<property name="geometry">
<rect>
<x>170</x>
<y>220</y>
<width>271</width>
<height>40</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="source">
<string>usa/diagnostics/pat_usa.01/State</string>
</property>
</widget>
<widget class="QuLabel" name="quLabel_6">
<property name="geometry">
<rect>
<x>10</x>
<y>270</y>
<width>431</width>
<height>101</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="source">
<string>usa/diagnostics/pat_usa.01/Status</string>
</property>
</widget>
<widget class="QLabel" name="label_5">
<property name="geometry">
<rect>
<x>10</x>
<y>230</y>
<width>151</width>
<height>21</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>15</pointsize>
</font>
</property>
<property name="text">
<string>State</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
<class>EApplyNumeric</class>
<extends>QWidget</extends>
<header>eapplynumeric.h</header>
</customwidget>
<customwidget>
<class>QuLabel</class>
<extends>QLabel</extends>
<header>qulabel.h</header>
</customwidget>
<customwidget>
<class>QuApplyNumeric</class>
<extends>EApplyNumeric</extends>
<header>quapplynumeric.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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