void addTemplate(int num, siginfo_t* info, void *other ) { /* ------------------------- */ char* templateId = NULL; long longRet = 0; /* ------------------------- */ asprintf(&templateId, "%d", (info->si_value).sival_int); PRINT_INFO("AWIZOJMSSERVERINF ADD NEW TEMPLATE TO CACHE\n"); PRINT_INFO("TEMPLATE ID : %d.\n", (info->si_value).sival_int ); /* ********************************************************* */ /* Odczyt szablonu z bazy i dodanie go do pamięci cache. */ /* ********************************************************* */ longRet = getDataFromDB( templateId, _GLOBAL_awizoConfig.dbase_handler, NULL ); if (longRet != BMD_OK){ PRINT_ERROR("Błędy w trakcie operacji zarządzania pamięcią cache. Error = %d\n", BMD_ERR_OP_FAILED); } sem_post(&(_GLOBAL_shptr->clientMutex)); free0(templateId); }
void PlotDialog::setupPlot() { QVector<double> x, y; getDataFromDB(y); y.insert(0, 0); for (int i = 0; i < y.size(); i++) { x.push_back(i); } //ui->customPlot->plotLayout()->insertRow(0); //ui->customPlot->plotLayout()->addElement(0, 0, new QCPPlotTitle(ui->customPlot, "Sensening Data Co2(ppm)")); ui->customPlot->addGraph(); ui->customPlot->graph()->setLineStyle(QCPGraph::lsLine); QPen pen; pen.setColor(QColor(255, 200, 20, 200)); pen.setStyle(Qt::DashLine); pen.setWidthF(2.5); ui->customPlot->graph()->setPen(pen); ui->customPlot->graph()->setBrush(QBrush(QColor(255,200,20,70))); ui->customPlot->graph(0)->setData(x,y); switch (dataType) { case CO2_TYPE: ui->customPlot->yAxis->setLabel("Sensening data Co2(ppm)"); ui->customPlot->yAxis->setRange(0, 1000); break; case TMP_TYPE: ui->customPlot->yAxis->setLabel("c"); ui->customPlot->yAxis->setRange(0, 50); break; case HUM_TYPE: ui->customPlot->yAxis->setLabel("%"); ui->customPlot->yAxis->setRange(0, 100); break; case ILL_TYPE: ui->customPlot->yAxis->setLabel("KLux"); ui->customPlot->yAxis->setRange(0, 100); break; } ui->customPlot->xAxis->setTicks(false); ui->customPlot->xAxis->setTickLabels(false); ui->customPlot->xAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); ui->customPlot->yAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); qDebug() << "y.size" << y.size(); ui->customPlot->xAxis->setRange(0, y.size()); ui->customPlot->xAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); ui->customPlot->yAxis->setUpperEnding(QCPLineEnding::esSpikeArrow); ui->customPlot->replot(); }