Changeset 17174 for trunk/FACT++/src


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++/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • 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.