Commit 40aa27d6 authored by Laurent Claustre's avatar Laurent Claustre

Improved test prgs

parent 8e2f7cb2
......@@ -96,3 +96,6 @@ IF(COMPILE_SIP)
INSTALL(FILES python/__init__.py DESTINATION "${PYTHON_SITE_PACKAGES_DIR}/Lima/Maxipix")
ENDIF()
# test prgs
ADD_SUBDIRECTORY(test)
[config]
version = 1.0
type = MAXIPIX
[dacs]
biaslvds = 128
buffanaloga = 127
buffanalogb = 127
ctpr = 1
disc = 110
fbk = 140
gnd = 80
hist = 0
ikrum = 5
preamp = 240
reflvds = 128
thl = 7480
ths = 80
vcas = 130
[detmodule]
chip_1 = 1
chip_2 = 2
chip_3 = 3
chip_4 = 4
frequency = 50.0
name = tpxatl44x
bias = 150
polarity = POSITIVE
asic = TPX1
nchips = 4
pitch = 1
xfirst = 0
yfirst = 0
xpixels = 256
ypixels = 256
name_1=x
name_2=x
name_3=x
name_4=x
energy = 5
[layout_standard]
layout = L_2X2
xchips=2
ychips=2
xgap=4
ygap=4
pos_1=10
pos_2=00
pos_3=01
pos_4=11
rot_2 = 1
rot_3 = -1
rot_1 = 1
rot_4 = -1
[calibration]
energy = 4.0
thlnoise_2 = 7809
thlnoise_3 = 7912
thlnoise_1 = 7846
thlnoise_4 = 7903
thlxray_2 = 7773
thlxray_3 = 7873
thlxray_1 = 7808
thlxray_4 = 7850
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
############################################################################
# This file is part of LImA, a Library for Image Acquisition
#
# Copyright (C) : 2009-2013
# Copyright (C) : 2009-2017
# European Synchrotron Radiation Facility
# BP 220, Grenoble 38043
# FRANCE
......@@ -19,44 +19,23 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
############################################################################
LIMA_DIR := $(shell pwd)/../../../..
LIMA_ESPIA_DIR := $(LIMA_DIR)/camera/common/espia
include $(LIMA_DIR)/config.inc
include $(LIMA_DIR)/control/control.inc
include $(LIMA_ESPIA_DIR)/include/espia.inc
SRCS = test.cpp test2.cpp
CPPFLAGS = -I../../include -I../../tools/src -I$(LIMA_ESPIA_DIR)/include \
$(CT_CPPFLAGS) -I$(ESPIA_DRV_INCL)
CXXFLAGS = $(CT_CXXFLAGS)
DEPLIBS = $(CT_DEPLIBS) \
$(LIMA_DIR)/build,limacore \
$(LIMA_DIR)/build,limaespia \
$(LIMA_DIR)/build,limamaxipix
LDFLAGS = $(CT_LDFLAGS) $(call lib-depflags,$(DEPLIBS)) -L$(ESPIA_DRV_LIB)
LDLIBS = $(CT_LDLIBS) $(call lib-deplibs,$(DEPLIBS)) -lespia
test-progs = test test2
all: $(test-progs)
test: test.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
test2: test2.o
$(CXX) $(LDFLAGS) -o $@ $+ $(LDLIBS)
clean:
rm -f *.o *.P test test2
%.o : %.cpp
$(COMPILE.cpp) $(CPPFLAGS) -MD $(CXXFLAGS) -o $@ $<
@cp $*.d $*.P; \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
rm -f $*.d
-include $(SRCS:.cpp=.P)
SET(maxipix_test1_srcs test_maxipix_config_reader.cpp)
SET(maxipix_test2_srcs test_maxipix_acq.cpp)
ADD_EXECUTABLE(test_maxipix_config_reader ${maxipix_test1_srcs})
ADD_EXECUTABLE(test_maxipix_acq ${maxipix_test2_srcs})
TARGET_LINK_LIBRARIES(test_maxipix_config_reader limacore limamaxipix)
TARGET_LINK_LIBRARIES(test_maxipix_acq limacore limamaxipix)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config/mydet_chip_1.edf config/mydet_chip_1.edf COPYONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config/tpxatl25_chip_1.bpc
config/tpxatl25_chip_1.bpc COPYONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config/tpxatl25_chip_2.bpc
config/tpxatl25_chip_2.bpc COPYONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config/tpxatl25_chip_3.bpc
config/tpxatl25_chip_3.bpc COPYONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config/tpxatl25_chip_4.bpc
config/tpxatl25_chip_4.bpc COPYONLY)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config/tpxatl25.cfg config/tpxatl25.cfg COPYONLY)
......@@ -8,14 +8,14 @@ biaslvds = 128
buffanaloga = 127
buffanalogb = 127
ctpr = 1
disc = 110
disc = 127
fbk = 128
gnd = 80
hist = 0
ikrum = 5
preamp = 240
preamp = 255
reflvds = 128
thl = 7437
thl = 7572
ths = 60
vcas = 130
......@@ -34,6 +34,7 @@ chip_1 = 1
chip_2 = 2
chip_3 = 3
chip_4 = 4
chip_5 = 5
pitch = 1
xfirst = 0
yfirst = 0
......@@ -41,22 +42,26 @@ name_1 = W15C12
name_2 = W15A6
name_3 = W15G7
name_4 = W15L8
energy = 8
energy = 10
[calibration]
mode = SPM
energy = 5
thlnoise_1 = 7530
thlnoise_2 = 7580
thlnoise_3 = 7558
thlnoise_4 = 7550
thlxray_1 = 7400
thlxray_2 = 7400
thlxray_3 = 7400
thlxray_4 = 7400
thlnoise_1 = 7575
thlnoise_2 = 7626
thlnoise_3 = 7586
thlnoise_4 = 7585
thlnoise_5 = 7585
thlxray_1 = 7425
thlxray_2 = 7526
thlxray_3 = 7486
thlxray_4 = 7485
thlxray_5 = 7485
[layout_standard]
layout = L_GENERAL
layout = L_2x2
#layout = L_GENERAL
#layout = L_NONE
xchips = 2
ychips = 2
xgap = 4
......@@ -82,4 +87,4 @@ yc_3 = 344
rot_3 = 2
xc_2 = 0
yc_2 = 260
rot_2 = 0
\ No newline at end of file
rot_2 = 0
This diff is collapsed.
This diff is collapsed.

