Commit ce74c1d0 authored by seb's avatar seb
Browse files

Core:

	- change header into CBF file
Pilatus:
	- add management of gapfill
	- small bug fixed


git-svn-id: https://scm.blissgarden.org/svn/lima/trunk@349 45c4679d-1946-429d-baad-37912b19538b
parent a1aaf894
......@@ -137,6 +137,24 @@ class Pilatus(PyTango.Device_4Impl):
communication = _PilatusIterface.communication()
communication.set_threshold_gain(threshold_value,gain)
#------------------------------------------------------------------
# Read gapfill attribute
#------------------------------------------------------------------
def read_Gapfill(self, attr):
communication = _PilatusIterface.communication()
gapfill = communication.gapfill()
attr.set_value(gapfill)
#------------------------------------------------------------------
# Write gapfill attribute
#------------------------------------------------------------------
def write_Gapfill(self, attr):
data = []
attr.get_write_value(data)
gapfill = data[0]
communication = _PilatusIterface.communication()
communication.set_gapfill(gapfill)
#==================================================================
#
# Pilatus command methods
......@@ -179,6 +197,10 @@ class PilatusClass(PyTango.DeviceClass):
[[PyTango.DevFloat,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'Gapfill':
[[PyTango.DevBoolean,
PyTango.SCALAR,
PyTango.READ_WRITE]],
}
......
......@@ -180,6 +180,8 @@ class Communication:
self._error_message = None
self._trigger_mode = Communication.INTERNAL
self._gap_fill = False
try:
self.connect(host,port)
except socket.error:
......@@ -246,7 +248,10 @@ class Communication:
self._state = self.SETTING_THRESHOLD
else:
raise 'Could not set threshold, server is not idle'
if self._gap_fill:
self.__asynSock.send('gapfill -1')
def exposure(self) :
with self.__cond:
return self._exposure
......@@ -379,3 +384,12 @@ class Communication:
self.__asynSock.send('k')
def set_gapfill(self,val) :
with self.__cond:
self._gap_fill = val
self.__asynSock.send('gapfill %d' % (self._gap_fill and -1 or 0))
def gapfill(self) :
with self.__cond:
return self._gap_fill and True or False
......@@ -167,7 +167,14 @@ int SaveContainerCbf::_writeCbfHeader(Data &aData,
cbf_failnez(cbf_new_category(m_cbf,currentCategory.c_str()));
}
cbf_failnez(cbf_new_column(m_cbf,key.c_str()));
cbf_failnez(cbf_set_value(m_cbf,i->second.c_str()));
if(!i->second.find_first_of('#')) // Goreterie MOSFLM
{
std::string tmpString = "\n";
tmpString += i->second;
cbf_failnez(cbf_set_value(m_cbf,tmpString.c_str()));
}
else
cbf_failnez(cbf_set_value(m_cbf,i->second.c_str()));
}
return 0;
}
......@@ -176,14 +183,7 @@ int SaveContainerCbf::_writeCbfData(Data &aData)
{
DEB_MEMBER_FUNCT();
char imageBuffer[64];
snprintf(imageBuffer,sizeof(imageBuffer),"image_%d",m_written_frames);
cbf_failnez(cbf_new_category (m_cbf, "array_data"));
cbf_failnez(cbf_new_column (m_cbf, "array_id"));
cbf_failnez(cbf_set_value (m_cbf, imageBuffer));
cbf_failnez(cbf_new_column (m_cbf, "binary_id"));
cbf_failnez(cbf_set_integervalue (m_cbf, m_written_frames));
cbf_failnez(cbf_new_column (m_cbf, "data"));
cbf_failnez(cbf_set_integerarray_wdims(m_cbf,
......@@ -197,7 +197,7 @@ int SaveContainerCbf::_writeCbfData(Data &aData)
aData.width,
aData.height,
0,
0));
128));
cbf_failnez(cbf_write_file(m_cbf,m_fout,0,CBF,MSG_DIGEST|MIME_HEADERS,0));
return 0;
......
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