8 #ifndef FI_DEVICE_FUNCTION_BASE_H
9 #define FI_DEVICE_FUNCTION_BASE_H
37 bool close(
bool noHeader =
false);
47 virtual void getValueRange(
double& mn,
double& mx)
const { mn = mx = 0.0; }
57 bool zeroAdjust =
false,
double vertShift = 0.0,
58 double scaleFac = 1.0) = 0;
61 std::vector<double>&
x, std::vector<double>& y,
62 int channel,
bool zeroAdjust =
false,
63 double shift = 0.0,
double scale = 1.0) = 0;
65 virtual void getRawData(std::vector<double>&
x, std::vector<double>& y,
66 double minX,
double maxX,
int channel = 0) = 0;
68 virtual void getData(std::vector<double>&
x, std::vector<double>& y,
69 const std::string&,
double minX = 0.0,
double maxX = -1.0)
73 virtual bool setData(
const std::vector<double>&
x,
const std::vector<double>& y) = 0;
76 double vertShift = 0.0,
double scaleFac = 1.0);
96 void getAxisUnit(
int axis,
char* unitText,
size_t n)
const;
97 void getAxisTitle(
int axis,
char* titleText,
size_t n)
const;
108 double x0,
double f0,
109 double x1,
double f1)
const;
112 double x0,
double f0,
113 double x1,
double f1)
const;
117 bool writeString(
const char* lab,
const std::string& val);
Functions and data type for direct access of large binary files.
#define FT_FILE
File pointer.
Definition: FFaIO.H:136
Definition: FiDeviceFunctionBase.H:19
virtual bool initialDeviceRead()=0
virtual double getValue(double x, int channel=0, bool zeroAdjust=false, double vertShift=0.0, double scaleFac=1.0)=0
double myStep
Definition: FiDeviceFunctionBase.H:133
FileStatus myFileStatus
Definition: FiDeviceFunctionBase.H:144
Endianness myInputEndian
Definition: FiDeviceFunctionBase.H:130
virtual void setPrecision(int)
Definition: FiDeviceFunctionBase.H:54
void getAxisTitle(int axis, char *titleText, size_t n) const
Definition: FiDeviceFunctionBase.C:94
Endianness
Definition: FiDeviceFunctionBase.H:29
@ BigEndian
Definition: FiDeviceFunctionBase.H:29
@ LittleEndian
Definition: FiDeviceFunctionBase.H:29
bool open(FileStatus status=Read_Only)
Definition: FiDeviceFunctionBase.H:35
InterpolationPolicy myExtrapolationPolicy
Definition: FiDeviceFunctionBase.H:146
Endianness myOutputEndian
Definition: FiDeviceFunctionBase.H:129
int getRefCount() const
Definition: FiDeviceFunctionBase.H:79
virtual bool preliminaryDeviceWrite()=0
virtual bool getValues(double x0, double x1, std::vector< double > &x, std::vector< double > &y, int channel, bool zeroAdjust=false, double shift=0.0, double scale=1.0)=0
virtual int isChannelPresentInFile(const std::string &)
Definition: FiDeviceFunctionBase.H:52
Axis
Definition: FiDeviceFunctionBase.H:28
@ X
Definition: FiDeviceFunctionBase.H:28
@ Y
Definition: FiDeviceFunctionBase.H:28
virtual void setEmptyChannel(const std::string &)
Definition: FiDeviceFunctionBase.H:90
virtual void getRawData(std::vector< double > &x, std::vector< double > &y, double minX, double maxX, int channel=0)=0
std::vector< double > Xval
Definition: FiDeviceFunctionBase.H:149
FiDeviceFunctionBase & operator=(const FiDeviceFunctionBase &)=delete
virtual bool isChannelPresentInFile(int)
Definition: FiDeviceFunctionBase.H:51
double integrate(double x, int order=1, int channel=0, double vertShift=0.0, double scaleFac=1.0)
Definition: FiDeviceFunctionBase.C:174
virtual void setTimeSpan(double)
Definition: FiDeviceFunctionBase.H:53
void setParent(const std::string &modelfile)
Definition: FiDeviceFunctionBase.H:91
virtual double getXAxisOrigin() const
Definition: FiDeviceFunctionBase.H:48
bool open(const char *devicename, FileStatus status=Read_Only)
Definition: FiDeviceFunctionBase.C:48
bool writeString(const char *str)
Definition: FiDeviceFunctionBase.C:115
int myRefCount
Definition: FiDeviceFunctionBase.H:153
void setFrequency(double aFreqency)
Definition: FiDeviceFunctionBase.H:87
virtual void getData(std::vector< double > &x, std::vector< double > &y, const std::string &, double minX=0.0, double maxX=-1.0)
Definition: FiDeviceFunctionBase.H:68
double getFrequency() const
Definition: FiDeviceFunctionBase.H:84
virtual bool setData(const std::vector< double > &x, const std::vector< double > &y)=0
virtual void getValueRange(double &mn, double &mx) const
Definition: FiDeviceFunctionBase.H:47
void getAxisUnit(int axis, char *unitText, size_t n) const
Definition: FiDeviceFunctionBase.C:85
void setAxisTitle(int axis, const char *titleText)
Definition: FiDeviceFunctionBase.C:109
InterpolationPolicy myInterpolationPolicy
Definition: FiDeviceFunctionBase.H:145
FiDeviceFunctionBase(const char *devicename=NULL)
Definition: FiDeviceFunctionBase.C:25
FT_FILE myFile
Definition: FiDeviceFunctionBase.H:124
void setStep(double aStep)
Definition: FiDeviceFunctionBase.H:86
double extrapolate(double x, double x0, double f0, double x1, double f1) const
Definition: FiDeviceFunctionBase.C:159
virtual ~FiDeviceFunctionBase()
Definition: FiDeviceFunctionBase.H:26
void setInterpolationPolicy(InterpolationPolicy policy=Linear)
Definition: FiDeviceFunctionBase.H:43
std::string myDatasetDevice
Definition: FiDeviceFunctionBase.H:126
void setExtrapolationPolicy(InterpolationPolicy policy=Constant)
Definition: FiDeviceFunctionBase.H:41
virtual bool concludingDeviceWrite(bool noHeader=false)=0
void setAxisUnit(int axis, const char *unitText)
Definition: FiDeviceFunctionBase.C:104
FileFormat
Definition: FiDeviceFunctionBase.H:30
@ ascii
Definition: FiDeviceFunctionBase.H:30
@ binary
Definition: FiDeviceFunctionBase.H:30
FileStatus getFileStatus() const
Definition: FiDeviceFunctionBase.H:94
bool close(bool noHeader=false)
Definition: FiDeviceFunctionBase.C:127
virtual bool getChannelList(std::vector< std::string > &)
Definition: FiDeviceFunctionBase.H:50
double interpolate(double x, double x0, double f0, double x1, double f1) const
Definition: FiDeviceFunctionBase.C:142
const std::string & getDevicename() const
Definition: FiDeviceFunctionBase.H:39
static Endianness myMachineEndian
Definition: FiDeviceFunctionBase.H:128
InterpolationPolicy
Definition: FiDeviceFunctionBase.H:32
@ Next_Value
Definition: FiDeviceFunctionBase.H:32
@ Constant
Definition: FiDeviceFunctionBase.H:32
@ Linear
Definition: FiDeviceFunctionBase.H:32
@ Previous_Value
Definition: FiDeviceFunctionBase.H:32
FiDeviceFunctionBase(const FiDeviceFunctionBase &)=delete
std::vector< double > Yval
Definition: FiDeviceFunctionBase.H:150
virtual void setValue(double x, double y)=0
int unref()
Definition: FiDeviceFunctionBase.C:38
virtual void setDescription(const std::string &)
Definition: FiDeviceFunctionBase.H:89
bool isReadOnly() const
Definition: FiDeviceFunctionBase.H:93
FileStatus
Definition: FiDeviceFunctionBase.H:31
@ Write_Only
Definition: FiDeviceFunctionBase.H:31
@ Read_Only
Definition: FiDeviceFunctionBase.H:31
@ Not_Loaded
Definition: FiDeviceFunctionBase.H:31
@ Not_Open
Definition: FiDeviceFunctionBase.H:31
std::string myParent
Definition: FiDeviceFunctionBase.H:125
int ref()
Definition: FiDeviceFunctionBase.H:80
virtual size_t getValueCount() const =0
std::map< int, axisInfo > myAxisInfo
Definition: FiDeviceFunctionBase.H:141
double getStep() const
Definition: FiDeviceFunctionBase.H:83
integer(ptr), save, private x
Definition: extCtrlSysRoutinesModule.f90:16
integer channel
Column index for data file.
Definition: initiateFunctionTypeModule.f90:26
character(lfnam_p) modelfile
Model file name.
Definition: headingNamelistModule.f90:21
Definition: FiDeviceFunctionBase.H:136
std::string unit
Definition: FiDeviceFunctionBase.H:137
std::string title
Definition: FiDeviceFunctionBase.H:138
subroutine scale(vec, a)
Definition: windTurbineRoutinesModule.f90:510