|
|
#include "wfpage.h"
|
|
|
#include <stdio.h>
|
|
|
|
|
|
WFPage::WFPage(QWidget *parent) :
|
|
|
QMainWindow(parent)
|
|
|
{
|
|
|
|
|
|
pageTitle = "default";
|
|
|
wfPlot_v = new WFPlot(this, WFDISPLAY_XMAX, WFDISPLAY_YMAX);
|
|
|
wfPlot_e1 = new WFPlot(this, WFDISPLAY_XMAX, WFDISPLAY_YMAX);
|
|
|
wfPlot_e2 = new WFPlot(this, WFDISPLAY_XMAX, WFDISPLAY_YMAX);
|
|
|
wfPlot_b1 = new WFPlot(this, WFDISPLAY_XMAX, WFDISPLAY_YMAX);
|
|
|
wfPlot_b2 = new WFPlot(this, WFDISPLAY_XMAX, WFDISPLAY_YMAX);
|
|
|
wfPlot_b3 = new WFPlot(this, WFDISPLAY_XMAX, WFDISPLAY_YMAX);
|
|
|
//
|
|
|
wfPlot_v->customPlot->setTitle("v");
|
|
|
wfPlot_e1->customPlot->setTitle("e1");
|
|
|
wfPlot_e2->customPlot->setTitle("e2");
|
|
|
wfPlot_b1->customPlot->setTitle("b1");
|
|
|
wfPlot_b2->customPlot->setTitle("b2");
|
|
|
wfPlot_b3->customPlot->setTitle("b3");
|
|
|
//
|
|
|
/*mainLayout = new QGridLayout;
|
|
|
mainLayout->addWidget(wfPlot_v, 0, 0, 1, 1);
|
|
|
mainLayout->addWidget(wfPlot_e1, 0, 1, 1, 1);
|
|
|
mainLayout->addWidget(wfPlot_e2, 0, 2, 1, 1);
|
|
|
mainLayout->addWidget(wfPlot_b1, 1, 0, 1, 1);
|
|
|
mainLayout->addWidget(wfPlot_b2, 1, 1, 1, 1);
|
|
|
mainLayout->addWidget(wfPlot_b3, 1, 2, 1, 1);*/
|
|
|
//
|
|
|
dockV = NULL;
|
|
|
dockE1 = NULL;
|
|
|
dockE2 = NULL;
|
|
|
dockB1 = NULL;
|
|
|
dockB2 = NULL;
|
|
|
dockB3 = NULL;
|
|
|
|
|
|
titleWidgetV = new QWidget();
|
|
|
titleWidgetE1 = new QWidget();
|
|
|
titleWidgetE2 = new QWidget();
|
|
|
titleWidgetB1 = new QWidget();
|
|
|
titleWidgetB2 = new QWidget();
|
|
|
titleWidgetB3 = new QWidget();
|
|
|
|
|
|
logFileName = new QLabel();
|
|
|
logFile = new QFile();
|
|
|
|
|
|
logFileEn = false;
|
|
|
storageEnabled = false;
|
|
|
allowDataStorage = false;
|
|
|
|
|
|
indexOffset = 0;
|
|
|
|
|
|
createToolBar();
|
|
|
readSettings();
|
|
|
}
|
|
|
|
|
|
void WFPage::displayOnPlot(short *data, unsigned char num)
|
|
|
{
|
|
|
fillDataBuffer( data, num );
|
|
|
|
|
|
switch(num){
|
|
|
case 0:
|
|
|
wfPlot_v->displayOnPlot(data, DEFAULT_SIZE);
|
|
|
break;
|
|
|
|
|
|
case 1:
|
|
|
wfPlot_e1->displayOnPlot(data, DEFAULT_SIZE);
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
wfPlot_e2->displayOnPlot(data, DEFAULT_SIZE);
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
wfPlot_b1->displayOnPlot(data, DEFAULT_SIZE);
|
|
|
break;
|
|
|
|
|
|
case 4:
|
|
|
wfPlot_b2->displayOnPlot(data, DEFAULT_SIZE);
|
|
|
break;
|
|
|
|
|
|
case 5:
|
|
|
wfPlot_b3->displayOnPlot(data, DEFAULT_SIZE);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::initDataBuffer()
|
|
|
{
|
|
|
for (unsigned int i = 0; i < DEFAULT_SIZE; i++)
|
|
|
{
|
|
|
dataBuffer[i].clear();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::fillDataBuffer(short *data, unsigned char num)
|
|
|
{
|
|
|
if ( (storageEnabled == true) | (allowDataStorage==true) ) // store data in buffers
|
|
|
{
|
|
|
switch(num) {
|
|
|
|
|
|
case 0 :
|
|
|
initDataBuffer();
|
|
|
for (unsigned int i=0; i<DEFAULT_SIZE; i++)
|
|
|
{
|
|
|
dataBuffer[i].append(QByteArray::number(data[i]));
|
|
|
dataBuffer[i].append(' ');
|
|
|
}
|
|
|
allowDataStorage = true;
|
|
|
break;
|
|
|
|
|
|
case 1 :
|
|
|
case 2 :
|
|
|
case 3 :
|
|
|
case 4 :
|
|
|
if (allowDataStorage==true) {
|
|
|
for (unsigned int i=0; i<DEFAULT_SIZE; i++)
|
|
|
{
|
|
|
dataBuffer[i].append(QByteArray::number(data[i]));
|
|
|
dataBuffer[i].append(' ');
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
case 5 :
|
|
|
if (allowDataStorage==true) {
|
|
|
for (unsigned int i=0; i<DEFAULT_SIZE; i++)
|
|
|
{
|
|
|
dataBuffer[i].append(QByteArray::number(data[i]));
|
|
|
dataBuffer[i].append(' ');
|
|
|
}
|
|
|
storeDataBuffer();
|
|
|
allowDataStorage = false;
|
|
|
}
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::storeDataBuffer()
|
|
|
{
|
|
|
for (int i = 0; i < DEFAULT_SIZE; i++ )
|
|
|
{
|
|
|
*(this->logFileStrm) << (i + indexOffset) << " " << dataBuffer[i] << endl;
|
|
|
}
|
|
|
indexOffset = indexOffset + DEFAULT_SIZE;
|
|
|
if (storageEnabled == false){
|
|
|
this->logFileStrm->flush();
|
|
|
this->logFile->waitForBytesWritten(3000);
|
|
|
this->logFile->close();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::createToolBar()
|
|
|
{
|
|
|
radio_v = new QRadioButton(tr("v"));
|
|
|
radio_e1 = new QRadioButton(tr("e1"));
|
|
|
radio_e2 = new QRadioButton(tr("e2"));
|
|
|
radio_b1 = new QRadioButton(tr("b1"));
|
|
|
radio_b2 = new QRadioButton(tr("b2"));
|
|
|
radio_b3 = new QRadioButton(tr("b3"));
|
|
|
radio_tabify = new QRadioButton(tr("tabify"));
|
|
|
|
|
|
radio_v->setAutoExclusive(false);
|
|
|
radio_e1->setAutoExclusive(false);
|
|
|
radio_e2->setAutoExclusive(false);
|
|
|
radio_b1->setAutoExclusive(false);
|
|
|
radio_b2->setAutoExclusive(false);
|
|
|
radio_b3->setAutoExclusive(false);
|
|
|
radio_tabify->setAutoExclusive(false);
|
|
|
|
|
|
button_selectAll = new QPushButton(tr("select all"));
|
|
|
button_storeWfrm = new QPushButton(tr("REC"));
|
|
|
button_chooseDir = new QPushButton(tr("choose dir"));
|
|
|
|
|
|
myToolBar = new QToolBar("select");
|
|
|
|
|
|
myToolBar->addWidget(radio_v);
|
|
|
myToolBar->addWidget(radio_e1);
|
|
|
myToolBar->addWidget(radio_e2);
|
|
|
myToolBar->addWidget(radio_b1);
|
|
|
myToolBar->addWidget(radio_b2);
|
|
|
myToolBar->addWidget(radio_b3);
|
|
|
myToolBar->addSeparator();
|
|
|
myToolBar->addWidget(button_selectAll);
|
|
|
myToolBar->addWidget(radio_tabify);
|
|
|
myToolBar->addSeparator();
|
|
|
myToolBar->addWidget(button_storeWfrm);
|
|
|
myToolBar->addWidget(button_chooseDir);
|
|
|
|
|
|
addToolBar(Qt::LeftToolBarArea, myToolBar);
|
|
|
|
|
|
radio_tabify->setChecked(true);
|
|
|
|
|
|
connect(this->radio_v, SIGNAL(clicked(bool)), this, SLOT(actionRadioV(bool)));
|
|
|
connect(this->radio_e1, SIGNAL(clicked(bool)), this, SLOT(actionRadioE1(bool)));
|
|
|
connect(this->radio_e2, SIGNAL(clicked(bool)), this, SLOT(actionRadioE2(bool)));
|
|
|
connect(this->radio_b1, SIGNAL(clicked(bool)), this, SLOT(actionRadioB1(bool)));
|
|
|
connect(this->radio_b2, SIGNAL(clicked(bool)), this, SLOT(actionRadioB2(bool)));
|
|
|
connect(this->radio_b3, SIGNAL(clicked(bool)), this, SLOT(actionRadioB3(bool)));
|
|
|
connect(this->button_selectAll, SIGNAL(clicked()), this, SLOT(selectAll()));
|
|
|
connect(this->radio_tabify, SIGNAL(clicked(bool)), this, SLOT(organizeDocks()));
|
|
|
connect(this->button_storeWfrm, SIGNAL(clicked()), this, SLOT(storeWfrm()));
|
|
|
connect(this->button_chooseDir, SIGNAL(clicked()), this, SLOT(chooseDir()));
|
|
|
}
|
|
|
|
|
|
void WFPage::actionRadioV(bool state)
|
|
|
{
|
|
|
if (state == true)
|
|
|
{
|
|
|
if (dockV == NULL)
|
|
|
{
|
|
|
dockV = new QDockWidget("V", this);
|
|
|
dockV->setWidget(wfPlot_v);
|
|
|
dockV->setTitleBarWidget(titleWidgetV);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this->removeDockWidget(dockV);
|
|
|
}
|
|
|
organizeDocks();
|
|
|
}
|
|
|
|
|
|
void WFPage::actionRadioE1(bool state)
|
|
|
{
|
|
|
if (state == true)
|
|
|
{
|
|
|
if (dockE1 == NULL)
|
|
|
{
|
|
|
dockE1 = new QDockWidget("E1", this);
|
|
|
dockE1->setWidget(wfPlot_e1);
|
|
|
dockE1->setTitleBarWidget(titleWidgetE1);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this->removeDockWidget(dockE1);
|
|
|
}
|
|
|
organizeDocks();
|
|
|
}
|
|
|
|
|
|
void WFPage::actionRadioE2(bool state)
|
|
|
{
|
|
|
if (state == true)
|
|
|
{
|
|
|
if (dockE2 == NULL)
|
|
|
{
|
|
|
dockE2 = new QDockWidget("E2", this);
|
|
|
dockE2->setWidget(wfPlot_e2);
|
|
|
dockE2->setTitleBarWidget(titleWidgetE2);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this->removeDockWidget(dockE2);
|
|
|
}
|
|
|
organizeDocks();
|
|
|
}
|
|
|
|
|
|
void WFPage::actionRadioB1(bool state)
|
|
|
{
|
|
|
if (state == true)
|
|
|
{
|
|
|
if (dockB1 == NULL)
|
|
|
{
|
|
|
dockB1 = new QDockWidget("B1", this);
|
|
|
dockB1->setWidget(wfPlot_b1);
|
|
|
dockB1->setTitleBarWidget(titleWidgetB1);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this->removeDockWidget(dockB1);
|
|
|
}
|
|
|
organizeDocks();
|
|
|
}
|
|
|
|
|
|
void WFPage::actionRadioB2(bool state)
|
|
|
{
|
|
|
if (state == true)
|
|
|
{
|
|
|
if (dockB2 == NULL)
|
|
|
{
|
|
|
dockB2 = new QDockWidget("B2", this);
|
|
|
dockB2->setWidget(wfPlot_b2);
|
|
|
dockB2->setTitleBarWidget(titleWidgetB2);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this->removeDockWidget(dockB2);
|
|
|
}
|
|
|
organizeDocks();
|
|
|
}
|
|
|
|
|
|
void WFPage::actionRadioB3(bool state)
|
|
|
{
|
|
|
if (state == true)
|
|
|
{
|
|
|
if (dockB3 == NULL)
|
|
|
{
|
|
|
dockB3 = new QDockWidget("B3", this);
|
|
|
dockB3->setWidget(wfPlot_b3);
|
|
|
dockB3->setTitleBarWidget(titleWidgetB3);
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
this->removeDockWidget(dockB3);
|
|
|
}
|
|
|
organizeDocks();
|
|
|
}
|
|
|
|
|
|
void WFPage::buildDockList()
|
|
|
{
|
|
|
dockList.clear();
|
|
|
|
|
|
if (radio_v->isChecked())
|
|
|
{
|
|
|
dockList.append(dockV);
|
|
|
removeDockWidget(dockV);
|
|
|
}
|
|
|
if (radio_e1->isChecked())
|
|
|
{
|
|
|
dockList.append(dockE1);
|
|
|
removeDockWidget(dockE1);
|
|
|
}
|
|
|
if (radio_e2->isChecked())
|
|
|
{
|
|
|
dockList.append(dockE2);
|
|
|
removeDockWidget(dockE2);
|
|
|
}
|
|
|
if (radio_b1->isChecked())
|
|
|
{
|
|
|
dockList.append(dockB1);
|
|
|
removeDockWidget(dockB1);
|
|
|
}
|
|
|
if (radio_b2->isChecked())
|
|
|
{
|
|
|
dockList.append(dockB2);
|
|
|
removeDockWidget(dockB2);
|
|
|
}
|
|
|
if (radio_b3->isChecked())
|
|
|
{
|
|
|
dockList.append(dockB3);
|
|
|
removeDockWidget(dockB3);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::organizeDocks()
|
|
|
{
|
|
|
if (radio_tabify->isChecked())
|
|
|
{
|
|
|
tabify();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
unTabify();
|
|
|
}
|
|
|
wfPlot_v->resize(wfPlot_v->minimumSizeHint());
|
|
|
wfPlot_e1->resize(wfPlot_e1->minimumSizeHint());
|
|
|
wfPlot_e2->resize(wfPlot_e2->minimumSizeHint());
|
|
|
wfPlot_b1->resize(wfPlot_b1->minimumSizeHint());
|
|
|
wfPlot_b2->resize(wfPlot_b2->minimumSizeHint());
|
|
|
wfPlot_b3->resize(wfPlot_b3->minimumSizeHint());
|
|
|
this->resize(this->minimumSizeHint());
|
|
|
}
|
|
|
|
|
|
void WFPage::unTabify()
|
|
|
{
|
|
|
buildDockList();
|
|
|
|
|
|
switch(dockList.size())
|
|
|
{
|
|
|
case 0:
|
|
|
break;
|
|
|
case 1:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
dockList.at(0)->show();
|
|
|
break;
|
|
|
case 2:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(1));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
break;
|
|
|
case 3:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(1));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(2));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
break;
|
|
|
case 4:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(1));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(2));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(3));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
dockList.at(3)->show();
|
|
|
break;
|
|
|
case 5:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(1));
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(2));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(3));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(4));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
dockList.at(3)->show();
|
|
|
dockList.at(4)->show();
|
|
|
break;
|
|
|
case 6:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(1));
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(2));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(3));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(4));
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(5));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
dockList.at(3)->show();
|
|
|
dockList.at(4)->show();
|
|
|
dockList.at(5)->show();
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::tabify()
|
|
|
{
|
|
|
buildDockList();
|
|
|
|
|
|
switch(dockList.size())
|
|
|
{
|
|
|
case 0:
|
|
|
break;
|
|
|
case 1:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
dockList.at(0)->show();
|
|
|
break;
|
|
|
case 2:
|
|
|
addDockWidget(Qt::TopDockWidgetArea, dockList.at(0));
|
|
|
tabifyDockWidget(dockList.at(0), dockList.at(1));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
break;
|
|
|
case 3:
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(0));
|
|
|
tabifyDockWidget(dockList.at(0), dockList.at(1));
|
|
|
tabifyDockWidget(dockList.at(1), dockList.at(2));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
break;
|
|
|
case 4:
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(0));
|
|
|
tabifyDockWidget(dockList.at(0), dockList.at(1));
|
|
|
tabifyDockWidget(dockList.at(1), dockList.at(2));
|
|
|
tabifyDockWidget(dockList.at(2), dockList.at(3));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
dockList.at(3)->show();
|
|
|
break;
|
|
|
case 5:
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(0));
|
|
|
tabifyDockWidget(dockList.at(0), dockList.at(1));
|
|
|
tabifyDockWidget(dockList.at(1), dockList.at(2));
|
|
|
tabifyDockWidget(dockList.at(2), dockList.at(3));
|
|
|
tabifyDockWidget(dockList.at(3), dockList.at(4));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
dockList.at(3)->show();
|
|
|
dockList.at(4)->show();
|
|
|
break;
|
|
|
case 6:
|
|
|
addDockWidget(Qt::BottomDockWidgetArea, dockList.at(0));
|
|
|
tabifyDockWidget(dockList.at(0), dockList.at(1));
|
|
|
tabifyDockWidget(dockList.at(1), dockList.at(2));
|
|
|
tabifyDockWidget(dockList.at(2), dockList.at(3));
|
|
|
tabifyDockWidget(dockList.at(3), dockList.at(4));
|
|
|
tabifyDockWidget(dockList.at(4), dockList.at(5));
|
|
|
dockList.at(0)->show();
|
|
|
dockList.at(1)->show();
|
|
|
dockList.at(2)->show();
|
|
|
dockList.at(3)->show();
|
|
|
dockList.at(4)->show();
|
|
|
dockList.at(5)->show();
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::selectAll()
|
|
|
{
|
|
|
radio_v->click();
|
|
|
radio_e1->click();
|
|
|
radio_e2->click();
|
|
|
radio_b1->click();
|
|
|
radio_b2->click();
|
|
|
radio_b3->click();
|
|
|
}
|
|
|
|
|
|
void WFPage::storeWfrm()
|
|
|
{
|
|
|
if (logFileEn == false)
|
|
|
{
|
|
|
buildFileName();
|
|
|
indexOffset = 0;
|
|
|
button_storeWfrm->setText(tr("STOP"));
|
|
|
logFileEn = true;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
// disable storage
|
|
|
storageEnabled = false;
|
|
|
button_storeWfrm->setText(tr("REC"));
|
|
|
logFileEn = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::buildFileName()
|
|
|
{
|
|
|
QTime time;
|
|
|
QDate date;
|
|
|
QString dateTime;
|
|
|
QString prefix;
|
|
|
|
|
|
date = QDate::currentDate();
|
|
|
time = QTime::currentTime();
|
|
|
|
|
|
dateTime = QString::number( date.year() ) + "_"
|
|
|
+ QString::number( date.month() ) + "_"
|
|
|
+ QString::number( date.day() ) + "-"
|
|
|
+ QString::number( time.hour() ) + "_"
|
|
|
+ QString::number( time.minute() ) + "_"
|
|
|
+ QString::number( time.second() );
|
|
|
|
|
|
prefix = defaultStorageDirectory + "/" + dateTime + "_" + pageTitle ;
|
|
|
|
|
|
if(this->logFile->isOpen()) this->logFile->close();
|
|
|
this->logFile->setFileName( prefix + ".data");
|
|
|
if(this->logFile->open(QIODevice::WriteOnly)) this->logFileStrm = new QTextStream(this->logFile);
|
|
|
|
|
|
*(this->logFileStrm) << "time V E1 E2 B1 B2 B3 " << endl;
|
|
|
|
|
|
storageEnabled = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
void WFPage::logFileEnDisable(bool state)
|
|
|
{
|
|
|
if(state==true)
|
|
|
{
|
|
|
this->logFileEn = true;
|
|
|
}
|
|
|
else if(state==false)
|
|
|
{
|
|
|
this->logFileEn = false;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
void WFPage::closeEvent(QCloseEvent *event)
|
|
|
{
|
|
|
writeSettings();
|
|
|
event->accept();
|
|
|
}
|
|
|
|
|
|
void WFPage::readSettings()
|
|
|
{
|
|
|
QSettings settings("lpp", "lfrsgse");
|
|
|
defaultStorageDirectory = settings.value("defaultStorageDirectory", QDir::homePath()).toString();
|
|
|
}
|
|
|
|
|
|
void WFPage::writeSettings()
|
|
|
{
|
|
|
QSettings settings("lpp", "lfrsgse");
|
|
|
settings.setValue("defaultStorageDirectory", defaultStorageDirectory);
|
|
|
}
|
|
|
|
|
|
void WFPage::chooseDir()
|
|
|
{
|
|
|
defaultStorageDirectory = QFileDialog::getExistingDirectory(this,
|
|
|
"choose the directory",
|
|
|
QDir::homePath(),
|
|
|
QFileDialog::ShowDirsOnly);
|
|
|
}
|
|
|
|