ZobristHash::ZobristHash(int rows, int cols, int statesPerSquare) { setRows(rows); setCols(cols); setStatesPerSquare(statesPerSquare); initTable(); }
void core::DotMatrix::init(int dotSize, int rows, int cols, DataFormat dt) { this->size = dotSize; //QActions continuousDrawingAction = new QAction(ICON_FREEHAND, "Dibujo continuo", this); clearAction = new QAction(ICON_CLEAR, "Limpiar", this); fillAction = new QAction(ICON_FILL, "Llenar", this); eraserAction = new QAction(ICON_ERASER, "Borrador", this); continuousDrawingAction->setCheckable(true); eraserAction->setCheckable(true); contextMenu.insertAction(getLockAction(), continuousDrawingAction); contextMenu.insertAction(continuousDrawingAction, fillAction); contextMenu.insertAction(fillAction, clearAction); contextMenu.insertAction(clearAction, eraserAction); setEnableContinuousDrawing(true); setEnableEraserPen(false); setRows(rows); setCols(cols); setEnableEdit(true); setBorder(QPen(Qt::black, 1)); setContainerRect(getContainer()); setDataType(dt); connect(continuousDrawingAction, SIGNAL(triggered(bool)), SLOT(setEnableContinuousDrawing(bool))); connect(clearAction, SIGNAL(triggered()), SLOT(clear())); connect(fillAction, SIGNAL(triggered()), SLOT(fill())); connect(eraserAction, SIGNAL(triggered(bool)), SLOT(setEnableEraserPen(bool))); }
bool VideoPreview::showConfigDialog(QWidget *parent) { VideoPreviewConfigDialog d(parent); d.setVideoFile(videoFile()); d.setDVDDevice(DVDDevice()); d.setCols(cols()); d.setRows(rows()); d.setInitialStep(initialStep()); d.setMaxWidth(maxWidth()); d.setDisplayOSD(displayOSD()); d.setAspectRatio(aspectRatio()); d.setFormat(extractFormat()); d.setSaveLastDirectory(save_last_directory); if (d.exec() == QDialog::Accepted) { setVideoFile(d.videoFile()); setDVDDevice(d.DVDDevice()); setCols(d.cols()); setRows(d.rows()); setInitialStep(d.initialStep()); setMaxWidth(d.maxWidth()); setDisplayOSD(d.displayOSD()); setAspectRatio(d.aspectRatio()); setExtractFormat(d.format()); save_last_directory = d.saveLastDirectory(); return true; } return false; }
void caWaterfallPlot::TimeOut() { // demo curve if(thisUnits != Monitor) { if(!disableDemo) { datamutex->lock(); GausCurv(position); m_data->setData(reducedArray, countRows, ActualNumberOfColumns, getRows(), ActualNumberOfColumns); setCols(ActualNumberOfColumns); if(firstDemoPlot) { updatePlot(); m_data->setLimits(0., getCols(), 0., getRows(), thisIntensityMin, thisIntensityMax); firstDemoPlot = false; } datamutex->unlock(); if(drift > 0 && position >= NumberOfColumns) drift = -1; if(drift < 0 && position <= 0) drift = 1; position += drift; } else { if(reducedArray != (double*) 0) { datamutex->lock(); m_data->setData(reducedArray, countRows, ActualNumberOfColumns, getRows(), ActualNumberOfColumns); if(firstTimerPlot) { updatePlot(); m_data->setLimits(0., getCols(), 0., getRows(), thisIntensityMin, thisIntensityMax); firstTimerPlot = false; } datamutex->unlock(); } } myReplot(); } }
void caWaterfallPlot::InitData(int numCols) { disableDemo = true; if(reducedArray != (double *) 0) { free(reducedArray); reducedArray = (double *) 0; } countRows = 0; setCols(numCols); ActualNumberOfColumns = NumberOfColumns = numCols; ActualNumberOfColumns = m_data->initData(NumberOfColumns, getRows()); if(ActualNumberOfColumns == 0) return; setCols(ActualNumberOfColumns); }
Matrix::Matrix(int rows, int cols) { setRows(rows); setCols(cols); matrix = new char*[rows]; for (int i = 0; i < rows; i++) { matrix[i] = new char[cols]; } }
void caWaterfallPlot::setData(int32_t *array, int size) { //printf("size=%d count=%d\n", size, thisCountNumber); int newSize = size; if(thisCountNumber > 0) { newSize = thisCountNumber; } else { newSize = thisCountNumber = size; } //if(thisCountNumber > 0) newSize = qMin(thisCountNumber, size); ActualNumberOfColumns = NumberOfColumns = newSize; if(thisUnits != Monitor) { CompressAndkeepArray(array, newSize, size); } else { int actualColumns = m_data->setData(array, countRows, NumberOfColumns, getRows(), size); setCols(actualColumns); } }
void VideoPreview::loadSettings() { qDebug("VideoPreview::loadSettings"); set->beginGroup("videopreview"); setCols(set->value("columns", cols()).toInt()); setRows(set->value("rows", rows()).toInt()); setInitialStep(set->value("initial_step", initialStep()).toInt()); setMaxWidth(set->value("max_width", maxWidth()).toInt()); setDisplayOSD(set->value("osd", displayOSD()).toBool()); setExtractFormat((ExtractFormat) set->value("format", extractFormat()).toInt()); save_last_directory = set->value("save_last_directory", save_last_directory).toBool(); last_directory = set->value("last_directory", last_directory).toString(); setVideoFile(set->value("filename", videoFile()).toString()); setDVDDevice(set->value("dvd_device", DVDDevice()).toString()); toggleInfoAct->setChecked(set->value("show_info", true).toBool()); set->endGroup(); }
void core::DotMatrix::setInputs(const vector<double> &inputs, int rows, int cols) { setRows(rows); setCols(cols); setInputs(inputs); }
void Board::setSize(size_t rows,size_t cols){ setRows(rows); setCols(cols); cout<<"Board::setSize(int,int)!"<<endl; }
void NetMat::resize( int r, int c ) { setRows(r); setCols(c); }
caWaterfallPlot::caWaterfallPlot(QWidget *parent): QWidget(parent) { QHBoxLayout *hboxLayout = new QHBoxLayout(this); thisCountNumber = 0; datamutex = new QMutex; // define a new plot plot = new QwtPlot(this); QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); plot->setSizePolicy(sizePolicy); // add it to layout hboxLayout->addWidget(plot); // define spectrogram d_spectrogram = new QwtPlotSpectrogram(); d_spectrogram->setRenderThreadCount(0); // use system specific thread count d_spectrogram->setColorMap(new ColorMap_Wavelength()); // define data m_data = new SpectrogramData(); // set 200 rows ( NumberofColumns columns for demo setRows(nbRows); setCols(nbCols); ActualNumberOfColumns = NumberOfColumns = nbCols; reducedArray = (double*) malloc(ActualNumberOfColumns * sizeof(double)); memset(reducedArray, 0, ActualNumberOfColumns *sizeof(double)); // initialize data m_data->initData(NumberOfColumns, getRows()); thisIntensityMin = 0; thisIntensityMax = 1000; setIntensityScalingMax(Channel); setIntensityScalingMin(Channel); // set data to spectrogram countRows = 0; d_spectrogram->setData(m_data); d_spectrogram->attach(plot); // define a grid plotGrid = new QwtPlotGrid(); plotGrid->attach(plot); // no titles yet setTitlePlot(""); setTitleX(""); setTitleY(""); // enable axis setXaxisEnabled(true); setYaxisEnabled(true); setCustomMap(""); setDiscreteCustomMap(false); setColormap(spectrum_wavelength); updatePlot(); firstMonitorPlot = firstDemoPlot = firstTimerPlot = true; // set a timer for nice demo thisUnits = Millisecond; thisPeriod = 200; Timer = new QTimer(this); Timer->setInterval((int) thisPeriod); Timer->start(); position = 0.0; drift = 1.0; disableDemo = false; connect(Timer, SIGNAL(timeout()), this, SLOT(TimeOut())); }