Commit d6cb66ac authored by Yuelong Yu's avatar Yuelong Yu
Browse files

only display temperatures

parent b5e97a0e
......@@ -742,14 +742,14 @@ void AGIPDMC::start_auxand_analog_voltage()
// else
// {
// Add your own code
SetState(Tango::MOVING);
{
omni_mutex_lock l(m_mtxData);
m_nOpMode = 3;
WriteAttr<Tango::DevShort>("AUX",1);
WriteAttr<Tango::DevShort>("OpMode",m_nOpMode);
// SetState(Tango::MOVING);
// {
// omni_mutex_lock l(m_mtxData);
// m_nOpMode = 3;
// WriteAttr<Tango::DevShort>("AUX",1);
// WriteAttr<Tango::DevShort>("OpMode",m_nOpMode);
}
// }
SetStatus("Starting AUX and analog voltage...");
RunCycle(3);
......@@ -874,31 +874,31 @@ void AGIPDMC::start_asics()
void AGIPDMC::RunCycle(int nMode)
{
SetState(Tango::MOVING);
// SetState(Tango::MOVING);
bool bTrue = WriteAttr<Tango::DevShort>("OpMode",nMode);
// bool bTrue = WriteAttr<Tango::DevShort>("OpMode",nMode);
//aux and analog voltage
if(nMode == 3)
bTrue = bTrue && WriteAttr<Tango::DevShort>("AUX",1);
// //aux and analog voltage
// if(nMode == 3)
// bTrue = bTrue && WriteAttr<Tango::DevShort>("AUX",1);
//if device is in automatic mode
// check if automatic == 0
// automatic is not 0, then Execute command is necessary to update the matrix.
// otherwise, matrix will not be updated.
// automatic is 1 then it is not.
// bTrue = bTrue && RunCommand("Execute");
// //if device is in automatic mode
// // check if automatic == 0
// // automatic is not 0, then Execute command is necessary to update the matrix.
// // otherwise, matrix will not be updated.
// // automatic is 1 then it is not.
// // bTrue = bTrue && RunCommand("Execute");
if(bTrue)
{
omni_mutex_lock l(m_mtxData);
m_nOpMode = nMode;
}
else
{
SetStatus("This step is failed. Please retry it.");
SetState(Tango::ON);
}
// if(bTrue)
// {
// omni_mutex_lock l(m_mtxData);
// m_nOpMode = nMode;
// }
// else
// {
// SetStatus("This step is failed. Please retry it.");
// SetState(Tango::ON);
// }
}
/*----- PROTECTED REGION ID(AGIPDMC::namespace_ending) ENABLED START -----*/
......
......@@ -43,6 +43,8 @@ namespace AGIPDMC_ns
short shADCValue = m_vshMatrix[nIdx/2];
//shADCValue = (((shADCValue & 0xff00) >> 8)| ((shADCValue & 0xff) << 8)) & 0xfff;
double dTemp = CalculateLTCCTemperature(shADCValue);
if(isnan(dTemp))
dTemp = UNKNOWN_VALUE;
m_vstTemperatures[i].dLTCCTemperature = dTemp;
i++;
}
......@@ -184,42 +186,42 @@ namespace AGIPDMC_ns
int MicroController::PowerUpStep1()
{
//return ((m_vshMatrix[POWER_UP_STATUS_1_INDEX] & 0xff00) >> 8);
sleep(5);
return 0;
return ((m_vshMatrix[POWER_UP_STATUS_1_INDEX] & 0xff00) >> 8);
// sleep(5);
// return 0;
}
int MicroController::PowerUpStep2()
{
// short shVal = (m_vshMatrix[POWER_UP_STATUS_2_INDEX] & 0xff00) >> 8;
// switch(shVal)
// {
// case 0: //not read yet
// return 1;
// case 1: // no error
// return 0;
// case 2: //wait
// return 1;
// case 3: //error
// return 2;
// }
sleep(5);
return 0;
short shVal = (m_vshMatrix[POWER_UP_STATUS_2_INDEX] & 0xff00) >> 8;
switch(shVal)
{
case 0: //not read yet
return 1;
case 1: // no error
return 0;
case 2: //wait
return 1;
case 3: //error
return 2;
}
// sleep(5);
// return 0;
}
int MicroController::PowerUpStep3()
{
// short shVal = (m_vshMatrix[POWER_UP_STATUS_3_INDEX] & 0xff00) >> 8;
short shVal = (m_vshMatrix[POWER_UP_STATUS_3_INDEX] & 0xff00) >> 8;
// //all modules are powered up
// if(shVal == 0xff)
// return 0;
// else //should call again
// return 1;
//all modules are powered up
if(shVal == 0xff)
return 0;
else //should call again
return 1;
sleep(5);
return 0;
// sleep(5);
// return 0;
}
int MicroController::PowerUpStep4()
......@@ -232,10 +234,12 @@ namespace AGIPDMC_ns
{
//this step should be checked manually.
//there is no feed back from sub modules
//return 1;
///
sleep(5);
return 0;
return 1;
// sleep(5);
// return 0;
}
int MicroController::PowerUpStep6()
......
......@@ -32,10 +32,11 @@ namespace AGIPDMC_ns
//board temperatures index for 8 modules
const vector<int> TEMPERATURE_INDEX_TABLE=
{0x280,0x2C0,
0x420,0x460,
0x5c0,0x600,
0x760,0x7a0
{
0x2A0,0x440,
0x5E0,0x780,
0x920,0xAC0,
0xC60,0xE00
};
//ltcc temperatures for 8 modules
......
......@@ -52,7 +52,8 @@ namespace AGIPDMC_ns
short shHigh = vshData[0];
short shLow = vshData[1];
cout<<" high: "<<shHigh<<" low: "<<shLow<<endl;
return (((int)(shLow & 0xff))<<24
+ (((int)(shLow & 0xff00))>>8)<<16
+ ((int)(shHigh & 0xff))<<8
......@@ -80,26 +81,27 @@ namespace AGIPDMC_ns
if(!m_vMatrixData.empty())
{
int nCounter = GetMatrixCounter(m_vMatrixData);
//get new matrix
if(m_nCurrentCounter < nCounter)
{
m_nCurrentCounter = nCounter;
UpdateTemperatures();
// int nCounter = GetMatrixCounter(m_vMatrixData);
// //get new matrix
// if(m_nCurrentCounter < nCounter)
// {
// m_nCurrentCounter = nCounter;
m_objAGIPDMC->m_nDataLength = nLen;
std::copy(m_vMatrixData.begin(),
m_vMatrixData.end(),
(m_objAGIPDMC->attr_RawMatrix_read));
// m_objAGIPDMC->m_nDataLength = nLen;
// std::copy(m_vMatrixData.begin(),
// m_vMatrixData.end(),
// (m_objAGIPDMC->attr_RawMatrix_read));
m_uptrMC->SetRawData(m_vMatrixData);
// m_uptrMC->SetRawData(m_vMatrixData);
//0 : power up step
if(m_nRunningMode == 0)
PowerCycle();
//1 : normal run step. update temperatures
else if(m_nRunningMode == 1)
UpdateTemperatures();
}
// //0 : power up step
// if(m_nRunningMode == 0)
// PowerCycle();
// //1 : normal run step. update temperatures
// else if(m_nRunningMode == 1)
// UpdateTemperatures();
// }
}
//cout<<"read"<<endl;
......@@ -255,7 +257,7 @@ namespace AGIPDMC_ns
m_objAGIPDMC->SetStatus("Module FPGAs are ready.");
break;
case 6:
m_objAGIPDMC->WriteAttr<Tango::DevShort>("OpMode",7);
// m_objAGIPDMC->WriteAttr<Tango::DevShort>("OpMode",7);
m_objAGIPDMC->SetStatus("ASISs are ready. System is in normal operation.");
m_nRunningMode = 1;
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment