Index: /trunk/FACT++/Makefile.am
===================================================================
--- /trunk/FACT++/Makefile.am	(revision 11617)
+++ /trunk/FACT++/Makefile.am	(revision 11618)
@@ -43,4 +43,7 @@
 if HAS_GUI
 bin_PROGRAMS += fact
+if HAS_VIEWER
+bin_PROGRAMS += viewer
+endif
 endif
 
@@ -311,17 +314,39 @@
 
 if HAS_GUI
-DIALOGS = \
+
+#
+
+fact_DIALOGS = \
 	gui/design.ui
 
-RESOURCES = \
+fact_RESOURCES = \
 	gui/design.qrc
 
-QT_SOURCES = \
+fact_QT_SOURCES = \
 	gui/DockWindow.cc \
 	gui/MainWindow.cc
-endif
-
-BUILT_SOURCES = $(DIALOGS:.ui=.h) $(RESOURCES:.qrc=.cc) $(QT_SOURCES:.cc=.moc.cc)
-
+
+fact_SRCADD = $(fact_DIALOGS:.ui=.h) $(fact_RESOURCES:.qrc=.cc) $(fact_QT_SOURCES:.cc=.moc.cc)
+
+#
+
+if HAS_VIEWER
+
+viewer_DIALOGS = \
+	gui/RawEventsViewer/viewer.ui
+
+viewer_QT_SOURCES = \
+	gui/RawEventsViewer/RawEventsViewer.cc
+
+viewer_SRCADD = $(viewer_DIALOGS:.ui=.h) $(viewer_RESOURCES:.qrc=.cc) $(viewer_QT_SOURCES:.cc=.moc.cc)
+
+endif
+
+endif
+
+
+
+BUILT_SOURCES = $(fact_SRCADD) $(viewer_SRCADD)
+	
 CLEANFILES += $(BUILT_SOURCES)
 
@@ -333,7 +358,13 @@
 	libConfiguration.la
 
-fact_SOURCES = $(BUILT_SOURCES) $(QT_SOURCES) \
+fact_SOURCES = $(fact_SRCADD) $(fact_QT_SOURCES) \
 	gui/CheckBoxDelegate.cc gui/HtmlDelegate.cc \
 	gui/fact.cc gui/FactGui.cc src/HeadersFTM.cc
+
+viewer_LDADD = $(QT4_LIB) $(QT4_LDFLAGS) -L. -lQtOpenGL -lGLU
+
+viewer_SOURCES = $(viewer_SRCADD) $(viewer_QT_SOURCES)
+
+
 
 #-------------------------------------------------------------------------
Index: /trunk/FACT++/Makefile.in
===================================================================
--- /trunk/FACT++/Makefile.in	(revision 11617)
+++ /trunk/FACT++/Makefile.in	(revision 11618)
@@ -53,10 +53,11 @@
 	chatclient$(EXEEXT) chatserv$(EXEEXT) biasctrl$(EXEEXT) \
 	mcp$(EXEEXT) fitsdump$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \
-	$(am__EXEEXT_3)
+	$(am__EXEEXT_3) $(am__EXEEXT_4)
 @HAS_GUI_TRUE@am__append_1 = fact
-@HAS_LIBXP_TRUE@am__append_2 = did
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__append_2 = viewer
+@HAS_LIBXP_TRUE@am__append_3 = did
 
 # This is a trick to be able to build them but not having them in 'all'
-@IS_FALSE@am__append_3 = \
+@IS_FALSE@am__append_4 = \
 @IS_FALSE@	test \
 @IS_FALSE@	dclient5 dserver2 \
@@ -65,11 +66,11 @@
 @IS_FALSE@	readfits
 
-@HAS_FITS_TRUE@am__append_4 = src/Fits.cc
-@HAS_GROFF_TRUE@am__append_5 = $(dist_man1_MANS:.man=.html)
-@HAS_GROFF_TRUE@am__append_6 = $(dist_man1_MANS:.man=.html) 
+@HAS_FITS_TRUE@am__append_5 = src/Fits.cc
+@HAS_GROFF_TRUE@am__append_6 = $(dist_man1_MANS:.man=.html)
 @HAS_GROFF_TRUE@am__append_7 = $(dist_man1_MANS:.man=.html) 