\ No newline at end of file
\ No newline at end of file
\ No newline at end of file
......@@ -25,8 +25,8 @@ int main()
//DebParams::setTypeFlags(DebParams::AllFlags);
//DebParams::setFormatFlags(DebParams::AllFlags);
string path = "../../config";
string filename = "mydet";
string path = "config/";
string filename = "tpxatl25";
m_camera = new Camera(0, path, filename, true);
m_interface = new Interface(*m_camera);
......@@ -56,23 +56,28 @@ int main()
saving->setPrefix("maxipix_");
saving->setSuffix(".edf");
saving->setSavingMode(CtSaving::AutoFrame);
//saving->setOverwritePolicy(CtSaving::Append);
saving->setOverwritePolicy(CtSaving::Overwrite);
// do acquisition
m_control->acquisition()->setAcqExpoTime(2.0);
cout << "Will acquire 10 frames 1 sec. exposure and save in EDF format, overwrite mode and single file maxipix_0000.edf" << endl;
m_control->acquisition()->setAcqExpoTime(1.0);
m_control->acquisition()->setLatencyTime(0.01);
m_control->acquisition()->setAcqNbFrames(nframes);
m_control->prepareAcq();
m_control->startAcq();
CtControl::ImageStatus im_status;
while(1) {
cout << "sleeping ...." << endl;
m_control->getImageStatus(im_status);
cout << "Acquired " << im_status.LastImageAcquired+1 << " Saved " << im_status.LastImageSaved+1 << "\r";
cout.flush();
sleep(1);
if (!m_camera->isAcqRunning())
if (im_status.LastImageSaved == 9)
break;
}
sleep(5); //all done!
cout << "Acquired " << im_status.LastImageAcquired+1 << " Saved " << im_status.LastImageSaved+1 << endl;
cout << ">>>>> Done ! <<<<<" << endl;
delete m_control;
delete m_interface;
delete m_camera;
delete m_interface;
delete m_camera;
return(1);
}
......@@ -13,7 +13,7 @@ import time
#DebParams.setModuleFlags(Ac0xffffb7)
cam = Maxipix.Camera(0,'../../config', 'mydet', True)
cam = Maxipix.Camera(0,'config', 'tpxatl25', True)
hwint = Maxipix.Interface(cam)
control = Core.CtControl(hwint)
......
......@@ -11,7 +11,7 @@ using namespace std;
int main() {
string line;
ifstream file("../config/mydet_chip_1.edf");
ifstream file("config/mydet_chip_1.edf");
if (file.is_open()) {
char *hdr = new char[1024];
file.seekg(0, ios::beg);
......@@ -27,7 +27,7 @@ int main() {
} else {
cout << "Unable to open file";
}
std::string fname = "../../mydet.cfg";
std::string fname = "config/tpxatl25.cfg";
INIReader reader(fname);
if (reader.ParseError() < 0) {
std::cout << "I/O error while reading file." << std::endl;
......@@ -41,14 +41,14 @@ int main() {
assert(reader.GetInteger(section, "buffanaloga", -1) == 127);
assert(reader.GetInteger(section, "buffanalogb", -1) == 127);
assert(reader.GetInteger(section, "ctpr", -1) == 1);
assert(reader.GetInteger(section, "disc", -1) == 110);
assert(reader.GetInteger(section, "disc", -1) == 127);
assert(reader.GetInteger(section, "fbk", -1) == 128);
assert(reader.GetInteger(section, "gnd", -1) == 80);
assert(reader.GetInteger(section, "hist", -1) == 0);
assert(reader.GetInteger(section, "ikrum", -1) == 5);
assert(reader.GetInteger(section, "preamp",-1) == 240);
assert(reader.GetInteger(section, "preamp",-1) == 255);
assert(reader.GetInteger(section, "reflvds",-1) == 128);
assert(reader.GetInteger(section, "thl",-1) == 7437);
assert(reader.GetInteger(section, "thl",-1) == 7572);
assert(reader.GetInteger(section, "ths",-1) == 60);
assert(reader.GetInteger(section, "vcas",-1) == 130);
......@@ -74,22 +74,22 @@ int main() {
assert(reader.Get(section, "name_2","Unknown") == "W15A6");
assert(reader.Get(section, "name_3","Unknown") == "W15G7");
assert(reader.Get(section, "name_4","Unknown") == "W15L8");
assert(reader.GetInteger(section, "energy",-1) == 8);
assert(reader.GetInteger(section, "energy",-1) == 10);
section = "calibration";
assert(reader.Get(section, "mode","Unknown") == "SPM");
assert(reader.GetInteger(section, "energy",-1) == 5);
assert(reader.GetInteger(section, "thlnoise_1",-1) == 7530);
assert(reader.GetInteger(section, "thlnoise_2",-1) == 7580);
assert(reader.GetInteger(section, "thlnoise_3",-1) == 7558);
assert(reader.GetInteger(section, "thlnoise_4",-1) == 7550);
assert(reader.GetInteger(section, "thlxray_1",-1) == 7400);
assert(reader.GetInteger(section, "thlxray_2",-1) == 7400);
assert(reader.GetInteger(section, "thlxray_3",-1) == 7400);
assert(reader.GetInteger(section, "thlxray_4",-1) == 7400);
assert(reader.GetInteger(section, "thlnoise_1",-1) == 7575);
assert(reader.GetInteger(section, "thlnoise_2",-1) == 7626);
assert(reader.GetInteger(section, "thlnoise_3",-1) == 7586);
assert(reader.GetInteger(section, "thlnoise_4",-1) == 7585);
assert(reader.GetInteger(section, "thlxray_1",-1) == 7425);
assert(reader.GetInteger(section, "thlxray_2",-1) == 7526);
assert(reader.GetInteger(section, "thlxray_3",-1) == 7486);
assert(reader.GetInteger(section, "thlxray_4",-1) == 7485);
section = "layout_standard";
assert(reader.Get(section, "layout","Unknown") == "L_GENERAL");
assert(reader.Get(section, "layout","Unknown") == "L_2x2");
assert(reader.GetInteger(section, "xchips",-1) == 2);
assert(reader.GetInteger(section, "ychips",-1) == 2);
assert(reader.GetInteger(section, "xgap",-1) == 4);
......
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