54 bool zeroAdjust,
double vertShift,
double scaleFac);
76 double minX,
double maxX,
int channel);
84 const std::string&
channel,
double minX,
double maxX);
87 virtual void setValue(
double x,
double y);
103 bool rewind =
false);
#define FT_FILE
File pointer.
Definition: FFaIO.H:136
static char * fname[_MAX_DBFIL]
Definition: binaryDB.c:35
Class representing external device functions based on ASCII files.
Definition: FiASCFile.H:31
virtual bool preliminaryDeviceWrite()
Dummy method doing nothing.
Definition: FiASCFile.H:131
virtual bool setData(const Doubles &x, const Doubles &y)
Adds a channel to current file by interpolation.
Definition: FiASCFile.C:628
virtual void getRawData(Doubles &x, Doubles &y, double minX, double maxX, int channel)
Extracts all function data point values within specified interval.
Definition: FiASCFile.C:732
virtual bool getChannelList(Strings &list)
Extracts the list of channel names (file column labels).
Definition: FiASCFile.C:510
int myChannel
Channel (column index) that currently resides in core.
Definition: FiASCFile.H:157
bool isCSVt
If true, this file has microsec as first column.
Definition: FiASCFile.H:160
int myNumChannels
Number of columns minus 1 (column 1 is the X-values)
Definition: FiASCFile.H:158
ValuesMap::iterator ValuesIter
Convenience type definition.
Definition: FiASCFile.H:151
static size_t bufferSize
Buffer size for ASCII output in KBytes.
Definition: FiASCFile.H:146
FiASCFile(const char *fname=NULL, int nchan=1)
Default constructor.
Definition: FiASCFile.C:29
virtual bool concludingDeviceWrite(bool noHeader)
Writes all function data to file.
Definition: FiASCFile.C:396
static int readHeader(FT_FILE fd, Strings &header)
Reads the header section of a specified file.
Definition: FiASCFile.C:818
virtual void getData(Doubles &x, Doubles &y, const std::string &channel, double minX, double maxX)
Extracts all function data point values within specified interval.
Definition: FiASCFile.C:725
std::vector< double > Doubles
Convenience type definition.
Definition: FiASCFile.H:32
virtual size_t getValueCount() const
Returns the number of (x,y) pairs of the function.
Definition: FiASCFile.H:44
virtual ~FiASCFile()
Empty destructor.
Definition: FiASCFile.H:41
static bool isMultiChannel(FT_FILE fd, const char *fname=NULL, bool rewind=false)
Checks if the specified file consists of two or more columns.
Definition: FiASCFile.C:478
virtual bool getValues(double x0, double x1, Doubles &x, Doubles &y, int channel, bool zeroAdj, double shift, double scale)
Evaluates the function at all points within specified interval.
Definition: FiASCFile.C:768
virtual void setValue(double x, double y)
Assigns a function value for a single-channel function.
Definition: FiASCFile.C:619
virtual bool initialDeviceRead()
Reads the file and loads the first channel into core.
Definition: FiASCFile.C:241
std::vector< std::string > Strings
Convenience type definition.
Definition: FiASCFile.H:33
static char * readLine(FT_FILE fd, bool commentsOnly=false)
Reads one line of data from specified file.
Definition: FiASCFile.C:43
static int getNoChannels(const char *fname)
Counts the number of channels (number of columns minus one).
Definition: FiASCFile.C:495
static int countColumns(FT_FILE fd)
Returns the number of columns in the file fd.
Definition: FiASCFile.C:460
std::map< double, Doubles > ValuesMap
Mapping from x-value (time) to channel values.
Definition: FiASCFile.H:150
virtual void setEmptyChannel(const std::string &desc)
Adds an empty channel to the file.
Definition: FiASCFile.C:710
virtual void setPrecision(int type)
Defines the output precision.
Definition: FiASCFile.H:97
virtual double getValue(double x, int channel, bool zeroAdjust, double vertShift, double scaleFac)
Evaluates the function for a given x value.
Definition: FiASCFile.C:543
static bool readNext(FT_FILE fd, const std::vector< int > &columns, Doubles &values)
Reads the next line of data from specified file.
Definition: FiASCFile.C:832
int readChannel(int channel)
Reads the specified channel into core.
Definition: FiASCFile.C:89
int outputFormat
0: 4-digits, 1: 8 digits, 2: 16-digits
Definition: FiASCFile.H:159
ValuesIter vit0
Start iterator of last evaluation interval.
Definition: FiASCFile.H:155
ValuesMap myValues
Curve data, either for all or one channel.
Definition: FiASCFile.H:154
virtual void setDescription(const std::string &desc)
Assigns a name to the (last) channel in file.
Definition: FiASCFile.C:612
ValuesIter vit1
End iterator of last evaluation interval.
Definition: FiASCFile.H:156
virtual int isChannelPresentInFile(const std::string &channel)
Returns the column index of the named channel.
Definition: FiASCFile.C:522
Strings chn
Channel names (columns labels)
Definition: FiASCFile.H:153
Definition: FiDeviceFunctionBase.H:19
integer(ptr), save, private x
Definition: extCtrlSysRoutinesModule.f90:16
type(fnvcolumntype), dimension(:), pointer, save columns
Definition: FNVwaveForceModule.f90:39
integer channel
Column index for data file.
Definition: initiateFunctionTypeModule.f90:26
character(len=40) type
Function type flag.
Definition: initiateFunctionTypeModule.f90:33
subroutine scale(vec, a)
Definition: windTurbineRoutinesModule.f90:510