-@HAS_GROFF_TRUE@@HAS_PS2PDF_TRUE@am__append_8 = $(dist_man1_MANS:.man=.pdf)
+@HAS_GROFF_TRUE@am__append_8 = $(dist_man1_MANS:.man=.html) 
 @HAS_GROFF_TRUE@@HAS_PS2PDF_TRUE@am__append_9 = $(dist_man1_MANS:.man=.pdf)
 @HAS_GROFF_TRUE@@HAS_PS2PDF_TRUE@am__append_10 = $(dist_man1_MANS:.man=.pdf)
+@HAS_GROFF_TRUE@@HAS_PS2PDF_TRUE@am__append_11 = $(dist_man1_MANS:.man=.pdf)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -159,6 +160,7 @@
 libTools_la_OBJECTS = $(am_libTools_la_OBJECTS)
 @HAS_GUI_TRUE@am__EXEEXT_1 = fact$(EXEEXT)
-@HAS_LIBXP_TRUE@am__EXEEXT_2 = did$(EXEEXT)
-@IS_FALSE@am__EXEEXT_3 = test$(EXEEXT) dclient5$(EXEEXT) \
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__EXEEXT_2 = viewer$(EXEEXT)
+@HAS_LIBXP_TRUE@am__EXEEXT_3 = did$(EXEEXT)
+@IS_FALSE@am__EXEEXT_4 = test$(EXEEXT) dclient5$(EXEEXT) \
 @IS_FALSE@	dserver2$(EXEEXT) fitsloader$(EXEEXT) \
 @IS_FALSE@	fitsgrep$(EXEEXT) sched$(EXEEXT) astro$(EXEEXT) \
@@ -222,5 +224,6 @@
 @HAS_GUI_TRUE@am__objects_4 = gui/DockWindow.moc.$(OBJEXT) \
 @HAS_GUI_TRUE@	gui/MainWindow.moc.$(OBJEXT)
-am__objects_5 = $(am__objects_2) $(am__objects_3) $(am__objects_4)
+@HAS_GUI_TRUE@am__objects_5 = $(am__objects_2) $(am__objects_3) \
+@HAS_GUI_TRUE@	$(am__objects_4)
 @HAS_GUI_TRUE@am__objects_6 = gui/DockWindow.$(OBJEXT) \
 @HAS_GUI_TRUE@	gui/MainWindow.$(OBJEXT)
@@ -303,4 +306,14 @@
 triggerschedule_DEPENDENCIES = libDim.la libDim++.la \
 	libDimExtension.la libConfiguration.la
+am__viewer_SOURCES_DIST = gui/RawEventsViewer/viewer.h \
+	gui/RawEventsViewer/RawEventsViewer.moc.cc \
+	gui/RawEventsViewer/RawEventsViewer.cc
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__objects_7 = gui/RawEventsViewer/RawEventsViewer.moc.$(OBJEXT)
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__objects_8 = $(am__objects_2) \
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@	$(am__objects_7)
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@am__objects_9 = gui/RawEventsViewer/RawEventsViewer.$(OBJEXT)
+am_viewer_OBJECTS = $(am__objects_8) $(am__objects_9)
+viewer_OBJECTS = $(am_viewer_OBJECTS)
+viewer_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 SCRIPTS = $(dist_noinst_SCRIPTS)
 DEFAULT_INCLUDES = -I.@am__isrc@
@@ -359,5 +372,5 @@
 	$(logtime_SOURCES) $(mcp_SOURCES) $(readfits_SOURCES) sched.c \
 	$(scheduler_SOURCES) $(test_SOURCES) $(time_SOURCES) \
-	$(triggerschedule_SOURCES)
+	$(triggerschedule_SOURCES) $(viewer_SOURCES)
 DIST_SOURCES = $(libConfiguration_la_SOURCES) $(libDim___la_SOURCES) \
 	$(libDim_la_SOURCES) $(libDimExtension_la_SOURCES) \
@@ -374,5 +387,5 @@
 	$(mcp_SOURCES) $(readfits_SOURCES) sched.c \
 	$(scheduler_SOURCES) $(test_SOURCES) $(time_SOURCES) \
-	$(triggerschedule_SOURCES)
+	$(triggerschedule_SOURCES) $(am__viewer_SOURCES_DIST)
 man1dir = $(mandir)/man1
 NROFF = nroff
@@ -648,5 +661,5 @@
 
 #-------------------------------------------------------------------------
