Commit 5992d47d authored by Jacob Lamblin's avatar Jacob Lamblin
Browse files

Add a refresher for modelcrate property

parent da0d49a0
......@@ -259,6 +259,8 @@ void DAQParamController::refreshNFEBoardProperty(int32 value) throw (CannotSetVa
cout << "nfeboard inchanged, skip the refresher" << endl ;
return;
}
nfeboard.update(value);
cout << dec << "nfeboard nouvelle " << nfeboard() << endl;
// // Resize properties and vector
// ntot.resize(value);
// ntail.resize(value);
......@@ -291,7 +293,7 @@ void DAQParamController::refreshNFEBoardProperty(int32 value) throw (CannotSetVa
m_ELECDriver->DAQParams.elecMapping_v.resize(ntotchannel());
m_ELECDriver->DAQParams.slotHV_v.resize(ntotchannel());
m_ELECDriver->DAQParams.channelHV_v.resize(ntotchannel());
m_ELECDriver->DAQParams.fe_trigger_mask=1023;
m_ELECDriver->DAQParams.fe_trigger_mask=0;
m_ELECDriver->DAQParams.fe_reset_mask=0;
m_ELECDriver->DAQParams.FEParams_v.resize(value);
......@@ -309,9 +311,11 @@ void DAQParamController::refreshNFEBoardProperty(int32 value) throw (CannotSetVa
//cout << "j " << j << "index " << index<< " " << m_ELECDriver->boardtype(j) << endl;
if (m_ELECDriver->boardtype(j) == stereo_elec::FEBOARD and index<value) {
m_ELECDriver->DAQParams.isFEBoard_v.at(j) = true;
m_ELECDriver->DAQParams.fe_trigger_mask|= (1 << j);
//m_ELECDriver->DAQParams.isFEBoardEnabled_v.at(j) = true;
m_ELECDriver->DAQParams.FEParams_v.at(index).FE8IPAdd=m_ELECDriver->boardipaddress(j);
m_ELECDriver->DAQParams.FEParams_v.at(index).slot_num = j+1;
m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask = 255;
slotindex.set(index, j);
cout << "IP " << m_ELECDriver->DAQParams.FEParams_v.at(index).FE8IPAdd << endl;
index++;
......@@ -493,6 +497,7 @@ void DAQParamController::refreshLedUsedProperty(int value) throw (CannotSetValue
m_ELECDriver->DAQParams.ledUsed = value;
}
void DAQParamController::refreshNTotProperty(int32 index, int32 value) throw (CannotSetValue) {
cout << "NTOT refresher index " << index << " nfeboard() " << nfeboard() << " value " << value << endl;
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).nTot = (short unsigned) value;
}
......@@ -505,42 +510,43 @@ void DAQParamController::refreshPretrigProperty(int32 index, int32 value) throw
}
void DAQParamController::refreshTrigQuantityProperty(int32 index, const std::string& value) throw (CannotSetValue) {
if (value == TrigSum)
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).isTriggerOnQ = true;
else
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).isTriggerOnQ = false;
if(index<nfeboard()){
if (value == TrigSum) m_ELECDriver->DAQParams.FEParams_v.at(index).isTriggerOnQ = true;
else m_ELECDriver->DAQParams.FEParams_v.at(index).isTriggerOnQ = false;
}
}
void DAQParamController::refreshTrigChannelProperty(int32 index, bool value) throw (CannotSetValue) {
if (value)
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= 0x00FF; // mise à 1 des 8 premiers bits
else
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= 0xFF00; // mise à 0 des 8 premiers bits
//cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
if(index<nfeboard()){
if (value) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= 0x00FF; // mise à 1 des 8 premiers bits
else m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= 0xFF00; // mise à 0 des 8 premiers bits
cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
}
}
void DAQParamController::refreshTrigSum03Property(int32 index, bool value) throw (CannotSetValue) {
if (value)
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= (short unsigned) (1u << 8); // mise à 1 du bit 8
else
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= (short unsigned) ~(1u << 8); // mise à 0 du bit 8
//cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
if(index<nfeboard()){
if (value) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= (short unsigned) (1u << 8); // mise à 1 du bit 8
else m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= (short unsigned) ~(1u << 8); // mise à 0 du bit 8
cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
}
}
void DAQParamController::refreshTrigSum47Property(int32 index, bool value) throw (CannotSetValue) {
if (value)
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= (short unsigned) (1u << 9); // mise à 1 du bit 9
else
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= (short unsigned) ~(1u << 9); // mise à 0 du bit 9
//cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
if(index<nfeboard()){
if (value) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= (short unsigned) (1u << 9); // mise à 1 du bit 9
else m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= (short unsigned) ~(1u << 9); // mise à 0 du bit 9
cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
}
}
void DAQParamController::refreshTrigSum07Property(int32 index, bool value) throw (CannotSetValue) {
if (value)
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= (short unsigned) (1u << 10); // mise à 1 du bit 10
else
if(index<nfeboard()) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= (short unsigned) ~(1u << 10); // mise à 0 du bit 10
//cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
if(index<nfeboard()){
if (value) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask |= (short unsigned) (1u << 10); // mise à 1 du bit 10
else m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask &= (short unsigned) ~(1u << 10); // mise à 0 du bit 10
cout << "trigMask " << (bitset<16> ) m_ELECDriver->DAQParams.FEParams_v.at(index).trigMask << endl;
}
}
void DAQParamController::refreshCFDDelayProperty(int32 index, int32 value) throw (CannotSetValue) {
......@@ -563,16 +569,16 @@ void DAQParamController::refreshNSumProperty(int32 index, int32 value) throw (Ca
}
void DAQParamController::refreshT1AcceptedProperty(int32 index, bool value) throw (CannotSetValue) {
if(value) m_ELECDriver->DAQParams.fe_trigger_mask|= (1 << slotindex(index));
else m_ELECDriver->DAQParams.fe_trigger_mask &= ~(1<< slotindex(index));
//m_ELECDriver->DAQParams.fe_trigger_mask=1023;
cout << "fe_trigger_mask "<< m_ELECDriver->DAQParams.fe_trigger_mask << " value=" << value << endl;
if(index<nfeboard()){
if(value) m_ELECDriver->DAQParams.fe_trigger_mask|= (1 << slotindex(index));
else m_ELECDriver->DAQParams.fe_trigger_mask &= ~(1<< slotindex(index));
cout << "fe_trigger_mask "<< m_ELECDriver->DAQParams.fe_trigger_mask << " value=" << value << endl;
}
}
void DAQParamController::refreshT1TimeResetProperty(int32 index, bool value) throw (CannotSetValue) {
if(index<nfeboard()){
if(value) m_ELECDriver->DAQParams.fe_reset_mask|= (1 << slotindex(index));
else m_ELECDriver->DAQParams.fe_reset_mask &= ~(1<< slotindex(index));
//m_ELECDriver->DAQParams.fe_reset_mask=0;
cout << "fe_reset_mask "<< m_ELECDriver->DAQParams.fe_reset_mask << " value=" << value << endl;
}
}
......
......@@ -22,15 +22,15 @@
<property name="nled" type="int32">
</property>
<dynamic_property name="dacbox1" size_property="nled" type="int32" max_length="5">
<dynamic_property name="dacbox1" size_property="nled" type="int32" max_length="10">
</dynamic_property>
<dynamic_property name="dacbox2" size_property="nled" type="int32" max_length="5">
<dynamic_property name="dacbox2" size_property="nled" type="int32" max_length="10">
</dynamic_property>
<dynamic_property name="dacbox3" size_property="nled" type="int32" max_length="5">
<dynamic_property name="dacbox3" size_property="nled" type="int32" max_length="10">
</dynamic_property>
<dynamic_property name="dacbox4" size_property="nled" type="int32" max_length="5">
<dynamic_property name="dacbox4" size_property="nled" type="int32" max_length="10">
</dynamic_property>
<dynamic_property name="dacbox5" size_property="nled" type="int32" max_length="5">
<dynamic_property name="dacbox5" size_property="nled" type="int32" max_length="10">
</dynamic_property>
</controller>
......@@ -62,6 +62,7 @@ CAENSYx527Driver::CAENSYx527Driver(const string& name):
registerFunction(CAENSYX527_FUNCTION);
registerRefresher(nslot,&CAENSYx527Driver::refreshNSlotProperty, this);
registerRefresher(ntotchannel,&CAENSYx527Driver::refreshNTotalChannelProperty, this);
registerRefresher(modelcrate,&CAENSYx527Driver::refreshModelCrateProperty, this);
/*
* Register the Spy and Observer commands necessary to do the updates.
*/
......@@ -71,18 +72,6 @@ CAENSYx527Driver::CAENSYx527Driver(const string& name):
sysHndl=-1;
model=SY5527;
address="0.0.0.0";
if(modelcrate()=="SY1527"){
model=SY1527;
}
else if(modelcrate()=="SY2527"){
model=SY2527;
}
else if(modelcrate()=="SY4527"){
model=SY4527;
}
else if(modelcrate()=="SY5527"){
model=SY5527;
}
locked = false;
}
......@@ -142,7 +131,21 @@ void CAENSYx527Driver::refreshNTotalChannelProperty(int32 value) throw (CannotSe
rampdown.resize(value);
}
void CAENSYx527Driver::refreshModelCrateProperty(const std::string& value) throw (CannotSetValue) {
if(value=="SY1527"){
model=SY1527;
}
else if(value=="SY2527"){
model=SY2527;
}
else if(value=="SY4527"){
model=SY4527;
}
else if(value=="SY5527"){
model=SY5527;
}
}
/*
* readParam
*/
......
......@@ -65,6 +65,7 @@ public:
*/
virtual void refreshNSlotProperty(int32 value) throw (CannotSetValue);
virtual void refreshNTotalChannelProperty(int32 value) throw (CannotSetValue);
virtual void refreshModelCrateProperty(const std::string& value) throw (CannotSetValue);
void readParamChannels();
......
Markdown is supported
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