Ejemplo n.º 1
0
Frame::Frame(QWidget *parent) : QFrame(parent) {
    this->resize(Config::FrameWidth, Config::FrameHeight);
    this->setMinimumSize(Config::FrameWidth, Config::FrameHeight);
    this->setMaximumSize(Config::FrameWidth, Config::FrameHeight);
    this->setWindowFlags(Qt::FramelessWindowHint);
    this->setStyleSheet(Config::FrameStyleSheet);

    _titlebar = new TitleBar(this);
    _toolbar = new ToolBar(this);
    _panel = new PanelWin(this);
    _statebar = new StateBar(this);

    _layout = new QVBoxLayout(this);
    _layout->setSpacing(0);
    _layout->setMargin(0);
    _layout->addWidget(_titlebar);
    _layout->addWidget(_toolbar);
    _layout->addWidget(_panel);
    _layout->addWidget(_statebar);


    connect(_titlebar->_btnMin, SIGNAL(clicked()), this, SLOT(minwin()));
    connect(_titlebar->_btnClose, SIGNAL(clicked()), this, SLOT(closewin()));

    connect(_toolbar->_btnKey, SIGNAL(clicked()), _panel, SLOT(selectKey()));
    connect(_toolbar->_btnCust, SIGNAL(clicked()), _panel, SLOT(selectCust()));


    connect(_panel->_btnExtractStart, SIGNAL(clicked()), this, SLOT(extractStart()));
    connect(_panel->_btnExtractCancel, SIGNAL(clicked()), this, SLOT(extractCancel()));


    connect(_panel->_btnSearchBrowse, SIGNAL(clicked()), this, SLOT(openFolder()));
    connect(_panel->_btnSearchStart, SIGNAL(clicked()), this, SLOT(searchStart()));
    connect(_panel->_btnSearchCancel, SIGNAL(clicked()), this, SLOT(searchCancel()));
    connect(_panel->_btnClearLogs, SIGNAL(clicked()), this, SLOT(clearLogs()));

    connect(_panel->_btnBackupBrowse, SIGNAL(clicked()), this, SLOT(openFolder()));
    connect(_panel->_btnBackupStart, SIGNAL(clicked()), this, SLOT(backupStart()));
    connect(_panel->_btnBackupCancel, SIGNAL(clicked()), this, SLOT(backupCancel()));


    _panel->_btnSearchCancel->setEnabled(false);
    _panel->_btnBackupCancel->setEnabled(false);
    _panel->_btnClearLogs->setEnabled(false);

  }
Ejemplo n.º 2
0
void initLog(){
	clearLogs();

	numBytesWritten = 0;

	time_t rawtime;
	struct tm * timeinfo;
	char buffer [80];

	time (&rawtime);
	timeinfo = localtime (&rawtime);

	strftime (buffer,80,"/mytmp/ABRS-%F-hr-%I-min-%M.log",timeinfo);

	logFileName.clear();
	logFileName.append(buffer);
}
Ejemplo n.º 3
0
void LogWindow::onClearLog(wxCommandEvent &e)
{
	clearLogs();
}
Ejemplo n.º 4
0
void CLogger::flush(bool dumpLogs)
{
	CEvent event(this, boost::assign::map_list_of("dumpLogs", (void*)&dumpLogs));
	onFlush(event);
	clearLogs();
}
Ejemplo n.º 5
0
/**
 * Private Constructor.
 */
QLogWindow::QLogWindow(QWidget *p) : QWidget(p)
{
	setupUi((QWidget*)this);
	QObject::connect(hideButton, SIGNAL(clicked()), this, SLOT(hideWindow()));
	QObject::connect(clearLogsButton, SIGNAL(clicked()), this, SLOT(clearLogs()));
}
int main(int argc, char const *argv[])
{
	int rc = -1;
	int x=0;
	ManagedDevice client;


	char *configFilePath = "./device.cfg";

	rc = initialize_configfile(&deviceClient, configFilePath);
	if(rc != SUCCESS){
		printf("initialize failed and returned rc = %d.\n Quitting..", rc);
		scanf("%d",&x);
		return 0;
	}

	rc = connectiotf_dm(&client);
	if(rc != SUCCESS){
		printf("Connection; failed and returned rc = %d.\n Quitting..", rc);
		scanf("%d",&x);
		return 0;
	}

	setCommandHandler_dm(&client, myCallback);
	setManagedHandler_dm(&client,managedCallBack );
	subscribeCommands_dm(&client);
	populateMgmtConfig(&client);
	int exit = 0;
	char reqId[40];
	while (!exit){
		printOptions();
		int val;
		scanf("%d",&val);
		switch (val) {
			case 1:
				printf("\n publish manage ..\n");
				publishManageEvent(&client,4000,1,1, reqId);
				printf("\n Manage Event Exited: %s",reqId);
				break;
			case 2:
				printf("\n publish unmanaged..\n");
				publishUnManageEvent(&client, reqId);
				printf("\nunmanaged Request Exit : %s",reqId);
				break;
			case 3:
				printf("\n publish addErrorCode ..\n");
				addErrorCode(&client, 121 , reqId);
				printf("\n addErrorCode Request Exit : %s",reqId);
				break;
			case 4:
				printf("\n publish clearErrorCodes ..\n");
				clearErrorCodes(&client,  reqId);
				printf("\n clearErrorCodes Request Exit :");// %s",reqId);
				break;
			case 5:
				printf("\n publish addLog ..\n");
				addLog(&client, "test","",1, reqId);
				printf("\n addLog Request Exit : %s",reqId);
				break;
			case 6:
				printf("\n publish clearLogs ..\n");
				clearLogs(&client,reqId);
				printf("\n clearLogs Request Exit : %s",reqId);
				break;
			case 7:
				printf("\n publish updateLocation ..\n");
				time_t t = time(NULL);
				char updatedDateTime[50];//"2016-03-01T07:07:56.323Z"
				strftime(updatedDateTime, sizeof(updatedDateTime), "%Y-%m-%dT%TZ", localtime(&t));
				updateLocation(&client, 77.5667,12.9667, 0,updatedDateTime, 0, reqId) ;
				printf("updateLocation Request Exit : %s",reqId);
				break;
			case 8:
				printf("\n publish Event To WIoTP ..\n");
				publishEventToIot(&client);
				break;
			default:
				disconnect_dm(&client);
				printf("\n Quitting!!\n");
				exit = 1;
				break;
		}
	}

	return 0;
}