-CLEANFILES = $(BUILT_SOURCES) $(am__append_7) $(am__append_10)
+CLEANFILES = $(BUILT_SOURCES) $(am__append_8) $(am__append_11)
 dist_noinst_SCRIPTS = autogen.sh
 EXTRA_DIST = Doxyfile dim/DIM_Performance.pdf dim/LICENSE.GPL \
@@ -655,5 +668,5 @@
 	dim/README_v14.txt dim/README_v17.txt dim/README_v16.txt \
 	dim/README_v17.txt dim/README_v18.txt dim/README_v19.txt \
-	$(DIALOGS) $(RESOURCES) $(am__append_6) $(am__append_9)
+	$(DIALOGS) $(RESOURCES) $(am__append_7) $(am__append_10)
 dns_LDADD = libDim.la libDimExtension.la
 dns_SOURCES = src/dns.c
@@ -828,5 +841,5 @@
 test_LDADD = libTools.la libStateMachine.la libTime.la libDim.la libDim++.la libConfiguration.la
 datalogger_SOURCES = src/datalogger.cc src/LocalControl.h \
-	$(am__append_4)
+	$(am__append_5)
 datalogger_LDADD = libDim.la libDim++.la libDimExtension.la \
 	libTime.la libTools.la libStateMachine.la \
@@ -850,15 +863,27 @@
 
 # -----
-@HAS_GUI_TRUE@DIALOGS = \
+
+#
+@HAS_GUI_TRUE@fact_DIALOGS = \
 @HAS_GUI_TRUE@	gui/design.ui
 
-@HAS_GUI_TRUE@RESOURCES = \
+@HAS_GUI_TRUE@fact_RESOURCES = \
 @HAS_GUI_TRUE@	gui/design.qrc
 
-@HAS_GUI_TRUE@QT_SOURCES = \
+@HAS_GUI_TRUE@fact_QT_SOURCES = \
 @HAS_GUI_TRUE@	gui/DockWindow.cc \
 @HAS_GUI_TRUE@	gui/MainWindow.cc
 
-BUILT_SOURCES = $(DIALOGS:.ui=.h) $(RESOURCES:.qrc=.cc) $(QT_SOURCES:.cc=.moc.cc)
+@HAS_GUI_TRUE@fact_SRCADD = $(fact_DIALOGS:.ui=.h) $(fact_RESOURCES:.qrc=.cc) $(fact_QT_SOURCES:.cc=.moc.cc)
+
+#
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@viewer_DIALOGS = \
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@	gui/RawEventsViewer/viewer.ui
+
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@viewer_QT_SOURCES = \
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@	gui/RawEventsViewer/RawEventsViewer.cc
+
+@HAS_GUI_TRUE@@HAS_VIEWER_TRUE@viewer_SRCADD = $(viewer_DIALOGS:.ui=.h) $(viewer_RESOURCES:.qrc=.cc) $(viewer_QT_SOURCES:.cc=.moc.cc)
+BUILT_SOURCES = $(fact_SRCADD) $(viewer_SRCADD)
 fact_LDADD = $(ROOTLDFLAGS) $(ROOTGLIBS) $(QT4_LIB) $(QT4_LDFLAGS) -L. \
 	libDim.la libDim++.la libDimExtension.la \
@@ -866,8 +891,10 @@
 	libConfiguration.la
 
-fact_SOURCES = $(BUILT_SOURCES) $(QT_SOURCES) \
+fact_SOURCES = $(fact_SRCADD) $(fact_QT_SOURCES) \
 	gui/CheckBoxDelegate.cc gui/HtmlDelegate.cc \
 	gui/fact.cc gui/FactGui.cc src/HeadersFTM.cc
 
+viewer_LDADD = $(QT4_LIB) $(QT4_LDFLAGS) -L. -lQtOpenGL -lGLU
+viewer_SOURCES = $(viewer_SRCADD) $(viewer_QT_SOURCES)
 
 #-------------------------------------------------------------------------
@@ -875,5 +902,5 @@
 
 #-------------------------------------------------------------------------
-MAN_TARGETS = $(dist_man1_MANS) $(am__append_5) $(am__append_8)
+MAN_TARGETS = $(dist_man1_MANS) $(am__append_6) $(am__append_9)
 all: $(BUILT_SOURCES)
 	$(MAKE) $(AM_MAKEFLAGS) all-am
