void matrixofpixels::HistogramPlotProperty(double Xmin, double Xmax, double Ymax) { changeitems(); setAxisAutoScale(this->xTop); setAxisAutoScale(this->xBottom); //setAxisFont(QwtPlot::xBottom,QFont("Helvetica",15,1)); QwtText xlabel("Value"); QwtText ylabel("Events"); QColor col(Qt::red); xlabel.setColor(col); ylabel.setColor(col); xlabel.setFont(QFont("Helvetica",15,1)); ylabel.setFont(QFont("Helvetica",15,1)); setAxisTitle(QwtPlot::xBottom,xlabel); setAxisTitle(QwtPlot::yLeft,ylabel); setCanvasBackground(QColor(Qt::white)); setAxisScale(QwtPlot::xBottom, Xmin, Xmax); setAxisMaxMinor(QwtPlot::xBottom, 0); setAxisScale(QwtPlot::yLeft, 0, Ymax); setAxisMaxMinor(QwtPlot::yLeft, 0); plotLayout()->setAlignCanvasToScales(true); his->attach(this); /*QwtPlotGrid **/grid = new QwtPlotGrid; grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine)); grid->attach(this); replot(); }
void matrixofpixels::PixPlotSpect(int TypeOfSpec,QwtMatrixRasterData *rasterpixdata) { changeitems(); MapPlot->setData(rasterpixdata); MapPlot->setRenderThreadCount(0); setAxisAutoScale(this->xTop); setAxisAutoScale(this->xBottom); switch (TypeOfSpec) { case 1: MapPlot->setColorMap(new ColorMap(BLUERED)); break; case 2: MapPlot->setColorMap(new ColorMap(BLACKWHITE)); break; default: MapPlot->setColorMap(new ColorMap(BLUERED)); } MapPlot->attach(/*MainPlot*/this); const QwtInterval zInterval = MapPlot->data()->interval(Qt::ZAxis); setAxisScale(QwtPlot::xBottom, 0, Npix); setAxisMaxMinor(QwtPlot::xBottom, 0); setAxisScale(QwtPlot::yLeft, 0, Npix); setAxisMaxMinor(QwtPlot::yLeft, 0); //rightAxis = new QwtScaleWidget(); QwtScaleWidget *rightAxis = axisWidget(QwtPlot::yRight); //rightAxis = axisWidget(QwtPlot::yRight); rightAxis->setColorBarEnabled(true); rightAxis->setColorBarWidth(20); rightAxis->setColorMap(zInterval, new ColorMap(TypeOfSpec) ); //ColorMap(TypeOfSpec); plotLayout()->setAlignCanvasToScales(true); setAxisScale(QwtPlot::yRight,zInterval.minValue(),zInterval.maxValue()); enableAxis(QwtPlot::yRight); replot(); setAutoFillBackground(true); /** setAutoFillBackground(true); - autozapolnenie, ctobi isklyuchit' nalozjeniya graphikov */ }
int netcmd(const char *cmd, char *args) { if (prefix(cmd, "proto")) { if (*args == '\0') { move(CMDLINE, 0); clrtoeol(); addstr("which proto?"); } else if (!selectproto(args)) { error("%s: Unknown protocol.", args); } return (1); } if (prefix(cmd, "ignore") || prefix(cmd, "display")) { changeitems(args, prefix(cmd, "display")); return (1); } if (prefix(cmd, "reset")) { selectproto(0); selecthost(0, 0); selectport(-1, 0); return (1); } if (prefix(cmd, "show")) { move(CMDLINE, 0); clrtoeol(); if (*args == '\0') { showprotos(); showhosts(); showports(); return (1); } if (prefix(args, "protos")) showprotos(); else if (prefix(args, "hosts")) showhosts(); else if (prefix(args, "ports")) showports(); else addstr("show what?"); return (1); } return (0); }