Пример #1
0
ChemStationFileLoader::Data::Data(const struct HPCS_MeasuredData *mdata) :
  fileDescription(mdata->file_description),
  sampleInfo(mdata->sample_info),
  operatorName(mdata->operator_name),
  date(HPCSDateToQDate(mdata->date)),
  time(HPCSDateToQTime(mdata->date)),
  methodName(mdata->method_name),
  chemstationRevision(mdata->cs_rev),
  samplingRate(mdata->sampling_rate),
  wavelengthMeasured(Wavelength(mdata->dad_wavelength_msr)),
  wavelengthReference(Wavelength(mdata->dad_wavelength_ref)),
  type(HPCSTypeToType(mdata->file_type)),
  yUnits(mdata->y_units),
  data(HPCSDataToQVector(mdata->data, mdata->data_count)),
  m_valid(true)
{
}
Пример #2
0
void SpectrumWidget::mouseReleaseEvent(  QMouseEvent *e )
{
	if (  e->button() == QMouseEvent::LeftButton )
	{
		int left = (int)Wavelength( ( double )m_LMBPointPress.x()/width() );
		int right = (int)Wavelength( ( double )e->pos().x()/width() );

		if ( left == right )
			return;

		if ( left > right )
			setBorders( right, left );
		else
			setBorders( left, right );
	}

	m_LMBPointPress.setX( -1 );
	m_LMBPointCurrent.setX( -1 );
}
Пример #3
0
void ZenithImager::Add(const BandInfo &band, const std::complex<float> *samples, const bool *isRFI, double u, double v, double w, double phaseRotation)
{
	size_t n = band.channels.size();
	for(size_t f=0;f<n;++f)
	{
		if(!isRFI[f])
		{
			const double wavelength = Wavelength(band.channels[f].frequencyHz);
			const double r = samples[f].real(), i = samples[f].imag();
			add(band, r, i, u, v, w, phaseRotation, wavelength);
		}
	}
}
Пример #4
0
void SpectrumWidget::drawTickmarks( QPainter* p )
{
	//the size of the text on the tickmarks
	const int space = 20;

	//the distance between the tickmarks in pixel
	const int d = 10;

	//the total number of tickmarks to draw (small and long)
	const int numberOfTickmarks = ( int )floor( width()/d );

	double pos = 0.0;
		
	for ( int i = 0; i < numberOfTickmarks; i++  )
	{
		if( i%5 == 0 )
		{//long tickmarks plus text
			p->drawLine( i*d, m_realHeight, i*d, m_realHeight+10 );	
			if ( i%10 == 0 && 
					i*d > space && 
					i*d < width()-space )
			{
				pos = ( double ) ( i*d )/width();
				p->fillRect( i*d-space, m_realHeight+12, 2*space, 15, Qt::white );
				p->drawText( i*d-space, m_realHeight+12, 2*space, 15, Qt::AlignCenter, KalziumUtils::localizedValue(  KalziumUtils::strippedValue( Wavelength( pos ) ), 6 ) );
			}
		}
		else {//small tickmarks
			p->drawLine( i*d, m_realHeight, i*d, m_realHeight+5 );
		}
	}
}