@@ -1286,4 +1313,19 @@
 	@rm -f triggerschedule$(EXEEXT)
 	$(AM_V_CXXLD)$(CXXLINK) $(triggerschedule_OBJECTS) $(triggerschedule_LDADD) $(LIBS)
+gui/RawEventsViewer/$(am__dirstamp):
+	@$(MKDIR_P) gui/RawEventsViewer
+	@: > gui/RawEventsViewer/$(am__dirstamp)
+gui/RawEventsViewer/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) gui/RawEventsViewer/$(DEPDIR)
+	@: > gui/RawEventsViewer/$(DEPDIR)/$(am__dirstamp)
+gui/RawEventsViewer/RawEventsViewer.moc.$(OBJEXT):  \
+	gui/RawEventsViewer/$(am__dirstamp) \
+	gui/RawEventsViewer/$(DEPDIR)/$(am__dirstamp)
+gui/RawEventsViewer/RawEventsViewer.$(OBJEXT):  \
+	gui/RawEventsViewer/$(am__dirstamp) \
+	gui/RawEventsViewer/$(DEPDIR)/$(am__dirstamp)
+viewer$(EXEEXT): $(viewer_OBJECTS) $(viewer_DEPENDENCIES) 
+	@rm -f viewer$(EXEEXT)
+	$(AM_V_CXXLD)$(CXXLINK) $(viewer_OBJECTS) $(viewer_LDADD) $(LIBS)
 
 mostlyclean-compile:
@@ -1334,4 +1376,6 @@
 	-rm -f gui/MainWindow.$(OBJEXT)
 	-rm -f gui/MainWindow.moc.$(OBJEXT)
+	-rm -f gui/RawEventsViewer/RawEventsViewer.$(OBJEXT)
+	-rm -f gui/RawEventsViewer/RawEventsViewer.moc.$(OBJEXT)
 	-rm -f gui/design.$(OBJEXT)
 	-rm -f gui/fact.$(OBJEXT)
@@ -1463,4 +1507,6 @@
 @AMDEP_TRUE@@am__include@ @am__quote@gui/$(DEPDIR)/design.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@gui/$(DEPDIR)/fact.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gui/RawEventsViewer/$(DEPDIR)/RawEventsViewer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@gui/RawEventsViewer/$(DEPDIR)/RawEventsViewer.moc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Configuration.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/Connection.Plo@am__quote@
@@ -1975,4 +2021,6 @@
 	-rm -f gui/$(DEPDIR)/$(am__dirstamp)
 	-rm -f gui/$(am__dirstamp)
+	-rm -f gui/RawEventsViewer/$(DEPDIR)/$(am__dirstamp)
+	-rm -f gui/RawEventsViewer/$(am__dirstamp)
 	-rm -f src/$(DEPDIR)/$(am__dirstamp)
 	-rm -f src/$(am__dirstamp)
@@ -1989,5 +2037,5 @@
 distclean: distclean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf ./$(DEPDIR) dim/src/$(DEPDIR) dim/src/did/$(DEPDIR) gui/$(DEPDIR) src/$(DEPDIR)
+	-rm -rf ./$(DEPDIR) dim/src/$(DEPDIR) dim/src/did/$(DEPDIR) gui/$(DEPDIR) gui/RawEventsViewer/$(DEPDIR) src/$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
@@ -2038,5 +2086,5 @@
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
-	-rm -rf ./$(DEPDIR) dim/src/$(DEPDIR) dim/src/did/$(DEPDIR) gui/$(DEPDIR) src/$(DEPDIR)
+	-rm -rf ./$(DEPDIR) dim/src/$(DEPDIR) dim/src/did/$(DEPDIR) gui/$(DEPDIR) gui/RawEventsViewer/$(DEPDIR) src/$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
Index: /trunk/FACT++/configure
===================================================================
--- /trunk/FACT++/configure	(revision 11617)
+++ /trunk/FACT++/configure	(revision 11618)
@@ -751,4 +751,10 @@
 IS_FALSE_FALSE
 IS_FALSE_TRUE
+HAS_VIEWER_FALSE
+HAS_VIEWER_TRUE
+HAS_FITS_H_FALSE
+HAS_FITS_H_TRUE
+HAS_IZSTREAM_H_FALSE
+HAS_IZSTREAM_H_TRUE
 HAS_ZLIB_FALSE
 HAS_ZLIB_TRUE
