Changeset 11982 for trunk/FACT++


Ignore:
Timestamp:
09/06/11 12:49:44 (13 years ago)
Author:
tbretz
Message:
Added possibility to set a single channel to its reference value.
Location:
trunk/FACT++
Files:
10 edited

Legend:

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

    r11903 r11982  
    3838        chatclient chatserv \
    3939        biasctrl \
    40         mcp \
     40        mcp feedback \
    4141        fitsdump
    4242
     
    269269        libConfiguration.la
    270270
     271feedback_SOURCES = src/feedback.cc src/LocalControl.h
     272feedback_LDADD   = libDim.la libDim++.la  libDimExtension.la \
     273                libTime.la libTools.la libStateMachine.la \
     274                libConfiguration.la
     275
    271276
    272277argv_SOURCES = src/argv.cc
  • trunk/FACT++/Makefile.in

    r11903 r11982  
    5252        fadctrl$(EXEEXT) fad$(EXEEXT) fscctrl$(EXEEXT) fsc$(EXEEXT) \
    5353        chatclient$(EXEEXT) chatserv$(EXEEXT) biasctrl$(EXEEXT) \
    54         mcp$(EXEEXT) fitsdump$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) \
    55         $(am__EXEEXT_3) $(am__EXEEXT_4)
     54        mcp$(EXEEXT) feedback$(EXEEXT) fitsdump$(EXEEXT) \
     55        $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \
     56        $(am__EXEEXT_4)
    5657@HAS_GUI_TRUE@am__append_1 = fact
    5758@HAS_VIEWER_TRUE@am__append_2 = viewer
     
    270271fadctrl_DEPENDENCIES = libDim.la libDim++.la libDimExtension.la \
    271272        libTime.la libTools.la libStateMachine.la libConfiguration.la
     273am_feedback_OBJECTS = src/feedback.$(OBJEXT)
     274feedback_OBJECTS = $(am_feedback_OBJECTS)
     275feedback_DEPENDENCIES = libDim.la libDim++.la libDimExtension.la \
     276        libTime.la libTools.la libStateMachine.la libConfiguration.la
    272277am_fitsdump_OBJECTS = src/fitsdump.$(OBJEXT)
    273278fitsdump_OBJECTS = $(am_fitsdump_OBJECTS)
     
    393398        $(dimctrl_SOURCES) $(dns_SOURCES) $(drivectrl_SOURCES) \
    394399        $(dserver2_SOURCES) $(fact_SOURCES) $(fad_SOURCES) \
    395         $(fadctrl_SOURCES) $(fitsdump_SOURCES) fitsgrep.c \
    396         $(fitsloader_SOURCES) $(fsc_SOURCES) $(fscctrl_SOURCES) \
    397         $(ftm_SOURCES) $(ftmctrl_SOURCES) $(log_SOURCES) \
    398         $(logtime_SOURCES) $(mcp_SOURCES) $(readfits_SOURCES) sched.c \
    399         $(scheduler_SOURCES) $(test_SOURCES) $(time_SOURCES) \
    400         $(triggerschedule_SOURCES) $(viewer_SOURCES)
     400        $(fadctrl_SOURCES) $(feedback_SOURCES) $(fitsdump_SOURCES) \
     401        fitsgrep.c $(fitsloader_SOURCES) $(fsc_SOURCES) \
     402        $(fscctrl_SOURCES) $(ftm_SOURCES) $(ftmctrl_SOURCES) \
     403        $(log_SOURCES) $(logtime_SOURCES) $(mcp_SOURCES) \
     404        $(readfits_SOURCES) sched.c $(scheduler_SOURCES) \
     405        $(test_SOURCES) $(time_SOURCES) $(triggerschedule_SOURCES) \
     406        $(viewer_SOURCES)
    401407DIST_SOURCES = $(libConfiguration_la_SOURCES) $(libDim___la_SOURCES) \
    402408        $(libDim_la_SOURCES) $(libDimExtension_la_SOURCES) \
     
    408414        $(drivectrl_SOURCES) $(dserver2_SOURCES) \
    409415        $(am__fact_SOURCES_DIST) $(fad_SOURCES) \
    410         $(am__fadctrl_SOURCES_DIST) $(fitsdump_SOURCES) fitsgrep.c \
    411         $(fitsloader_SOURCES) $(fsc_SOURCES) $(fscctrl_SOURCES) \
    412         $(ftm_SOURCES) $(ftmctrl_SOURCES) $(log_SOURCES) \
    413         $(logtime_SOURCES) $(mcp_SOURCES) $(readfits_SOURCES) sched.c \
     416        $(am__fadctrl_SOURCES_DIST) $(feedback_SOURCES) \
     417        $(fitsdump_SOURCES) fitsgrep.c $(fitsloader_SOURCES) \
     418        $(fsc_SOURCES) $(fscctrl_SOURCES) $(ftm_SOURCES) \
     419        $(ftmctrl_SOURCES) $(log_SOURCES) $(logtime_SOURCES) \
     420        $(mcp_SOURCES) $(readfits_SOURCES) sched.c \
    414421        $(scheduler_SOURCES) $(test_SOURCES) $(time_SOURCES) \
    415422        $(triggerschedule_SOURCES) $(am__viewer_SOURCES_DIST)
     
    852859        libConfiguration.la
    853860
     861feedback_SOURCES = src/feedback.cc src/LocalControl.h
     862feedback_LDADD = libDim.la libDim++.la  libDimExtension.la \
     863                libTime.la libTools.la libStateMachine.la \
     864                libConfiguration.la
     865
    854866argv_SOURCES = src/argv.cc
    855867argv_LDADD = libConfiguration.la
     
    12911303        @rm -f fadctrl$(EXEEXT)
    12921304        $(AM_V_CXXLD)$(CXXLINK) $(fadctrl_OBJECTS) $(fadctrl_LDADD) $(LIBS)
     1305src/feedback.$(OBJEXT): src/$(am__dirstamp) \
     1306        src/$(DEPDIR)/$(am__dirstamp)
     1307feedback$(EXEEXT): $(feedback_OBJECTS) $(feedback_DEPENDENCIES)
     1308        @rm -f feedback$(EXEEXT)
     1309        $(AM_V_CXXLD)$(CXXLINK) $(feedback_OBJECTS) $(feedback_LDADD) $(LIBS)
    12931310src/fitsdump.$(OBJEXT): src/$(am__dirstamp) \
    12941311        src/$(DEPDIR)/$(am__dirstamp)
     
    15121529        -rm -f src/fad.$(OBJEXT)
    15131530        -rm -f src/fadctrl.$(OBJEXT)
     1531        -rm -f src/feedback.$(OBJEXT)
    15141532        -rm -f src/fitsdump.$(OBJEXT)
    15151533        -rm -f src/fitsloader.$(OBJEXT)
     
    16211639@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fad.Po@am__quote@
    16221640@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fadctrl.Po@am__quote@
     1641@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/feedback.Po@am__quote@
    16231642@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fitsdump.Po@am__quote@
    16241643@AMDEP_TRUE@@am__include@ @am__quote@src/$(DEPDIR)/fitsloader.Po@am__quote@
  • trunk/FACT++/ftmctrl.rc

    r11339 r11982  
     1console=2
     2
     3run-type=data
     4run-type=pedestal
     5run-type=drs-calib
     6
     7sampling-frequency.default = 2000
     8
     9ftu-report-interval.default = 100
     10
     11
     12[trigger]
     13enable-trigger.default = yes
     14enable-trigger.pedestal = no
     15enable-trigger.drs-calib = no
     16
     17enable-external-1.default = no
     18enable-external-2.default = no
     19enable-veto.default = no
     20enable-clock-conditioner.default = no
     21
     22multiplicity-physics.default = 1
     23multiplicity-calib.default = 40
     24coincidence-window-physics.default = 10
     25coincidence-window-calib.default = 10
     26dead-time.default = 25
     27delay.default = 25
     28time-marker-delay.default = 25
     29
     30#disable-patch.default =
     31#disable-pixel.default =
     32
     33
     34[trigger.threshold]
     35
     36patch.default = 150
     37logic.default = 16
     38
     39
     40[trigger.sequence]
     41interval.default = 50
     42pedestal.default = 0
     43lp-int.default = 0
     44lp-ext.default = 0
     45
     46
     47[light-pulser.external]
     48
     49intensity.default = 100
     50enable-group1.default = no
     51enable-group2.default = no
     52
     53
     54[light-pulser.internal]
     55
     56intensity.default =  10
     57enable-group1.default = no
     58enable-group2.default = no
     59
     60
    161[clock-conditioner]
    262frequency   = 800
     
    3696R15.4000    = 0x1400fa0f
    3797R15.5000    = 0x0802710f
     98
  • trunk/FACT++/gui/MainWindow.cc

    r11957 r11982  
    575575}
    576576
     577/*
    577578void MainWindow::on_fBiasRequestStatus_clicked()
    578579{
     
    580581        Dim::SendCommand("BIAS_CONTROL/REQUEST_STATUS");
    581582}
     583*/
    582584
    583585void MainWindow::on_fBiasApplyReference_clicked()
    584586{
    585587    if (!fInHandler)
    586         Dim::SendCommand("BIAS_CONTROL/SET_GAPD_REFERENCE_VOLTAGE");
     588        Dim::SendCommand("BIAS_CONTROL/SET_GLOBAL_GAPD_REFERENCE_VOLTAGE");
     589}
     590
     591void MainWindow::on_fBiasApplyReferenceCh_clicked()
     592{
     593    if (!fInHandler)
     594        Dim::SendCommand("BIAS_CONTROL/SET_CHANNEL_GAPD_REFERENCE_VOLTAGE",
     595                         uint16_t(fBiasHvBoard->value()*32+fBiasHvChannel->value()));
    587596}
    588597
  • trunk/FACT++/gui/MainWindow.h

    r11957 r11982  
    172172    void on_fBiasCurrentMax_valueChanged(int); // FIXME: Could be set as slot in the designer
    173173
    174     void on_fBiasRequestStatus_clicked();
     174    //void on_fBiasRequestStatus_clicked();
    175175    void on_fBiasApply_clicked();
    176176    void on_fBiasApplyGlobal_clicked();
    177177    void on_fBiasApplyReference_clicked();
     178    void on_fBiasApplyReferenceCh_clicked();
    178179    void on_fBiasSetToZero_clicked();
    179180    void on_fBiasReset_clicked();
  • trunk/FACT++/src/RemoteControl.h

    r11051 r11982  
    121121    {
    122122    }
     123
     124    //void SetReceiver(void *) { }
    123125
    124126    bool PrintGeneralHelp()
  • trunk/FACT++/src/argv.cc

    r11229 r11982  
    44
    55using namespace std;
     6
     7template<class T,class S>
     8std::ostream &operator<<(std::ostream &out, const pair<T,S> &f)
     9{
     10    out << f.first << "|" << f.second;
     11    return out;
     12}
     13template<class T, class S>
     14std::istream &operator>>(std::istream &in,  pair<T,S> &f)
     15{
     16    char c;
     17    in >> f.first;
     18    in >> c;
     19    if (c!=':')
     20        return in;
     21    in >> f.second;
     22    return in;
     23}
     24
     25typedef pair<int,int> mytype;
     26
     27
     28//Source is OutputStreamable, meaning that an operator<< is defined
     29// that takes a std::ostream or std::wostream object on the left hand side
     30// and an instance of the argument type on the right.
     31
     32// Target is InputStreamable, meaning that an operator>> is defined that
     33// takes a std::istream or std::wistream object on the left hand side and
     34// an instance of the result type on the right.
     35
     36//Target is CopyConstructible [20.1.3].
     37//Target is DefaultConstructible, meaning that it is possible to default-initialize an object of that type [8.5, 20.1.4].
    638
    739// --------------------------------------------------------------------------
     
    6799    po::options_description config("Configuration");
    68100    config.add_options()
     101        ("xxx", vars<int>(),             "Print available commandline options.")
     102        ("test.*", var<int>(),             "Print available commandline options.")
     103        ("map.*",  var<int>(),             "Print available commandline options.")
    69104        ("compression",    var<int>(),                      "set compression level")
    70105        ("optimization",   var<int>(10, &opt),              "optimization level")
     
    82117        ("switch",        po_switch(),                    "include path")
    83118        ("bool",          var<bool>()->implicit_value(true),                    "include path")
     119        ("mytype",        var<mytype>(),                  "include path")
    84120        ;
    85121
     
    170206    cout << "Program " << argv[0] << " started successfully." << endl;
    171207
     208    cout << conf.Has("test.A") << " " << conf.Get<int>("test.A") << endl;
     209    cout << conf.Has("test.%") << " " << conf.Get<int>("test.%") << endl;
     210    cout << conf.Has("test.9") << " " << conf.Get<int>("test.9") << endl;
     211    cout << conf.Has("test.data") << " " << conf.Get<int>("test.data") << endl;
     212    cout << conf.Has("test.pedestal") << " " << conf.Get<int>("test.pedestal") << endl;
     213    cout << conf.Has("map.1") << " " << conf.Get<int>("map.1") << endl;
     214    cout << conf.Has("map.2") << " " << conf.Get<int>("map.2") << endl;
     215
     216    return 0;
     217
    172218    cout << conf.Has("switch") << " " << conf.Get<bool>("switch") << endl;
    173     cout << conf.Has("bool") << " " << conf.Get<bool>("bool") << endl;
     219    cout << conf.Has("bool")   << " " << conf.Get<bool>("bool") << endl;
     220    cout << conf.Has("mytype") << " " << conf.Get<mytype>("mytype") << endl;
     221
     222    cout << "---" << endl;
     223    cout << conf.Has("test:A") << " " << conf.Get<int>("test:A") << endl;
     224    cout << conf.Has("test:%") << " " << conf.Get<int>("test:%") << endl;
     225    cout << conf.Has("test:9") << " " << conf.Get<int>("test:9") << endl;
     226
     227/*
     228    map<string, int> m = conf.GetMap<int>("test:");
     229
     230    cout << m["test:A"] << endl;
     231    cout << m["test:%"] << endl;
     232    cout << m["test:9"] << endl;
     233*/
     234
    174235
    175236    return 0;
  • trunk/FACT++/src/biasctrl.cc

    r11980 r11982  
    955955    }
    956956
     957    bool SetGapdReferenceCh(uint16_t ch)
     958    {
     959        if (!CheckChDac("SetGapdReferenceCh", fVoltGapd[ch], ch))
     960            return false;
     961
     962        fVoltRef[ch] = fVoltGapd[ch];
     963
     964        if (!fIsRamping)
     965            fIsRamping = RampOneStep();
     966
     967        return true;
     968    }
     969
     970
    957971    void SetZero()
    958972    {
     
    14591473    }
    14601474
     1475    int SetGapdReferenceCh(const EventImp &evt)
     1476    {
     1477        if (!CheckEventSize(evt.GetSize(), "SetGapdReferenceCh", 2))
     1478            return false;
     1479
     1480        fBias.SetGapdReferenceCh(evt.GetUShort());
     1481
     1482        return T::GetCurrentState();
     1483    }
     1484
     1485
    14611486    // --------------------------------------------------------------------
    14621487
     
    17141739            ("Set a single channel a new DAC reference value. Starts ramping if necessary.");
    17151740
    1716         T::AddEvent("SET_GAPD_REFERENCE_VOLTAGE", kConnected, kAtReference, kOverCurrent)
     1741        T::AddEvent("SET_GLOBAL_GAPD_REFERENCE_VOLTAGE", kConnected, kAtReference, kOverCurrent)
    17171742            (Wrapper(bind(&ConnectionBias::SetGapdVoltage, &fBias, 0.)))
    17181743            ("Set all channels to their G-APD reference voltage. Starts ramping if necessary.");
     1744
     1745        T::AddEvent("SET_CHANNEL_GAPD_REFERENCE_VOLTAGE", "S:1", kConnected, kAtReference, kOverCurrent)
     1746            (bind(&StateMachineBias::SetGapdReferenceCh, this, placeholders::_1))
     1747            ("Set a single channel channels to its G-APD reference voltage. Starts ramping if necessary.");
    17191748
    17201749        T::AddEvent("SET_GAPD_REFERENCE_OFFSET", "F:1", kConnected, kAtReference, kOverCurrent)
  • trunk/FACT++/src/logtime.cc

    r11229 r11982  
    66#include <iostream>
    77
     8#include "DimDescriptionService.h"
     9
    810int main(int, const char **)
    911{
    10    // We could use putenv to make the Configure class change the value...
     12    // We could use putenv to make the Configure class change the value...
    1113    setenv("DIM_DNS_NODE", "localhost", 0);
    1214
     
    1416    DimServer::start("TIME");
    1517
     18    usleep(2000000);
     19
     20    DimServer::stop();
     21
     22    return 0;
     23
    1624    // Some info on the console
    1725    std::cout << "Offering TIME/MESSAGE...\n" << std::endl;
     26
     27    short s;
     28    int i;
     29    long long ll;
     30    float f;
     31    DimDescribedService servt("TIME/TEST", "O:1;I:1;C",
     32                              "This is my test command|Char[c]:This is a char|   Int This is an int|String[s]:This is a string");
     33
     34    DimDescribedService servs("TIME/SHORT",     s,  "[a]");
     35    DimDescribedService servx("TIME/LONGLONG",  ll, "|: This is my long long");
     36    DimDescribedService servi("TIME/INT",       i,  "|MyInt  [  mi  ] ");
     37    DimDescribedService servf("TIME/FLOAT",     f,  "|   MyFloat  :   This is my float");
     38    DimDescribedService servc("TIME/TIME", const_cast<char*>(""), "|MyTime[T]:This is my time");
     39
     40    DimCommand cmd("TIME/CMD", "I:2;F:2");
     41
     42    DimDescriptionService des("TIME/CMD", "|range[addr]:From DAC to DAC|values[DAC]:DAC values to be set");
     43
     44    {
     45    Time t0;
    1846
    1947    // Setup a DimService called TIME/MESSAGE
     
    2351        // Send current time
    2452        msg.Message(Time().GetAsStr());
     53//        servx.Update();
     54        /*
     55        servs.updateService();
     56        servi.updateService();
     57        servf.updateService();
     58        servc.updateService();
     59         */
     60        // wait approximately one second
     61        usleep(100000);
    2562
    26         // wait approximately one second
    27         usleep(1000000);
     63//        if (t0.UnixTime()-Time().UnixTime()<-5)
     64//            break;
    2865    }
     66    }
     67
     68    DimDescribedService servxx("TIME/XXX", const_cast<char*>(""), "|MyTime[T]:This is my time");
     69    usleep(10000000);
    2970
    3071    return 0;
  • trunk/FACT++/src/mcp.cc

    r11619 r11982  
    5555        kStateConfiguring2,
    5656        kStateConfiguring3,
     57        kStateConfiguring4,
    5758        kStateConfigured,
    5859    };
     
    271272    }
    272273
     274    Time fConfigTimer;
     275
    273276    int Execute()
    274277    {
     
    317320                    return GetCurrentState();
    318321
     322                fConfigTimer = Time();
     323
     324                return kStateConfiguring4;
     325            }
     326
     327            if (GetCurrentState()==kStateConfiguring4)
     328            {
     329                // We need some delay to ensure that after sending the
     330                // "Enable Trigger Line" command to all FADs the really
     331                // have all already enabled the trigger line
     332                if (Time()-fConfigTimer<boost::posix_time::milliseconds(100))
     333                    return kStateConfiguring4;
     334
    319335                Message("Starting Trigger (FTM)");
    320336                Dim::SendCommand("FTM_CONTROL/START_RUN");
     
    391407
    392408        AddStateName(kStateConfiguring3, "Configuring3",
     409                     ".");
     410
     411        AddStateName(kStateConfiguring4, "Configuring4",
    393412                     ".");
    394413
Note: See TracChangeset for help on using the changeset viewer.