Scope
PixelmapperBasic.h
1 #pragma once
2 
3 #include "ScopeDatatypes.h"
4 
5 // Forward declarations
6 namespace scope {
7  class DaqChunk;
8  typedef std::shared_ptr<DaqChunk> DaqChunkPtr;
9  class DaqChunkResonance;
10  typedef std::shared_ptr<DaqChunkResonance> DaqChunkResonancePtr;
11  class ScopeMultiImage;
12  template<class T> class ScopeDatatypeBase;
13  typedef ScopeDatatypeBase<ScannerVectorTypeHelper> ScannerVectorType;
14  typedef std::shared_ptr<ScopeMultiImage> ScopeMultiImagePtr;
15  namespace parameters {
16  class ScannerVectorFrameBasic;
17  }
18 }
19 
20 namespace scope {
21 
23 enum PixelmapperResult {
24  Nothing = 0x0,
25  Error = 0x01,
26  EndOfChunk = 0x02,
27  FrameComplete = 0x04,
28  EndOfChunkAndFrameComplete = 0x02 & 0x04
29 };
30 
33 
34 protected:
37 
39  ScopeMultiImagePtr current_frame;
40 
43 
45  std::shared_ptr<const std::vector<std::size_t>> lookup;
46 
48  std::vector<std::size_t>::const_iterator lastlookup;
49 
50 public:
54  PixelmapperBasic(const ScannerType& _scanner, const ScannerVectorType& _type);
55 
57  virtual ~PixelmapperBasic();
58 
60  static std::unique_ptr<PixelmapperBasic> Factory(const ScannerType& _scanner, const ScannerVectorType& _type);
61 
63  virtual void SetCurrentFrame(ScopeMultiImagePtr const _current_frame);
64 
66  virtual void SetParameters(parameters::ScannerVectorFrameBasic* const _svparameters);
67 
69  virtual void SetLookupVector(std::shared_ptr<const std::vector<std::size_t>> const _lookup);
70 
73  virtual PixelmapperResult LookupChunk(DaqChunkPtr const _chunk, const uint16_t& _currentavgcount);
74  virtual PixelmapperResult LookupChunk(DaqChunkResonancePtr const _chunk, const uint16_t& _currentavgcount);
75  /* @} */
76 };
77 
78 }
parameters::ScannerVectorFrameBasic * svparameters
current scanner vector parameter set (needs to be pointer for dynamic_cast in derived classes and bec...
const ScannerVectorTypeHelper::Mode type
Type/scan mode of this pixelmapper.
Parent class for pixel mappers.
Mode
The different types of scans.
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
virtual void SetCurrentFrame(ScopeMultiImagePtr const _current_frame)
Sets pointer to the current frame to be mapped into.
std::shared_ptr< const std::vector< std::size_t > > lookup
for position lookup
In here all declarations for all kinds of datatypes Scope needs.
virtual PixelmapperResult LookupChunk(DaqChunkPtr const _chunk, const uint16_t &_currentavgcount)
Different flavors of mapping a chunk.
Parameters for a ScannerVectorFrameBasic.
Definition: Framescan.h:45
ScopeMultiImagePtr current_frame
pointer to the current frame to be mapped into
std::vector< std::size_t >::const_iterator lastlookup
last position in lookup where we looked up last time
virtual void SetParameters(parameters::ScannerVectorFrameBasic *const _svparameters)
Set current parameters.
virtual void SetLookupVector(std::shared_ptr< const std::vector< std::size_t >> const _lookup)
Sets the vectors for lookup.
virtual ~PixelmapperBasic()
We need a virtual destructor here, so that derived types get correctly destroyed. ...
static std::unique_ptr< PixelmapperBasic > Factory(const ScannerType &_scanner, const ScannerVectorType &_type)
A static factor method for pixelmappers.
PixelmapperBasic(const ScannerType &_scanner, const ScannerVectorType &_type)
Initializes.