@@ -4804,11 +4810,11 @@
   lt_cv_nm_interface="BSD nm"
   echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:4806: $ac_compile\"" >&5)
+  (eval echo "\"\$as_me:4812: $ac_compile\"" >&5)
   (eval "$ac_compile" 2>conftest.err)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4809: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval echo "\"\$as_me:4815: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
   (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
   cat conftest.err >&5
-  (eval echo "\"\$as_me:4812: output\"" >&5)
+  (eval echo "\"\$as_me:4818: output\"" >&5)
   cat conftest.out >&5
   if $GREP 'External.*some_variable' conftest.out > /dev/null; then
@@ -6015,5 +6021,5 @@
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 6017 "configure"' > conftest.$ac_ext
+  echo '#line 6023 "configure"' > conftest.$ac_ext
   if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
@@ -7676,9 +7682,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:7678: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:7684: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:7682: \$? = $ac_status" >&5
+   echo "$as_me:7688: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -8015,9 +8021,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8017: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8023: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:8021: \$? = $ac_status" >&5
+   echo "$as_me:8027: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -8120,9 +8126,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8122: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8128: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8126: \$? = $ac_status" >&5
+   echo "$as_me:8132: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -8175,9 +8181,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:8177: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:8183: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:8181: \$? = $ac_status" >&5
+   echo "$as_me:8187: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -10559,5 +10565,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10561 "configure"
+#line 10567 "configure"
 #include "confdefs.h"
 
@@ -10655,5 +10661,5 @@
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 10657 "configure"
+#line 10663 "configure"
 #include "confdefs.h"
 
@@ -12611,9 +12617,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12613: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12619: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:12617: \$? = $ac_status" >&5
+   echo "$as_me:12623: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
@@ -12710,9 +12716,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12712: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12718: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12716: \$? = $ac_status" >&5
+   echo "$as_me:12722: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -12762,9 +12768,9 @@
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:12764: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:12770: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:12768: \$? = $ac_status" >&5
+   echo "$as_me:12774: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
@@ -18339,6 +18345,46 @@
 
 
-#AC_CHECK_FILE(gui/RawEventsViewer(izstream.h, [action.if-yes], [action-if-no])
-#AC_CHECK_FILE(gui/RawEventsViewer(fits.h    , [action.if-yes], [action-if-no])
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gui/RawEventsViewer/izstream.h" >&5
+$as_echo_n "checking for gui/RawEventsViewer/izstream.h... " >&6; }
+if test "${ac_cv_file_gui_RawEventsViewer_izstream_h+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  test "$cross_compiling" = yes &&
+  as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "gui/RawEventsViewer/izstream.h"; then
+  ac_cv_file_gui_RawEventsViewer_izstream_h=yes
+else
+  ac_cv_file_gui_RawEventsViewer_izstream_h=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_gui_RawEventsViewer_izstream_h" >&5
+$as_echo "$ac_cv_file_gui_RawEventsViewer_izstream_h" >&6; }
+if test "x$ac_cv_file_gui_RawEventsViewer_izstream_h" = x""yes; then :
+  HAVE_IZSTREAM_H=yes
+else
+  HAVE_IZSTREAM_H=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gui/RawEventsViewer/fits.h" >&5
+$as_echo_n "checking for gui/RawEventsViewer/fits.h... " >&6; }
+if test "${ac_cv_file_gui_RawEventsViewer_fits_h+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  test "$cross_compiling" = yes &&
+  as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "gui/RawEventsViewer/fits.h"; then
+  ac_cv_file_gui_RawEventsViewer_fits_h=yes
+else
+  ac_cv_file_gui_RawEventsViewer_fits_h=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file_gui_RawEventsViewer_fits_h" >&5
+$as_echo "$ac_cv_file_gui_RawEventsViewer_fits_h" >&6; }
+if test "x$ac_cv_file_gui_RawEventsViewer_fits_h" = x""yes; then :
+  HAVE_FITS_H=yes
+else
+  HAVE_FITS_H=no
+fi
+
 
 # Needed to compile FACT++
@@ -21814,5 +21860,5 @@
 
 		cat > conftest.$ac_ext <<EOF
-#line 21816 "configure"
+#line 21862 "configure"
 #include "confdefs.h"
 #include <qglobal.h>
