mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-09-17 17:00:27 +02:00
2021-02-01 Fred Gleason <fredg@paravelsystems.com>
* Added 'RDGpioSlotsModel'. * Refactored the 'Livewire GPIO Source Assignments' dialog in rdadmin(1) to use the model-based API. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
parent
e25bec42a2
commit
0be2a7696b
@ -20965,3 +20965,7 @@
|
||||
* Added 'RDNodeSlotsModel'.
|
||||
* Refactored the 'Viewing Livewire Node' dialog in rdadmin(1) to use
|
||||
the model-based API.
|
||||
2021-02-01 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added 'RDGpioSlotsModel'.
|
||||
* Refactored the 'Livewire GPIO Source Assignments' dialog in
|
||||
rdadmin(1) to use the model-based API.
|
||||
|
@ -145,6 +145,7 @@ dist_librd_la_SOURCES = dbversion.h\
|
||||
rdgetpasswd.cpp rdgetpasswd.h\
|
||||
rdgpio.cpp rdgpio.h\
|
||||
rdgpioselector.cpp rdgpioselector.h\
|
||||
rdgpioslotsmodel.cpp rdgpioslotsmodel.h\
|
||||
rdgrid.cpp rdgrid.h\
|
||||
rdgroup.cpp rdgroup.h\
|
||||
rdgroup_list.cpp rdgroup_list.h\
|
||||
@ -328,6 +329,7 @@ nodist_librd_la_SOURCES = moc_rd3emptycart.cpp\
|
||||
moc_rdgetpasswd.cpp\
|
||||
moc_rdgpio.cpp\
|
||||
moc_rdgpioselector.cpp\
|
||||
moc_rdgpioslotsmodel.cpp\
|
||||
moc_rdgrouplistmodel.cpp\
|
||||
moc_rdhotkeys.cpp\
|
||||
moc_rdhotkeylist.cpp\
|
||||
|
@ -106,6 +106,7 @@ SOURCES += rdframe.cpp
|
||||
SOURCES += rdget_ath.cpp
|
||||
SOURCES += rdgetpasswd.cpp
|
||||
SOURCES += rdgpioselector.cpp
|
||||
SOURCES += rdgpioslotsmodel.cpp
|
||||
SOURCES += rdgrid.cpp
|
||||
SOURCES += rdgroup.cpp
|
||||
SOURCES += rdgroup_list.cpp
|
||||
@ -274,6 +275,7 @@ HEADERS += rdframe.h
|
||||
HEADERS += rdget_ath.h
|
||||
HEADERS += rdgetpasswd.h
|
||||
HEADERS += rdgpioselector.h
|
||||
HEADERS += rdgpioslotsmodel.h
|
||||
HEADERS += rdgrid.h
|
||||
HEADERS += rdgpio.h
|
||||
HEADERS += rdgroup_list.h
|
||||
|
@ -2505,6 +2505,29 @@ pro dobu zprávy.
|
||||
<translation>PIN:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGpioSlotsModel</name>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
|
@ -2482,6 +2482,29 @@ figure for the report period.
|
||||
<translation>PIN:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGpioSlotsModel</name>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
|
@ -2477,6 +2477,29 @@ para el período a reportar.
|
||||
<translation>Pin:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGpioSlotsModel</name>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
|
@ -2128,6 +2128,29 @@ figure for the report period.
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGpioSlotsModel</name>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
|
@ -2463,6 +2463,29 @@ for rapportperioden.
|
||||
<translation>Pin-nummer:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGpioSlotsModel</name>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
|
@ -2463,6 +2463,29 @@ for rapportperioden.
|
||||
<translation>Pin-nummer:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGpioSlotsModel</name>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
|
@ -2470,6 +2470,29 @@ para o período do relatório
|
||||
<translation>Pin:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGpioSlotsModel</name>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RDGroupListModel</name>
|
||||
<message>
|
||||
|
297
lib/rdgpioslotsmodel.cpp
Normal file
297
lib/rdgpioslotsmodel.cpp
Normal file
@ -0,0 +1,297 @@
|
||||
// rdgpioslotsmodel.cpp
|
||||
//
|
||||
// Data model for Livewire multicast GPIO slots
|
||||
//
|
||||
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program 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, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#include "rdapplication.h"
|
||||
#include "rdescape_string.h"
|
||||
#include "rdgpioslotsmodel.h"
|
||||
|
||||
RDGpioSlotsModel::RDGpioSlotsModel(RDMatrix *mtx,int slot_quan,QObject *parent)
|
||||
: QAbstractTableModel(parent)
|
||||
{
|
||||
d_mtx=mtx;
|
||||
d_slot_quantity=slot_quan;
|
||||
|
||||
//
|
||||
// Column Attributes
|
||||
//
|
||||
unsigned left=Qt::AlignLeft|Qt::AlignVCenter;
|
||||
unsigned center=Qt::AlignCenter;
|
||||
// unsigned right=Qt::AlignRight|Qt::AlignVCenter;
|
||||
|
||||
d_headers.push_back(tr("Lines"));
|
||||
d_alignments.push_back(center);
|
||||
|
||||
d_headers.push_back(tr("Source #"));
|
||||
d_alignments.push_back(center);
|
||||
|
||||
d_headers.push_back(tr("Surface Address"));
|
||||
d_alignments.push_back(left);
|
||||
|
||||
|
||||
updateModel();
|
||||
}
|
||||
|
||||
|
||||
RDGpioSlotsModel::~RDGpioSlotsModel()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
QPalette RDGpioSlotsModel::palette()
|
||||
{
|
||||
return d_palette;
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::setPalette(const QPalette &pal)
|
||||
{
|
||||
d_palette=pal;
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::setFont(const QFont &font)
|
||||
{
|
||||
d_font=font;
|
||||
d_bold_font=font;
|
||||
d_bold_font.setWeight(QFont::Bold);
|
||||
}
|
||||
|
||||
|
||||
int RDGpioSlotsModel::columnCount(const QModelIndex &parent) const
|
||||
{
|
||||
return d_headers.size();
|
||||
}
|
||||
|
||||
|
||||
int RDGpioSlotsModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
return d_texts.size();
|
||||
}
|
||||
|
||||
|
||||
QVariant RDGpioSlotsModel::headerData(int section,Qt::Orientation orient,
|
||||
int role) const
|
||||
{
|
||||
if((orient==Qt::Horizontal)&&(role==Qt::DisplayRole)) {
|
||||
return d_headers.at(section);
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
QVariant RDGpioSlotsModel::data(const QModelIndex &index,int role) const
|
||||
{
|
||||
QString str;
|
||||
int col=index.column();
|
||||
int row=index.row();
|
||||
|
||||
if(row<d_texts.size()) {
|
||||
switch((Qt::ItemDataRole)role) {
|
||||
case Qt::DisplayRole:
|
||||
return d_texts.at(row).at(col);
|
||||
|
||||
case Qt::DecorationRole:
|
||||
// Nothing to do!
|
||||
break;
|
||||
|
||||
case Qt::TextAlignmentRole:
|
||||
return d_alignments.at(col);
|
||||
|
||||
case Qt::FontRole:
|
||||
if(col==0) {
|
||||
return d_bold_font;
|
||||
}
|
||||
return d_font;
|
||||
|
||||
case Qt::TextColorRole:
|
||||
// Nothing to do!
|
||||
break;
|
||||
|
||||
case Qt::BackgroundRole:
|
||||
// Nothing to do!
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
int RDGpioSlotsModel::slotId(const QModelIndex &row) const
|
||||
{
|
||||
return d_ids.at(row.row());
|
||||
}
|
||||
|
||||
|
||||
QModelIndex RDGpioSlotsModel::addSlot(int id)
|
||||
{
|
||||
//
|
||||
// Find the insertion offset
|
||||
//
|
||||
int offset=d_ids.size();
|
||||
for(int i=0;i<d_ids.size();i++) {
|
||||
if(id<d_ids.at(i)) {
|
||||
offset=i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
beginInsertRows(QModelIndex(),offset,offset);
|
||||
QList<QVariant> list;
|
||||
for(int i=0;i<columnCount();i++) {
|
||||
list.push_back(QVariant());
|
||||
}
|
||||
d_texts.insert(offset,list);
|
||||
d_ids.insert(offset,id);
|
||||
updateRowLine(offset);
|
||||
endInsertRows();
|
||||
|
||||
return createIndex(offset,0);
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::removeSlot(const QModelIndex &row)
|
||||
{
|
||||
beginRemoveRows(QModelIndex(),row.row(),row.row());
|
||||
|
||||
d_ids.removeAt(row.row());
|
||||
d_texts.removeAt(row.row());
|
||||
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::removeSlot(int id)
|
||||
{
|
||||
for(int i=0;i<d_ids.size();i++) {
|
||||
if(d_ids.at(i)==id) {
|
||||
removeSlot(createIndex(i,0));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::refresh(const QModelIndex &row)
|
||||
{
|
||||
if(row.row()<d_texts.size()) {
|
||||
QString sql=sqlFields()+
|
||||
QString().sprintf("where ID=%u",d_ids.at(row.row()));
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
updateRow(row.row(),q);
|
||||
emit dataChanged(createIndex(row.row(),0),
|
||||
createIndex(row.row(),columnCount()));
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::refresh(int id)
|
||||
{
|
||||
for(int i=0;i<d_texts.size();i++) {
|
||||
if(d_ids.at(i)==id) {
|
||||
updateRowLine(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::updateModel()
|
||||
{
|
||||
QList<QVariant> texts;
|
||||
|
||||
RDSqlQuery *q=NULL;
|
||||
QString sql=sqlFields()+
|
||||
"where "+
|
||||
"STATION_NAME=\""+RDEscapeString(d_mtx->station())+"\" && "+
|
||||
QString().sprintf("MATRIX=%d && ",d_mtx->matrix())+
|
||||
QString().sprintf("SLOT<%d ",d_slot_quantity/5)+
|
||||
"order by SLOT ";
|
||||
beginResetModel();
|
||||
d_texts.clear();
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
d_ids.push_back(0);
|
||||
d_texts.push_back(texts);
|
||||
updateRow(d_texts.size()-1,q);
|
||||
}
|
||||
delete q;
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::updateRowLine(int line)
|
||||
{
|
||||
if(line<d_texts.size()) {
|
||||
QString sql=sqlFields()+
|
||||
QString().sprintf("where ID=%u",d_ids.at(line));
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
updateRow(line,q);
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void RDGpioSlotsModel::updateRow(int row,RDSqlQuery *q)
|
||||
{
|
||||
QList<QVariant> texts;
|
||||
|
||||
// Lines
|
||||
texts.push_back(QString().sprintf("%d - %d",5*row+1,5*row+5));
|
||||
|
||||
// Source Number
|
||||
if(q->value(2).toInt()>0) {
|
||||
texts.push_back(QString().sprintf("%05d",q->value(2).toInt()));
|
||||
}
|
||||
else {
|
||||
texts.push_back(tr("[none]"));
|
||||
}
|
||||
|
||||
// Surface Address
|
||||
if(q->value(3).toString().isEmpty()) {
|
||||
texts.push_back(tr("[all]"));
|
||||
}
|
||||
else {
|
||||
texts.push_back(q->value(3));
|
||||
}
|
||||
|
||||
d_ids[row]=q->value(0).toInt();
|
||||
d_texts[row]=texts;
|
||||
}
|
||||
|
||||
|
||||
QString RDGpioSlotsModel::sqlFields() const
|
||||
{
|
||||
QString sql=QString("select ")+
|
||||
"ID," // 00
|
||||
"SLOT,"+ // 01
|
||||
"SOURCE_NUMBER," // 02
|
||||
"IP_ADDRESS "+ // 03
|
||||
"from LIVEWIRE_GPIO_SLOTS ";
|
||||
|
||||
return sql;
|
||||
}
|
75
lib/rdgpioslotsmodel.h
Normal file
75
lib/rdgpioslotsmodel.h
Normal file
@ -0,0 +1,75 @@
|
||||
// rdgpioslotsmodel.h
|
||||
//
|
||||
// Data model for Livewire multicast GPIO slots
|
||||
//
|
||||
// (C) Copyright 2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
// published by the Free Software Foundation.
|
||||
//
|
||||
// This program 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, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef RDGPIOSLOTSMODEL_H
|
||||
#define RDGPIOSLOTSMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
#include <QFont>
|
||||
#include <QList>
|
||||
#include <QPalette>
|
||||
#include <QTimer>
|
||||
|
||||
#include <rddb.h>
|
||||
#include <rdmatrix.h>
|
||||
#include <rdnotification.h>
|
||||
#include <rduser.h>
|
||||
|
||||
class RDGpioSlotsModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDGpioSlotsModel(RDMatrix *mtx,int slot_quan,QObject *parent=0);
|
||||
~RDGpioSlotsModel();
|
||||
QPalette palette();
|
||||
void setPalette(const QPalette &pal);
|
||||
void setFont(const QFont &font);
|
||||
int columnCount(const QModelIndex &parent=QModelIndex()) const;
|
||||
int rowCount(const QModelIndex &parent=QModelIndex()) const;
|
||||
QVariant headerData(int section,Qt::Orientation orient,
|
||||
int role=Qt::DisplayRole) const;
|
||||
QVariant data(const QModelIndex &index,int role=Qt::DisplayRole) const;
|
||||
int slotId(const QModelIndex &row) const;
|
||||
QModelIndex addSlot(int id);
|
||||
void removeSlot(const QModelIndex &row);
|
||||
void removeSlot(int id);
|
||||
void refresh(const QModelIndex &row);
|
||||
void refresh(int id);
|
||||
|
||||
protected:
|
||||
void updateModel();
|
||||
void updateRowLine(int line);
|
||||
void updateRow(int row,RDSqlQuery *q);
|
||||
QString sqlFields() const;
|
||||
|
||||
private:
|
||||
QPalette d_palette;
|
||||
QFont d_font;
|
||||
QFont d_bold_font;
|
||||
QList<QVariant> d_headers;
|
||||
QList<QVariant> d_alignments;
|
||||
QList<QList<QVariant> > d_texts;
|
||||
QList<int> d_ids;
|
||||
RDMatrix *d_mtx;
|
||||
int d_slot_quantity;
|
||||
};
|
||||
|
||||
|
||||
#endif // RDGPIOSLOTSMODEL_H
|
@ -340,7 +340,7 @@ void RDResourceListModel::updateRow(int row,RDSqlQuery *q)
|
||||
}
|
||||
break;
|
||||
|
||||
defaults:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Edit a Rivendell Livewire GPIO Slot Association
|
||||
//
|
||||
// (C) Copyright 2013-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2013-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -23,36 +23,27 @@
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdescape_string.h>
|
||||
|
||||
#include <edit_livewiregpio.h>
|
||||
#include "edit_livewiregpio.h"
|
||||
|
||||
EditLiveWireGpio::EditLiveWireGpio(int slot,int *source,QHostAddress *addr,
|
||||
QWidget *parent)
|
||||
EditLiveWireGpio::EditLiveWireGpio(QWidget *parent)
|
||||
: RDDialog(parent)
|
||||
{
|
||||
setModal(true);
|
||||
|
||||
edit_slot=slot;
|
||||
edit_source=source;
|
||||
edit_address=addr;
|
||||
|
||||
//
|
||||
// Fix the Window Size
|
||||
//
|
||||
setMinimumWidth(sizeHint().width());
|
||||
setMaximumWidth(sizeHint().width());
|
||||
setMinimumHeight(sizeHint().height());
|
||||
setMaximumHeight(sizeHint().height());
|
||||
setMinimumSize(sizeHint());
|
||||
setMaximumSize(sizeHint());
|
||||
setWindowTitle("RDAdmin - "+tr("Edit GPIO Source"));
|
||||
|
||||
//
|
||||
// GPIO Lines
|
||||
//
|
||||
QLabel *label=new QLabel(tr("GPIO Lines")+
|
||||
QString().sprintf(" %d - %d",5*slot+1,5*slot+5),this);
|
||||
label->setGeometry(10,10,sizeHint().width()-20,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignCenter);
|
||||
edit_title_label=new QLabel(this);
|
||||
edit_title_label->setGeometry(10,10,sizeHint().width()-20,20);
|
||||
edit_title_label->setFont(labelFont());
|
||||
edit_title_label->setAlignment(Qt::AlignCenter);
|
||||
|
||||
//
|
||||
// Livewire Source Number
|
||||
@ -61,7 +52,7 @@ EditLiveWireGpio::EditLiveWireGpio(int slot,int *source,QHostAddress *addr,
|
||||
edit_source_number_spin->setGeometry(130,32,60,20);
|
||||
edit_source_number_spin->setRange(0,RD_LIVEWIRE_MAX_SOURCE);
|
||||
edit_source_number_spin->setSpecialValueText(tr("None"));
|
||||
label=new QLabel(tr("Livewire Source: "),this);
|
||||
QLabel *label=new QLabel(tr("Livewire Source: "),this);
|
||||
label->setGeometry(10,32,115,20);
|
||||
label->setFont(labelFont());
|
||||
label->setAlignment(Qt::AlignVCenter|Qt::AlignRight);
|
||||
@ -94,14 +85,6 @@ EditLiveWireGpio::EditLiveWireGpio(int slot,int *source,QHostAddress *addr,
|
||||
button->setFont(buttonFont());
|
||||
button->setText(tr("&Cancel"));
|
||||
connect(button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||
|
||||
//
|
||||
// Load Data
|
||||
//
|
||||
edit_source_number_spin->setValue(*edit_source);
|
||||
if(!edit_address->isNull()) {
|
||||
edit_ip_address_edit->setText(edit_address->toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,6 +100,37 @@ QSizePolicy EditLiveWireGpio::sizePolicy() const
|
||||
}
|
||||
|
||||
|
||||
int EditLiveWireGpio::exec(int slot_id)
|
||||
{
|
||||
QHostAddress addr;
|
||||
|
||||
edit_id=slot_id;
|
||||
|
||||
QString sql=QString("select ")+
|
||||
"SLOT,"+ // 00
|
||||
"SOURCE_NUMBER,"+ // 01
|
||||
"IP_ADDRESS "+ // 02
|
||||
"from LIVEWIRE_GPIO_SLOTS where "+
|
||||
QString().sprintf("ID=%u",slot_id);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
edit_title_label->
|
||||
setText(tr("GPIO Lines")+
|
||||
QString().sprintf(" %d - %d",
|
||||
5*q->value(0).toInt()+1,5*q->value(0).toInt()+5));
|
||||
edit_source_number_spin->setValue(q->value(1).toInt());
|
||||
if(addr.setAddress(q->value(2).toString())) {
|
||||
edit_ip_address_edit->setText(addr.toString());
|
||||
}
|
||||
else {
|
||||
edit_ip_address_edit->setText("");
|
||||
}
|
||||
}
|
||||
|
||||
return QDialog::exec();
|
||||
}
|
||||
|
||||
|
||||
void EditLiveWireGpio::okData()
|
||||
{
|
||||
QHostAddress addr;
|
||||
@ -125,17 +139,20 @@ void EditLiveWireGpio::okData()
|
||||
if(addr.isNull()&&(!edit_ip_address_edit->text().isEmpty())&&
|
||||
(edit_ip_address_edit->text()!="0.0.0.0")) {
|
||||
QMessageBox::warning(this,"RDAdmin - "+tr("Invalid IP Address"),
|
||||
tr("The IP address is invalid!"));
|
||||
tr("The Surface Address is invalid!"));
|
||||
return;
|
||||
}
|
||||
*edit_source=edit_source_number_spin->value();
|
||||
edit_address->setAddress(addr.toString());
|
||||
QString sql=QString("update LIVEWIRE_GPIO_SLOTS set ")+
|
||||
QString().sprintf("SOURCE_NUMBER=%d,",edit_source_number_spin->value())+
|
||||
"IP_ADDRESS=\""+RDEscapeString(addr.toString())+"\" "+
|
||||
QString().sprintf("where ID=%u",edit_id);
|
||||
RDSqlQuery::apply(sql);
|
||||
|
||||
done(0);
|
||||
done(true);
|
||||
}
|
||||
|
||||
|
||||
void EditLiveWireGpio::cancelData()
|
||||
{
|
||||
done(-1);
|
||||
done(false);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Edit a Rivendell Livewire GPIO Slot Association
|
||||
//
|
||||
// (C) Copyright 2013-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2013-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -21,9 +21,10 @@
|
||||
#ifndef EDIT_LIVEWIREGPIO_H
|
||||
#define EDIT_LIVEWIREGPIO_H
|
||||
|
||||
#include <qspinbox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qhostaddress.h>
|
||||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QSpinBox>
|
||||
#include <QHostAddress>
|
||||
|
||||
#include <rddialog.h>
|
||||
#include <rdmatrix.h>
|
||||
@ -32,18 +33,20 @@ class EditLiveWireGpio : public RDDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
EditLiveWireGpio(int slot,int *source,QHostAddress *addr,QWidget *parent=0);
|
||||
EditLiveWireGpio(QWidget *parent=0);
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
|
||||
public slots:
|
||||
int exec(int slot_id);
|
||||
|
||||
private slots:
|
||||
void okData();
|
||||
void cancelData();
|
||||
|
||||
private:
|
||||
int edit_slot;
|
||||
int *edit_source;
|
||||
QHostAddress *edit_address;
|
||||
int edit_id;
|
||||
QLabel *edit_title_label;
|
||||
QSpinBox *edit_source_number_spin;
|
||||
QLineEdit *edit_ip_address_edit;
|
||||
};
|
||||
|
@ -1068,8 +1068,9 @@ void EditMatrix::livewireButtonData()
|
||||
|
||||
void EditMatrix::livewireGpioButtonData()
|
||||
{
|
||||
ListLiveWireGpios *dialog=new ListLiveWireGpios(edit_matrix,
|
||||
edit_gpis_box->value()/RD_LIVEWIRE_GPIO_BUNDLE_SIZE,this);
|
||||
AddGpioSlots();
|
||||
ListLiveWireGpios *dialog=
|
||||
new ListLiveWireGpios(edit_matrix,edit_gpis_box->value(),this);
|
||||
dialog->exec();
|
||||
delete dialog;
|
||||
}
|
||||
@ -1326,6 +1327,8 @@ bool EditMatrix::WriteMatrix()
|
||||
AddEndpoints(RDMatrix::Output);
|
||||
AddResources(RDMatrix::VguestTypeRelay);
|
||||
AddResources(RDMatrix::VguestTypeDisplay);
|
||||
AddGpioSlots();
|
||||
PurgeGpioSlots();
|
||||
|
||||
//
|
||||
// Update GPIO Tables
|
||||
@ -1544,8 +1547,8 @@ void EditMatrix::AddResources(RDMatrix::VguestType type) const
|
||||
sql+=QString().sprintf("NUMBER=%d",i+1);
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
||||
@ -1610,3 +1613,40 @@ bool EditMatrix::ConfirmPruneResources(RDMatrix::VguestType type)
|
||||
delete q;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void EditMatrix::AddGpioSlots()
|
||||
{
|
||||
if(edit_matrix->type()==RDMatrix::LiveWireMcastGpio) {
|
||||
int bundle_end=edit_gpis_box->value()/5;
|
||||
for(int i=0;i<bundle_end;i++) {
|
||||
QString sql=QString("select ")+
|
||||
"ID "+ // 00
|
||||
"from LIVEWIRE_GPIO_SLOTS where "+
|
||||
"STATION_NAME=\""+RDEscapeString(edit_matrix->station())+"\" && "+
|
||||
QString().sprintf("MATRIX=%d && ",edit_matrix->matrix())+
|
||||
QString().sprintf("SLOT=%d",i);
|
||||
RDSqlQuery *q=new RDSqlQuery(sql);
|
||||
if(!q->first()) {
|
||||
sql=QString("insert into LIVEWIRE_GPIO_SLOTS set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(edit_matrix->station())+"\","+
|
||||
QString().sprintf("MATRIX=%d,",edit_matrix->matrix())+
|
||||
QString().sprintf("SLOT=%d",i);
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void EditMatrix::PurgeGpioSlots()
|
||||
{
|
||||
if(edit_matrix->type()==RDMatrix::LiveWireMcastGpio) {
|
||||
QString sql=QString("delete from LIVEWIRE_GPIO_SLOTS where ")+
|
||||
"STATION_NAME=\""+RDEscapeString(edit_matrix->station())+"\" && "+
|
||||
QString().sprintf("MATRIX=%d && ",edit_matrix->matrix())+
|
||||
QString().sprintf("SLOT>=%d",edit_gpis_box->value()/5);
|
||||
RDSqlQuery::apply(sql);
|
||||
}
|
||||
}
|
||||
|
@ -77,6 +77,9 @@ class EditMatrix : public RDDialog
|
||||
void PruneResources(RDMatrix::VguestType type) const;
|
||||
bool ConfirmPruneResources(RDMatrix::VguestType type);
|
||||
|
||||
void AddGpioSlots();
|
||||
void PurgeGpioSlots();
|
||||
|
||||
RDMatrix *edit_matrix;
|
||||
QString edit_stationname;
|
||||
int edit_matrix_number;
|
||||
@ -142,9 +145,7 @@ class EditMatrix : public RDDialog
|
||||
QSpinBox *edit_card_box;
|
||||
QLabel *edit_displays_label;
|
||||
QSpinBox *edit_displays_box;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif // EDIT_MATRIX_H
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// List Rivendell Livewire GPIO Slot Associations
|
||||
//
|
||||
// (C) Copyright 2013-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2013-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -30,8 +30,6 @@ ListLiveWireGpios::ListLiveWireGpios(RDMatrix *matrix,int slot_quan,
|
||||
QWidget *parent)
|
||||
: RDDialog(parent)
|
||||
{
|
||||
setModal(true);
|
||||
|
||||
//
|
||||
// Fix the Window Size
|
||||
//
|
||||
@ -41,25 +39,24 @@ ListLiveWireGpios::ListLiveWireGpios(RDMatrix *matrix,int slot_quan,
|
||||
list_slot_quan=slot_quan;
|
||||
setWindowTitle("RDAdmin - "+tr("Livewire GPIO Source Assignments"));
|
||||
|
||||
//
|
||||
// Dialogs
|
||||
//
|
||||
list_gpio_dialog=new EditLiveWireGpio(this);
|
||||
|
||||
//
|
||||
// Matrix List Box
|
||||
//
|
||||
list_view=new RDListView(this);
|
||||
list_title_label=new QLabel(list_view,tr("Switchers:"),this);
|
||||
list_title_label->setFont(labelFont());
|
||||
list_view->setAllColumnsShowFocus(true);
|
||||
list_view->setItemMargin(5);
|
||||
list_view->addColumn(tr("Lines"));
|
||||
list_view->setColumnAlignment(0,Qt::AlignHCenter);
|
||||
list_view->addColumn(tr("Source #"));
|
||||
list_view->setColumnAlignment(1,Qt::AlignCenter);
|
||||
list_view->addColumn(tr("Surface Address"));
|
||||
list_view->setColumnAlignment(2,Qt::AlignCenter);
|
||||
list_view->setColumnSortType(0,RDListView::GpioSort);
|
||||
connect(list_view,SIGNAL(doubleClicked(Q3ListViewItem *,const QPoint &,int)),
|
||||
this,SLOT(doubleClickedData(Q3ListViewItem *,const QPoint &,int)));
|
||||
|
||||
RefreshList();
|
||||
list_view=new RDTableView(this);
|
||||
list_model=new RDGpioSlotsModel(matrix,slot_quan,this);
|
||||
list_model->setFont(defaultFont());
|
||||
list_model->setPalette(palette());
|
||||
list_view->setModel(list_model);
|
||||
connect(list_view,SIGNAL(doubleClicked(const QModelIndex &)),
|
||||
this,SLOT(doubleClickedData(const QModelIndex &)));
|
||||
connect(list_model,SIGNAL(modelReset()),
|
||||
list_view,SLOT(resizeColumnsToContents()));
|
||||
list_view->resizeColumnsToContents();
|
||||
|
||||
//
|
||||
// Edit Button
|
||||
@ -70,28 +67,21 @@ ListLiveWireGpios::ListLiveWireGpios(RDMatrix *matrix,int slot_quan,
|
||||
connect(list_edit_button,SIGNAL(clicked()),this,SLOT(editData()));
|
||||
|
||||
//
|
||||
// Ok Button
|
||||
// Close Button
|
||||
//
|
||||
list_ok_button=new QPushButton(this);
|
||||
list_ok_button->setDefault(true);
|
||||
list_ok_button->setFont(buttonFont());
|
||||
list_ok_button->setText(tr("&OK"));
|
||||
connect(list_ok_button,SIGNAL(clicked()),this,SLOT(okData()));
|
||||
|
||||
//
|
||||
// Cancel Button
|
||||
//
|
||||
list_cancel_button=new QPushButton(this);
|
||||
list_cancel_button->setDefault(true);
|
||||
list_cancel_button->setFont(buttonFont());
|
||||
list_cancel_button->setText(tr("&Cancel"));
|
||||
connect(list_cancel_button,SIGNAL(clicked()),this,SLOT(cancelData()));
|
||||
list_close_button=new QPushButton(this);
|
||||
list_close_button->setDefault(true);
|
||||
list_close_button->setFont(buttonFont());
|
||||
list_close_button->setText(tr("&Close"));
|
||||
connect(list_close_button,SIGNAL(clicked()),this,SLOT(closeData()));
|
||||
}
|
||||
|
||||
|
||||
ListLiveWireGpios::~ListLiveWireGpios()
|
||||
{
|
||||
delete list_gpio_dialog;
|
||||
delete list_view;
|
||||
delete list_model;
|
||||
}
|
||||
|
||||
|
||||
@ -109,129 +99,33 @@ QSizePolicy ListLiveWireGpios::sizePolicy() const
|
||||
|
||||
void ListLiveWireGpios::editData()
|
||||
{
|
||||
if(list_view->selectedItem()==NULL) {
|
||||
QModelIndexList rows=list_view->selectionModel()->selectedRows();
|
||||
|
||||
if(rows.size()!=1) {
|
||||
return;
|
||||
}
|
||||
int source=list_view->currentItem()->text(1).toInt();
|
||||
QHostAddress addr;
|
||||
addr.setAddress(list_view->currentItem()->text(2));
|
||||
EditLiveWireGpio *d=
|
||||
new EditLiveWireGpio(list_view->currentItem()->text(0).toInt(),
|
||||
&source,&addr);
|
||||
if(d->exec()==0) {
|
||||
if(source==0) {
|
||||
list_view->currentItem()->setText(1,tr("[none]"));
|
||||
}
|
||||
else {
|
||||
list_view->currentItem()->setText(1,QString().sprintf("%d",source));
|
||||
}
|
||||
if(addr.isNull()) {
|
||||
list_view->currentItem()->setText(2,tr("[all]"));
|
||||
}
|
||||
else {
|
||||
list_view->currentItem()->setText(2,addr.toString());
|
||||
}
|
||||
int id=list_model->slotId(rows.first());
|
||||
if(list_gpio_dialog->exec(id)) {
|
||||
list_model->refresh(rows.first());
|
||||
}
|
||||
delete d;
|
||||
}
|
||||
|
||||
|
||||
void ListLiveWireGpios::doubleClickedData(Q3ListViewItem *item,const QPoint &pt,
|
||||
int col)
|
||||
void ListLiveWireGpios::doubleClickedData(const QModelIndex &index)
|
||||
{
|
||||
editData();
|
||||
}
|
||||
|
||||
|
||||
void ListLiveWireGpios::okData()
|
||||
void ListLiveWireGpios::closeData()
|
||||
{
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
int slot=0;
|
||||
QString addr_str="NULL";
|
||||
|
||||
RDListViewItem *item=(RDListViewItem *)list_view->firstChild();
|
||||
while(item!=NULL) {
|
||||
QHostAddress addr;
|
||||
addr_str="NULL";
|
||||
addr.setAddress(item->text(2));
|
||||
if(!addr.isNull()) {
|
||||
addr_str="\""+addr.toString()+"\"";
|
||||
}
|
||||
sql=QString("update LIVEWIRE_GPIO_SLOTS set ")+
|
||||
QString().sprintf("SOURCE_NUMBER=%d,",item->text(1).toInt())+
|
||||
"IP_ADDRESS="+addr_str+" "+
|
||||
"where (STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
|
||||
QString().sprintf("(MATRIX=%d)&&",list_matrix->matrix())+
|
||||
QString().sprintf("(SLOT=%d)",slot);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
slot++;
|
||||
item=(RDListViewItem *)item->nextSibling();
|
||||
}
|
||||
|
||||
done(0);
|
||||
}
|
||||
|
||||
|
||||
void ListLiveWireGpios::cancelData()
|
||||
{
|
||||
done(-1);
|
||||
done(true);
|
||||
}
|
||||
|
||||
|
||||
void ListLiveWireGpios::resizeEvent(QResizeEvent *e)
|
||||
{
|
||||
list_view->setGeometry(10,24,size().width()-20,size().height()-94);
|
||||
list_title_label->setGeometry(14,5,85,19);
|
||||
list_view->setGeometry(10,3,size().width()-20,size().height()-73);
|
||||
list_edit_button->setGeometry(10,size().height()-60,80,50);
|
||||
list_ok_button->setGeometry(size().width()-180,size().height()-60,80,50);
|
||||
list_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||
}
|
||||
|
||||
|
||||
void ListLiveWireGpios::RefreshList()
|
||||
{
|
||||
Q3ListViewItem *l;
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDSqlQuery *q1;
|
||||
|
||||
list_view->clear();
|
||||
sql=QString("select SLOT,SOURCE_NUMBER,IP_ADDRESS from LIVEWIRE_GPIO_SLOTS ")+
|
||||
"where (STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\")&&"+
|
||||
QString().sprintf("(MATRIX=%d) ",list_matrix->matrix())+
|
||||
"order by SLOT";
|
||||
q=new RDSqlQuery(sql);
|
||||
q->first();
|
||||
for(int i=0;i<list_slot_quan;i++) {
|
||||
l=new RDListViewItem(list_view);
|
||||
l->setText(0,QString().sprintf("%d - %d",5*i+1,5*i+5));
|
||||
if(q->isValid()&&(q->value(0).toInt()==i)) {
|
||||
if(q->value(1).toInt()==0) {
|
||||
l->setText(1,tr("[none]"));
|
||||
}
|
||||
else {
|
||||
l->setText(1,QString().sprintf("%d",q->value(1).toInt()));
|
||||
}
|
||||
if(q->value(2).toString().isEmpty()) {
|
||||
l->setText(2,tr("[all]"));
|
||||
}
|
||||
else {
|
||||
l->setText(2,q->value(2).toString());
|
||||
}
|
||||
q->next();
|
||||
}
|
||||
else {
|
||||
sql=QString("insert into LIVEWIRE_GPIO_SLOTS set ")+
|
||||
"STATION_NAME=\""+RDEscapeString(list_matrix->station())+"\","+
|
||||
QString().sprintf("MATRIX=%d,",list_matrix->matrix())+
|
||||
QString().sprintf("SLOT=%d",i);
|
||||
q1=new RDSqlQuery(sql);
|
||||
delete q1;
|
||||
l->setText(1,tr("[none]"));
|
||||
l->setText(2,tr("[all]"));
|
||||
}
|
||||
}
|
||||
delete q;
|
||||
list_close_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// List Rivendell Livewire GPIO Slot Associations
|
||||
//
|
||||
// (C) Copyright 2013-2019 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2013-2021 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -21,13 +21,16 @@
|
||||
#ifndef LIST_LIVEWIREGPIOS_H
|
||||
#define LIST_LIVEWIREGPIOS_H
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
#include <rd.h>
|
||||
#include <rddialog.h>
|
||||
#include <rdlistview.h>
|
||||
//#include <rdlistview.h>
|
||||
#include <rdgpioslotsmodel.h>
|
||||
#include <rdmatrix.h>
|
||||
#include <rdtableview.h>
|
||||
|
||||
#include "edit_livewiregpio.h"
|
||||
|
||||
class ListLiveWireGpios : public RDDialog
|
||||
{
|
||||
@ -40,22 +43,25 @@ class ListLiveWireGpios : public RDDialog
|
||||
|
||||
private slots:
|
||||
void editData();
|
||||
void doubleClickedData(Q3ListViewItem *item,const QPoint &pt,int col);
|
||||
void okData();
|
||||
void cancelData();
|
||||
void doubleClickedData(const QModelIndex &index);
|
||||
void closeData();
|
||||
// void cancelData();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *e);
|
||||
|
||||
private:
|
||||
void RefreshList();
|
||||
QLabel *list_title_label;
|
||||
// void RefreshList();
|
||||
// QLabel *list_title_label;
|
||||
QPushButton *list_edit_button;
|
||||
QPushButton *list_ok_button;
|
||||
QPushButton *list_cancel_button;
|
||||
RDListView *list_view;
|
||||
QPushButton *list_close_button;
|
||||
// QPushButton *list_cancel_button;
|
||||
// RDListView *list_view;
|
||||
RDTableView *list_view;
|
||||
RDGpioSlotsModel *list_model;
|
||||
RDMatrix *list_matrix;
|
||||
int list_slot_quan;
|
||||
EditLiveWireGpio *list_gpio_dialog;
|
||||
};
|
||||
|
||||
|
||||
|
@ -2152,11 +2152,11 @@ Stále ještě chcete uložit?</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The IP address is invalid!</source>
|
||||
<source>None</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>None</source>
|
||||
<source>The Surface Address is invalid!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -5786,7 +5786,7 @@ Stále ještě jej chcete smazat?</translation>
|
||||
<name>ListLiveWireGpios</name>
|
||||
<message>
|
||||
<source>Switchers:</source>
|
||||
<translation type="unfinished">Přepínače:</translation>
|
||||
<translation type="obsolete">Přepínače:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Edit</source>
|
||||
@ -5794,36 +5794,24 @@ Stále ještě jej chcete smazat?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished">&OK</translation>
|
||||
<translation type="obsolete">&OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished">Z&rušit</translation>
|
||||
<translation type="obsolete">Z&rušit</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished">[žádný]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="obsolete">[žádný]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Livewire GPIO Source Assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished">&Zavřít</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListMatrices</name>
|
||||
|
@ -1998,11 +1998,11 @@ Do you still want to save?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The IP address is invalid!</source>
|
||||
<source>None</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>None</source>
|
||||
<source>The Surface Address is invalid!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -5432,7 +5432,7 @@ Generieren</translation>
|
||||
<name>ListLiveWireGpios</name>
|
||||
<message>
|
||||
<source>Switchers:</source>
|
||||
<translation type="unfinished">Schalter:</translation>
|
||||
<translation type="obsolete">Schalter:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Edit</source>
|
||||
@ -5440,36 +5440,24 @@ Generieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished">&OK</translation>
|
||||
<translation type="obsolete">&OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished">Abbre&chen</translation>
|
||||
<translation type="obsolete">Abbre&chen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished">[keine]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="obsolete">[keine]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Livewire GPIO Source Assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished">&Schliessen</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListMatrices</name>
|
||||
|
@ -2166,7 +2166,7 @@ Do you still want to save?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The IP address is invalid!</source>
|
||||
<source>The Surface Address is invalid!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -5737,7 +5737,7 @@ Do you still want to delete it?</source>
|
||||
<name>ListLiveWireGpios</name>
|
||||
<message>
|
||||
<source>Switchers:</source>
|
||||
<translation type="unfinished">Suicheras:</translation>
|
||||
<translation type="obsolete">Suicheras:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Edit</source>
|
||||
@ -5745,36 +5745,20 @@ Do you still want to delete it?</source>
|
||||
</message>
|
||||
<message>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished">&Aceptar</translation>
|
||||
<translation type="obsolete">&Aceptar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished">&Cancelar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="obsolete">&Cancelar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Livewire GPIO Source Assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished">&Cerrar</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListMatrices</name>
|
||||
|
@ -1592,11 +1592,11 @@ Do you still want to save?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The IP address is invalid!</source>
|
||||
<source>None</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>None</source>
|
||||
<source>The Surface Address is invalid!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -4308,46 +4308,18 @@ Permissions</source>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListLiveWireGpios</name>
|
||||
<message>
|
||||
<source>Switchers:</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Edit</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Livewire GPIO Source Assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListMatrices</name>
|
||||
|
@ -1973,7 +1973,7 @@ Vil du framleis lagra?</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The IP address is invalid!</source>
|
||||
<source>The Surface Address is invalid!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -5297,7 +5297,7 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
<name>ListLiveWireGpios</name>
|
||||
<message>
|
||||
<source>Switchers:</source>
|
||||
<translation type="unfinished">Svitsjarar:</translation>
|
||||
<translation type="obsolete">Svitsjarar:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Edit</source>
|
||||
@ -5305,36 +5305,24 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished">&OK</translation>
|
||||
<translation type="obsolete">&OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished">&Avbryt</translation>
|
||||
<translation type="obsolete">&Avbryt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished">[ingen]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="obsolete">[ingen]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Livewire GPIO Source Assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished">&Lukk</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListMatrices</name>
|
||||
|
@ -1973,7 +1973,7 @@ Vil du framleis lagra?</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The IP address is invalid!</source>
|
||||
<source>The Surface Address is invalid!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -5297,7 +5297,7 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
<name>ListLiveWireGpios</name>
|
||||
<message>
|
||||
<source>Switchers:</source>
|
||||
<translation type="unfinished">Svitsjarar:</translation>
|
||||
<translation type="obsolete">Svitsjarar:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Edit</source>
|
||||
@ -5305,36 +5305,24 @@ Klikk på "Lisens"-knappen for fleire opplysningar.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished">&OK</translation>
|
||||
<translation type="obsolete">&OK</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished">&Avbryt</translation>
|
||||
<translation type="obsolete">&Avbryt</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished">[ingen]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="obsolete">[ingen]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Livewire GPIO Source Assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished">&Lukk</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListMatrices</name>
|
||||
|
@ -1979,7 +1979,7 @@ Você ainda quer salvar?</translation>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The IP address is invalid!</source>
|
||||
<source>The Surface Address is invalid!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
@ -5412,44 +5412,28 @@ Você ainda quer Deletar?</translation>
|
||||
<name>ListLiveWireGpios</name>
|
||||
<message>
|
||||
<source>Switchers:</source>
|
||||
<translation type="unfinished">Switchers:</translation>
|
||||
<translation type="obsolete">Switchers:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Edit</source>
|
||||
<translation type="unfinished">&Editar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&OK</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Cancel</source>
|
||||
<translation type="unfinished">&Cancelar</translation>
|
||||
<translation type="obsolete">&Cancelar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[none]</source>
|
||||
<translation type="unfinished">[Nenhum]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Lines</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Surface Address</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>[all]</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Source #</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="obsolete">[Nenhum]</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Livewire GPIO Source Assignments</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>&Close</source>
|
||||
<translation type="unfinished">&Fechar</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ListMatrices</name>
|
||||
|
Loading…
x
Reference in New Issue
Block a user