Changeset 17174


Ignore:
Timestamp:
09/19/13 16:15:12 (11 years ago)
Author:
tbretz
Message:
Some minor updates and a bug fix in the format of the NOMINAL service.
Location:
trunk/FACT++
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/Makefile.am

    r17061 r17174  
    4747        showlog \
    4848        fitsdump fitscheck \
    49         zfits \
    50         fitsCompressor
     49        zfits
    5150
    5251if HAS_GUI
     
    453452
    454453fitsdump_SOURCES = src/fitsdump.cc
    455 fitsdump_LDADD   = $(ROOTLDFLAGS) $(ROOTLIBS) libConfiguration.la libTime.la
     454fitsdump_LDADD   = $(ROOTLDFLAGS) $(ROOTLIBS) libConfiguration.la libTime.la libTools.la
    456455
    457456fitscheck_SOURCES = src/fitscheck.cc
  • trunk/FACT++/Makefile.in

    r16957 r17174  
    5353        temperature$(EXEEXT) timecheck$(EXEEXT) showlog$(EXEEXT) \
    5454        fitsdump$(EXEEXT) fitscheck$(EXEEXT) zfits$(EXEEXT) \
    55         fitsCompressor$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \
    56         $(am__EXEEXT_3) $(am__EXEEXT_4) $(am__EXEEXT_5) \
    57         $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8)
     55        $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
     56        $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \
     57        $(am__EXEEXT_7) $(am__EXEEXT_8)
    5858@HAS_GUI_TRUE@am__append_1 = fact
    5959@HAS_DBUS_TRUE@am__append_2 = skypeclient
     
    320320feedback_DEPENDENCIES = libDim++.la libDim.la libDimExtension.la \
    321321        libStateMachine.la libTools.la libTime.la libConfiguration.la
    322 am_fitsCompressor_OBJECTS = src/fitsCompressor.$(OBJEXT)
    323 fitsCompressor_OBJECTS = $(am_fitsCompressor_OBJECTS)
    324 fitsCompressor_DEPENDENCIES = libConfiguration.la
    325322am_fitscheck_OBJECTS = src/fitscheck.$(OBJEXT)
    326323fitscheck_OBJECTS = $(am_fitscheck_OBJECTS)
     
    329326fitsdump_OBJECTS = $(am_fitsdump_OBJECTS)
    330327fitsdump_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
    331         libConfiguration.la libTime.la
     328        libConfiguration.la libTime.la libTools.la
    332329fitsgrep_SOURCES = fitsgrep.c
    333330fitsgrep_OBJECTS = fitsgrep.$(OBJEXT)
     
    537534        $(dns_SOURCES) $(drivectrl_SOURCES) $(dserver2_SOURCES) \
    538535        $(fact_SOURCES) $(fad_SOURCES) $(fadctrl_SOURCES) \
    539         $(feedback_SOURCES) $(fitsCompressor_SOURCES) \
    540         $(fitscheck_SOURCES) $(fitsdump_SOURCES) fitsgrep.c \
    541         $(fitsloader_SOURCES) $(fsc_SOURCES) $(fscctrl_SOURCES) \
    542         $(ftm_SOURCES) $(ftmctrl_SOURCES) $(gcn_SOURCES) \
    543         $(lidctrl_SOURCES) $(log_SOURCES) $(logtime_SOURCES) \
    544         $(magiclidar_SOURCES) $(magicweather_SOURCES) \
    545         $(makedata_SOURCES) $(makeplots_SOURCES) $(mcp_SOURCES) \
    546         $(moon_SOURCES) $(pwrctrl_SOURCES) $(ratecontrol_SOURCES) \
    547         $(ratescan_SOURCES) $(readfits_SOURCES) sched.c \
    548         $(scheduler_SOURCES) $(showlog_SOURCES) $(skypeclient_SOURCES) \
    549         $(smartfact_SOURCES) $(temperature_SOURCES) $(test_SOURCES) \
    550         $(time_SOURCES) $(timecheck_SOURCES) $(tngweather_SOURCES) \
     536        $(feedback_SOURCES) $(fitscheck_SOURCES) $(fitsdump_SOURCES) \
     537        fitsgrep.c $(fitsloader_SOURCES) $(fsc_SOURCES) \
     538        $(fscctrl_SOURCES) $(ftm_SOURCES) $(ftmctrl_SOURCES) \
     539        $(gcn_SOURCES) $(lidctrl_SOURCES) $(log_SOURCES) \
     540        $(logtime_SOURCES) $(magiclidar_SOURCES) \
     541        $(magicweather_SOURCES) $(makedata_SOURCES) \
     542        $(makeplots_SOURCES) $(mcp_SOURCES) $(moon_SOURCES) \
     543        $(pwrctrl_SOURCES) $(ratecontrol_SOURCES) $(ratescan_SOURCES) \
     544        $(readfits_SOURCES) sched.c $(scheduler_SOURCES) \
     545        $(showlog_SOURCES) $(skypeclient_SOURCES) $(smartfact_SOURCES) \
     546        $(temperature_SOURCES) $(test_SOURCES) $(time_SOURCES) \
     547        $(timecheck_SOURCES) $(tngweather_SOURCES) \
    551548        $(triggerschedule_SOURCES) $(viewer_SOURCES) $(webDid_SOURCES) \
    552549        $(zfits_SOURCES)
     
    561558        $(dserver2_SOURCES) $(am__fact_SOURCES_DIST) $(fad_SOURCES) \
    562559        $(am__fadctrl_SOURCES_DIST) $(feedback_SOURCES) \
    563         $(fitsCompressor_SOURCES) $(fitscheck_SOURCES) \
    564         $(fitsdump_SOURCES) fitsgrep.c $(fitsloader_SOURCES) \
    565         $(fsc_SOURCES) $(fscctrl_SOURCES) $(ftm_SOURCES) \
    566         $(ftmctrl_SOURCES) $(gcn_SOURCES) $(lidctrl_SOURCES) \
    567         $(log_SOURCES) $(logtime_SOURCES) $(magiclidar_SOURCES) \
    568         $(magicweather_SOURCES) $(makedata_SOURCES) \
    569         $(makeplots_SOURCES) $(mcp_SOURCES) $(moon_SOURCES) \
    570         $(pwrctrl_SOURCES) $(ratecontrol_SOURCES) $(ratescan_SOURCES) \
    571         $(readfits_SOURCES) sched.c $(scheduler_SOURCES) \
    572         $(showlog_SOURCES) $(skypeclient_SOURCES) $(smartfact_SOURCES) \
    573         $(temperature_SOURCES) $(test_SOURCES) $(time_SOURCES) \
    574         $(timecheck_SOURCES) $(tngweather_SOURCES) \
     560        $(fitscheck_SOURCES) $(fitsdump_SOURCES) fitsgrep.c \
     561        $(fitsloader_SOURCES) $(fsc_SOURCES) $(fscctrl_SOURCES) \
     562        $(ftm_SOURCES) $(ftmctrl_SOURCES) $(gcn_SOURCES) \
     563        $(lidctrl_SOURCES) $(log_SOURCES) $(logtime_SOURCES) \
     564        $(magiclidar_SOURCES) $(magicweather_SOURCES) \
     565        $(makedata_SOURCES) $(makeplots_SOURCES) $(mcp_SOURCES) \
     566        $(moon_SOURCES) $(pwrctrl_SOURCES) $(ratecontrol_SOURCES) \
     567        $(ratescan_SOURCES) $(readfits_SOURCES) sched.c \
     568        $(scheduler_SOURCES) $(showlog_SOURCES) $(skypeclient_SOURCES) \
     569        $(smartfact_SOURCES) $(temperature_SOURCES) $(test_SOURCES) \
     570        $(time_SOURCES) $(timecheck_SOURCES) $(tngweather_SOURCES) \
    575571        $(triggerschedule_SOURCES) $(am__viewer_SOURCES_DIST) \
    576572        $(webDid_SOURCES) $(zfits_SOURCES)
     
    11411137fitsloader_LDADD = libStateMachine.la libTools.la libTime.la libDim++.la libDim.la libConfiguration.la
    11421138fitsdump_SOURCES = src/fitsdump.cc
    1143 fitsdump_LDADD = $(ROOTLDFLAGS) $(ROOTLIBS) libConfiguration.la libTime.la
     1139fitsdump_LDADD = $(ROOTLDFLAGS) $(ROOTLIBS) libConfiguration.la libTime.la libTools.la
    11441140fitscheck_SOURCES = src/fitscheck.cc
    11451141fitscheck_LDADD = libConfiguration.la
     
    15971593        @rm -f feedback$(EXEEXT)
    15981594        $(AM_V_CXXLD)$(CXXLINK) $(feedback_OBJECTS) $(feedback_LDADD) $(LIBS)
    1599 src/fitsCompressor.$(OBJEXT): src/$(am__dirstamp) \
    1600         src/$(DEPDIR)/$(am__dirstamp)
    1601 fitsCompressor$(EXEEXT): $(fitsCompressor_OBJECTS) $(fitsCompressor_DEPENDENCIES) $(EXTRA_fitsCompressor_DEPENDENCIES)
    1602         @rm -f fitsCompressor$(EXEEXT)
    1603         $(AM_V_CXXLD)$(CXXLINK) $(fitsCompressor_OBJECTS) $(fitsCompressor_LDADD) $(LIBS)
    16041595src/fitscheck.$(OBJEXT): src/$(am__dirstamp) \
    16051596        src/$(DEPDIR)/$(am__dirstamp)
     
    19651956        -rm -f src/fadctrl.$(OBJEXT)
    19661957        -rm -f src/feedback.$(OBJEXT)
    1967         -rm -f src/fitsCompressor.$(OBJEXT)
    19681958        -rm -f src/fitscheck.$(OBJEXT)
    19691959        -rm -f src/fitsdump.$(OBJEXT)
     
    21142104@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fadctrl.Po@am__quote@
    21152105@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/feedback.Po@am__quote@
    2116 @AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fitsCompressor.Po@am__quote@
    21172106@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fitscheck.Po@am__quote@
    21182107@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fitsdump.Po@am__quote@
     
    29532942
    29542943doc: $(MAN_TARGETS) $(JAVA_SCRIPT_DOC) doxygen-run
     2944        @ln -s index.html doxygen-doc/html/main.html
    29552945
    29562946diff:
  • trunk/FACT++/aclocal.m4

    r15491 r17174  
    17251725#   exception to the GPL to apply to your modified version as well.
    17261726
    1727 #serial 16
     1727#serial 17
    17281728
    17291729AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
     
    18991899        case "${host_cpu}-${host_os}" in
    19001900            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
    1901             *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
     1901            *-osf* | *-hpux*) flag="-D_REENTRANT";;
     1902            *solaris*)
     1903            if test "$GCC" = "yes"; then
     1904                flag="-D_REENTRANT"
     1905            else
     1906                flag="-mt -D_REENTRANT"
     1907            fi
     1908            ;;
    19021909        esac
    19031910        AC_MSG_RESULT(${flag})
  • trunk/FACT++/configure

    r16957 r17174  
    1848018480        case "${host_cpu}-${host_os}" in
    1848118481            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
    18482             *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
     18482            *-osf* | *-hpux*) flag="-D_REENTRANT";;
     18483            *solaris*)
     18484            if test "$GCC" = "yes"; then
     18485                flag="-D_REENTRANT"
     18486            else
     18487                flag="-mt -D_REENTRANT"
     18488            fi
     18489            ;;
    1848318490        esac
    1848418491        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5
     
    2397023977
    2397123978                cat > conftest.$ac_ext <<EOF
    23972 #line 23972 "configure"
     23979#line 23979 "configure"
    2397323980#include "confdefs.h"
    2397423981#include <qglobal.h>
  • trunk/FACT++/scripts/Main.js

    r17031 r17174  
    221221        return;
    222222
    223     this.ok = cnt==0;
    224 
    225     console.out("  DeltaUov=%.3f [N(>0.033V)=%d]".$(avg, cnt));
    226 }
    227 
    228 // DN:  Why is voltageOff() implemented as
    229 //      a method of a Subscription to a specific Service
    230 //      I naively would think of voltageOff() as an unbound function.
    231 //      I seems to me it has to be a method of a Subscription object, in order
    232 //      to use the update counting method. But does it have to be
    233 //      a Subscription to FEEDBACK/DEVIATION, or could it work with other services as well?
     223
     224    this.ok = cnt==0 || (this.last!=undefined && Math.abs(this.last-avg)<0.002);
     225
     226    console.out("  DeltaUov=%.3f (%.3f) [N(>0.033V)=%d]".$(avg, Math.abs(this.last-avg), cnt));
     227
     228    this.last = avg;
     229}
     230
    234231service_feedback.voltageOff = function()
    235232{
     
    247244    {
    248245        dim.log("Switching voltage off.");
    249 
    250         this.ok = undefined;
    251246
    252247        // Supress the possibility that the bias control is
     
    260255    }
    261256
    262     dim.wait("BIAS_CONTROL", "VoltageOff", 60000);
     257    dim.wait("BIAS_CONTROL", "VoltageOff", 60000); // FIXME: 30000?
    263258
    264259    // FEEDBACK stays in CurrentCtrl when Voltage is off but output enabled
     
    305300
    306301    // Wait until voltage on
    307     dim.wait("BIAS_CONTROL", "VoltageOn", 60000);
    308 
    309     if (isOff)
    310         this.ok = false;
     302    dim.wait("BIAS_CONTROL", "VoltageOn", 60000); // FIXME: 30000?
     303
     304//    if (isOff)
     305//        this.ok = false;
    311306}
    312307
     
    324319    var now = new Date();
    325320
    326     v8.timeout(60000, func, this);
     321    this.last = undefined;
     322    this.ok = false;
     323    v8.timeout(4*60000, func, this); // FIMXE: Remove 4!
     324    this.ok = undefined;
    327325
    328326    if (irq)
     
    330328    else
    331329        dim.log("Voltage stable within limits");
    332 
    333     this.ok = undefined;
    334330}
    335331
     
    378374    //dim.send("FEEDBACK/STOP");
    379375    dim.send("FTM_CONTROL/STOP_TRIGGER");
     376
     377    dim.wait("FTM_CONTROL",  "Valid",        3000);
     378    dim.wait("FEEDBACK",     "Calibrated",   3000);
     379
    380380    dim.send("BIAS_CONTROL/DISCONNECT");
    381 
    382     dim.wait("FTM_CONTROL",  "Valid",        3000);
    383381    dim.wait("BIAS_CONTROL", "Disconnected", 3000);
    384     dim.wait("FEEDBACK",     "Calibrated",   3000);
    385382
    386383    var report = sub.get();
     
    806803        while (!irq && !takeRun("single-pe", 10000));
    807804
     805        /*
     806        // =================== new feedback ======================
     807        dim.log("Switching to new bias calibration and feedback.");
     808        dim.send("BIAS_CONTROL/EXPERT_MODE", true);
     809        dim.wait("BIAS_CONTROL", "ExpertMode", 3000);
     810        dim.send("BIAS_CONTROL/EXPERT_LOAD_MAP_FILE", "/home/fact/operation/GAPDmap_with_spare_module-new2.txt");
     811        dim.send("BIAS_CONTROL/EXPERT_MODE", false);
     812        dim.wait("BIAS_CONTROL", "VoltageOn", 3000);
     813        dim.send("FEEDBACK/STOP");
     814        dim.wait("FEEDBACK", "Calibrated", 3000);
     815        dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", false);
     816        dim.send("FEEDBACK/START", 1.1);
     817        dim.wait("FEEDBACK", "InProgress", 45000);
     818        service_feedback.voltageOn();
     819        service_feedback.waitForVoltageOn();
     820
     821        v8.sleep(60000);
     822        dim.log("Taking single p.e. run.");
     823        while (!irq && !takeRun("single-pe", 10000));
     824
     825        dim.send("FEEDBACK/STOP");
     826        dim.wait("FEEDBACK", "Calibrated", 3000);
     827        dim.send("FEEDBACK/ENABLE_TEMP_OFFSETS", true);
     828        dim.send("FEEDBACK/START", 1.1);
     829        dim.wait("FEEDBACK", "InProgress", 45000);
     830        service_feedback.voltageOn();
     831        service_feedback.waitForVoltageOn();
     832
     833        v8.sleep(60000);
     834        dim.log("Taking single p.e. run.");
     835        while (!irq && !takeRun("single-pe", 10000));
     836        */
     837        // =======================================================
     838
    808839        // It is unclear what comes next, so we better switch off the voltage
    809840        service_feedback.voltageOff();
     841
     842        /*
     843        // =============== Switch back to old feedback =============
     844        dim.log("Switching to old bias calibration and feedback.");
     845        dim.send("BIAS_CONTROL/EXPERT_MODE", true);
     846        dim.wait("BIAS_CONTROL", "ExpertMode", 3000);
     847        dim.send("BIAS_CONTROL/EXPERT_LOAD_MAP_FILE", "/home/fact/operation/GAPDmap_with_spare_module-new.txt");
     848        dim.send("BIAS_CONTROL/EXPERT_MODE", false);
     849        dim.wait("BIAS_CONTROL", "VoltageOff", 3000);
     850        dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", true);
     851        dim.send("FEEDBACK/ENABLE_TEMP_OFFSETS", false);
     852        // =========================================================
     853        */
     854
    810855        system_on = true;
    811856        dim.log("Task finished [STARTUP]");
     
    909954        console.out("");
    910955        break; // case "RATESCAN"
    911 
     956/*
     957    case "FEEDBACK-TEST":
     958        // ----------------- Enable new feedback ---------------
     959        service_feedback.voltageOff();
     960        dim.log("Switching to new bias calibration and feedback.");
     961        dim.send("BIAS_CONTROL/EXPERT_MODE", true);
     962        dim.wait("BIAS_CONTROL", "ExpertMode", 3000);
     963        dim.send("BIAS_CONTROL/EXPERT_LOAD_MAP_FILE", "/home/fact/operation/GAPDmap_with_spare_module-new2.txt");
     964        dim.send("BIAS_CONTROL/EXPERT_MODE", false);
     965        dim.wait("BIAS_CONTROL", "VoltageOff", 3000);
     966        dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", false);
     967
     968        // ---------------- Take single pe run ------------------
     969        CloseLid();
     970        doDrsCalibration("singlepe");  // will turn voltage off
     971        service_feedback.voltageOn();
     972        service_feedback.waitForVoltageOn();
     973        v8.sleep(15000);
     974        dim.log("Taking single p.e. run.");
     975        while (!irq && !takeRun("single-pe", 10000));
     976
     977        dim.send("FEEDBACK/STOP");
     978        dim.wait("FEEDBACK", "Calibrated", 3000);
     979        dim.send("FEEDBACK/ENABLE_TEMP_OFFSETS", true);
     980        dim.send("FEEDBACK/START", 1.1);
     981        dim.wait("FEEDBACK", "InProgress", 45000);
     982        service_feedback.voltageOn();
     983        service_feedback.waitForVoltageOn();
     984        v8.sleep(15000);
     985        dim.log("Taking single p.e. run.");
     986        while (!irq && !takeRun("single-pe", 10000));
     987
     988        // ------------------ Ratescan --------------------------
     989        var tm1 = new Date();
     990
     991        // This is a workaround to make sure that we really catch
     992        // the new OnTrack state later and not the old one
     993        dim.send("DRIVE_CONTROL/STOP");
     994        dim.wait("DRIVE_CONTROL", "Armed", 15000);
     995
     996        // The lid must be open
     997        OpenLid();
     998
     999        // The voltage must be switched on
     1000        service_feedback.voltageOn();
     1001
     1002        if (obs.source != undefined)
     1003        {
     1004            dim.log("Pointing telescope to '"+obs[cub].source+"'.");
     1005            dim.send("DRIVE_CONTROL/TRACK_ON", obs[sub].source);
     1006        }
     1007        else
     1008        {
     1009            dim.log("Pointing telescope to ra="+obs[sub].ra+" dec="+obs[sub].dec);
     1010            dim.send("DRIVE_CONTROL/TRACK", obs[sub].ra, obs[sub].dec);
     1011        }
     1012
     1013        dim.wait("DRIVE_CONTROL", "OnTrack", 150000); // 110s for turning and 30s for stabilizing
     1014
     1015        service_feedback.waitForVoltageOn();
     1016
     1017        var tm2 = new Date();
     1018
     1019        dim.log("Starting ratescan.");
     1020
     1021        // Start rate scan
     1022        dim.send("RATE_SCAN/START_THRESHOLD_SCAN", 50, 1000, -10);
     1023
     1024        // Lets wait if the ratescan really starts... this might take a few
     1025        // seconds because RATE_SCAN configures the ftm and is waiting for
     1026        // it to be configured.
     1027        dim.wait("RATE_SCAN", "InProgress", 10000);
     1028        dim.wait("RATE_SCAN", "Connected", 2700000);
     1029
     1030        // this line is actually some kind of hack.
     1031        // after the Ratescan, no data is written to disk. I don't know why, but it happens all the time
     1032        // So I decided to put this line here as a kind of patchwork....
     1033        //dim.send("FAD_CONTROL/SET_FILE_FORMAT", 2);
     1034
     1035        dim.log("Ratescan done [%.1fs, %.1fs]".$((tm2-tm1)/1000, (new Date()-tm2)/1000));
     1036
     1037        // ------------------ Switch back --------------------------
     1038
     1039        dim.send("BIAS_CONTROL/EXPERT_MODE", true);
     1040        dim.wait("BIAS_CONTROL", "ExpertMode", 3000);
     1041        dim.send("BIAS_CONTROL/EXPERT_LOAD_MAP_FILE", "/home/fact/operation/GAPDmap_with_spare_module-new.txt");
     1042        dim.send("BIAS_CONTROL/EXPERT_MODE", false);
     1043        dim.wait("BIAS_CONTROL", "VoltageOn", 3000);
     1044        dim.send("FEEDBACK/STOP");
     1045        dim.wait("FEEDBACK", "Calibrated", 3000);
     1046        dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", true);
     1047        dim.send("FEEDBACK/ENABLE_TEMP_OFFSETS", false);
     1048        dim.send("FEEDBACK/START", 1.1);
     1049        dim.wait("FEEDBACK", "InProgress", 60000);
     1050
     1051        dim.log("Starting ratescan.");
     1052
     1053        // Start rate scan
     1054        dim.send("RATE_SCAN/START_THRESHOLD_SCAN", 50, 1000, -10);
     1055
     1056        // Lets wait if the ratescan really starts... this might take a few
     1057        // seconds because RATE_SCAN configures the ftm and is waiting for
     1058        // it to be configured.
     1059        dim.wait("RATE_SCAN", "InProgress", 10000);
     1060        dim.wait("RATE_SCAN", "Connected", 2700000);
     1061
     1062        // this line is actually some kind of hack.
     1063        // after the Ratescan, no data is written to disk. I don't know why, but it happens all the time
     1064        // So I decided to put this line here as a kind of patchwork....
     1065        //dim.send("FAD_CONTROL/SET_FILE_FORMAT", 2);
     1066
     1067        dim.log("Ratescan done [%.1fs, %.1fs]".$((tm2-tm1)/1000, (new Date()-tm2)/1000));
     1068
     1069        dim.log("Task finished [FEEDBACK-TEST]");
     1070        console.out("");
     1071        break;
     1072
     1073    case "SINGLEPE-TEST":
     1074        // ----------------- Enable new feedback ---------------
     1075        service_feedback.voltageOff();
     1076        dim.log("Switching to new bias calibration and feedback.");
     1077        dim.send("BIAS_CONTROL/EXPERT_MODE", true);
     1078        dim.wait("BIAS_CONTROL", "ExpertMode", 3000);
     1079        dim.send("BIAS_CONTROL/EXPERT_LOAD_MAP_FILE", "/home/fact/operation/GAPDmap_with_spare_module-new2.txt");
     1080        dim.send("BIAS_CONTROL/EXPERT_MODE", false);
     1081        dim.wait("BIAS_CONTROL", "VoltageOff", 3000);
     1082        dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", false);
     1083
     1084        // ---------------- Take single pe run ------------------
     1085        CloseLid();
     1086        doDrsCalibration("singlepe");  // will turn voltage off
     1087        dim.send("FEEDBACK/STOP");
     1088        dim.wait("FEEDBACK", "Calibrated", 3000);
     1089        dim.send("FEEDBACK/ENABLE_TEMP_OFFSETS", true);
     1090        dim.send("FEEDBACK/START", 1.1);
     1091        dim.wait("FEEDBACK", "InProgress", 45000);
     1092        service_feedback.voltageOn();
     1093        service_feedback.waitForVoltageOn();
     1094        v8.sleep(15000);
     1095        dim.log("Taking single p.e. run.");
     1096        while (!irq && !takeRun("single-pe", 10000));
     1097
     1098        // ------------------ Switch back --------------------------
     1099        dim.send("BIAS_CONTROL/EXPERT_MODE", true);
     1100        dim.wait("BIAS_CONTROL", "ExpertMode", 3000);
     1101        dim.send("BIAS_CONTROL/EXPERT_LOAD_MAP_FILE", "/home/fact/operation/GAPDmap_with_spare_module-new.txt");
     1102        dim.send("BIAS_CONTROL/EXPERT_MODE", false);
     1103        dim.wait("BIAS_CONTROL", "VoltageOn", 3000);
     1104        dim.send("FEEDBACK/STOP");
     1105        dim.wait("FEEDBACK", "Calibrated", 3000);
     1106        dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", true);
     1107        dim.send("FEEDBACK/ENABLE_TEMP_OFFSETS", false);
     1108        dim.send("FEEDBACK/START", 1.1);
     1109        dim.wait("FEEDBACK", "InProgress", 60000);
     1110
     1111        dim.log("Task finished [SINGLEPE-TEST]");
     1112        console.out("");
     1113        break;
     1114*/
    9121115
    9131116    case "DATA":
  • trunk/FACT++/scripts/Observation_class.js

    r16074 r17174  
    5858        case 'DATA':
    5959            if (i!=obj.measurements.length-1)
    60                 throw new Error("DATA must be the last in the list of measurements");
     60                throw new Error("DATA [n="+i+", "+utc.toUTCString()+"] must be the last in the list of measurements [cnt="+obj.measurements.length+"]");
    6161            if (ret[i].source == undefined)
    6262                throw new Error("Observation must have either 'source' or 'task' " +
     
    7979                                "if 'task' == 'ratescan'");
    8080            break;
    81 
     81       /*
     82        case 'FEEDBACK-TEST':
     83            if (ret[i].source == undefined && (ret[i].ra == undefined || ret[i].dec == undefined))
     84                throw new Error("Observation must have either 'source' or 'ra' & 'dec' " +
     85                                "if 'task' == 'ratescan'");
     86            break;
     87        */
     88        //case 'SINGLEPE-TEST':
    8289        case 'SINGLEPE':
    8390        case 'DRSCALIB':
  • trunk/FACT++/scripts/Startup.js

    r17028 r17174  
    218218{
    219219    dim.send("BIAS_CONTROL/SET_ZERO_VOLTAGE");
    220     dim.wait("BIAS_CONTROL", "VoltageOff", 15000);
     220    dim.wait("BIAS_CONTROL", "VoltageOff", 30000); // waS: 15000
    221221
    222222    var now = new Date();
     
    227227
    228228    console.out("Wait for calibration to end");
    229     dim.wait("FEEDBACK", "Calibrated", 60000);
     229    dim.wait("FEEDBACK", "Calibrated", 90000);
    230230
    231231    console.out("Calibration finished ["+(new Date()-now)+"ms]");
    232232
    233233    console.out("Wait for voltage to be off");
    234     dim.wait("BIAS_CONTROL", "VoltageOff", 5000);
     234    dim.wait("BIAS_CONTROL", "VoltageOff", 30000); // was: 15000
    235235}
    236236
     
    261261// ================================================================
    262262
    263 dim.send("BIAS_CONTROL/SET_EXPERT_MODE", true);
     263dim.log("Switching to old bias calibration and feedback.");
     264dim.send("BIAS_CONTROL/EXPERT_MODE", true);
    264265dim.send("BIAS_CONTROL/EXPERT_LOAD_MAP_FILE", "/home/fact/operation/GAPDmap_with_spare_module-new.txt");
    265 dim.send("BIAS_CONTROL/SET_EXPERT_MODE", false);
    266 dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", false);
     266dim.send("BIAS_CONTROL/EXPERT_MODE", false);
     267dim.send("FEEDBACK/ENABLE_OLD_ALGORITHM", true);
     268dim.send("FEEDBACK/ENABLE_TEMP_OFFSETS", false);
     269v8.sleep(3000);
    267270
    268271// ================================================================
     
    283286 [ "PWR_CONTROL",     [ "SystemOn"                        ] ],
    284287 [ "AGILENT_CONTROL", [ "VoltageOn"                       ] ],
    285  [ "BIAS_CONTROL",    [ "VoltageOn", "VoltageOff"         ] ],
     288 [ "BIAS_CONTROL",    [ "VoltageOff"                      ] ],
    286289 [ "FEEDBACK",        [ "Calibrated"                      ] ],
    287290 [ "RATE_SCAN",       [ "Connected"                       ] ],
  • trunk/FACT++/scripts/getSchedule.js

    r15292 r17174  
    33function getSchedule()
    44{
    5     // List of all available measurement types
    6     var measurementType = [ "STARTUP", "IDLE", "DRSCALIB", "SINGLEPE", "DATA", "RATESCAN", "SHUTDOWN" ];
     5    // List of all available measurement types (see also Observation_class.js)
     6    var measurementType = [ "STARTUP", "IDLE", "DRSCALIB", "SINGLEPE", "DATA", "RATESCAN", "SHUTDOWN"/*, "FEEDBACK-TEST", "SINGLEPE-TEST"*/ ];
    77
    88    // Get current time
  • trunk/FACT++/src/DimServiceInfoList.cc

    r16096 r17174  
    696696#endif
    697697
    698     const int rc = DimClient::sendCommand(cmd.c_str(), (void*)v.data(), v.size());
    699     if (!rc)
    700         throw runtime_error("ERROR - Sending command "+cmd+" failed.");
     698    DimClient::sendCommandNB(cmd.c_str(), (void*)v.data(), v.size());
     699//    const int rc = DimClient::sendCommand(cmd.c_str(), (void*)v.data(), v.size());
     700//    if (!rc)
     701//        throw runtime_error("ERROR - Sending command "+cmd+" failed.");
    701702}
    702703
  • trunk/FACT++/src/InterpreterV8.cc

    r16985 r17174  
    14451445void InterpreterV8::JsHandleEvent(const EventImp &evt, uint64_t cnt, const string &service)
    14461446{
     1447    // FIXME: This blocks service updates, we have to run this
     1448    //        in a dedicated thread.
    14471449    const Locker locker;
    14481450
     
    15131515void InterpreterV8::JsHandleState(const std::string &server, const State &state)
    15141516{
     1517    // FIXME: This blocks service updates, we have to run this
     1518    //        in a dedicated thread.
    15151519    const Locker locker;
    15161520
     
    16191623int InterpreterV8::JsHandleInterrupt(const EventImp &evt)
    16201624{
     1625    // FIXME: This blocks service updates, we have to run this
     1626    //        in a dedicated thread.
    16211627    const Locker locker;
    16221628
     
    27232729    rc.emplace_back("new Date(");
    27242730    rc.emplace_back("'use strict';");
    2725 
     2731    rc.emplace_back("undefined");
     2732    rc.emplace_back("null");
     2733    rc.emplace_back("delete ");
    27262734
    27272735    rc.emplace_back("dim.log(");
  • trunk/FACT++/src/biasctrl.cc

    r17024 r17174  
    6969    vector<int16_t>  fCurrent;     // Current in ADC units (12bit = 5mA)
    7070
     71    virtual void UpdateV(const Time = Time())
     72    {
     73    }
     74
     75    virtual void UpdateVgapd()
     76    {
     77    }
     78
     79public:
    7180    virtual void UpdateVA()
    7281    {
    7382    }
    7483
    75     virtual void UpdateV(const Time = Time())
    76     {
    77     }
    78 
    79     virtual void UpdateVgapd()
    80     {
    81     }
    82 
    8384    // ====================================================
    8485
     86protected:
    8587    vector<float> fBreakdownVoltage;      // Breakdown voltage of GAPDs
    8688    //vector<float> fChannelOffset;         // User defined channel offset
     
    15111513    DimDescribedService fDimGapd;
    15121514
     1515public:
    15131516    void UpdateVA()
    15141517    {
     
    15211524    }
    15221525
     1526private:
    15231527    void UpdateV(const Time now=Time())
    15241528    {
     
    15601564        fDimVolt("BIAS_CONTROL/VOLTAGE", "F:416",
    15611565                 "|Uout[V]:Output voltage"),
    1562         fDimGapd("BIAS_CONTROL/NOMINAL", "F:416;F:416;F:416;F:416",
     1566        fDimGapd("BIAS_CONTROL/NOMINAL", "F:416;F:416;F:416",
    15631567                 "|Ubr[V]:Nominal breakdown voltage at 25deg C"
    15641568                 "|Uoff[V]:Bias crate channel calibration offsets"
     
    17711775            return T::GetCurrentState();
    17721776        }
     1777
     1778        fBias.UpdateVA();
     1779
     1780        T::Info("Successfully loaded new mapping '"+evt.GetString()+"'");
    17731781
    17741782        return T::GetCurrentState();
  • trunk/FACT++/src/fscctrl.cc

    r17170 r17174  
    551551        }
    552552
    553         UpdateHum( time, humidities);
    554553        UpdateTemp(time, temperatures);
    555554        UpdateVolt(time, voltages);
    556555        UpdateCur( time, currents);
     556        UpdateHum( time, humidities);
    557557
    558558        StartRead();
     
    697697        rms /= T.size();
    698698        rms -= avg*avg;
    699         rms = rms<0 ? 0 : sqrt(rms - avg*avg);
     699        rms = rms<0 ? 0 : sqrt(rms);
    700700
    701701        // Clean broken reports
     
    725725        T = inter.Interpolate(T);
    726726
     727        avg = 0;
     728        rms = 0;
     729        for (int i=0; i<320; i++)
     730        {
     731            avg += T[i];
     732            rms += T[i]*T[i];
     733        }
     734
     735        avg /= 320;
     736        rms /= 320;
     737        rms -= avg*avg;
     738        rms = rms<0 ? 0 : sqrt(rms);
     739
     740        vector<float> out;
     741        out.reserve(322);
     742        out.assign(T.cbegin(), T.cend());
     743        out.emplace_back(avg);
     744        out.emplace_back(rms);
     745
    727746        // Update the Dim service with the interpolated positions
    728         Update(fDimTemp2, vector<float>(T.cbegin(), T.cend()), time);
     747        Update(fDimTemp2, out, time);
    729748    }
    730749
     
    755774                    "|T_back[deg C]:FTM backpanel temperatures FTM (top/bottom), FSC (top/bottom)"
    756775                    "|T_eth[deg C]:Ethernet switches temperatures top (front/back), bottom (f/b)"),
    757         fDimTemp2  ("FSC_CONTROL/BIAS_TEMP", "F:1;F:320",
     776        fDimTemp2  ("FSC_CONTROL/BIAS_TEMP", "F:1;F:320;F:1;F:1",
    758777                    "|t[s]:FSC uptime"
    759                     "|T[deg C]:Interpolated temperatures at bias patch positions"),
     778                    "|T[deg C]:Interpolated temperatures at bias patch positions"
     779                    "|T_avg[deg C]:Average temperature calculated from all patches"
     780                    "|T_rms[deg C]:Temperature RMS calculated from all patches"),
    760781        fDimHum    ("FSC_CONTROL/HUMIDITY", "F:1;F:4",
    761782                    "|t[s]:FSC uptime"
     
    926947        fFSC.SetVerbose(!conf.Get<bool>("quiet"));
    927948
    928         const string fname1 = conf.Get<string>("sesnor-pos-file");
     949        const string fname1 = conf.Get<string>("sensor-pos-file");
    929950        const auto v1 = ReadVector(fname1);
    930951        if (v1.size() != 31)
Note: See TracChangeset for help on using the changeset viewer.