API Documentation
Loading...
Searching...
No Matches
MagneticCalibration.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#include <NDEVR/IOFactory.h>
4#include <NDEVR/Model.h>
5#include <NDEVR/Buffer.h>
6#include <NDEVR/Vector.h>
7namespace NDEVR
8{
9 /**--------------------------------------------------------------------------------------------------
10 \brief Stores magnetic calibration data as a Model including the transformation and calibration points
11 \ingroup Hardware Magnetometer
12 **/
14 {
15 public:
19 void addCalibrationPoint(const Vector<3, fltp08>& point, fltp08 hm = 1.0);
20 void clearData();
22 void calculate(fltp08 hm = 1.0);
23 void removeOutliers(fltp08 rejection);
24 void writeToFile(File calibration_file, bool is_active);
25 void readFromFile(File calibration_file, bool is_active);
26 void setVertices(const Buffer<Vector<3, fltp08>>& vertices);
27 void setB(const Vector<3, fltp08>& B);
28 void setA(const Vector<9, fltp08>& A);
32 fltp08 stdDev() const;
36 bool hasSufficientData() const;
39 static constexpr const char* TypeName() { return "magnetic_calibration"; }
41 protected:
43 protected:
44 void init();
45 };
46
47 /**--------------------------------------------------------------------------------------------------
48 \brief IOFactory interface for reading and writing MagneticCalibrationData to files.
49 \ingroup Hardware Magnetometer
50 **/
52 {
53 public:
55 private:
56 void getSupportedFormats(Buffer<FileFormat>& formats, bool is_read) override;
57 Buffer<UUID> filterModelsToExport(Buffer<UUID> models_to_check, const DesignObjectLookup* lookup, const FileFormat& export_format) const override;
58 bool readFile(FactoryParameters& file) override;
59 bool writeFile(FactoryParameters& file) override;
60 virtual FactoryFeatures factoryFeatures(const FactoryParameters& file, bool is_import) const override;
61 };
62}
#define HARDWARE_API
Definition DLLInfo.h:56
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
Allows IOFactories to report what features they support to make the import/export dialogs easier to s...
Definition FactoryFeatures.h:44
Data that describes a particular file format and how to use the format with the program....
Definition FileFormat.h:43
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
A service that provides Import/Export functionality for a model heirarchy. These can be registered wi...
Definition IOFactory.h:117
Stores magnetic calibration data as a Model including the transformation and calibration points.
Definition MagneticCalibration.h:14
Vector< 3, fltp08 > B() const
void calculate(fltp08 hm=1.0)
void setVertices(const Buffer< Vector< 3, fltp08 > > &vertices)
void writeToFile(File calibration_file, bool is_active)
Buffer< Vector< 3, fltp08 > > data() const
void setA(const Vector< 9, fltp08 > &A)
void removeOutliers(fltp08 rejection)
MagneticCalibrationData(const Model &model)
void addCalibrationPoint(const Vector< 3, fltp08 > &point, fltp08 hm=1.0)
Vector< 3, fltp08 > correct(Vertex< 3, fltp08 > vec)
void readFromFile(File calibration_file, bool is_active)
static Matrix< fltp08 > CalibrationMatrix(const Vector< 9, fltp08 > &A, const Vector< 3, fltp08 > &B)
void setB(const Vector< 3, fltp08 > &B)
void updateAndApplyCalibrationMatrix(const Vector< 9, fltp08 > &A, const Vector< 3, fltp08 > &B)
Vector< 9, fltp08 > A() const
static constexpr const char * TypeName()
Definition MagneticCalibration.h:39
IOFactory interface for reading and writing MagneticCalibrationData to files.
Definition MagneticCalibration.h:52
Definition Matrix.hpp:176
A core class that represents a node on model heirarchy. This node may contain a Geometry or one or mo...
Definition Model.h:58
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
Definition ACIColor.h:37
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...
Definition BaseValues.hpp:127
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
A container of input information that is to be filled with output information by an IOFactory.
Definition IOFactory.h:61