~d-nelson/research-assistant/nextDNK

« back to all changes in this revision

Viewing changes to RAPlugins/DemoDevices/DummyCCDDriver.cpp

  • Committer: Dmitrii
  • Date: 2024-03-12 02:02:44 UTC
  • Revision ID: d.nelson@mail.ioffe.ru-20240312020244-nl3fb371j3xy82a6
Have a little progress.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
void  sDummyCCDDriver::ConnectUSBDevice ()
42
42
{
43
 
  qDebug() << "sDummyCCDDriver::ConnectUSBDevice";
 
43
  qDebug() << "sDummyCCDDriver - ConnectUSBDevice";
44
44
  emit Connected();
45
45
}
46
46
 
64
64
  for (int i = 0; i < NumOfPixels; i++) {
65
65
    Abscissa.ArrBody[i] = 200.0 + dX * i ;
66
66
  }
67
 
  qDebug() << "sDummyCCDDriver::CalculateAbscissa";
 
67
  qDebug() << "sDummyCCDDriver - CalculateAbscissa";
68
68
  emit NewAbscissa (Abscissa);
69
69
}
70
70
 
71
71
void  sDummyCCDDriver::StartDevice ()
72
72
{
 
73
  int _IT = Round((MeasureTime/(sPhysValue(1.0e-3,"s"))).ToReal());
 
74
  State_O_Measuring->SetTimeout(_IT);
 
75
}
 
76
 
 
77
void  sDummyCCDDriver::StopDevice ()
 
78
{
 
79
}
 
80
 
 
81
void  sDummyCCDDriver::SetDevice_MeasureTime (sPhysValue _MTime)
 
82
{
73
83
  try{
74
 
    int _IT = Round((MeasureTime/(sPhysValue(1.0e-3,"s"))).ToReal());
75
 
    if (_IT < 1) _IT = 1;
76
 
    State_O_Measuring->SetTimeout(_IT);
 
84
    int _IT = Round((_MTime/(sPhysValue(1.0e-3,"s"))).ToReal());
 
85
    _IT = (_IT / 10) * 10;
 
86
    if (_IT < 10) _IT = 10;
 
87
qDebug() << "sDummyCCDDriver - SetDevice_MeasureTime, _IT = " << _IT;
 
88
    MeasureTime =  sPhysValue(_IT*1.0e-3,"s");
 
89
    emit MeasureTimeSet(MeasureTime);
77
90
  }catch(rxRAlgebra){
78
91
    SetInvalid(tr("Something wrong with units."));
79
92
  }
80
93
}
81
94
 
82
 
void  sDummyCCDDriver::StopDevice ()
83
 
{
84
 
}
85
 
 
86
 
void  sDummyCCDDriver::SetDevice_MeasureTime (sPhysValue _MTime)
87
 
{
88
 
  MeasureTime =  _MTime;
89
 
  emit MeasureTimeSet(MeasureTime);
90
 
}
91
 
 
92
95
 
93
96
//------------------------------------------------------------------------------
94
97
} //namespace RA