Ignore:
Timestamp:
07/27/11 21:02:11 (13 years ago)
Author:
tbretz
Message:
Added 'no-dim' option to make boost happy; added function to convert PT1000 data to temperatures (~1% rms)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/fscctrl.cc

    r11578 r11673  
    7979
    8080private:
     81    //
     82    // From: http://de.wikipedia.org/wiki/Pt100
     83    //
     84    double GetTempPT1000(double R) const
     85    {
     86        const double R0 = 1000; // 1KOhm
     87
     88        const double a = 3.85e-3;
     89
     90        return (R/R0 - 1)/a;
     91    }
     92
     93
    8194    void HandleReceivedData(const bs::error_code& err, size_t bytes_received, int /*type*/)
    8295    {
     
    229242        }
    230243
     244        for (size_t i=0; i<resist.size(); i++)
     245            if (resist[i]>800 && resist[i]<2000)
     246                cout << setw(2) << i << " - " << setw(4) << (int)resist[i] << ": " << setprecision(1) << fixed << GetTempPT1000(resist[i]) << endl;
     247        else
     248                cout << setw(2) << i << " - " << setw(4) << (int)resist[i] << ": " << "----" << endl;
     249
    231250        StartRead();
    232251    }
     
    530549    po::options_description control("FTM control options");
    531550    control.add_options()
     551        ("no-dim",        po_bool(),  "Disable dim services")
    532552        ("addr,a",        var<string>("localhost:5000"),  "Network address of FTM")
    533553        ("quiet,q",       po_bool(),  "Disable printing contents of all received messages (except dynamic data) in clear text.")
Note: See TracChangeset for help on using the changeset viewer.