TOBI SignalServer  0.1
/home/breidi/Dropbox/signalserver/include/hardware/nirscout.h
Go to the documentation of this file.
00001 /*
00002     This file is part of the TOBI signal server.
00003 
00004     The TOBI signal server is free software: you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation, either version 3 of the License, or
00007     (at your option) any later version.
00008 
00009     The TOBI signal server is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017     Copyright 2010 Christian Breitwieser
00018     Contact: c.breitwieser@tugraz.at
00019 */
00020 
00021 #ifndef NIRSCOUT_H
00022 #define NIRSCOUT_H
00023 
00029 #include "hardware/hw_thread.h"
00030 #include "hardware/hw_thread_builder.h"
00031 
00032 #include "extern/include/NIRScout/TomographyAPI.h"
00033 
00034 namespace tobiss
00035 {
00036 
00037 //-----------------------------------------------------------------------------
00038 
00039 class NIRScout : public HWThread
00040 {
00041   public:
00042     NIRScout(ticpp::Iterator<ticpp::Element> hw);
00043     ~NIRScout();
00044 
00045     virtual SampleBlock<double> getSyncData();
00046     virtual SampleBlock<double> getAsyncData();
00047 
00051     virtual void run();
00055     virtual void stop();
00056 
00057   private:
00061     virtual void setDeviceSettings(ticpp::Iterator<ticpp::Element>const &father);
00065     virtual void setChannelSettings(ticpp::Iterator<ticpp::Element>const &father);
00069     void setHardware(ticpp::Iterator<ticpp::Element>const &hw);
00070 
00071     std::string getErrorMsg();
00072 
00073   private:
00074     boost::uint32_t                  port_;
00075     std::string                      target_ip_;
00076 
00077     char*                            string_buffer_;
00078 
00079     float*                           raw_data_;
00080     double*                          timestamps_;
00081     char*                            timing_bytes_;
00082 
00083     int                              sources_;
00084     int                              detectors_;
00085     int                              wavelengths_;
00086 
00087     int                              buffer_size_;
00088     int                              frame_count_;
00089 
00090     int                              error_code_;
00091 
00092     enum NameCodes
00093     {
00094       sources = 0, detectors, wavelengths
00095     };
00096 
00097     static const HWThreadBuilderTemplateRegistratorWithoutIOService<NIRScout> factory_registrator_;
00098 
00099 
00100 };
00101 
00102 
00103 }  //tobiss
00104 
00105 
00106 #endif // NIRSCOUT_H
 All Data Structures Files Functions Variables