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

file name is related to instance name of the server

parent cbc990ef
......@@ -268,6 +268,22 @@ namespace AGIPDMaster_ns
}
}
//get the device instance name
//it will be used to generate save file name
for(int i=0;i<m_vobjDP.size();i++)
{
string strServerID = m_vobjDP[i]->info().server_id;
std::size_t stFound = strServerID.find_first_of('/');
if(stFound != std::string::npos)
strServerID = strServerID.substr(stFound+1,strServerID.length()-stFound-1);
else
strServerID = to_string(i);
m_vDevName.push_back(strServerID);
// cout<<strServerID<<endl;
}
//m_thAcq = new AcquisitionThread(this,m_mtxAcq);
set_state(Tango::OFF);
......@@ -1369,7 +1385,8 @@ namespace AGIPDMaster_ns
if(strVal!=string("") && strVal!=string("test"))
{
strVal = strVal.substr(3,(strVal.length()-1));//remove m1_ prefix
std::size_t stFound = strVal.find_first_of('_');
strVal = strVal.substr(stFound+1,(strVal.length()-1-stFound));//remove m1_ prefix
*attr_FilePrefix_read = CORBA::string_dup(strVal.c_str());
}
......@@ -1779,8 +1796,7 @@ namespace AGIPDMaster_ns
/*----- PROTECTED REGION END -----*/ // AGIPDMaster::stop_acq
}
}
//--------------------------------------------------------
/**
......@@ -1874,7 +1890,7 @@ namespace AGIPDMaster_ns
{
string strTmp;
if(strAttr == string("FilePrefix"))
strTmp = string("m")+to_string(static_cast<long long int>(nIdx))+string("_")+strVal;
strTmp = m_vDevName[i]+string("_")+strVal;
else
strTmp = strVal;
......
......@@ -59,6 +59,7 @@ class AGIPDMaster : public Tango::Device_4Impl
string m_strMsg;
Tango::DevState m_stateDetLatest;
vector<Tango::DeviceProxy*> m_vobjDP;
vector<string> m_vDevName;
omni_thread* m_thAcq;
omni_mutex m_mtxAcq;
......
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