Scope
PixelmapperBasic.cpp
1 #include "stdafx.h"
2 #include "parameters/Scope.h"
3 #include "PixelmapperBasic.h"
4 #include "PixelmapperFrameSaw.h"
5 #include "PixelmapperFrameBiDi.h"
6 #include "PixelmapperFrameResonanceSW.h"
7 #include "PixelmapperFrameResonanceHW.h"
8 #include "helpers/DaqChunk.h"
9 #include "ScopeDatatypes.h"
10 #include "helpers/ScopeMultiImage.h"
11 
12 namespace scope {
13 
15  : type(_type)
16  , current_frame(nullptr)
17  , svparameters(parameters::ScannerVectorFrameBasic::Factory(_type).release())
18  , lookup(nullptr) {
19 }
20 
22 
23 }
24 
25 std::unique_ptr<PixelmapperBasic> PixelmapperBasic::Factory(const ScannerType& _scanner, const ScannerVectorType& _type) {
26  switch ( (ScannerTypeHelper::Mode)_scanner ) {
27  case ScannerTypeHelper::Regular:
28  switch ( (ScannerVectorTypeHelper::Mode)_type ) {
29  case ScannerVectorTypeHelper::Bidirectional:
30  return std::unique_ptr<PixelmapperFrameBiDi>(new PixelmapperFrameBiDi());
31  // Not yet implemented
32  //case ScannerVectorTypeHelper::Planehopper:
33  // return std::unique_ptr<PixelmapperBasic>(new PixelmapperBasic());
34 
35  default:
36  return std::unique_ptr<PixelmapperFrameSaw>(new PixelmapperFrameSaw());
37  }
38  break;
39  case ScannerTypeHelper::Resonance:
40  switch ( (ScannerVectorTypeHelper::Mode)_type ) {
41  case ScannerVectorTypeHelper::ResonanceBiDi:
42  return std::unique_ptr<SCOPE_RESONANCEPIXELMAPPER_T>(new SCOPE_RESONANCEPIXELMAPPER_T());
43  }
44  break;
45  }
46 }
47 
48 void PixelmapperBasic::SetCurrentFrame(ScopeMultiImagePtr const _current_frame) {
49  current_frame = _current_frame;
50 }
51 
52 void PixelmapperBasic::SetLookupVector(std::shared_ptr<const std::vector<std::size_t>> const _lookup) {
53  lookup = _lookup;
54  lastlookup = std::begin(*lookup);
55 }
56 
58  this->svparameters = _svparameters;
59 }
60 
61 PixelmapperResult PixelmapperBasic::LookupChunk(DaqChunkPtr const _chunk, const uint16_t& _currentavgcount) {
62  PixelmapperResult result(Nothing);
63  return result;
64 }
65 
66 PixelmapperResult PixelmapperBasic::LookupChunk(DaqChunkResonancePtr const _chunk, const uint16_t& _currentavgcount) {
67  PixelmapperResult result(Nothing);
68  return result;
69 }
70 
71 }
parameters::ScannerVectorFrameBasic * svparameters
current scanner vector parameter set (needs to be pointer for dynamic_cast in derived classes and bec...
Parent class for frame scans.
Mode
The different types of scans.
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
This is the include file for standard system include files, or project specific include files that ar...
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.
Mode
The different types of scanners.
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. ...
Maps acquired pixels into an image, takes care of onset cutoff, retrace etc.
static std::unique_ptr< PixelmapperBasic > Factory(const ScannerType &_scanner, const ScannerVectorType &_type)
A static factor method for pixelmappers.
Maps acquired pixels into an image, takes care of return fractions I: real image, forth scan...
PixelmapperBasic(const ScannerType &_scanner, const ScannerVectorType &_type)
Initializes.