@@ -22523,4 +22569,29 @@
 fi
 
+ if test "$HAVE_IZSTREAM_H" = yes; then
+  HAS_IZSTREAM_H_TRUE=
+  HAS_IZSTREAM_H_FALSE='#'
+else
+  HAS_IZSTREAM_H_TRUE='#'
+  HAS_IZSTREAM_H_FALSE=
+fi
+
+ if test "$HAVE_FITS_H" = yes; then
+  HAS_FITS_H_TRUE=
+  HAS_FITS_H_FALSE='#'
+else
+  HAS_FITS_H_TRUE='#'
+  HAS_FITS_H_FALSE=
+fi
+
+
+ if test "$HAVE_FITS_H" = yes; then
+  HAS_VIEWER_TRUE=
+  HAS_VIEWER_FALSE='#'
+else
+  HAS_VIEWER_TRUE='#'
+  HAS_VIEWER_FALSE=
+fi
+
 
  if test "x" = "y"; then
@@ -22549,8 +22620,18 @@
 
 fi
-if test "$HAVE_ZLIB" = yes; then
+
+if test "$HAVE_FITS_H" = yes; then
+
+   if test "$HAVE_IZSTREAM_H" = yes; then
+
+      if test "$HAVE_ZLIB" = yes; then
   $as_echo "#define HAVE_ZLIB 1" >>confdefs.h
 
 fi
+
+fi
+
+fi
+
 
 ##########################################################################
@@ -22866,4 +22947,16 @@
 if test -z "${HAS_ZLIB_TRUE}" && test -z "${HAS_ZLIB_FALSE}"; then
   as_fn_error $? "conditional \"HAS_ZLIB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_IZSTREAM_H_TRUE}" && test -z "${HAS_IZSTREAM_H_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_IZSTREAM_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_FITS_H_TRUE}" && test -z "${HAS_FITS_H_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_FITS_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HAS_VIEWER_TRUE}" && test -z "${HAS_VIEWER_FALSE}"; then
+  as_fn_error $? "conditional \"HAS_VIEWER\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
@@ -25258,4 +25351,8 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}:  zlib                   / 'zlib.h'          found: $HAVE_ZLIB" >&5
 $as_echo "$as_me:  zlib                   / 'zlib.h'          found: $HAVE_ZLIB" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}:  gui/RawEventsViewer/izstream.h             found: $HAVE_IZSTREAM_H" >&5
+$as_echo "$as_me:  gui/RawEventsViewer/izstream.h             found: $HAVE_IZSTREAM_H" >&6;}
+{ $as_echo "$as_me:${as_lineno-$LINENO}:  gui/RawEventsViewer/fits.h                 found: $HAVE_FITS_H" >&5
+$as_echo "$as_me:  gui/RawEventsViewer/fits.h                 found: $HAVE_FITS_H" >&6;}
 { $as_echo "$as_me:${as_lineno-$LINENO}:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&5
 $as_echo "$as_me:  cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO" >&6;}
@@ -25421,6 +25518,20 @@
   :
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  zlib not found. Support for reading zipped files disabled!" >&5
-$as_echo "$as_me: WARNING:  zlib not found. Support for reading zipped files disabled!" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  zlib not found. Support for reading zipped files viewer disabled!" >&5
+$as_echo "$as_me: WARNING:  zlib not found. Support for reading zipped files viewer disabled!" >&2;}
+
+fi
+if test "$HAVE_IZSTREAM_H" = yes; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Mars izstream.h not found in gui/RawEventsViwer. Support for reading zipped files in viewer disabled!" >&5
+$as_echo "$as_me: WARNING:  Mars izstream.h not found in gui/RawEventsViwer. Support for reading zipped files in viewer disabled!" >&2;}
+
+fi
+if test "$HAVE_FITS_H" = yes; then
+  :
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Mars fits.h not found in gui/RawEventsViwer. Support for viewer disabled!" >&5
+$as_echo "$as_me: WARNING:  Mars fits.h not found in gui/RawEventsViwer. Support for viewer disabled!" >&2;}
 
 fi
@@ -25452,6 +25563,6 @@
   :
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Either QT4 or qt-root is missing: GUI disabled!" >&5
-$as_echo "$as_me: WARNING:  Either QT4 or qt-root is missing: GUI disabled!" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING:  Either QT4 or qt-root is missing: GUIs disabled!" >&5
+$as_echo "$as_me: WARNING:  Either QT4 or qt-root is missing: GUIs disabled!" >&2;}
 
 fi
