Loading...
Searching...
No Matches
resources-base.h
1/*
2
3MIT License
4
5Copyright (c) 2017 FMI Open Development / Markus Peura, first.last@fmi.fi
6
7Permission is hereby granted, free of charge, to any person obtaining a copy
8of this software and associated documentation files (the "Software"), to deal
9in the Software without restriction, including without limitation the rights
10to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11copies of the Software, and to permit persons to whom the Software is
12furnished to do so, subject to the following conditions:
13
14The above copyright notice and this permission notice shall be included in all
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23SOFTWARE.
24
25*/
26/*
27Part of Rack development has been done in the BALTRAD projects part-financed
28by the European Union (European Regional Development Fund and European
29Neighbourhood Partnership Instrument, Baltic Sea Region Programme 2007-2013)
30*/
31
32// # pragma once
33
34#ifndef RACK_RESOURCES_BASE
35#define RACK_RESOURCES_BASE
36
37#include <string>
38
39#include <drain/util/Static.h>
40
41#include "data/DataSelector.h"
42#include "data/PolarODIM.h"
43#include "hi5/Hi5.h"
44
45// #include "graphics.h" // SVG
46
47#include "resources-image.h"
48
49
50namespace rack {
51
52
53
55public:
56
57 AndreContext() : andreSelect("path=dataset1:3,elangle=0:2.0"), defaultQuality(0.9) {
58 // defaultQuality initialized in respective cmd CmdQuality
59 }
60
61 AndreContext(const AndreContext & ctx) : andreSelect(ctx.andreSelect), defaultQuality(ctx.defaultQuality) {
62 // defaultQuality initialized in respective cmd CmdQuality
63 }
64
65 std::string andreSelect;
66
67 float defaultQuality;
68};
69
70
71
72
73
75
76public:
77
79
80 Hdf5Context(const Hdf5Context &ctx);
81
82 std::string select;
83 std::string inputSelect;
84
87
90
92 Hi5Tree cartesianHi5;
93
95 Hi5Tree *currentHi5; // = &inputHi5;
96
97
99
102 Hi5Tree *currentPolarHi5; // = &inputHi5;
103
104
105 enum Hi5Role {
106 CURRENT=1, // Latest HDF5 processed
107 INPUT=2, // Latest input file
108 POLAR=4, // Current Polar volume or product
109 CARTESIAN=8, // Accept Cartesian
110 PRODUCT=16, // To select polar product (POLAR,PRODUCT) instead of volume
111 EMPTY=32, // Also accept empty
112 PRIVATE=64, // File owned my this thread only
113 SHARED=128, // File shared by all the threads
114 };
115
117
118
120
124 Hi5Tree & getMyHi5(Hi5RoleFlagger::ivalue_t filter=(CARTESIAN|POLAR|INPUT|CURRENT));
125
126
128
134 Hi5Tree & getHi5Defunct(Hi5RoleFlagger::ivalue_t filter);
135
137
143 /*
144 inline
145 Hi5Tree & getCartesianHi5(h5_role::value_t filter=(PRIVATE|SHARED)){
146 return getHi5(filter | CARTESIAN);
147 }
148
149 inline
150 Hi5Tree & getCurrentInputHi5(h5_role::value_t filter=(PRIVATE|SHARED)){
151 return getHi5(filter | CURRENT|INPUT);
152 }
153
154 static inline
155 Hdf5Context & getStaticContext(){
156 return drain::Static::get<Hdf5Context>();
157 }
158 */
159
160protected:
161
162 void updateHdf5Status(drain::VariableMap & statusMap) const; // Not static, because checks
163
164 static Hi5Tree empty;
165
166};
167
168template <>
170
171} /* namespace rack */
172
173#endif /* RACKLET_H_ */
174
175// Rack
Two-way mapping between strings and objects of template class T.
Definition Dictionary.h:63
Flagger accepting values of enum type E.
Definition EnumFlags.h:190
A map of Variables.
Definition VariableMap.h:61
Definition resources-base.h:54
Definition resources-base.h:74
Hi5Tree polarInputHi5
The last input file read, typically a volume. May be concatenated ie. read in incrementally.
Definition resources-base.h:86
Hi5Tree & getHi5Defunct(Hi5RoleFlagger::ivalue_t filter)
Derives the most relevant polar data (input or product) and returns it.
Definition resources-base.cpp:210
Hi5Tree & getMyHi5(Hi5RoleFlagger::ivalue_t filter=(CARTESIAN|POLAR|INPUT|CURRENT))
Pointer to the last HDF5 structure in Cartesian coordinates: input or Cartesian product.
Definition resources-base.cpp:120
Hi5Tree * currentPolarHi5
Pointer to the last HDF5 structure in polar coordinates: input volume or polar product.
Definition resources-base.h:102
void updateHdf5Status(drain::VariableMap &statusMap) const
Derives the most relevant polar input data and returns it.
Definition resources-base.cpp:244
Hi5Tree cartesianHi5
A single-radar Cartesian product or a multi-radar composite (mosaic).
Definition resources-base.h:92
Hi5Tree polarProductHi5
The polar product that has been generated from the volume.
Definition resources-base.h:89
Hi5Tree * currentHi5
Pointer to the last HDF5 structure read or generated.
Definition resources-base.h:95
Definition DataSelector.cpp:44
Wrapper for unique (static) dictionary of enum values.
Definition EnumFlags.h:66