void GRIHist1DGridScrollWidget::ResetGrid() {
  // remove widgets from hist layout, add the visible ones to it
  ClearGrid();
  Q_ASSERT(hist_widg_disp_vec_.size() == 0);
  hist_layout_ = new QGridLayout();
  hist_frame_->setLayout(hist_layout_);
  for (int row = minor_upper_left_row_; row < minor_upper_left_row_ + minor_ny_;
       ++row) {
    for (int col=minor_upper_left_col_; col < minor_upper_left_col_+minor_nx_;
         ++col) {
      int ind = row * major_nx_ + col;
      if (ind < gri_hist_vec_.size()) {
        // make a histogram widget
        GRIHist1DWidget *histWidg = new GRIHist1DWidget(0, gri_hist_vec_[ind]);
        histWidg->set_xlabel(hist_xlabel_vec_[ind]);
        histWidg->set_ylabel(hist_ylabel_vec_[ind]);
        histWidg->set_foreground_color(hist_foreground_color_vec_[ind]);
        histWidg->set_background_color(hist_background_color_vec_[ind]);
        histWidg->set_outline_color(hist_outline_color_vec_[ind]);
        histWidg->SetLogScale(hist_logscale_on_vec_[ind]);
        histWidg->SetAutoScale(hist_autoscale_on_vec_[ind]);
        hist_widg_disp_vec_.append(histWidg);
        hist_layout_->addWidget(histWidg,row,col);
      }
    }
  }
}
void GLIDebugVariableGrid::RefreshGrid()
{
  //Flag that we are updating the cells internally (so update callbacks do not get called)
  SetInternalEditMode(true);

  //Begin batch to not redraw during changes
  BeginBatch();

  //Clear any existing data
  ClearGrid();
  rowTypeDataArray.clear();

  //Delete all rows
  if(GetNumberRows() > 0)
  {
    DeleteRows(0, GetNumberRows());
  }

  //Refresh the watch values
  RefreshWatchValues();

  //Refresh the uniform data
  RefreshUniformValues();

  //End Batch to update the changes to the grid 
  EndBatch();

  //Reset the cell update counter
  SetInternalEditMode(false);  
}
示例#3
0
void GRIHist1DGridWidget::SetGridNx(int nx) {
  ClearGrid();
  grid_layout_ = new QGridLayout();
  setLayout(grid_layout_);
  for (int i = 0; i < hist_widget_.size(); ++i) {
    grid_layout_->addWidget(hist_widget_.at(i), i / nx, i % nx);
  }
}
void CatheterCmdGrid::copyEditWindow(const CatheterCmdGrid* grid) {
    ClearGrid();
    setNumberRows(grid->GetNumberRows());

    for (int i = 0; i < grid->GetNumberRows(); i++) {
        setCommandChannel(i, grid->getCommandChannel(i));
        setCommandCurrent(i, grid->getCommandCurrentMA(i));
        setCommandDelay(i, grid->getCommandDelay(i));
    }
}
示例#5
0
GRIHist1DGridWidget::~GRIHist1DGridWidget() {
  ClearGrid();

  // free all pointers
  while (hist_widget_.size() > 0) {
    GRIHist1DWidget *h0 = hist_widget_[0];
    hist_widget_.remove(0);
    delete h0;
  }
}
示例#6
0
bool CGridRFUParam::TransferDataToWindow()
{
  bool bRtn = (m_pParms != NULL) && !m_sKitName.IsEmpty();
  if(bRtn)
  {
    const vector<int> &anChannelDetection = m_pParms->GetChannelDetection();
    const vector<int> &anChannelRFU = m_pParms->GetChannelRFU();
    ClearGrid();
    _TransferToChannelRows(anChannelRFU,anChannelDetection);

    _SetCellIntValue(m_nROW_SAMPLE,COL_ANALYSIS,m_pParms->GetMinRFU_Sample());
    _SetCellIntValue(m_nROW_SAMPLE,COL_INTERLOCUS,m_pParms->GetMinRFU_Interlocus());
    _SetCellIntValue(m_nROW_SAMPLE,COL_DETECTION,m_pParms->GetSampleDetectionThreshold());
    _SetCellIntValue(m_nROW_LADDER,COL_ANALYSIS,m_pParms->GetMinRFU_Ladder());
    _SetCellIntValue(m_nROW_LADDER,COL_INTERLOCUS,m_pParms->GetMinLadderInterlocusRFU());
    _SetCellIntValue(m_nROW_ILS,COL_ANALYSIS,m_pParms->GetMinRFU_ILS());
  }
  return bRtn;
}
bool CGridAnalysis::_SetGridSize(int nRowCount, int nColCount)
{
  // return true if OK, false if error
  int nRowCurrent = GetNumberRows();
  int nColCurrent = GetNumberCols();
  bool bError = false;

  ClearSelection();
  ClearGrid();

  if((!nRowCount) || (nColCount < 1))
  {
    bError = true;
    nRowCount = 1;
    nColCount = 1;
  }
  if(nColCurrent > nColCount)
  {
    DeleteCols(nColCount,nColCurrent - nColCount);
  }
  else if(nColCurrent < nColCount)
  {
    AppendCols(nColCount - nColCurrent);
  }
  if(nRowCurrent > nRowCount)
  {
    DeleteRows(nRowCount,nRowCurrent - nRowCount);
  }
  else if(nRowCurrent < nRowCount)
  {
    AppendRows(nRowCount - nRowCurrent);
  }
  if(bError)
  {
    SetColLabelValue(0,wxEmptyString);
    SetRowLabelValue(0,wxEmptyString);
    SetCellStyle(0,0,GRID_NORMAL);
    SetCellValue(0,0,wxEmptyString);
  }
  return !bError;
}
示例#8
0
void ABalloonGrid::TryPop(int32 InGridX, int32 InGridY)
{
	//UE_LOG(YLog, Warning, TEXT("TryPop start, X:%d,Y:%d"), InGridX, InGridY);
	int32 GridIndex = InGridY * GridSizeY + InGridX;
	SP_Grid G = Grids[GridIndex];
	if (!G->Object) return;
	EColorType Color = G->Object->Color;
	SearchResult.Add(G);
	G->Dirty = true;
	CrossSearch(InGridX, InGridY, Color);
	//UE_LOG(YLog, Warning, TEXT("TryPop finish %d"), SearchResult.Num());
	if (SearchResult.Num() < 2)
	{
		ClearGrid();
		SearchResult.Empty();
		return;
	}
	for (auto G : SearchResult)
	{
		PopCandidates.Add(G->Object);
	}
}
GRIHist1DGridScrollWidget::~GRIHist1DGridScrollWidget() {
  ClearGrid();
}
void CatheterCmdGrid::resetEditWindow() {
    // leave 'NCHANNELS_DEFAULT' rows in the table
    setNumberRows(NCHANNELS);
    // clear data from table
    ClearGrid();
}
示例#11
0
void CPrefView::ChangeGrid()
{
	CString Buff;
	int i1,i2,j,k;
	int n=m_pG->m_agr.GetCount();
	int* u=new int[n];
	int* v=new int[n];
	CExponent* pC;
	m_Grid.SetHighLight(0);
	m_ComboX.GetWindowText(Buff); 
	if (Buff!="")
	{
		pC=GetExponent(Buff);
		m_Grid.SetCols(pC->m_scale->GetGradation()+1);
		m_ComboY.GetWindowText(Buff); 
		if (Buff!="")
		{
			pC=GetExponent(Buff);
			m_Grid.SetRows(pC->m_scale->GetGradation()+1);
		}
		else m_Grid.SetRows(2);
	}
	else
	{
		ClearGrid();
	}

	m_ComboX.GetWindowText(Buff);
	if (Buff!="")
	{
		pC=GetExponent(Buff);                //,&flag);
		m_Grid.SetRow(0);
		m_Grid.SetColWidth(0,m_sG0.cx);
		m_Grid.SetRowHeight(0,m_sG0.cy);
		CreateAllBitmapX();
		for (j=0; j<pC->m_scale->GetGradation(); j++)
		{
			m_Grid.SetColWidth(j+1,m_sG.cx);
			m_Grid.SetCol(j+1);	//firs col is head
			//if (flag) { SetBitmap(j,pC->GetGradation()-1, j+1,0); m_Grid.SetText("");}
			//else { m_Grid.SetText(pC->GetLex(j)); m_Grid.SetPicture(NULL);}
			
			m_Grid.SetRefCellPicture(m_pPictX[j].GetPictureDispatch());
			m_Grid.SetCellPictureAlignment(4);
		}
		
		for (j=0; j<n; j++) u[j]=m_U[j];
		m_pM->GetCritDim(v);
		i1=GetIndex(Buff,m_pG);
		m_ComboY.GetWindowText(Buff);
		if (Buff!="") 
		{
			pC=GetExponent(Buff); //,&flag);
			m_Grid.SetCol(0);
			for (j=0; j<pC->m_scale->GetGradation(); j++)
			{
				m_Grid.SetRowHeight(j+1,m_sG.cy);
				m_Grid.SetRow(j+1);	//firs col is head
			//	if (flag) { SetBitmap(j,pC->GetGradation()-1,0,j+1); m_Grid.SetText("");}
			//	else { m_Grid.SetText(pC->GetLex(j)); m_Grid.SetPicture(NULL);}
				m_Grid.SetText(pC->m_scale->GetLex(j));
			}
			i2=GetIndex(Buff,m_pG);
			for (j=0; j<v[i1]; j++)
			{
				m_Grid.SetCol(j+1);
				u[i1]=j;
				for (k=0; k<v[i2]; k++)
				{
					m_Grid.SetRow(k+1);
					u[i2]=k;
					SetBitmap(m_pM->GetPreferance(u), m_pM->m_robast-1,j+1,k+1);
				}
			}
		}
		else
		{
			m_Grid.SetRow(1);
			m_Grid.SetCol(0);
			m_Grid.SetRowHeight(1,m_sG.cy);
			m_Grid.SetText(""); m_Grid.SetRefCellPicture(NULL);
			for (j=0; j<v[i1]; j++)
			{
				m_Grid.SetCol(j+1);
				u[i1]=j;
				SetBitmap(m_pM->GetPreferance(u),m_pM->m_robast-1,j+1,1);
			}
		}
	}
	m_ComboY.GetWindowText(Buff);
	if (Buff!="") 
	{
		m_Grid.SetRow(m_U[i2]+1);
	}
	else m_Grid.SetRow(1);
	m_Grid.SetCol(m_U[i1]+1);
	m_Grid.SetHighLight(1);
	delete [] u;
	delete [] v;
	UpdateValue();
}