Index: /trunk/FACT++/configure.ac
===================================================================
--- /trunk/FACT++/configure.ac	(revision 11617)
+++ /trunk/FACT++/configure.ac	(revision 11618)
@@ -111,6 +111,8 @@
 		 HAVE_ZLIB=yes, HAVE_ZLIB=no)
 
-#AC_CHECK_FILE(gui/RawEventsViewer(izstream.h, [action.if-yes], [action-if-no])
-#AC_CHECK_FILE(gui/RawEventsViewer(fits.h    , [action.if-yes], [action-if-no])
+AC_CHECK_FILE(gui/RawEventsViewer/izstream.h, 
+		HAVE_IZSTREAM_H=yes, HAVE_IZSTREAM_H=no)
+AC_CHECK_FILE(gui/RawEventsViewer/fits.h, 
+		HAVE_FITS_H=yes, HAVE_FITS_H=no)
 
 # Needed to compile FACT++
@@ -290,4 +292,8 @@
 AM_CONDITIONAL(HAS_FITS,      [test "$HAVE_CFITSIO" = yes -a "$HAVE_CCFITS" = yes])
 AM_CONDITIONAL(HAS_ZLIB,      [test "$HAVE_ZLIB" = yes])
+AM_CONDITIONAL(HAS_IZSTREAM_H,[test "$HAVE_IZSTREAM_H" = yes])
+AM_CONDITIONAL(HAS_FITS_H,    [test "$HAVE_FITS_H" = yes])
+
+AM_CONDITIONAL(HAS_VIEWER,    [test "$HAVE_FITS_H" = yes])
 
 AM_CONDITIONAL(IS_FALSE,      [test "x" = "y"])
@@ -296,5 +302,11 @@
 AM_COND_IF(HAS_FITS, [AC_DEFINE(HAVE_FITS)], )
 AM_COND_IF(HAS_ROOT, [AC_DEFINE(HAVE_ROOT)], )
-AM_COND_IF(HAS_ZLIB, [AC_DEFINE(HAVE_ZLIB)], )
+
+AM_COND_IF(HAS_FITS_H, [
+   AM_COND_IF(HAS_IZSTREAM_H, [
+      AM_COND_IF(HAS_ZLIB, [AC_DEFINE(HAVE_ZLIB)], )
+   ])
+],)
+
 
 ##########################################################################
@@ -345,4 +357,6 @@
 AC_MSG_NOTICE()
 AC_MSG_NOTICE([ zlib                   / 'zlib.h'          found: $HAVE_ZLIB])
+AC_MSG_NOTICE([ gui/RawEventsViewer/izstream.h             found: $HAVE_IZSTREAM_H])
+AC_MSG_NOTICE([ gui/RawEventsViewer/fits.h                 found: $HAVE_FITS_H])
 AC_MSG_NOTICE([ cfitsio                / 'fitsio.h'        found: $HAVE_CFITSIO])
 AC_MSG_NOTICE([ CCfits                 / 'CCfits/CCfits'   found: $HAVE_CCFITS])
@@ -427,5 +441,11 @@
 AC_MSG_NOTICE()
 AM_COND_IF(HAS_ZLIB,, 
-      AC_MSG_WARN([ zlib not found. Support for reading zipped files disabled!])
+      AC_MSG_WARN([ zlib not found. Support for reading zipped files viewer disabled!])
+)
+AM_COND_IF(HAS_IZSTREAM_H,, 
+      AC_MSG_WARN([ Mars izstream.h not found in gui/RawEventsViwer. Support for reading zipped files in viewer disabled!])
+)
+AM_COND_IF(HAS_FITS_H,, 
+      AC_MSG_WARN([ Mars fits.h not found in gui/RawEventsViwer. Support for viewer disabled!])
 )
 AM_COND_IF(HAS_LIBXP,, 
@@ -441,5 +461,5 @@
 )
 AM_COND_IF(HAS_GUI, [], 
-      AC_MSG_WARN([ Either QT4 or qt-root is missing: GUI disabled!])
-)
-AC_MSG_NOTICE()
+      AC_MSG_WARN([ Either QT4 or qt-root is missing: GUIs disabled!])
+)
+AC_MSG_NOTICE()
