git-svn-id: svn://db.shs.com.ru/libs@357 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2018-02-13 13:59:11 +00:00
parent a9a05517a9
commit 540b358a08
26 changed files with 218 additions and 260 deletions

View File

@@ -1,6 +1,8 @@
project(qcd_utils)
cmake_minimum_required(VERSION 2.6)
cmake_policy(SET CMP0017 OLD)
if (POLICY CMP0017)
cmake_policy(SET CMP0017 NEW)
endif()
if (NOT LIBPROJECT)
find_package(PIP REQUIRED)
option(LIB "System install" 0)
@@ -21,10 +23,8 @@ qt_add_library(${PROJECT_NAME} SHARED out_CPP)
qt_target_link_libraries(${PROJECT_NAME} pip qad_utils qad_widgets cd_utils piqt)
message(STATUS "Building ${PROJECT_NAME}")
add_subdirectory(pult)
if(LIBPROJECT)
#sdk_install("" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}")
sdk_install("" "${PROJECT_NAME}" "${out_HDR}" "${out_QM}")
else()
if(LIB)
if(WIN32)
@@ -49,3 +49,5 @@ else()
endif()
endif()
add_subdirectory(pult)

View File

@@ -1,6 +1,6 @@
project(cd_pult)
file(GLOB SRC "*.h" "*.cpp" "*.ui" "*.qrc" "lang/*.ts")
find_qt(${QtVersions} Core Gui)
find_qt(${QtVersions} Core Gui OpenGL)
qt_wrap(${SRC} HDRS out_HDR CPPS out_CPP QMS out_QM)
qt_add_executable(${PROJECT_NAME} WIN32 out_CPP)
qt_target_link_libraries(${PROJECT_NAME} qad_utils qad_widgets qad_graphic qcd_utils qad_application)

View File

@@ -24,10 +24,10 @@ CDPultWindow::CDPultWindow(QWidget *parent) : EMainWindow(parent), ui(new Ui::CD
session.addEntry(ribbon->tabWidget());
session.load();
reset();
CONNECTU(&K, sended, this, KSended);
CONNECTU(&K, received, this, KReceived);
CONNECTU(&K, sendFailed, this, KSendFailed);
CONNECTU(&K, receiveFailed, this, KReceiveFailed);
connect(ui->viewK, SIGNAL(KSendSucceed()), this, SLOT(KSended()));
connect(ui->viewK, SIGNAL(KReceiveSucceed()), this, SLOT(KReceived()));
connect(ui->viewK, SIGNAL(KSendFailed()), this, SLOT(KSendFailed()));
connect(ui->viewK, SIGNAL(KReceiveFailed()), this, SLOT(KReceiveFailed()));
if (windowState() == Qt::WindowMinimized)
setWindowState(Qt::WindowNoState);
}
@@ -44,23 +44,22 @@ void CDPultWindow::loadFile(const QString & fp) {
void CDPultWindow::KReceived() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, OKIcon), Q_ARG(QString, "K received succesfull"));
addToLog(OKIcon, "K received succesfull");
}
void CDPultWindow::KSended() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, OKIcon), Q_ARG(QString, "K sended succesfull"));
addToLog(OKIcon, "K sended succesfull");
}
void CDPultWindow::KSendFailed() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, FailIcon), Q_ARG(QString, "K NOT sended"));
addToLog(FailIcon, "K NOT sended");
}
void CDPultWindow::KReceiveFailed() {
QMetaObject::invokeMethod(this, "addToLog", Qt::QueuedConnection, Q_ARG(LogIcon, FailIcon), Q_ARG(QString, "K NOT received"));
//addToLog(FailIcon, "K NOT received");
addToLog(FailIcon, "K NOT received");
}
@@ -77,7 +76,7 @@ void CDPultWindow::closeEvent(QCloseEvent *e) {
void CDPultWindow::reset(bool full) {
setWindowTitle(QString("CD Pult"));
ui->viewK->setKFile("");
ui->viewK->clearK();
// ui->viewK->clearK();
file_name.clear();
ui->viewK->refresh();
setChanged(false);

View File

@@ -10,11 +10,10 @@ namespace Ui {
class CDPultWindow;
}
class CDPultWindow : public EMainWindow, public PIObject
class CDPultWindow : public EMainWindow
{
Q_OBJECT
Q_ENUMS(LogIcon)
PIOBJECT(CDPultWindow)
public:
enum LogIcon {NoIcon, OKIcon, FailIcon, WaitIcon};
@@ -24,12 +23,7 @@ public:
private:
EVENT_HANDLER(void, KSended);
EVENT_HANDLER(void, KReceived);
EVENT_HANDLER(void, KSendFailed);
EVENT_HANDLER(void, KReceiveFailed);
void closeEvent(QCloseEvent * );
void closeEvent(QCloseEvent *);
void reset(bool full = false);
bool load(const QString & path);
bool save(const QString & path);
@@ -41,6 +35,10 @@ private:
QMap<LogIcon, QIcon> log_icons;
private slots:
void KSended();
void KReceived();
void KSendFailed();
void KReceiveFailed();
void addToLog(LogIcon icon, const QString & msg);
void on_actionSend_K_triggered();
void on_actionReceive_K_triggered();

View File

@@ -124,7 +124,7 @@ void CDKItemModel::rebuildModel() {
void CDKItemModel::buildItem(CDKItem *it, CDSection & r) {
//piCout << "build item" << r.name << r.alias;
PIMap<int, CDType>::iterator i;
for (i = r.k.begin(); i != r.k.end(); ++i) {
for (i = r.cd.begin(); i != r.cd.end(); ++i) {
it->childs << new CDKItem(i.key(), CDKItem::ItemCDType, it);
}
PIMap<int, CDSection>::iterator j;

View File

@@ -29,7 +29,6 @@ CDKView::~CDKView() {
void CDKView::refresh() {
if (!kmodel) {
//K.reinitConnection(K.pultConfig());
kmodel = new CDKItemModel();
setModel(kmodel);
setItemDelegateForColumn(4, new CDKDelegate());
@@ -75,6 +74,7 @@ void CDKView::loadK() {
void CDKView::clearK() {
//piCout << "clearK";
K.root() = CDSection();
refresh();
}