FEDRA emulsion software from the OPERA Collaboration
AcqLight Class Reference

#include <AcqStage1.h>

Inheritance diagram for AcqLight:
Collaboration diagram for AcqLight:

Public Member Functions

 AcqLight ()
 
bool Initialize ()
 
void OFF ()
 
void ON ()
 
int ReadLightLevel ()
 
int ReadTemperature ()
 
void ResetTimer ()
 
virtual ~AcqLight ()
 

Public Attributes

int BoardId
 
bool IsON
 
int LightLevel
 
int TurnOffLightTime
 

Constructor & Destructor Documentation

◆ AcqLight()

AcqLight::AcqLight ( )
861{
862 BoardId=1;
864 LightLevel=28600;
865// T=new TTimer(TurnOffLightTime,kFALSE);
866// TThread *Th = new TThread(Hook,0);
867 IsON=false;
868}
int BoardId
Definition: AcqStage1.h:115
int TurnOffLightTime
Definition: AcqStage1.h:116
int LightLevel
Definition: AcqStage1.h:117
bool IsON
Definition: AcqStage1.h:118

◆ ~AcqLight()

virtual AcqLight::~AcqLight ( )
inlinevirtual
113{}

Member Function Documentation

◆ Initialize()

bool AcqLight::Initialize ( )
871{
872//Initialises the light controller
873 try
874 {
875
876 if (flex_enable_axes( BoardId, 0, 2, 0x00) != NIMC_noError) throw(3);
877 if (flex_clear_pu_status( BoardId) != NIMC_noError) throw(3);
878 if (flex_enable_axes( BoardId, 0, 0, 0) != NIMC_noError) throw(3);
879 if (flex_config_axis( BoardId, 4, 0, 0, 0, 0) != NIMC_noError) throw(3);
880 if (flex_load_dac( BoardId, 0x34, LightLevel, 0xFF) != NIMC_noError) throw(3);
881 if (flex_enable_axes( BoardId, 0, 2, 0x0E) != NIMC_noError) throw(3);
882 if (flex_set_adc_range( BoardId, 0x54, NIMC_ADC_BIPOLAR_5) != NIMC_noError) throw(3); //+-5V -> +-2047
883 }
884 catch (...)
885 {
886 return false;
887 };
888// T->Connect("Timeout()","AcqLight",this,"OFF()");
889
890 ON();
891 return true;
892
893}
FLEXFUNC flex_enable_axes(BOARD, u8 reserved, u8 PIDRate, u8 axisMap)
FLEXFUNC flex_set_adc_range(BOARD, u8 ADC, u16 range)
FLEXFUNC flex_load_dac(BOARD, u8 DAC, i16 outputValue, u8 inputVector)
FLEXFUNC flex_config_axis(BOARD, u8 axis, u8 primaryFeedback, u8 secondaryFeedback, u8 primaryOutput, u8 secondaryOutput)
FLEXFUNC flex_clear_pu_status(BOARD)
#define NIMC_ADC_BIPOLAR_5
Definition: MotnCnst.h:308
#define NIMC_noError
Definition: MotnErr.h:21
void ON()
Definition: AcqStage1.cxx:895

◆ OFF()

void AcqLight::OFF ( )
904{
905 flex_load_dac(BoardId, 0x34, 0, 0xFF);
906 IsON=false;
907
908}

◆ ON()

void AcqLight::ON ( )
896{
897 flex_load_dac(BoardId, 0x34, LightLevel, 0xFF);
898 IsON=true;
899 // gSystem->Sleep(1000);
900 ResetTimer();
901}
void ResetTimer()
Definition: AcqStage1.cxx:910

◆ ReadLightLevel()

int AcqLight::ReadLightLevel ( )
927{
928 // Reads ADC channel 4 normally connected to termometer
929 i16 ADC;
930 flex_read_dac_rtn(BoardId, 0x34, &ADC);
931 LightLevel=ADC;
932 return ADC;
933}
FLEXFUNC flex_read_dac_rtn(BOARD, u8 axisOrDAC, i16 FAR *DACValue)
short i16
Definition: MotnCnst.h:34

◆ ReadTemperature()

int AcqLight::ReadTemperature ( )
918{
919 // Reads ADC channel 4 normally connected to termometer
920 i16 ADC;
921 flex_read_adc_rtn(BoardId, 0x54, &ADC);
922 return ADC;
923}
FLEXFUNC flex_read_adc_rtn(BOARD, u8 ADC, i16 FAR *ADCValue)

◆ ResetTimer()

void AcqLight::ResetTimer ( )
911{
912//Resets lamp timeout
913// T->Reset();
914// T->Start(TurnOffLightTime*1000,kTRUE);
915}

Member Data Documentation

◆ BoardId

int AcqLight::BoardId

◆ IsON

bool AcqLight::IsON

◆ LightLevel

int AcqLight::LightLevel

◆ TurnOffLightTime

int AcqLight::TurnOffLightTime

The documentation for this class was generated from the following files: