Remove commented code

This commit is contained in:
Douglas Araujo
2024-09-12 11:34:51 +02:00
parent c587eabd00
commit 3b0e24798f

View File

@@ -6,8 +6,6 @@
using namespace std;
//#define NUM_HAMA_PARAMS ((int)(&LAST_HAMA_PARAM - &FIRST_HAMA_PARAM + 1))
static const char* driverName = "drvOrca";
static void c_imagetask(void* arg) {
@@ -176,9 +174,6 @@ Orca::Orca(const char* portName, int cameraId, int maxBuffers, size_t maxMemory,
// System Information
createParam(hColorTypeString, asynParamInt32, &hColorType);
createParam(hBitPerChannelString, asynParamInt32, &hBitPerChannel);
// createParam( hImageWidthString, asynParamInt32,
// &hImageWidth); createParam( hImageHeightString, asynParamInt32,
// &hImageHeight);
createParam(hImageRowBytesString, asynParamInt32, &hImageRowbytes);
createParam(hImageFrameBytesString, asynParamInt32, &hImageFramebytes);
createParam(hImageTopOffsetBytesString, asynParamInt32,
@@ -249,13 +244,7 @@ Orca::Orca(const char* portName, int cameraId, int maxBuffers, size_t maxMemory,
printf(
"===================================================================\n");
}
//============================================================================
// Orca::~Orca(){
// // not sure if the destructor has to be define here...
// printf("[DEBUG] === Destructor ADOrca ===\n");
//}
//========================================================================================================
int Orca::initCamera() {
int err = 0;
@@ -296,12 +285,6 @@ int Orca::initCamera() {
err |= readParameter(DCAM_IDPROP_IMAGE_ROWBYTES);
err |= readParameter(DCAM_IDPROP_IMAGE_HEIGHT);
// SUBARRAYMODE ------------------------------------------
// FEATURE -----------------------------------------------
// EXPOSURETIME ------------------------------------------
// ALU ---------------------------------------------------
err |= readParameter(DCAM_IDPROP_DEFECTCORRECT_MODE);
err |= readParameter(DCAM_IDPROP_HOTPIXELCORRECT_LEVEL);
@@ -312,7 +295,6 @@ int Orca::initCamera() {
// OUTPUT TRIGGER ----------------------------------------
err |= readParameter(DCAM_IDPROP_OUTPUTTRIGGER_ACTIVE);
err |= readParameter(DCAM_IDPROP_NUMBEROF_OUTPUTTRIGGERCONNECTOR);
// MASTER PULSE ------------------------------------------
// SYNCHRONOUS TIMING ------------------------------------
err |= readParameter(DCAM_IDPROP_TIMING_READOUTTIME);
@@ -349,9 +331,6 @@ int Orca::initCamera() {
err |= readParameter(DETECTOR_PIXEL_NUM_VERT);
if (err) {
// asynPrint(pasynUser, ASYN_TRACEIO_DRIVER, "%s:%s: port=%s, value=%d,
// status=%d\n",
// driverName, functionName, this->portName, value, (int)status);
}
return err;
}
@@ -485,7 +464,6 @@ int Orca::readParameter(int propertyID, bool processPV) {
dcamprop_getvalue(m_hdcam, DCAM_IDPROP_SENSORCOOLERSTATUS, &dvalue);
status = setIntegerParam(hSensorCoolerStatus, dvalue);
break;
// - sensor temperature in a thread
// - binning and roi
case DCAM_IDPROP_BINNING: //(RW1--)
@@ -855,7 +833,6 @@ void Orca::imageTask() {
int acquire;
int count = 0;
int callback;
// int acquireStatusError = 0;
int imageMode = 0;
int totalImages = 0;
int initial_evr_counters = 0;
@@ -890,7 +867,6 @@ void Orca::imageTask() {
epicsTimeGetCurrent(&prevAcqTime);
if (status != asynSuccess) {
// acquireStatusError = 1;
epicsThreadSleep(.1);
} else {
getIntegerParam(ADNumImages, &totalImages);
@@ -1133,12 +1109,8 @@ asynStatus Orca::writeInt32(asynUser* pasynUser, epicsInt32 value) {
stopAcquire();
}
} else if (index == ADImageMode) {
// dcamprop_setvalue(m_hdcam, DCAM_IDPROP_, value);
// dcamprop_getvalue(m_hdcam, DCAM_IDPROP_, &value_d);
printf("[DEBUG]::writeInit32 ADImageMode\n");
} else if (index == ADNumExposures) {
// camprop_setvalue(m_hdcam, DCAM_IDPROP_EXPOSURETIME, value);
// dcamprop_getvalue(m_hdcam, DCAM_IDPROP_EXPOSURETIME, &value_d);
printf("[DEBUG]::writeInit32 ADNumExposures\n");
} else if (index == ADMinX) {
int minH = 0, sizeH = 0;
@@ -1237,8 +1209,6 @@ asynStatus Orca::writeInt32(asynUser* pasynUser, epicsInt32 value) {
}
readParameter(DCAM_IDPROP_TIMING_READOUTTIME, false);
} else if (index == ADReadStatus) {
// dcamprop_setvalue(m_hdcam, DCAM_IDPROP_, value);
// dcamprop_getvalue(m_hdcam, DCAM_IDPROP_, &value_d);
printf("[DEBUG]::writeInit32 ADReadStatus\n");
}
@@ -1356,22 +1326,7 @@ asynStatus Orca::writeInt32(asynUser* pasynUser, epicsInt32 value) {
"IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
/*
else if (index == hIntensityLutMode) {
printf("[DEBUG]::function IntensityLutMode %d\n", value);
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_INTENSITYLUT_MODE,
&dvalue); if(failed(m_err)) { printError(m_hdcam, m_err,
"dcamprop_setgetvalue()", "IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
else if (index == hIntensityLutPage) {
printf("[DEBUG]::function IntensityLutPage %d\n", value);
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_INTENSITYLUT_PAGE,
&dvalue); if(failed(m_err)) { printError(m_hdcam, m_err,
"dcamprop_setgetvalue()", "IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
*/
//-- ALU
else if (index == hDefectCorrectMode) {
m_err =
@@ -1398,15 +1353,7 @@ asynStatus Orca::writeInt32(asynUser* pasynUser, epicsInt32 value) {
"IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
/*
else if (index == hExtractionMode) {
printf("[DEBUG]::writeInit32 ExtractionMode %d\n", value);
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_EXTRACTION_MODE,
&dvalue); if(failed(m_err)) { printError(m_hdcam, m_err,
"dcamprop_setgetvalue()", "IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
*/
//-- Output trigger
else if (index == hOutputTriggerSource0) {
printf("[DEBUG]::writeInit32 OutputTriggerSource0 %d\n", value);
@@ -1570,12 +1517,7 @@ asynStatus Orca::writeInt32(asynUser* pasynUser, epicsInt32 value) {
if (index < FIRST_HAMA_PARAM) {
status = ADDriver::writeInt32(pasynUser, value);
printf("[+DEBUG]:: ADDriver::writeInit32 %s\n", paramName);
// ADDriver::writeInt32(pasynUser, value);
}
// else{
// printf("[-DEBUG]::function writeInt32 did not find a parameter index
// = %d, %s\n", index, paramName);
// }
}
/* Do callbacks so higher layers see any changes */
@@ -1678,9 +1620,7 @@ asynStatus Orca::writeFloat64(asynUser* pasynUser, epicsFloat64 value) {
"IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
//-- Sensor cooler - nothing
//-- Binning and ROI - nothing
//-- ALU - nothing
//-- Output trigger
else if (index == hOutputTriggerDelay0) {
printf("[DEBUG]::function OutputTriggerDelay0 %f\n", value);
@@ -1754,22 +1694,7 @@ asynStatus Orca::writeFloat64(asynUser* pasynUser, epicsFloat64 value) {
"IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
/*
else if (index == hInternalFrameRate) {
printf("[DEBUG]::function InternalFrameRate %f\n", value);
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_INTERNALFRAMERATE,
&dvalue); if(failed(m_err)) { printError(m_hdcam, m_err,
"dcamprop_setgetvalue()", "IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
else if (index == hInternalFrameInterval) {
printf("[DEBUG]::function Internal FrameInterval %f\n", value);
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_INTERNAL_FRAMEINTERVAL,
&dvalue); if(failed(m_err)) { printError(m_hdcam, m_err,
"dcamprop_setgetvalue()", "IDPROP:0x%08x, VALUE:%f\n", index, dvalue);
}
}
*/
else if (index == hInternalLineInterval) {
printf("[DEBUG]::function InternalLineInterupt %f\n", value);
m_err = dcamprop_setgetvalue(m_hdcam, DCAM_IDPROP_INTERNAL_LINEINTERVAL,
@@ -1873,10 +1798,6 @@ void Orca::report(FILE* fp, int details) {
fprintf(fp, "OUTPUT TRIGGER CONNECTOR:\t%f\n", dvalue);
m_err = dcamprop_getvalue(m_hdcam, DCAM_IDPROP_OUTPUTTRIGGER_ACTIVE, &dvalue);
fprintf(fp, "OUTPUT TRIGGER ACTIVE:\t%f\n", dvalue);
// m_err = dcamprop_getvalue(m_hdcam, DCAM_IDPROP_OUTPUTTRIGGER_ACTIVE+4,
// &dvalue); fprintf(fp, ":\t%f\n", dvalue); m_err =
// dcamprop_getvalue(m_hdcam, DCAM_IDPROP_OUTPUTTRIGGER_ACTIVE+6, &dvalue);
// fprintf(fp, ":\t%f\n", dvalue);
// - master pulse
m_err = dcamprop_getvalue(m_hdcam, DCAM_IDPROP_MASTERPULSE_MODE, &dvalue);
@@ -2029,9 +1950,6 @@ int Orca::connectCamera(void) {
hwait = waitopen.hwait;
}
/* close api */ //- it should be here??????????????
// dcamapi_uninit();
// return status;
return 0;
}
@@ -2048,12 +1966,6 @@ int Orca::disconnectCamera(void) {
asynPrint(pasynUserSelf, ASYN_TRACE_FLOW, "%s:%s: disconnecting camera %d\n",
driverName, functionName, m_id);
// status = AT_GetBool(handle_, L"CameraAcquiring", &acquiring);
// if(status == AT_SUCCESS && acquiring) {
// status |= AT_Command(handle_, L"Acquisition Stop");
// }
// status |= freeBuffers();
dcamdev_close(m_hdcam);
if (status) {
@@ -2342,29 +2254,10 @@ int Orca::getProperties() {
basepropattr.iProp = iProp;
err = dcamprop_getattr(m_hdcam, &basepropattr);
if (!failed(err)) {
#if SHOW_PROPERTY_ATTRIBUTE
// show property attribute
// dcamcon_show_propertyattr( basepropattr );
#endif
#if SHOW_PROPERTY_MODEVALUELIST
// show mode value list of property
// if( (basepropattr.attribute & DCAMPROP_TYPE_MASK) == DCAMPROP_TYPE_MODE )
// dcamcon_show_supportmodevalues( m_hdcam, iProp, basepropattr.valuemin );
#endif
#if SHOW_PROPERTY_ARRAYELEMENT
// show array element
// if( basepropattr.attribute2 & DCAMPROP_ATTR2_ARRAYBASE )
// dcamcon_show_arrayelement( m_hdcam, basepropattr );
#endif
}
// get next property id
err = dcamprop_getnextid(m_hdcam, &iProp, DCAMPROP_OPTION_SUPPORT);
if (failed(err)) {
// no more supported property id
return err;
}
@@ -2383,10 +2276,7 @@ int Orca::roundToNearestMultipleOfFour(int value) {
return value + (4 - remainder);
}
//============================================================================
//============================================================================
/* Code for iocsh registration */
extern "C" int OrcaConfig(const char* portName, int cameraId, int maxBuffers,
size_t maxMemory, int priority, int stackSize,
int maxFrames) {
@@ -2407,23 +2297,19 @@ static const iocshArg OrcaConfigArg6 = {"maxFrames", iocshArgInt};
static const iocshArg* const OrcaConfigArgs[] = {
&OrcaConfigArg0, &OrcaConfigArg1, &OrcaConfigArg2, &OrcaConfigArg3,
&OrcaConfigArg4, &OrcaConfigArg5, &OrcaConfigArg6};
//============================================================================
static const iocshFuncDef configorca = {"devOrcamatsuConfig", 7,
OrcaConfigArgs};
//============================================================================
static void configorcaCallFunc(const iocshArgBuf* args) {
OrcaConfig(args[0].sval, args[1].ival, args[2].ival, args[3].ival,
args[4].ival, args[5].ival, args[6].ival);
}
//============================================================================
static void orcaRegister(void) {
iocshRegister(&configorca, configorcaCallFunc);
}
//============================================================================
extern "C" {
epicsExportRegistrar(orcaRegister);
}