Commit 98539cf5 authored by Christoffer Ackelman's avatar Christoffer Ackelman

Merged qt branch with master.

parent bf94b287
......@@ -40,6 +40,10 @@ libdb5.1-dev
libdb5.1++-dev
doxygen
qt4-dev-tools
libphonon4
libphonon-dev
Optional:
openjdk-6-jdk Web interface and java API
......
......@@ -81,7 +81,8 @@ pwre init $ename
mkdir -p $pwre_broot
pwre configure
pwre create_all_modules
pwre build_all_modules $gui
pwre build_kernel $gui
pwre method_build $gui
# Create a package version html file
$root/src/tools/pkg/deb/pwrrt/build.sh -v
......
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
ifndef link_rule_mk
link_rule_mk := 1
ifeq ($(PWRE_CONF_PNAK),"1")
link = $(ldxx) -L$(pwr_elib) $(elinkflags) $(domap) -o $(pwr_exe)/profinet_viewer_qt \
$(bld_dir)/profinet_viewer_qt.o \
$(bld_dir)/pn_viewer_qt.o \
$(bld_dir)/pn_viewer_qt_moc.o \
$(bld_dir)/pn_viewernav_qt.o \
$(bld_dir)/pn_viewer.o $(bld_dir)/pn_viewernav.o \
$(bld_dir)/pn_viewer_pnac.o\
$(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrxtt) $(pwre_conf_libqt) \
$(pwre_conf_libpwrrt) $(pwre_conf_libpnak) $(pwre_conf_lib)
else
link = $(ldxx) -L$(pwr_elib) $(elinkflags) $(domap) -o $(pwr_exe)/profinet_viewer_qt \
$(bld_dir)/profinet_viewer_qt.o \
$(bld_dir)/pn_viewer_qt.o \
$(bld_dir)/pn_viewernav_qt.o \
$(bld_dir)/pn_viewer.o $(bld_dir)/pn_viewernav.o \
$(bld_dir)/pn_viewer_pnac.o\
$(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrxtt) $(pwre_conf_libqt) \
$(pwre_conf_libpwrrt) $(pwre_conf_libpnak) $(pwre_conf_lib)
endif
endif
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* pn_viewer_qt.cpp -- Profinet viewer */
#ifdef PWRE_CONF_PNAK
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "co_lng.h"
#include "cow_xhelp.h"
#include "pn_viewer_qt.h"
#include "pn_viewernav_qt.h"
#include "cow_wow_qt.h"
#include "rt_pb_msg.h"
#include <QMenuBar>
#include <QVBoxLayout>
void PnViewerQtWidget::closeEvent(QCloseEvent *event)
{
viewer->activate_close();
QWidget::closeEvent(event);
}
PnViewerQt::PnViewerQt(void *v_parent_ctx, QWidget *v_parent_wid,
const char *v_name, const char *v_device,
pwr_tStatus *status)
: PnViewer(v_parent_ctx, v_name, v_device, status)
{
toplevel = new PnViewerQtWidget(this, v_parent_wid);
toplevel->setMinimumSize(800, 600);
toplevel->setWindowTitle(fl(v_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
CoWowQt::SetWindowIcon(toplevel);
QMenuBar *menu_bar = new QMenuBar();
// File Entry
QMenu *file = menu_bar->addMenu(translate_utf8("&File"));
addMenuItem(toplevel, file, "&Close", SLOT(close()), "CTRL+W", "window-close");
// Functions Entry
QMenu *functions = menu_bar->addMenu(translate_utf8("F&unctions"));
addMenuItem(toplevel, functions, "&Update", SLOT(activate_update()));
addMenuItem(toplevel, functions, "&Filter", SLOT(activate_filter()));
addMenuItem(toplevel, functions, "&Set Device Properties",
SLOT(activate_setdevice()));
addMenuItem(toplevel, functions, "&Change Value", SLOT(activate_changevalue()),
"CTRL+Q");
// View menu
QMenu *view = menu_bar->addMenu(translate_utf8("&View"));
addMenuItem(toplevel, view, "Zoom &In", SLOT(activate_zoom_in()), "CTRL+I",
"zoom-in");
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-reset");
// Help menu
QMenu *help = menu_bar->addMenu(translate_utf8("&Help"));
addMenuItem(toplevel, help, "&Help", SLOT(activate_help()), "CTRL+H",
"system-help");
// Statusbar and cmd input
QStatusBar *statusbar = new QStatusBar();
msg_label = new QLabel("");
msg_label->setFixedHeight(25);
cmd_prompt = new QLabel("value > ");
cmd_prompt->setFixedHeight(25);
value_recall = new CoWowRecall();
cmd_entry = new CoWowEntryQt(value_recall);
cmd_entry->setFixedHeight(25);
QObject::connect(cmd_entry, SIGNAL(editing_finished()), toplevel,
SLOT(valchanged_cmd_entry()));
statusbar->addWidget(msg_label);
statusbar->addWidget(cmd_prompt);
add_expanding(statusbar, cmd_entry);
// Create viewernav
QSplitter *nav_paned = new QSplitter(Qt::Horizontal);
QVBoxLayout *nav_left_layout = new QVBoxLayout();
QWidget *nav_left = layout_to_widget(nav_left_layout);
QVBoxLayout *nav_right_layout = new QVBoxLayout();
QWidget *nav_right = layout_to_widget(nav_right_layout);
QLabel *header_left = new QLabel("Devices on Network");
QLabel *header_right = new QLabel("Devices from Configuration");
viewernav = new PnViewerNavQt(this, nav_right, viewer_eType_Network,
&nav_widget);
viewernav->change_value_cb = &change_value;
viewernav->message_cb = &message_cb;
viewernavconf = new PnViewerNavQt(this, nav_left, viewer_eType_Configuration,
&navconf_widget);
viewernavconf->change_value_cb = &change_value;
viewernavconf->message_cb = &message_cb;
nav_left_layout->addWidget(header_left);
add_expanding(nav_left_layout, nav_widget);
nav_right_layout->addWidget(header_right);
add_expanding(nav_right_layout, navconf_widget);
add_expanding(nav_paned, nav_left);
nav_paned->addWidget(nav_right);
QVBoxLayout *form = new QVBoxLayout(toplevel);
form->setMenuBar(menu_bar);
add_expanding(form, nav_paned);
form->addWidget(statusbar);
toplevel->setLayout(form);
toplevel->show();
cmd_prompt->setVisible(false);
cmd_entry->setVisible(false);
wow = new CoWowQt(toplevel);
}
void PnViewerQt::message(char severity, const char *msg)
{
msg_label->setText(QString::fromLatin1(msg));
}
void PnViewerQt::open_change_value()
{
if (input_open) {
cmd_entry->setVisible(false);
set_prompt("");
input_open = 0;
return;
}
int sts = viewernav->check_attr_value();
if (EVEN(sts)) {
if (sts == PB__ATTRNOEDIT) {
message('E', "Attribute is no edit");
} else {
message('E', "Syntax error");
}
return;
}
cmd_entry->setVisible(true);
message(' ', "");
cmd_entry->setFocus();
cmd_entry->setText("");
set_prompt(Lng::translate("value >"));
input_open = 1;
}
void PnViewerQtWidget::valchanged_cmd_entry()
{
if (viewer->input_open) {
QByteArray text = viewer->cmd_entry->text().toLatin1();
viewer->viewernav->set_attr_value(text.data());
viewer->cmd_entry->setVisible(false);
viewer->set_prompt("");
viewer->input_open = 0;
viewer->viewernav->set_input_focus();
}
}
void PnViewerQt::set_prompt(const char *prompt)
{
if (strcmp(prompt, "") == 0) {
cmd_prompt->setVisible(false);
msg_label->setVisible(true);
} else {
msg_label->setVisible(false);
cmd_prompt->setText(QString::fromLatin1(prompt));
cmd_prompt->setVisible(true);
}
}
void PnViewerQtWidget::focusInEvent(QFocusEvent *event)
{
if (!viewer->focustimer.disabled()) {
viewer->viewernav->set_input_focus();
viewer->focustimer.disable(400);
}
QWidget::focusInEvent(event);
}
void PnViewerQtWidget::activate_filter()
{
viewer->activate_filter(viewer_eFilterType_NotMatching);
}
void PnViewerQtWidget::activate_zoom_in()
{
viewer->viewernav->zoom(1.2);
}
void PnViewerQtWidget::activate_zoom_out()
{
viewer->viewernav->zoom(5.0 / 6);
}
void PnViewerQtWidget::activate_zoom_reset()
{
viewer->viewernav->unzoom();
}
#endif
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef pn_viewer_qt_h
#define pn_viewer_qt_h
/* pn_viewer_qt.h -- Profinet viewer */
#ifndef pn_viewer_h
# include "../src/pn_viewer.h"
#endif
#ifndef cow_wow_qt_h
# include "cow_wow_qt.h"
#endif
class PnViewerQtWidget;
class PnViewerQt : public PnViewer {
public:
PnViewerQt(void *v_parent_ctx, QWidget *v_parent_wid, const char *v_name,
const char *v_device, pwr_tStatus *status);
QWidget *nav_widget;
QWidget *navconf_widget;
QLabel *msg_label;
QLabel *cmd_prompt;
CoWowFocusTimerQt focustimer;
CoWowFocusTimerQt maptimer;
CoWowRecall *value_recall;
CoWowEntryQt *cmd_entry;
void message(char severity, const char *msg);
void set_prompt(const char *prompt);
void open_change_value();
private:
PnViewerQtWidget *toplevel;
};
class PnViewerQtWidget : public QWidget {
Q_OBJECT
public:
PnViewerQtWidget(PnViewerQt *parent_ctx, QWidget *parent)
: QWidget(parent, Qt::Window), viewer(parent_ctx) {}
protected:
void focusInEvent(QFocusEvent *event);
void closeEvent(QCloseEvent *event);
public slots:
void valchanged_cmd_entry();
void activate_filter();
void activate_zoom_in();
void activate_zoom_out();
void activate_zoom_reset();
private:
PnViewerQt *viewer;
};
#endif
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* pn_viewernav_qt.cpp -- Profinet viewer */
#ifdef PWRE_CONF_PNAK
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
extern "C" {
#include "co_cdh.h"
#include "co_time.h"
}
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_qt.h"
#include "pn_viewernav_qt.h"
PnViewerNavQt::PnViewerNavQt(void *l_parent_ctx, QWidget *l_parent_wid,
viewer_eType l_type, QWidget **w)
: PnViewerNav(l_parent_ctx, l_type)
{
form_widget =
scrolledbrowwidgetqt_new(PnViewerNav::init_brow_cb, this, &brow_widget);
showNow(brow_widget);
// Create the root item
*w = form_widget;
}
PnViewerNavQt::~PnViewerNavQt()
{
delete brow;
form_widget->close();
}
void PnViewerNavQt::set_input_focus()
{
brow_widget->setFocus();
}
#endif
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef pn_viewernav_qt_h
#define pn_viewernav_qt_h
/* pn_viewernav_qt.h -- Profinet viewer */
#ifndef pn_viewernav_h
# include "../src/pn_viewernav.h"
#endif
class PnViewerNavQt : public PnViewerNav {
public:
PnViewerNavQt(void *v_parent_ctx, QWidget *v_parent_wid, viewer_eType v_type,
QWidget **w);
~PnViewerNavQt();
QWidget *brow_widget;
QWidget *form_widget;
void set_input_focus();
};
#endif
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* profinet_viewer.cpp -- Profinet viewer */
#ifdef PWRE_CONF_PNAK
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include "pwr.h"
#include "co_lng.h"
#include "co_error.h"
#include "cow_xhelp_qt.h"
#include "pn_viewer_qt.h"
#include <QApplication>
typedef struct {
QWidget *toplevel;
PnViewer *viewer;
} tViewer;
static void usage()
{
printf("\nUsage: profinet_viewer [-l language] [device]\n");
}
static void viewer_close(void *c)
{
((tViewer *) c)->viewer->toplevel->close();
exit(0);
}
int main(int argc, char *argv[])
{
int i;
int sts;
tViewer *ctx;
char dev_name[20] = "eth1";
QApplication app(argc, argv);
ctx = (tViewer *) calloc(1, sizeof(tViewer));
setlocale(LC_NUMERIC, "POSIX");
setlocale(LC_TIME, "en_US");
ctx->toplevel = new QWidget();
ctx->toplevel->setMinimumSize(100, 100);
ctx->toplevel->setWindowTitle(fl("Profinet Viewer"));
ctx->toplevel->setAttribute(Qt::WA_DeleteOnClose);
// Create help window
CoXHelpQt *xhelp = new CoXHelpQt(ctx->toplevel, 0, xhelp_eUtility_Wtt,
(int *) &sts);
CoXHelpQt::set_default(xhelp);
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-h") == 0) {
usage();
exit(0);
} else if (strcmp(argv[i], "-l") == 0) {
if (i + 1 >= argc) {
usage();
exit(0);
}
Lng::set(argv[i + 1]);
i++;
} else if (strncmp(argv[i], "eth", 3) == 0) {
snprintf(dev_name, sizeof(dev_name), "%s", argv[i]);
}
}
// Open window
try {
ctx->viewer =
new PnViewerQt(ctx, ctx->toplevel, "Profinet Viewer", dev_name, &sts);
ctx->viewer->close_cb = viewer_close;
} catch (co_error &e) {
printf("** Exception: %s\n", e.what().c_str());
exit(0);
}
ctx->toplevel->show();
try {
ctx->viewer->update_devices();
} catch (co_error &e) {
printf("** Exception: %s\n", e.what().c_str());
}
return app.exec();
}
#else
#include <stdio.h>
int main()
{
printf("Softing PNAK not built with this Proview release\n");
}
#endif
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* cow_pb_gsd_attr_qt.cpp -- Display gsd attributes */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "cow_wow_qt.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "flow_msg.h"
#include "rt_pb_msg.h"
#include "cow_pb_gsd_attr_qt.h"
#include "cow_pb_gsd_attrnav_qt.h"
#include <QDialogButtonBox>
#include <QMenuBar>
#include <QPushButton>
#include <QVBoxLayout>
void GsdAttrQt::message(char severity, const char *message)
{
msg_label->setText(fl(message));
}
void GsdAttrQt::set_prompt(const char *prompt)
{
if (strcmp(prompt, "") == 0) {
cmd_prompt->setVisible(false);
msg_label->setVisible(true);
} else {
msg_label->setVisible(false);
cmd_prompt->setVisible(true);
}
}
void GsdAttrQt::change_value()
{
if (input_open) {
cmd_input->setVisible(false);
set_prompt("");
input_open = 0;
return;
}
if (!edit_mode) {
message('E', "Not in edit mode");
return;
}
char *value;
int sts = attrnav->check_attr_value(&value);
if (EVEN(sts)) {
if (sts == PB__NOATTRSEL) {
message('E', "No attribute is selected");
} else {
message('E', "Attribute can't be modified");
}
return;
}
cmd_input->setVisible(true);
message(' ', "");
cmd_input->setFocus();
if (value) {
cmd_input->setText(fl(value));
// Select the text
cmd_input->selectAll();
} else {
cmd_input->setText("");
}
set_prompt("value >");
input_open = 1;
}
//
// Callbackfunctions from menu entries
//
void GsdAttrQtWidget::activate_cmd_input()
{
attr->cmd_prompt->setVisible(false);
attr->cmd_input->setVisible(false);
attr->attrnav->set_inputfocus();
if (attr->input_open) {
QByteArray text = attr->cmd_input->text().toLocal8Bit();
attr->attrnav->set_attr_value(text.data());
attr->cmd_input->setVisible(false);
attr->set_prompt("");
attr->input_open = 0;
}
}
void GsdAttrQtWidget::focusInEvent(QFocusEvent *event)
{
if (!attr->focustimer.disabled()) {
if (attr->cmd_input->isVisible()) {
attr->cmd_input->setFocus();
} else if (attr->attrnav) {
attr->attrnav->set_inputfocus();
}
attr->focustimer.disable(400);
}
QWidget::focusInEvent(event);
}
void GsdAttrQtWidget::closeEvent(QCloseEvent *event)
{
attr->activate_exit();
QWidget::closeEvent(event);
}
GsdAttrQt::GsdAttrQt(QWidget *a_parent_wid, void *a_parent_ctx, void *a_object,
pb_gsd *a_gsd, int a_edit_mode)
: GsdAttr(a_parent_ctx, a_object, a_gsd, a_edit_mode)
{
int sts;
toplevel = new GsdAttrQtWidget(this, a_parent_wid);
toplevel->setMinimumSize(500, 500);
toplevel->setWindowTitle(fl("pbGsdEditor"));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
// Menu
QMenuBar *menu_bar = new QMenuBar();
// File entry
QMenu *file = menu_bar->addMenu(translate_utf8("&File"));
addMenuItem(toplevel, file, "&Print", SLOT(activate_print()), "",
"document-print");
addMenuItem(toplevel, file, "&Close", SLOT(close()), "CTRL+W", "window-close");
// Edit entry
QMenu *edit = menu_bar->addMenu(translate_utf8("&Edit"));
menubutton_copy =
addMenuItem(toplevel, edit, "&Copy", SLOT(activate_copy()), "CTRL+C",
"edit-copy");
menubutton_cut =
addMenuItem(toplevel, edit, "&Cut", SLOT(activate_cut()), "CTRL+X",
"edit-cut");
menubutton_paste =
addMenuItem(toplevel, edit, "&Paste", SLOT(activate_paste()), "CTRL+V",
"edit-paste");
// Functions entry
QMenu *functions = menu_bar->addMenu(translate_utf8("F&unctions"));
menubutton_changevalue = addMenuItem(toplevel, functions, "&Change Value",
SLOT(activate_changevalue()), "CTRL+Q");
// View Entry
QMenu *view = menu_bar->addMenu(translate_utf8("&View"));
addMenuItem(toplevel, view, "Zoom &In", SLOT(activate_zoom_in()), "CTRL+I",
"zoom-in");
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-reset");
// Help entry
QMenu *help = menu_bar->addMenu(translate_utf8("&Help"));
addMenuItem(toplevel, help, "&Help", SLOT(activate_help()), "CTRL+H",
"system-help");
// Navigator
attrnav =
new GsdAttrNavQt(this, toplevel, "Plant", gsd, edit_mode, &brow_widget, &sts);
attrnav->message_cb = &GsdAttr::gsdattr_message;
attrnav->change_value_cb = &GsdAttr::gsdattr_change_value_cb;
// Status bar and value input
QStatusBar *statusbar = new QStatusBar();
msg_label = new QLabel("");
msg_label->setFixedHeight(25);
cmd_prompt = new QLabel("value > ");
cmd_prompt->setFixedHeight(25);
cmd_input = new QLineEdit();
cmd_input->setFixedHeight(25);
QObject::connect(cmd_input, SIGNAL(editing_finished()), toplevel,
SLOT(valchanged_cmd_input()));
statusbar->addWidget(msg_label);
statusbar->addWidget(cmd_prompt);
add_expanding(statusbar, cmd_input);
// Apply and Ok buttons
QDialogButtonBox *buttons = new QDialogButtonBox();
buttons->addButton(QDialogButtonBox::Ok);
buttons->button(QDialogButtonBox::Ok)->setFixedSize(70, 25);
buttons->addButton(QDialogButtonBox::Apply);
buttons->button(QDialogButtonBox::Apply)->setFixedSize(70, 25);
buttons->addButton(QDialogButtonBox::Cancel);
buttons->button(QDialogButtonBox::Cancel)->setFixedSize(70, 25);
QObject::connect(buttons->button(QDialogButtonBox::Ok), SIGNAL(clicked()),
toplevel, SLOT(activate_cmd_ok()));
QObject::connect(buttons->button(QDialogButtonBox::Apply), SIGNAL(clicked()),
toplevel, SLOT(activate_cmd_apply()));
QObject::connect(buttons->button(QDialogButtonBox::Cancel), SIGNAL(clicked()),
toplevel, SLOT(activate_cmd_ca()));
QVBoxLayout *vbox = new QVBoxLayout(toplevel);
vbox->setMenuBar(menu_bar);
add_expanding(vbox, brow_widget);
vbox->addWidget(statusbar);
vbox->addWidget(separator(QFrame::HLine));
vbox->addWidget(buttons);
toplevel->setLayout(vbox);
toplevel->show();
cmd_prompt->setVisible(false);
cmd_input->setVisible(false);
if (!edit_mode) {
buttons->button(QDialogButtonBox::Ok)->setEnabled(false);
buttons->button(QDialogButtonBox::Apply)->setEnabled(false);
menubutton_copy->setEnabled(false);
menubutton_cut->setEnabled(false);
menubutton_paste->setEnabled(false);
menubutton_changevalue->setEnabled(false);
}
wow = new CoWowQt(toplevel);
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef cow_pb_gsd_attr_qt_h
#define cow_pb_gsd_attr_qt_h
/* cow_pb_gsd_attr_qt.h -- Profibus gsd attribute editor */
#include "cow_pb_gsd_attr.h"
#include "cow_wow_qt.h"
class GsdAttrQtWidget;
class GsdAttrQt : public GsdAttr {
public:
QWidget *brow_widget;
QWidget *form_widget;
QLabel *msg_label;
QLabel *cmd_prompt;
QLineEdit *cmd_input;
QWidget *attrnav_form;
QAction *menubutton_copy;
QAction *menubutton_cut;
QAction *menubutton_paste;
QAction *menubutton_changevalue;
CoWowFocusTimerQt focustimer;
GsdAttrQt(QWidget *a_parent_wid, void *a_parent_ctx, void *a_object,
pb_gsd *a_gsd, int a_edit_mode);
void message(char severity, const char *message);
void set_prompt(const char *prompt);
void change_value();
private:
GsdAttrQtWidget *toplevel;
};
class GsdAttrQtWidget : public QWidget {
Q_OBJECT
public:
GsdAttrQtWidget(GsdAttrQt *parent_ctx, QWidget *parent)
: QWidget(parent, Qt::Window), attr(parent_ctx) {}
protected:
void focusInEvent(QFocusEvent *event);
void closeEvent(QCloseEvent *event);
public slots:
void activate_cmd_input();
void valchanged_cmd_input()
{
};
private:
GsdAttrQt *attr;
};
#endif
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* cow_pb_gsd_attrnav_qt.cpp -- Display gsd attributes */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "cow_wow_qt.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_qt.h"
#include "flow_msg.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget_qt.h"
#include "cow_pb_gsd.h"
#include "cow_pb_gsd_attr_qt.h"
#include "cow_pb_gsd_attrnav_qt.h"
#include "rt_pb_msg.h"
GsdAttrNavQt::GsdAttrNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
const char *xn_name, pb_gsd *xn_gsd,
int xn_edit_mode, QWidget **w, pwr_tStatus *status)
: GsdAttrNav(xn_parent_ctx, xn_name, xn_gsd, xn_edit_mode, status)
{
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
*w = form_widget;
wow = new CoWowQt(brow_widget);
trace_timerid = wow->timer_new();
*status = 1;
}
GsdAttrNavQt::~GsdAttrNavQt()
{
delete trace_timerid;
delete brow;
form_widget->close();
}
void GsdAttrNavQt::set_inputfocus()
{
brow_widget->setFocus();
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef cow_pb_gsd_attrnav_qt_h
#define cow_pb_gsd_attrnav_qt_h
/* cow_pb_gsd_attrnav_qt.h -- Profibus gsd configurator navigator */
#ifndef cow_pb_gsd_attrnav_h
# include "cow_pb_gsd_attrnav.h"
#endif
//! The navigation area of the attribute editor.
class GsdAttrNavQt : public GsdAttrNav {
public:
GsdAttrNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid, const char *xn_name,
pb_gsd *xn_gsd, int xn_edit_mode, QWidget **w,
pwr_tStatus *status);
~GsdAttrNavQt();
void set_inputfocus();
QWidget *brow_widget;
QWidget *form_widget;
};
#endif
\ No newline at end of file
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef cow_pn_gsdml_attr_qt_h
#define cow_pn_gsdml_attr_qt_h
/* cow_pn_gsdml_attr_qt.h -- Profibus gsd attribute editor */
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "cow_wow_qt.h"
#include "cow_pn_gsdml_attr.h"
class GsdmlAttrQtWidget;
class GsdmlAttrQt : public GsdmlAttr {
public:
GsdmlAttrQtWidget *toplevel;
QWidget *brow_widget;
QWidget *form_widget;
QLabel *msg_label;
QLabel *cmd_prompt;
QTextEdit *help_text;
QAction *menubutton_copy;
QAction *menubutton_cut;
QAction *menubutton_paste;
QAction *menubutton_changevalue;
QAction *menubutton_viewio;
CoWowFocusTimerQt focustimer;
static CoWowRecall value_recall;
CoWowEntryQt *cmd_entry;
GsdmlAttrQt(QWidget *a_parent_wid, void *a_parent_ctx, void *a_object,
pn_gsdml *a_gsdml, int a_edit_mode, const char *a_data_filename,
pwr_tStatus *a_sts);
void message(char severity, const char *message);
void attr_help_text(const char *help_text);
void set_prompt(const char *prompt);
void change_value();
};
class GsdmlAttrQtWidget : public QWidget {
Q_OBJECT
public:
GsdmlAttrQtWidget(GsdmlAttrQt *parent_ctx, QWidget *parent)
: QWidget(parent, Qt::Window), attr(parent_ctx) {}
protected:
void focusInEvent(QFocusEvent *event);
void closeEvent(QCloseEvent *event);
public slots:
void activate_ordermoduletype_default();
void activate_ordermoduletype_name();
void activate_ordermoduletype_number();
void activate_viewio(bool set);
void activate_cmd_entry();
void valchanged_cmd_entry()
{
};
private:
GsdmlAttrQt *attr;
};
#endif
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* cow_pn_gsdml_attrnav_qt.cpp -- Display gsd attributes */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include "co_cdh.h"
#include "co_time.h"
#include "cow_wow_qt.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_qt.h"
#include "flow_msg.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget_qt.h"
#include "cow_pn_gsdml.h"
#include "cow_pn_gsdml_attr_qt.h"
#include "cow_pn_gsdml_attrnav_qt.h"
#include "rt_pb_msg.h"
GsdmlAttrNavQt::GsdmlAttrNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
const char *xn_name, pn_gsdml *xn_gsdml,
int xn_edit_mode, QWidget **w,
pwr_tStatus *status)
: GsdmlAttrNav(xn_parent_ctx, xn_name, xn_gsdml, xn_edit_mode, status)
{
form_widget = scrolledbrowwidgetqt_new(init_brow_cb, this, &brow_widget);
showNow(brow_widget);
*w = form_widget;
wow = new CoWowQt(brow_widget);
trace_timerid = wow->timer_new();
*status = 1;
}
GsdmlAttrNavQt::~GsdmlAttrNavQt()
{
delete trace_timerid;
delete brow;
form_widget->close();
}
void GsdmlAttrNavQt::set_inputfocus()
{
brow_widget->setFocus();
}
void GsdmlAttrNavQt::display_attr_help_text()
{
brow_tNode *node_list;
int node_count;
ItemPn *base_item;
brow_GetSelectedNodes(brow->ctx, &node_list, &node_count);
if (!node_count)
return;
brow_GetUserData(node_list[0], (void **)&base_item);
free(node_list);
switch(base_item->type) {
/*
* The following two item types could make use of the same info_text that the the base class does,
* but since they already contained references they were used instead...
*/
case attrnav_eItemType_PnParValue:
case attrnav_eItemType_PnParEnum: {
ItemPnParEnum *item = (ItemPnParEnum *)base_item;
gsdml_ValueItem *vi = 0;
if (item->value_ref)
vi = (gsdml_ValueItem *)item->value_ref->Body.ValueItemTarget.p;
//If we do have help available show it
if (vi && vi->Body.Help.p)
((GsdmlAttrQt*)parent_ctx)->attr_help_text((char*)vi->Body.Help.p);
else
((GsdmlAttrQt*)parent_ctx)->attr_help_text("");
break;
}
default: {
if (base_item->info_text)
((GsdmlAttrQt*)parent_ctx)->attr_help_text(base_item->info_text);
else
((GsdmlAttrQt*)parent_ctx)->attr_help_text("");
}
}
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef cow_pn_gsdml_attrnav_qt_h
#define cow_pn_gsdml_attrnav_qt_h
/* cow_pn_gsdml_attrnav_qt.h -- Profibus gsd configurator navigator */
#ifndef cow_pn_gsdml_attrnav_h
# include "cow_pn_gsdml_attrnav.h"
#endif
//! The navigation area of the attribute editor.
class GsdmlAttrNavQt : public GsdmlAttrNav {
public:
GsdmlAttrNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
const char *xn_name, pn_gsdml *xn_gsdml, int xn_edit_mode,
QWidget **w, pwr_tStatus *status);
~GsdmlAttrNavQt();
void set_inputfocus();
void display_attr_help_text();
QWidget *brow_widget;
QWidget *form_widget;
};
#endif
\ No newline at end of file
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_c_pb_dp_slave_qt.c -- work bench methods of the Pb_DP_Slave class. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <vector>
#include <map>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "wb_env.h"
#include "flow.h"
#include "flow_ctx.h"
#include "flow_api.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "cow_wow.h"
#include "cow_xhelp_qt.h"
#include "cow_pb_gsd.h"
#include "cow_pb_gsd_attr_qt.h"
#include "wb_c_pb_dp_slave.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wnav.h"
#include "wb_wsx.h"
using namespace std;
static pwr_tStatus Configure(ldh_sMenuCall *ip)
{
pwr_tStatus sts;
slave_sCtx *ctx;
sts = pb_dp_slave_create_ctx(ip->PointedSession, ip->Pointed, ip->wnav, &ctx);
if (sts != PB__USERPRMDATALEN && EVEN(sts)) { return sts; }
ctx->attr =
new GsdAttrQt(CoXHelpQt::get_widget(), ctx, 0, ctx->gsd, ctx->edit_mode);
ctx->attr->close_cb = pb_dp_slave_close_cb;
ctx->attr->save_cb = pb_dp_slave_save_cb;
ctx->attr->help_cb = pb_dp_slave_help_cb;
if (EVEN(sts)) {
ctx->attr->wow->DisplayError("Configuration load error",
"Configuration load error\nCheck configuration data");
}
return 1;
}
static pwr_tStatus ConfigureFilter(ldh_sMenuCall *ip)
{
return 1;
}
//
// Syntax check.
//
static pwr_tStatus SyntaxCheck(ldh_tSesContext Session,
pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
)
{
return wsx_CheckIoDevice(Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_None);
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(Pb_DP_Slave) =
{pwr_BindMethod(Configure), pwr_BindMethod(ConfigureFilter),
pwr_BindMethod(SyntaxCheck), pwr_NullMethod};
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_c_pb_dp_slave_qt.c -- work bench methods of the Pb_DP_Slave class. */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <vector>
#include <map>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "wb_env.h"
#include "flow.h"
#include "flow_ctx.h"
#include "flow_api.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "cow_wow.h"
#include "cow_xhelp_qt.h"
#include "cow_pn_gsdml.h"
#include "cow_pn_gsdml_attr_qt.h"
#include "wb_c_pndevice.h"
#include "wb_pwrs.h"
#include "wb_ldh_msg.h"
#include "wb_ldh.h"
#include "wb_pwrb_msg.h"
#include "rt_pb_msg.h"
#include "wb_wnav.h"
#include "wb_wsx.h"
#include "../../cow/qt/cow_pn_gsdml_attr_qt.h"
using namespace std;
char *id_to_string(pwr_tOid oid)
{
unsigned char vid[4];
static char str[40];
memcpy(&vid, &oid.vid, sizeof(vid));
sprintf(str, "%3.3u_%3.3u_%3.3u_%3.3u_%8.8x", vid[3], vid[2], vid[1], vid[0],
oid.oix);
return str;
}
static pwr_tStatus Configure(ldh_sMenuCall *ip)
{
pwr_tStatus sts;
device_sCtx *ctx;
pwr_tFileName datafile;
sprintf(datafile, "$pwrp_load/pwr_pn_%s.xml",
id_to_string(ip->Pointed.Objid));
sts = pndevice_create_ctx(ip->PointedSession, ip->Pointed, ip->wnav, &ctx);
if (EVEN(sts)) { return sts; }
ctx->attr = new GsdmlAttrQt(CoXHelpQt::get_widget(), ctx, 0, ctx->gsdml,
ctx->edit_mode, datafile, &sts);
if (sts == PB__CONFIGABORTED) {
((GsdmlAttrQt *) ctx->attr)->toplevel->close();
return 1;
}
ctx->attr->close_cb = pndevice_close_cb;
ctx->attr->save_cb = pndevice_save_cb;
ctx->attr->help_cb = pndevice_help_cb;
if (ODD(sts)) {
sts = pndevice_init(ctx);
}
if (EVEN(sts)) {
ctx->attr->wow->DisplayError("Configuration load error",
"Configuration load error\nCheck configuration data");
}
return 1;
}
static pwr_tStatus ConfigureFilter(ldh_sMenuCall *ip)
{
return 1;
}
//
// Copy Device.
//
static pwr_tStatus CopyDevice(ldh_sMenuCall *ip)
{
char *gsdml;
int size;
int sts;
pwr_tOid oid;
pwr_tAttrRef aref[2];
pwr_tFileName datafile_src, datafile_dest;
pwr_tFileName found_file;
pwr_tCmd cmd;
// Check if data file exist
sprintf(datafile_src, "$pwrp_load/pwr_pn_%s.xml",
id_to_string(ip->Pointed.Objid));
dcli_translate_filename(datafile_src, datafile_src);
sts = dcli_search_file(datafile_src, found_file, DCLI_DIR_SEARCH_INIT);
dcli_search_file(datafile_src, found_file, DCLI_DIR_SEARCH_END);
if (EVEN(sts)) { return sts; }
sts = ldh_GetObjectPar(ip->PointedSession, ip->Pointed.Objid, "RtBody",
"GSDMLfile", &gsdml, &size);
if (EVEN(sts)) { return sts; }
if (strcmp(gsdml, "") == 0) {
free(gsdml);
return 0;
}
free(gsdml);
memset(aref, 0, sizeof(aref));
aref[0] = ip->Pointed;
sts = ldh_CopyObjectTrees(ip->PointedSession, aref, ip->Pointed.Objid,
ldh_eDest_After, 0, 1, 0, 0);
if (EVEN(sts)) { return sts; }
sts = ldh_GetNextSibling(ip->PointedSession, ip->Pointed.Objid, &oid);
if (EVEN(sts)) { return sts; }
sprintf(datafile_dest, "$pwrp_load/pwr_pn_%s.xml", id_to_string(oid));
dcli_translate_filename(datafile_dest, datafile_dest);
snprintf(cmd, sizeof(cmd), "cp %s %s", datafile_src, datafile_dest);
system(cmd);
return 1;
}
static pwr_tStatus CopyDeviceFilter(ldh_sMenuCall *ip)
{
char *gsdml;
int size;
int sts;
pwr_tFileName datafile;
pwr_tFileName found_file;
// Check if data file exist
sprintf(datafile, "$pwrp_load/pwr_pn_%s.xml",
id_to_string(ip->Pointed.Objid));
dcli_translate_filename(datafile, datafile);
sts = dcli_search_file(datafile, found_file, DCLI_DIR_SEARCH_INIT);
dcli_search_file(datafile, found_file, DCLI_DIR_SEARCH_END);
if (EVEN(sts)) { return 0; }
sts = ldh_GetObjectPar(ip->PointedSession, ip->Pointed.Objid, "RtBody",
"GSDMLfile", &gsdml, &size);
if (EVEN(sts)) { return sts; }
if (strcmp(gsdml, "") == 0) {
free(gsdml);
return 0;
}
free(gsdml);
return 1;
}
//
// Syntax check.
//
static pwr_tStatus SyntaxCheck(ldh_tSesContext Session,
pwr_tAttrRef Object, /* current object */
int *ErrorCount, /* accumulated error count */
int *WarningCount /* accumulated waring count */
)
{
return wsx_CheckIoDevice(Session, Object, ErrorCount, WarningCount,
wsx_mCardOption_None);
}
//
// Get value.
//
static pwr_tStatus GetIoDeviceData(pwr_tAttrRef Object, const char *Attr,
char *Buf, int BufSize)
{
pwr_tFileName datafile;
pwr_tStatus sts;
sprintf(datafile, "$pwrp_load/pwr_pn_%s.xml", id_to_string(Object.Objid));
dcli_translate_filename(datafile, datafile);
GsdmlDeviceData *data = new GsdmlDeviceData();
sts = data->read(datafile);
if (EVEN(sts)) { return sts; }
sts = data->get_value(Attr, Buf, BufSize);
delete data;
return sts;
}
static pwr_tStatus SetIoDeviceData(pwr_tAttrRef Object, const char *Attr,
const char *Value)
{
pwr_tFileName datafile;
pwr_tStatus sts;
sprintf(datafile, "$pwrp_load/pwr_pn_%s.xml", id_to_string(Object.Objid));
dcli_translate_filename(datafile, datafile);
GsdmlDeviceData *data = new GsdmlDeviceData();
sts = data->read(datafile);
if (EVEN(sts)) { return sts; }
sts = data->modify_value(Attr, Value);
if (ODD(sts)) {
data->print(datafile);
}
delete data;
return sts;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindMethods(PnDevice) =
{pwr_BindMethod(Configure), pwr_BindMethod(ConfigureFilter),
pwr_BindMethod(CopyDevice), pwr_BindMethod(CopyDeviceFilter),
pwr_BindMethod(SyntaxCheck), pwr_BindMethod(GetIoDeviceData),
pwr_BindMethod(SetIoDeviceData), pwr_NullMethod};
\ No newline at end of file
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* xtt_c_pb_db_slave_qt.cpp -- xtt methods for Pb_DP_Slave. */
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "flow_std.h"
#include "co_cdh.h"
#include "xtt_menu.h"
#include "xtt_xnav.h"
#include "rt_xnav_msg.h"
#include "pwr_privilege.h"
#include "cow_pb_gsd.h"
#include "cow_xhelp_qt.h"
#include "cow_pb_gsd_attr_qt.h"
#include "xtt_c_pb_dp_slave.h"
// Show Configuration
static pwr_tStatus ShowConfiguration(xmenu_sMenuCall *ip)
{
xtt_slave_sCtx *ctx;
pwr_tStatus sts;
int edit_mode = 0;
sts = xtt_pb_dp_slave_create_ctx(ip->Pointed, ip->EditorContext, &ctx);
if (EVEN(sts)) { return sts; }
ctx->attr =
new GsdAttrQt(CoXHelpQt::get_widget(), ctx, 0, ctx->gsd, edit_mode);
ctx->attr->close_cb = xtt_pb_dp_slave_close_cb;
ctx->attr->save_cb = xtt_pb_dp_slave_save_cb;
ctx->attr->help_cb = xtt_pb_dp_slave_help_cb;
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to xtt should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindXttMethods(Pb_DP_Slave) =
{pwr_BindXttMethod(ShowConfiguration), pwr_NullMethod};
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* xtt_c_pndevice_qt.cpp -- xtt methods for PnDevice. */
#include "pwr_baseclasses.h"
#include "pwr_profibusclasses.h"
#include "flow_std.h"
#include "co_cdh.h"
#include "xtt_menu.h"
#include "xtt_xnav.h"
#include "rt_xnav_msg.h"
#include "pwr_privilege.h"
#include "cow_pb_gsd.h"
#include "cow_xhelp_qt.h"
#include "cow_pn_gsdml_attr_qt.h"
#include "xtt_c_pndevice.h"
#include "rt_pb_msg.h"
using namespace std;
char *id_to_string(pwr_tOid oid)
{
unsigned char vid[4];
static char str[40];
memcpy(&vid, &oid.vid, sizeof(vid));
sprintf(str, "%3.3u_%3.3u_%3.3u_%3.3u_%8.8x", vid[3], vid[2], vid[1], vid[0], oid.oix);
return str;
}
// Show Configuration
static pwr_tStatus ShowConfiguration(xmenu_sMenuCall *ip)
{
pwr_tStatus sts;
xtt_pndevice_sCtx *ctx;
pwr_tFileName datafile;
sprintf(datafile, "$pwrp_load/pwr_pn_%s.xml", id_to_string(ip->Pointed.Objid));
sts = xtt_pndevice_create_ctx(ip->Pointed, ip->EditorContext, &ctx);
if (EVEN(sts))
return sts;
ctx->attr = new GsdmlAttrQt(CoXHelpQt::get_widget(), ctx, 0, ctx->gsdml, 0,
datafile, &sts);
if (sts == PB__CONFIGABORTED) {
delete ctx->attr;
return 1;
}
ctx->attr->close_cb = xtt_pndevice_close_cb;
ctx->attr->save_cb = xtt_pndevice_save_cb;
ctx->attr->help_cb = xtt_pndevice_help_cb;
#if 0
if (ODD(sts))
sts = pndevice_init(ctx);
#endif
if (EVEN(sts)) {
ctx->attr->wow->DisplayError("Configuration load error",
"Configuration load error\nCheck configuration data");
}
return 1;
}
/*----------------------------------------------------------------------------*\
Every method to be exported to xtt should be registred here.
\*----------------------------------------------------------------------------*/
pwr_dExport pwr_BindXttMethods(PnDevice) = {
pwr_BindXttMethod(ShowConfiguration),
pwr_NullMethod
};
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(pwr_exe)/sev_xtt_qt \
$(bld_dir)/sev_xtt_qt.o \
$(bld_dir)/xtt_tbl_qt.o $(bld_dir)/xtt_tbl_qt_moc.o \
$(bld_dir)/xtt_tblnav_qt.o \
$(bld_dir)/xtt_tbl.o $(bld_dir)/xtt_tblnav.o $(bld_dir)/xtt_tbl_command.o \
$(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrxtt) $(pwre_conf_libqt) $(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrxtt) \
$(pwre_conf_libpwrrt) $(pwre_conf_lib)
endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#include <fstream>
#include <vector>
#include <locale.h>
#include "pwr.h"
#include "pwr_class.h"
#include "co_error.h"
#include "rt_qcom.h"
#include "rt_errh.h"
#include "rt_sevcli.h"
#include "xtt_tbl_qt.h"
#include <QApplication>
void tbl_close_cb(void *tbl)
{
exit(0);
}
int main(int argc, char *argv[])
{
pwr_tStatus sts;
qcom_sAid aid;
sevcli_tCtx sevcli;
sevcli_sHistItem *items;
unsigned int itemcnt;
char servername[40] = "";
// Get options
for (int i = 1; i < argc; i++) {
if (strcmp(argv[i], "-s") == 0 && i + 1 < argc) {
strncpy(servername, argv[i + 1], sizeof(servername));
i++;
}
}
sts = qcom_Init(&sts, &aid, "sev_xtt");
if (EVEN(sts)) { co_error(sts); }
sevcli_init(&sts, &sevcli);
if (EVEN(sts)) {
printf("Sev client init error %u\n", sts);
exit(0);
}
if (strcmp(servername, "") != 0) {
sevcli_set_servernode(&sts, sevcli, servername);
}
sevcli_get_itemlist(&sts, sevcli, &items, &itemcnt);
if (EVEN(sts)) {
printf("Sev client get itemlist error %u\n", sts);
exit(0);
}
QApplication app(argc, argv);
setlocale(LC_NUMERIC, "POSIX");
setlocale(LC_TIME, "en_US");
XttTblQt *tbl = new XttTblQt(0, 0, sevcli, items, itemcnt);
tbl->close_cb = tbl_close_cb;
return app.exec();
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* xtt_tbl.cpp -- Sev Table Viewer */
#include <fstream>
#include <vector>
#include "glow_std.h"
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "cow_wow_qt.h"
#include "cow_xhelp_qt.h"
#include "cow_login_qt.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_qt.h"
#include "glow.h"
#include "glow_curvectx.h"
#include "flow_msg.h"
#include "xtt_tbl_qt.h"
#include "xtt_tblnav_qt.h"
#include "xtt_sevhist_qt.h"
#include <QMenuBar>
#include <QVBoxLayout>
void XttTblQt::message(char severity, const char *message)
{
msg_label->setText(fl(message));
}
void XttTblQtWidget::closeEvent(QCloseEvent *event)
{
if (tbl->close_cb) {
(tbl->close_cb)(tbl);
} else {
delete tbl;
}
QWidget::closeEvent(event);
}
void XttTblQtWidget::focusInEvent(QFocusEvent *event)
{
if (tbl->tblnav) {
tbl->tblnav->set_inputfocus();
}
QWidget::focusInEvent(event);
}
void XttTblQtWidget::activate_print()
{
if (!tbl->is_authorized()) {
return;
}
tbl->activate_print();
}
void XttTblQtWidget::activate_help()
{
if (!tbl->is_authorized()) {
return;
}
tbl->activate_help();
}
void XttTblQtWidget::activate_help_project()
{
if (!tbl->is_authorized()) {
return;
}
tbl->activate_help_project();
}
void XttTblQtWidget::activate_help_proview()
{
if (!tbl->is_authorized()) {
return;
}
tbl->activate_help_proview();
}
void XttTblQtWidget::activate_opensevhist()
{
if (!tbl->is_authorized()) {
return;
}
tbl->activate_opensevhist();
}
void XttTblQtWidget::activate_delete_item()
{
if (!tbl->is_authorized(pwr_mPrv_SevAdmin)) {
return;
}
tbl->activate_delete_item();
}
void XttTblQtWidget::activate_tree_layout()
{
if (!tbl->is_authorized()) {
return;
}
tbl->tblnav->show_tree();
}
void XttTblQtWidget::activate_list_layout()
{
if (!tbl->is_authorized()) {
return;
}
tbl->tblnav->show_list();
}
XttSevHist *XttTblQt::sevhist_new(pwr_tOid *oidv, pwr_tOName *anamev,
pwr_tOName *onamev, bool *sevhistobjectv,
pwr_tStatus *sts)
{
QWidget *w;
return new XttSevHistQt(this, toplevel, "Process History", &w, oidv, anamev,
onamev, sevhistobjectv, sevcli, 0, 0, 0, 0,
time_ePeriod_lastHour, 0, sts);
}
CoLogin *XttTblQt::login_new(const char *name, const char *groupname,
void (*bc_success)(void *),
void (*bc_cancel)(void *), pwr_tStatus *status)
{
return new CoLoginQt(this, toplevel, name, groupname, bc_success, bc_cancel,
0, status);
}
void XttTblQtWidget::activate_command()
{
if (!tbl->is_authorized()) {
return;
}
if (tbl->command_open) {
tbl->cmd_entry->setVisible(false);
tbl->set_prompt("");
tbl->command_open = 0;
return;
}
tbl->cmd_entry->setText("");
tbl->cmd_entry->setVisible(true);
tbl->message(' ', "");
tbl->cmd_entry->setFocus();
tbl->set_prompt("xtt >");
tbl->command_open = 1;
}
void XttTblQt::set_prompt(const char *prompt)
{
if (strcmp(prompt, "") == 0) {
cmd_prompt->setVisible(false);
msg_label->setVisible(true);
} else {
msg_label->setVisible(false);
cmd_prompt->setText(QString::fromLatin1(prompt));
cmd_prompt->setVisible(true);
}
}
void XttTblQtWidget::valchanged_cmd_input()
{
QByteArray text = tbl->cmd_entry->text().toLatin1();
tbl->command(text.data());
tbl->cmd_entry->setVisible(false);
tbl->set_prompt("");
tbl->command_open = 0;
tbl->tblnav->set_inputfocus();
}
XttTblQt::XttTblQt(QWidget *a_parent_wid, void *a_parent_ctx,
sevcli_tCtx a_sevcli, sevcli_sHistItem *itemlist,
int item_cnt) : XttTbl(a_parent_ctx, a_sevcli)
{
int sts;
toplevel = new XttTblQtWidget(this, a_parent_wid);
toplevel->setMinimumSize(500, 700);
toplevel->setWindowTitle(fl("SevXtt Navigator"));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
CoWowQt::SetWindowIcon(toplevel);
// Menu
QMenuBar *menu_bar = new QMenuBar();
// File entry
QMenu *file = menu_bar->addMenu(translate_utf8("&File"));
addMenuItem(toplevel, file, "&Print", SLOT(activate_print()), "",
"document-print");
addMenuItem(toplevel, file, "&Login", SLOT(open_login()));
addMenuItem(toplevel, file, "Log&Out", SLOT(logout()));
addMenuItem(toplevel, file, "&Close", SLOT(close()), "CTRL+W", "window-close");
// Functions entry
QMenu *functions = menu_bar->addMenu(translate_utf8("F&unctions"));
addMenuItem(toplevel, functions, "&Open Process History",
SLOT(activate_opensevhist()), "CTRL+G");
addMenuItem(toplevel, functions, "Co&mmand", SLOT(activate_command()), "CTRL+B");
addMenuItem(toplevel, functions, "&Delete Item", SLOT(activate_delete_item()));
// View menu
QMenu *view = menu_bar->addMenu(translate_utf8("&View"));
addMenuItem(toplevel, view, "&Tree Layout", SLOT(activate_tree_layout()));
addMenuItem(toplevel, view, "&List Layout", SLOT(activate_list_layout()));
addMenuItem(toplevel, view, "Zoom &In", SLOT(activate_zoom_in()), "CTRL+I",
"zoom-in");
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-reset");
// Help entry
QMenu *help = menu_bar->addMenu(translate_utf8("&Help"));
addMenuItem(toplevel, help, "&Overview", SLOT(activate_help()), "CTRL+H",
"system-help");
addMenuItem(toplevel, help, "&Project", SLOT(activate_help_project()));
addMenuItem(toplevel, help, "&About Proview", SLOT(activate_help_proview()));
// Toolbar
QToolBar *tools = new QToolBar();
addToolItem(toplevel, tools, "Open history item", SLOT(activate_opensevhist()),
"$pwr_exe/xtt_meth_trend.png");
addToolItem(toplevel, tools, "Zoom in", SLOT(activate_zoomin()),
"$pwr_exe/xtt_zoom_in.png");
addToolItem(toplevel, tools, "Zoom out", SLOT(activate_zoomout()),
"$pwr_exe/xtt_zoom_out.png");
addToolItem(toplevel, tools, "Zoom reset", SLOT(activate_zoomreset()),
"$pwr_exe/xtt_zoom_reset.png");
// Statusbar and cmd input
QStatusBar *statusbar = new QStatusBar();
msg_label = new QLabel("");
msg_label->setFixedHeight(25);
cmd_prompt = new QLabel("value > ");
cmd_prompt->setFixedHeight(25);
cmd_recall = new CoWowRecall();
cmd_entry = new CoWowEntryQt(cmd_recall);
cmd_entry->setFixedHeight(25);
QObject::connect(cmd_entry, SIGNAL(editing_finished()), toplevel,
SLOT(valchanged_cmd_input()));
statusbar->addWidget(msg_label);
statusbar->addWidget(cmd_prompt);
add_expanding(statusbar, cmd_entry);
tblnav = new TblNavQt(this, toplevel, itemlist, item_cnt, &brow_widget, &sts);
tblnav->message_cb = &XttTbl::message;
tblnav->is_authorized_cb = &XttTbl::is_authorized;
tblnav->command_cb = &XttTbl::command_cb;
QVBoxLayout *vbox = new QVBoxLayout(toplevel);
vbox->setMenuBar(menu_bar);
vbox->addWidget(tools);
add_expanding(vbox, brow_widget);
vbox->addWidget(statusbar);
toplevel->setLayout(vbox);
toplevel->show();
cmd_prompt->setVisible(false);
cmd_entry->setVisible(false);
// Create help window
CoXHelp *xhelp = new CoXHelpQt(toplevel, this, xhelp_eUtility_Xtt, &sts);
CoXHelp::set_default(xhelp);
wow = new CoWowQt(toplevel);
if (!is_authorized(pwr_mAccess_AllSev, 0)) {
open_login();
}
if (!quiet) {
if (cologin) {
// Set login window as parent to warranty as focus is left to parent.
((CoWowQt *) wow)->SetParent(((CoLoginQt *) cologin)->toplevel);
}
wow->DisplayWarranty();
if (cologin) {
((CoWowQt *) wow)->SetParent(toplevel);
}
}
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef xtt_tbl_qt_h
#define xtt_tbl_qt_h
#include "../src/xtt_tbl.h"
#include "xtt_tblnav_qt.h"
#include "cow_wow_qt.h"
/* ge_tbl.h -- Ge tblibute editor */
class CoWowRecall;
class CoWowEntryQt;
class XttTblQtWidget;
class XttTblQt : public XttTbl {
public:
XttTblQt(QWidget *a_parent_wid, void *a_parent_ctx, sevcli_tCtx a_sevcli,
sevcli_sHistItem *itemlist, int item_cnt);
XttTblQtWidget *toplevel;
QWidget *brow_widget;
QWidget *form_widget;
QLabel *msg_label;
QLabel *cmd_prompt;
CoWowRecall *cmd_recall;
CoWowEntryQt *cmd_entry;
void message(char severity, const char *message);
XttSevHist *sevhist_new(pwr_tOid *oidv, pwr_tOName *anamev,
pwr_tOName *onamev, bool *sevhistobjectv,
pwr_tStatus *sts);
CoLogin *login_new(const char *wl_name, const char *wl_groupname,
void (*wl_bc_success)(void *),
void (*wl_bc_cancel)(void *), pwr_tStatus *status);
void set_prompt(const char *prompt);
};
class XttTblQtWidget : public QWidget {
Q_OBJECT
public:
XttTblQtWidget(XttTblQt *parent_ctx, QWidget *parent)
: QWidget(parent, Qt::Window), tbl(parent_ctx) {}
protected:
void focusInEvent(QFocusEvent *event);
void closeEvent(QCloseEvent *event);
public slots:
void activate_command();
void valchanged_cmd_input();
void activate_print();
void activate_opensevhist();
void activate_delete_item();
void activate_tree_layout();
void activate_list_layout();
void activate_help();
void activate_help_project();
void activate_help_proview();
private:
XttTblQt *tbl;
};
#endif
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* sev_tblnav.cpp -- Sev Table Viewer */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include "co_cdh.h"
#include "co_time.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_qt.h"
#include "flow_msg.h"
#include "glow.h"
#include "glow_growctx.h"
#include "glow_growapi.h"
#include "glow_growwidget_qt.h"
#include "xtt_tbl_qt.h"
#include "xtt_tblnav_qt.h"
TblNavQt::TblNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
sevcli_sHistItem *xn_itemlist, int xn_item_cnt, QWidget **w,
pwr_tStatus *status)
: TblNav(xn_parent_ctx, xn_itemlist, xn_item_cnt, status)
{
form_widget =
scrolledbrowwidgetqt_new(TblNav::init_brow_cb, this, &brow_widget);
showNow(brow_widget);
// Create the root item
*w = form_widget;
*status = 1;
}
TblNavQt::~TblNavQt()
{
delete brow;
form_widget->close();
}
void TblNavQt::set_inputfocus()
{
brow_widget->setFocus();
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef xtt_tblnav_qt_h
#define xtt_tblnav_qt_h
/* xtt_tblnav_qt.h -- Simple navigator */
#ifndef xtt_tblnav_h
# include "../src/xtt_tblnav.h"
#endif
#include <QWidget>
//! The navigation area of the attribute editor.
class TblNavQt : public TblNav {
public:
TblNavQt(void *xn_parent_ctx, QWidget *xn_parent_wid,
sevcli_sHistItem *xn_itemlist, int xn_item_cnt, QWidget **w,
pwr_tStatus *status);
~TblNavQt();
QWidget *brow_widget;
QWidget *form_widget;
void set_inputfocus();
};
#endif
\ No newline at end of file
......@@ -2,7 +2,7 @@ ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) $(export_obj) \
$(objects) $(pwre_conf_libdir) $(pwre_conf_libpwrco) $(pwre_conf_lib) $(pwre_conf_libgtk)
$(objects) $(pwre_conf_libdir) $(pwre_conf_libpwrco) $(pwre_conf_lib) $(pwre_conf_libgtk) $(pwre_conf_libqt)
linkcp = cp $(export_exe) $(eexe_dir)/
......
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
ifndef link_rule_mk
link_rule_mk := 1
ifeq ($(export_type),exp)
link = $(ldxx) $(explinkflags) $(domap) -o $(pwr_exe)/wb_qt \
$(bld_dir)/wb_qt.o $(bld_dir)/wb_main.o \
$(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_procom.o $(pwr_eobj)/stdsoap2.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrwbqt) $(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbqt) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrxtt) $(pwre_conf_libqt) \
$(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib)
else
# link = $(ldxx) $(elinkflags) $(domap) -o $(pwr_exe)/wb_qt \
# $(bld_dir)/wb_qt.o $(bld_dir)/wb_main.o $(wb_msg_eobjs) $(rt_msg_eobjs) \
# $(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_procom.o $(pwr_eobj)/stdsoap2.o \
# $(pwre_conf_libdir) $(pwre_conf_libpwrwbqt) $(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrwb) \
# $(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbqt) $(pwre_conf_libpwrwb) \
# $(pwre_conf_libqt) \
# $(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib)
link = :
endif
endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_qt.cpp -- work bench */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <map>
#include "wb_env.h"
#include "flow.h"
#include "flow_ctx.h"
#include "flow_api.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "pwr.h"
#include "co_msg.h"
#include "co_cdh.h"
#include "co_dcli.h"
#include "cow_wow.h"
#include "wb.h"
#include "wb_ldh.h"
#include "cow_login_qt.h"
#include "co_login_msg.h"
#include "wb_utl_api.h"
#include "wb_vsel_qt.h"
#include "cow_msgwindow_qt.h"
#include "cow_xhelp_qt.h"
#include "co_lng.h"
#include "cow_wow_qt.h"
#include "co_user.h"
#include "wb_wtt_qt.h"
#include "wb_log_qt.h"
#include "wb_erep.h"
#include "wb_vrepwbl.h"
#include "wb_vrepdbs.h"
#include "wb_vrepmem.h"
#include "wb_vrepext.h"
#include "wb_qt.h"
#include <QApplication>
#include <QTimer>
using namespace std;
Wtt *WbQt::wtt_new(const char *name, const char *iconname,
ldh_tWBContext ldhwbctx, pwr_tVolumeId volid,
ldh_tVolume volctx, wnav_sStartMenu *root_menu,
pwr_tStatus *status)
{
return new WttQt(0, toplevel, name, iconname, ldhwbctx, volid, volctx, root_menu,
status);
}
WVsel *WbQt::vsel_new(pwr_tStatus *status, const char *name,
ldh_tWBContext ldhwbctx, char *volumename,
int (*bc_success)(void *, pwr_tVolumeId *, int),
void (*bc_cancel)(), int (*bc_time_to_exit)(void *),
int show_volumes, wb_eType wb_type)
{
return new WVselQt(status, NULL, mainwindow, name, ldhwbctx, volumename,
bc_success, bc_cancel, bc_time_to_exit, show_volumes,
wb_type);
}
int main(int argc, char *argv[])
{
if (argc >= 2 && strcmp(argv[1], "-m") == 0) {
wb_erep::printMethods();
exit(0);
}
QApplication app(argc, argv);
new WbQt(argc, argv);
return app.exec();
}
WbQt::WbQt(int argc, char *argv[]) : mainwindow(0)
{
pwr_tStatus sts;
int login_display = 0;
int nav_display = 0;
char systemname[80];
char systemgroup[80];
char password[40];
char username[40];
char volumename[40];
char *volumename_p;
int arg_cnt;
char title[80];
char backdoor[] = "aaY2CiHS.y4Wc";
int sw_projectvolume = 0;
int sw_classeditor = 0;
int sw_projectlist = 0;
char filename[200];
int i;
int quiet = 0;
unsigned int options = 0;
setlocale(LC_ALL, "en_US");
setlocale(LC_NUMERIC, "POSIX");
setlocale(LC_TIME, "en_US");
Wb::main_wb = this;
strcpy(username, "");
strcpy(password, "");
// Open directory volume as default
volumename_p = volumename;
strcpy(volumename, "directory");
sw_projectvolume = 1;
arg_cnt = 0;
for (i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'h':
usage();
exit(0);
case 'a':
// Load all volumes
sw_projectvolume = 0;
volumename_p = 0;
break;
case 'q':
// Quiet
quiet = 1;
break;
case 's':
// Open dbs file
options |= ldh_mWbOption_OpenDbs;
break;
case 'l':
if (i + 1 >= argc) {
usage();
exit(0);
}
Lng::set(argv[i + 1]);
i++;
break;
case 'f':
if (i + 1 >= argc) {
usage();
exit(0);
}
i++;
break;
case 'c':
if (i + 1 >= argc) {
usage();
exit(0);
}
sw_classeditor = 1;
strcpy(filename, argv[i + 1]);
sw_projectvolume = 0;
i++;
break;
case 'p':
sw_projectlist = 1;
sw_projectvolume = 0;
strcpy(volumename, "");
break;
default:
printf("Unknown argument: %s\n", argv[i]);
}
} else {
switch (arg_cnt) {
case 0:
strcpy(username, argv[i]);
break;
case 1:
strcpy(password, argv[i]);
break;
case 2:
strcpy(volumename, argv[i]);
sw_projectvolume = 0;
break;
default:
printf("Unknown argument: %s\n", argv[i]);
}
arg_cnt++;
}
}
toplevel = new QWidget();
toplevel->setMinimumSize(100, 100);
toplevel->setWindowTitle(fl("Pwr wb"));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
// Attach to history log
new wb_log_qt(toplevel);
// Create message window
MsgWindowQt
*msg_window = new MsgWindowQt(0, mainwindow, "Workbench messages", &sts);
msg_window->find_wnav_cb = Wb::find_wnav_cb;
msg_window->find_plc_cb = Wb::find_plc_cb;
MsgWindow::set_default(msg_window);
MsgWindow::message('I', "Development environment started");
// Create help window
CoXHelpQt *xhelp = new CoXHelpQt(mainwindow, 0, xhelp_eUtility_Wtt, &sts);
CoXHelp::set_default(xhelp);
sts = ldh_OpenWB(&wbctx, volumename_p, options);
psts(sts, NULL);
if (EVEN(sts)) { exit(sts); }
/* Get system name */
sts = utl_get_systemname(systemname, systemgroup);
if (EVEN(sts)) {
/* No system object, login as system !! */
CoLogin::insert_login_info("SYSTEM", password, username, pwr_mAccess_AllPwr,
0);
nav_display = 1;
} else {
if (arg_cnt >= 1 && strcmp(UserList::pwcrypt(argv[1]), backdoor) == 0) {
/* Login as system !! */
CoLogin::insert_login_info("SYSTEM", "", "", pwr_mAccess_AllPwr, 0);
nav_display = 1;
} else if (arg_cnt >= 1) {
/* Check username and password */
sts = CoLogin::user_check(systemgroup, username, password);
if (EVEN(sts)) {
/* Login in is not ok, start login window */
login_display = 1;
} else {
/* Login is ok, start navigator */
nav_display = 1;
}
} else if (arg_cnt == 0) {
/* No arguments, start login window */
login_display = 1;
}
}
if (!login_display) {
char msg[80];
sprintf(msg, "User %s logged in", CoLogin::username());
MsgWindow::message('I', msg);
wb_log::log(wlog_eCategory_WbLogin, CoLogin::username(), 0);
strcpy(title, "PwR Development ");
strcat(title, CoLogin::username());
strcat(title, " on ");
strcat(title, systemname);
toplevel->setWindowTitle(fl(title));
}
if (sw_projectvolume && !login_display) {
Wtt *wtt;
char projectname[80];
pwr_tVolumeId volume = ldh_cDirectoryVolume;
utl_get_projectname(projectname);
strcpy(title, CoLogin::username());
strcat(title, " on ");
strcat(title, projectname);
wtt = wtt_new(title, "Navigator", wbctx, volume, 0, 0, &sts);
if (ODD(sts)) {
appl_count++;
wtt->close_cb = Wb::wtt_close;
wtt->open_volume_cb = Wb::wtt_open_volume;
wtt->time_to_exit_cb = Wb::time_to_exit;
wttlist_add(&sts, wtt, volume);
} else {
psts(sts, NULL);
}
} else if (sw_classeditor) {
wtt_open_volume(0, wb_eType_ClassEditor, filename,
wow_eFileSelType_WblClass);
} else if (sw_projectlist) {
wtt_open_volume(0, wb_eType_ExternVolume, "ProjectList", wow_eFileSelType_);
} else if (nav_display && !login_display) {
if (CoLogin::privilege() & pwr_mPrv_DevRead) {
strcpy(title, "PwR Navigator: ");
strcat(title, CoLogin::username());
strcat(title, " on ");
strcat(title, systemname);
appl_count++;
vsel_new(&sts, "PwR Volumes", wbctx, volumename, &Wb::vsel_success,
&Wb::vsel_cancel, &Wb::time_to_exit, 0, wb_eType_Volume);
} else {
exit(LOGIN__NOPRIV);
}
} else if (login_display) {
new CoLoginQt(NULL, mainwindow, "PwR Login", systemgroup,
&Wb::login_success, &Wb::login_cancel, 0, &sts);
}
strcpy(title, "PwR Development ");
strcat(title, CoLogin::username());
strcat(title, " on ");
strcat(title, systemname);
toplevel->hide();
if (!quiet) {
CoWowQt *wow = new CoWowQt(toplevel);
// Use timeout to get in on the top of the display
QTimer::singleShot(100, wow->object, SLOT(DisplayWarranty()));
}
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef wb_qt_h
#define wb_qt_h
#ifndef wb_main_h
#include "wb_main.h"
#endif
#include <QWidget>
class WbQt : public Wb {
public:
QWidget *toplevel;
QWidget *mainwindow;
WbQt(int argc, char *argv[]);
virtual ~WbQt()
{
};
Wtt *wtt_new(const char *name, const char *iconname, ldh_tWBContext wbctx,
pwr_tVolumeId volid, ldh_tVolume volctx,
wnav_sStartMenu *root_menu, pwr_tStatus *status);
WVsel *vsel_new(pwr_tStatus *status, const char *name, ldh_tWBContext wbctx,
char *volumename,
int (*bc_success)(void *, pwr_tVolumeId *, int),
void (*bc_cancel)(), int (*bc_time_to_exit)(void *),
int show_volumes, wb_eType wb_type);
};
#endif
\ No newline at end of file
......@@ -69,12 +69,18 @@ int main( int argc, char *argv[])
if ( !found) {
struct stat st;
strcpy( file, "$pwr_exe/wb_gtk");
strcpy( file, "$pwr_exe/wb_qt");
dcli_translate_filename( file, file);
if ( stat( file, &st) == 0)
strcpy( wmg, "gtk");
else
strcpy( wmg, "motif");
strcpy( wmg, "qt");
else {
strcpy( file, "$pwr_exe/wb_gtk");
dcli_translate_filename( file, file);
if ( stat( file, &st) == 0)
strcpy( wmg, "gtk");
else
strcpy( wmg, "motif");
}
}
strcpy( file, argv[0]);
......
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(pwr_exe)/wb_cmd_qt \
$(bld_dir)/wb_cmd_qt.o $(bld_dir)/wb_cmd_main.o \
$(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o $(pwr_obj)/wb_procom.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrwbqt) $(pwre_conf_libpwrxttqt) $(pwre_conf_libpwrwb) \
$(pwre_conf_libpwrxtt) $(pwre_conf_libpwrwbqt) $(pwre_conf_libpwrwb) \
$(pwre_conf_libqt) \
$(pwre_conf_libpwrrt) $(pwre_conf_libwb) $(pwre_conf_lib)
endif
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
/* wb_cmd_qt.c -- command file processing
The main program of pwrc. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include "pwr.h"
#include "pwr_class.h"
#include "co_dcli.h"
#include "ge.h"
#include "rt_load.h"
#include "wb_foe_msg.h"
#include "co_dcli.h"
#include "co_dcli_input.h"
#include "flow.h"
#include "flow_ctx.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "wb_utl.h"
#include "wb_lfu.h"
#include "cow_login.h"
#include "wb_wnav_qt.h"
#include "wb_wnav_item.h"
#include "wb_pal.h"
#include "wb_watt.h"
#include "wb_wnav_msg.h"
#include "wb_cmdc_qt.h"
#include "wb.h"
#include "wb_log_qt.h"
#include "cow_msgwindow.h"
#include <QApplication>
CmdQt::CmdQt(int argc, char *argv[])
{
QWidget *w;
pwr_tStatus sts;
// Attach to history log
new wb_log_qt(0);
cout << "wb_cmd_qt: Initializing qt widgets...\n";
wnav =
new WNavQt((void *) this, NULL, "", "", &w, ldhses, (wnav_sStartMenu *) 0,
wnav_eWindowType_No, &sts);
wnav->attach_volume_cb = attach_volume_cb;
wnav->detach_volume_cb = detach_volume_cb;
wnav->get_wbctx_cb = get_wbctx;
wnav->save_cb = save_cb;
wnav->revert_cb = revert_cb;
wnav->close_cb = close_cb;
parse(argc, argv);
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
new CmdQt(argc, argv);
return app.exec();
}
\ No newline at end of file
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
#ifndef wb_cmdc_qt_h
#define wb_cmdc_qt_h
#ifndef wb_cmdc_h
# include "wb_cmdc.h"
#endif
class CmdQt : public Cmd {
public:
CmdQt(int argc, char *argv[]);
};
#endif
\ No newline at end of file
......@@ -46,47 +46,59 @@
#include "wb_main.h"
#include "co_dcli.h"
int main( int argc, char *argv[])
int main(int argc, char *argv[])
{
int i;
int found = 0;
char wmg[80];
pwr_tFileName file;
if ( argc > 1) {
for ( i = 1; i < argc; i++) {
if ( strcmp( argv[i], "-f") == 0) {
if ( i+1 >= argc) {
// Wb::usage();
exit(0);
}
found = 1;
strcpy( wmg, argv[i+1]);
i++;
if (argc > 1) {
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-f") == 0) {
if (i + 1 >= argc) {
// Wb::usage();
exit(0);
}
found = 1;
strcpy(wmg, argv[i + 1]);
i++;
}
}
}
}
if ( !found) {
if (!found) {
struct stat st;
strcpy( file, "$pwr_exe/wb_cmd_gtk");
dcli_translate_filename( file, file);
if ( stat( file, &st) == 0)
strcpy( wmg, "gtk");
else {
strcpy( file, "$pwr_eexe/wb_cmd_gtk");
dcli_translate_filename( file, file);
if ( stat( file, &st) == 0)
strcpy( wmg, "gtk");
else
strcpy( wmg, "motif");
char *s;
if ((s = getenv( "pwre_conf_qt"))) {
strcpy(file, "$pwr_exe/wb_cmd_qt");
dcli_translate_filename(file, file);
if (stat(file, &st) != 0) {
strcpy(file, "$pwr_eexe/wb_cmd_qt");
dcli_translate_filename(file, file);
}
strcpy(wmg, "qt");
} else {
strcpy(file, "$pwr_exe/wb_cmd_gtk");
dcli_translate_filename(file, file);
if (stat(file, &st) == 0) {
strcpy(wmg, "gtk");
} else {
strcpy(file, "$pwr_eexe/wb_cmd_gtk");
dcli_translate_filename(file, file);
if (stat(file, &st) == 0) {
strcpy(wmg, "gtk");
} else {
strcpy(wmg, "motif");
}
}
}
}
strcpy( file, argv[0]);
strcat( file, "_");
strcat( file, wmg);
strcpy(file, argv[0]);
strcat(file, "_");
strcat(file, wmg);
execvp( file, argv);
}
execvp(file, argv);
}
\ No newline at end of file
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_bckw_qt.cpp -- Backupfile display window */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "co_lng.h"
#include "cow_xhelp.h"
#include "wb_ldh.h"
#include "wb_bckw_qt.h"
#include "wb_bckwnav_qt.h"
#include "cow_wow_qt.h"
#include <QMenuBar>
#include <QVBoxLayout>
WbBckWQt::WbBckWQt(void *bckw_parent_ctx, QWidget *bckw_parent_wid,
ldh_tSession bckw_ldhses, const char *bckw_name,
wb_bck_list *l_list, int l_editmode, pwr_tStatus *status)
: WbBckW(bckw_parent_ctx, bckw_ldhses, bckw_name, l_list, l_editmode,
status)
{
toplevel = new WbBckWQtWidget(this, bckw_parent_wid);
toplevel->setMinimumSize(1100, 600);
toplevel->setWindowTitle(fl(bckw_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
CoWowQt::SetWindowIcon(toplevel);
QMenuBar *menu_bar = new QMenuBar();
// File Entry
QMenu *file = menu_bar->addMenu(translate_utf8("&File"));
addMenuItem(toplevel, file, "&Open", SLOT(activate_open()));
addMenuItem(toplevel, file, "&Compare Backup File", SLOT(activate_diff()));
addMenuItem(toplevel, file, "C&ompare Database", SLOT(activate_diff_wb()));
addMenuItem(toplevel, file, "&Print", SLOT(activate_print()), "",
"document-print");
addMenuItem(toplevel, file, "&Transfer to database",
SLOT(activate_transfer_wb()));
addMenuItem(toplevel, file, "&Filter", SLOT(activate_filter()));
addMenuItem(toplevel, file, "&Close", SLOT(close()), "CTRL+W", "window-close");
// Edit menu
QMenu *edit = menu_bar->addMenu(translate_utf8("&Edit"));
addMenuItem(toplevel, edit, "&Check all", SLOT(activate_check_all()));
addMenuItem(toplevel, edit, "&Check clear", SLOT(activate_check_clear()));
// View menu
QMenu *view = menu_bar->addMenu(translate_utf8("&View"));
addMenuItem(toplevel, view, "Zoom &In", SLOT(activate_zoom_in()), "CTRL+I",
"zoom-in");
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-original");
// Help menu
QMenu *help = menu_bar->addMenu(translate_utf8("&Help"));
addMenuItem(toplevel, help, "&Help", SLOT(activate_help()), "CTRL+H",
"system-help");
QVBoxLayout *form = new QVBoxLayout(toplevel);
// Create bckwnav
bckwnav =
new WbBckWNavQt(this, toplevel, bckw_ldhses, l_list, l_editmode, &nav_widget);
form->setMenuBar(menu_bar);
add_expanding(form, nav_widget);
toplevel->setLayout(form);
toplevel->show();
wow = new CoWowQt(toplevel);
WbBckW::show();
if (list && list->type() != bck_eType_WbDiff) {
file_transfer_wb->setVisible(false);
edit_check_all->setVisible(false);
edit_check_clear->setVisible(false);
}
}
void WbBckWQt::print()
{
pwr_tStatus sts;
CoWowQt::CreateBrowPrintDialogQt(name, bckwnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, this, &sts);
}
void WbBckWQtWidget::focusInEvent(QFocusEvent *event)
{
if (!bck->focustimer.disabled()) {
bck->bckwnav->set_input_focus();
bck->focustimer.disable(400);
}
QWidget::focusInEvent(event);
}
void WbBckWQtWidget::closeEvent(QCloseEvent *event)
{
delete bck;
QWidget::closeEvent(event);
}
void WbBckWQt::set_title(char *title)
{
toplevel->setWindowTitle(QString::fromLatin1(title));
}
void WbBckWQtWidget::activate_zoom_in()
{
bck->bckwnav->zoom(1.2);
}
void WbBckWQtWidget::activate_zoom_out()
{
bck->bckwnav->zoom(5.0 / 6);
}
void WbBckWQtWidget::activate_zoom_reset()
{
bck->bckwnav->unzoom();
}
void WbBckWQtWidget::activate_help()
{
CoXHelp::dhelp("backup_refman", 0, navh_eHelpFile_Other,
"$pwr_lang/man_dg.dat", true);
}
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef wb_bckw_qt_h
#define wb_bckw_qt_h
/* wb_bckw_qt.h -- Backupfile display window */
#include "co_dcli.h"
#include "wb_ldh.h"
#ifndef wb_bckw_h
# include "wb_bckw.h"
#endif
#ifndef cow_wow_qt_h
# include "cow_wow_qt.h"
#endif
class WbBckWQtWidget;
class WbBckWQt : public WbBckW {
public:
WbBckWQt(void *l_parent_ctx, QWidget *l_parent_wid, ldh_tSession l_ldhses,
const char *l_name, wb_bck_list *l_list, int l_editmode,
pwr_tStatus *status);
QWidget *nav_widget;
QWidget *file_transfer_wb;
QWidget *edit_check_all;
QWidget *edit_check_clear;
CoWowFocusTimerQt focustimer;
CoWowFocusTimerQt maptimer;
void print();
void set_title(char *title);
private:
WbBckWQtWidget *toplevel;
};
class WbBckWQtWidget : public QWidget {
Q_OBJECT
public:
WbBckWQtWidget(WbBckWQt *parent_ctx, QWidget *parent)
: QWidget(parent, Qt::Window), bck(parent_ctx) {}
protected:
void focusInEvent(QFocusEvent *event);
void closeEvent(QCloseEvent *event);
public slots:
void activate_zoom_in();
void activate_zoom_out();
void activate_zoom_reset();
void activate_help();
private:
WbBckWQt *bck;
};
#endif
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_bckwnav_qt.cpp -- Backupfile display window */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_qt.h"
#include "wb_ldh.h"
#include "wb_bckwnav_qt.h"
#include "cow_qt_helpers.h"
WbBckWNavQt::WbBckWNavQt(void *l_parent_ctx, QWidget *l_parent_wid,
ldh_tSession l_ldhses, wb_bck_list *l_list,
int l_editmode, QWidget **w)
: WbBckWNav(l_parent_ctx, l_ldhses, l_list, l_editmode)
{
form_widget =
scrolledbrowwidgetqt_new(WbBckWNav::init_brow_cb, this, &brow_widget);
showNow(brow_widget);
// Create the root item
*w = form_widget;
}
WbBckWNavQt::~WbBckWNavQt()
{
delete brow;
form_widget->close();
}
void WbBckWNavQt::set_input_focus()
{
brow_widget->setFocus();
}
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef wb_bckwnav_qt_h
#define wb_bckwnav_qt_h
/* wb_bckwnav_qt.h -- Backup display window */
#ifndef wb_bckwnav_h
# include "wb_bckwnav.h"
#endif
class WbBckWNavQt : public WbBckWNav {
public:
WbBckWNavQt(void *bckw_parent_ctx, QWidget *bckw_parent_wid,
ldh_tSession bckw_ldhses, wb_bck_list *l_list, int l_editmode,
QWidget **w);
~WbBckWNavQt();
QWidget *brow_widget;
QWidget *form_widget;
void set_input_focus();
};
#endif
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_expw_qt.cpp -- Backupfile display window */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "co_lng.h"
#include "cow_xhelp.h"
#include "wb_ldh.h"
#include "wb_expw_qt.h"
#include "wb_expwnav_qt.h"
#include "cow_wow_qt.h"
#include "../../../../xtt/lib/cow/qt/cow_wow_qt.h"
#include <QMenuBar>
#include <QVBoxLayout>
WbExpWQt::WbExpWQt(void *expw_parent_ctx, QWidget *expw_parent_wid,
ldh_tSession expw_ldhses, const char *expw_name, int l_type,
int l_editmode, pwr_tStatus *status)
: WbExpW(expw_parent_ctx, expw_ldhses, expw_name, l_type, l_editmode,
status)
{
toplevel = new WbExpWQtWidget(this, expw_parent_wid);
toplevel->setMinimumSize(1100, 600);
toplevel->setWindowTitle(fl(expw_name));
toplevel->setAttribute(Qt::WA_DeleteOnClose);
CoWowQt::SetWindowIcon(toplevel);
QMenuBar *menu_bar = new QMenuBar();
// File Entry
QMenu *file = menu_bar->addMenu(translate_utf8("&File"));
addMenuItem(toplevel, file, btext, SLOT(activate_export()));
addMenuItem(toplevel, file, "&Close", SLOT(close()), "CTRL+W", "window-close");
// Edit menu
QMenu *edit = menu_bar->addMenu(translate_utf8("&Edit"));
addMenuItem(toplevel, edit, "&Update", SLOT(activate_update()), "CTRL+U");
addMenuItem(toplevel, edit, "&Check all", SLOT(activate_check_all()));
addMenuItem(toplevel, edit, "C&heck clear", SLOT(activate_check_clear()));
addMenuItem(toplevel, edit, "Check &reset", SLOT(activate_check_reset()));
addCheckableMenuItem(toplevel, edit, "&Show all", SLOT(activate_show_all(bool)),
"CTRL+A");
// View menu
QMenu *view = menu_bar->addMenu(translate_utf8("&View"));
addMenuItem(toplevel, view, "Zoom &In", SLOT(activate_zoom_in()), "CTRL+I",
"zoom-in");
addMenuItem(toplevel, view, "Zoom &Out", SLOT(activate_zoom_out()), "CTRL+O",
"zoom-out");
addMenuItem(toplevel, view, "Zoom &Reset", SLOT(activate_zoom_reset()), "",
"zoom-original");
// Help Entry
QMenu *help = menu_bar->addMenu(translate_utf8("&Help"));
addMenuItem(toplevel, help, "&Help", SLOT(activate_help()), "CTRL+H",
"system-help");
// Toolbar
QToolBar *tools = new QToolBar();
addToolItem(toplevel, tools, action, SLOT(activate_export()),
"$pwr_exe/wb_export.png");
addToolItem(toplevel, tools, "Update", SLOT(activate_update()),
"$pwr_exe/ge_update.png");
addToolItem(toplevel, tools, "Zoom in", SLOT(activate_zoom_in()),
"$pwr_exe/xtt_zoom_in.png");
addToolItem(toplevel, tools, "Zoom out", SLOT(activate_zoom_out()),
"$pwr_exe/xtt_zoom_out.png");
addToolItem(toplevel, tools, "Zoom reset", SLOT(activate_zoom_reset()),
"$pwr_exe/xtt_zoom_reset.png");
QVBoxLayout *form = new QVBoxLayout(toplevel);
// Create expwnav
expwnav =
new WbExpWNavQt(this, toplevel, expw_ldhses, l_type, l_editmode, &nav_widget);
form->setMenuBar(menu_bar);
form->addWidget(tools);
add_expanding(form, nav_widget);
toplevel->setLayout(form);
toplevel->show();
wow = new CoWowQt(toplevel);
WbExpW::show();
// expwnav->check_all();
}
void WbExpWQt::print()
{
pwr_tStatus sts;
CoWowQt::CreateBrowPrintDialogQt(name, expwnav->brow->ctx,
flow_eOrientation_Portrait, 1.0, this, &sts);
}
void WbExpWQtWidget::focusInEvent(QFocusEvent *event)
{
if (!exp->focustimer.disabled()) {
exp->expwnav->set_input_focus();
exp->focustimer.disable(400);
}
QWidget::focusInEvent(event);
}
void WbExpWQtWidget::closeEvent(QCloseEvent *event)
{
delete exp;
QWidget::closeEvent(event);
}
void WbExpWQt::set_title(char *title)
{
toplevel->setWindowTitle(QString::fromLatin1(title));
}
void WbExpWQtWidget::activate_show_all(bool set)
{
exp->expwnav->set_show_all(set);
}
void WbExpWQtWidget::activate_zoom_in()
{
exp->expwnav->zoom(1.2);
}
void WbExpWQtWidget::activate_zoom_out()
{
exp->expwnav->zoom(5.0 / 6);
}
void WbExpWQtWidget::activate_zoom_reset()
{
exp->expwnav->unzoom();
}
void WbExpWQtWidget::activate_help()
{
if (exp->type == expw_eType_Export || exp->type == expw_eType_Import) {
CoXHelp::dhelp("exportimport_refman", 0, navh_eHelpFile_Other,
"$pwr_lang/man_dg.dat", true);
} else if (exp->type == expw_eType_BuildDirectories) {
CoXHelp::dhelp("builddir_refman", 0, navh_eHelpFile_Other,
"$pwr_lang/man_dg.dat", true);
}
}
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef wb_expw_qt_h
#define wb_expw_qt_h
/* wb_expw_qt.h -- Backupfile display window */
#include "co_dcli.h"
#include "wb_ldh.h"
#ifndef wb_expw_h
# include "wb_expw.h"
#endif
#ifndef cow_wow_qt_h
# include "cow_wow_qt.h"
#endif
class WbExpWQtWidget;
class WbExpWQt : public WbExpW {
public:
WbExpWQt(void *l_parent_ctx, QWidget *l_parent_wid, ldh_tSession l_ldhses,
const char *l_name, int type, int l_editmode, pwr_tStatus *status);
QWidget *form;
QWidget *nav_widget;
QWidget *edit_check_all;
QWidget *edit_check_clear;
QWidget *edit_check_reset;
QWidget *edit_show_all;
QWidget *file_export;
CoWowFocusTimerQt focustimer;
CoWowFocusTimerQt maptimer;
void print();
void set_title(char *title);
private:
WbExpWQtWidget *toplevel;
};
class WbExpWQtWidget : public QWidget {
Q_OBJECT
public:
WbExpWQtWidget(WbExpWQt *parent_ctx, QWidget *parent)
: QWidget(parent, Qt::Window), exp(parent_ctx) {}
protected:
void focusInEvent(QFocusEvent *event);
void closeEvent(QCloseEvent *event);
public slots:
void activate_show_all(bool set);
void activate_zoom_in();
void activate_zoom_out();
void activate_zoom_reset();
void activate_help();
private:
WbExpWQt *exp;
};
#endif
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_expwnav_qt.cpp -- Backupfile display window */
#include "glow_std.h"
#include <stdio.h>
#include <stdlib.h>
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "flow.h"
#include "flow_browctx.h"
#include "flow_browapi.h"
#include "flow_browwidget_qt.h"
#include "wb_ldh.h"
#include "wb_expwnav_qt.h"
#include "cow_qt_helpers.h"
WbExpWNavQt::WbExpWNavQt(void *l_parent_ctx, QWidget *l_parent_wid,
ldh_tSession l_ldhses, int l_type, int l_editmode,
QWidget **w)
: WbExpWNav(l_parent_ctx, l_ldhses, l_type, l_editmode)
{
form_widget =
scrolledbrowwidgetqt_new(WbExpWNav::init_brow_cb, this, &brow_widget);
showNow(brow_widget);
// Create the root item
*w = form_widget;
}
WbExpWNavQt::~WbExpWNavQt()
{
delete brow;
form_widget->close();
}
void WbExpWNavQt::set_input_focus()
{
brow_widget->setFocus();
}
\ No newline at end of file
/**
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef wb_expwnav_qt_h
#define wb_expwnav_qt_h
/* wb_expwnav_qt.h -- Backup display window */
#ifndef wb_expwnav_h
# include "wb_expwnav.h"
#endif
class WbExpWNavQt : public WbExpWNav {
public:
WbExpWNavQt(void *expw_parent_ctx, QWidget *expw_parent_wid,
ldh_tSession expw_ldhses, int l_type, int l_editmode,
QWidget **w);
~WbExpWNavQt();
QWidget *brow_widget;
QWidget *form_widget;
void set_input_focus();
};
#endif
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
/* wb_gre_qt.cpp
This module creates the flow window and handles
the flow callbacks. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "pwr.h"
#include "pwr_baseclasses.h"
#include "flow_ctx.h"
#include "flow_api.h"
#include "flow_widget_qt.h"
#include "co_cdh.h"
#include "co_time.h"
#include "co_dcli.h"
#include "cow_wow_qt.h"
#include "wb_ldh.h"
#include "wb_foe_msg.h"
#include "wb_vldh_msg.h"
#include "wb_vldh.h"
#include "wb_foe.h"
#include "wb_goec.h"
#include "wb_goen.h"
#include "wb_utl_api.h"
#include "wb_gre_qt.h"
#include "wb_tra.h"
#include <QTimer>
WGreQt::WGreQt(void *wg_parent_ctx, QWidget *wg_parent_wid, const char *name)
: WGre(wg_parent_ctx, 0), trace_obj(0)
{
ctx_init();
form_widget = scrolledflowwidgetqt_new(init_flow, this, &flow_widget);
showNow(flow_widget);
popupmenu_mode = GRE_POPUPMENUMODE_OBJECT;
}
WGreQt::~WGreQt()
{
form_widget->close();
}
int WGreQt::new_navigator(QWidget *parent)
{
nav_widget = flownavwidgetqt_new(flow_widget);
return 1;
}
int WGreQt::new_navigator_popup()
{
return 1;
}
void WGreQtTraceObject::trace_scan()
{
if (wgre->trace_started) {
flow_TraceScan(wgre->flow_ctx);
trace_timerid = new QTimer(this);
trace_timerid->setSingleShot(true);
connect(trace_timerid, SIGNAL(timeout()), this, SLOT(trace_scan()));
trace_timerid->start(500);
}
}
void WGreQt::trace_start()
{
trace_started = 1;
trace_obj->trace_scan();
}
void WGreQt::trace_stop()
{
if (trace_started) {
trace_started = 0;
delete trace_obj;
}
}
void WGreQt::get_popup_position(int *x, int *y)
{
int wind_x, wind_y;
CoWowQt::PopupPosition(form_widget, *x, *y, &wind_x, &wind_y);
*x = wind_x;
*y = wind_y;
}
\ No newline at end of file
This diff is collapsed.
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2017 SSAB EMEA AB.
*
* This file is part of Proview.
*
* This program 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 2 of
* the License, or (at your option) any later version.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
**/
#ifndef wb_log_qt_h
#define wb_log_qt_h
#include "pwr.h"
#include "cow_log_qt.h"
#include "wb_log.h"
class wb_log_qt : public wb_log {
CoLogQt *m_log;
public:
wb_log_qt(QWidget *parent)
{
m_log = new CoLogQt(parent, wlog_cLogFile);
m_log->set_default();
}
};
#endif
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
-include ../../special.mk
-include ../special.mk
-include special.mk
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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