Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
Public Member Functions | List of all members
iMS::CompensationTable Class Reference

A table of CompensationPoints storing look-up data that can be transferred to memory in the Synthesiser. More...

#include <include/Compensation.h>

Inheritance diagram for iMS::CompensationTable:
Inheritance graph
[legend]
Collaboration diagram for iMS::CompensationTable:
Collaboration graph
[legend]

Public Member Functions

const bool Save (const std::string &fileName) const
 Save Table contents to file using latest protocol version. More...
 
Constructors & Destructors
 CompensationTable ()
 Default Constructor. More...
 
 CompensationTable (const IMSSystem &iMS)
 Empty Constructor. More...
 
 CompensationTable (int LUTDepth, const MHz &lower_freq, const MHz &upper_freq)
 
 CompensationTable (const IMSSystem &iMS, const CompensationPoint &pt)
 Fill Constructor. More...
 
 CompensationTable (int LUTDepth, const MHz &lower_freq, const MHz &upper_freq, const CompensationPoint &pt)
 
 CompensationTable (const IMSSystem &iMS, const std::string &fileName)
 File Read Constructor. More...
 
 CompensationTable (int LUTDepth, const MHz &lower_freq, const MHz &upper_freq, const std::string &fileName)
 
 CompensationTable (const IMSSystem &iMS, const int entry)
 Non-volatile Memory Constructor. More...
 
 ~CompensationTable ()
 Destructor.
 
 CompensationTable (const CompensationTable &)
 Copy Constructor.
 
CompensationTableoperator= (const CompensationTable &)
 Assignment Constructor.
 
Helper Functions
const std::size_t Size () const
 Returns the Number of Entries in the CompensationTable. More...
 
const MHz FrequencyAt (const unsigned int index) const
 Returns the frequency represented by a given entry in the CompensationTable. More...
 
- Public Member Functions inherited from iMS::DequeBase< CompensationPoint >
void clear ()
 clears the contents More...
 
iterator insert (iterator pos, const CompensationPoint &value)
 Inserts a single new element into the DequeBase. More...
 
iterator insert (const_iterator pos, size_t count, const CompensationPoint &value)
 Inserts multiple copies of an element into the DequeBase.
 
iterator insert (iterator pos, const_iterator first, const_iterator last)
 Inserts a range of elements into the DequeBase.
 
void push_back (const CompensationPoint &value)
 Appends the given element value to the end of the container.
 
void pop_back ()
 Removes the last element of the container.
 
void push_front (const CompensationPoint &value)
 Prepends the given element value to the beginning of the container.
 
void pop_front ()
 Removes the first element of the container.
 
iterator erase (iterator pos)
 Removes the element at pos.
 
iterator erase (iterator first, iterator last)
 Removes the elements in the range [first; last].
 
std::size_t size () const
 Returns the number of elements in the container.
 
 DequeBase (const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr))
 Create a default empty List with optional name.
 
 DequeBase (size_t, const CompensationPoint &, const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr))
 Fill Constructor.
 
 DequeBase (const_iterator first, const_iterator last, const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr))
 Range Constructor.
 
 DequeBase (const DequeBase &)
 Copy Constructor.
 
 ~DequeBase ()
 Destructor.
 
DequeBaseoperator= (const DequeBase &)
 Assignment Constructor.
 
CompensationPointoperator[] (int idx)
 Random Write Access to an element in the Deque. More...
 
const CompensationPointoperator[] (int idx) const
 Random Access to an element in the Deque. More...
 
bool operator== (DequeBase const &rhs) const
 Equality Operator checks Deque object UUID's for equivalence. More...
 
const std::array< std::uint8_t, 16 > GetUUID () const
 Returns a vector representing the Unique Identifier assigned to the DequeBase object. More...
 
const std::time_t & ModifiedTime () const
 Returns Time at which the Container was last modified. More...
 
std::string ModifiedTimeFormat () const
 Returns Human-readable string for the time at which the Container was last modified. More...
 
const std::string & Name () const
 A string stored with the Container to aid human users in identifying its purpose. More...
 
std::string & Name ()
 
iterator begin ()
 Returns an iterator pointing to the first element in the DequeBase container. More...
 
const_iterator begin () const
 Returns a const_iterator pointing to the first element in the DequeBase container. More...
 
iterator end ()
 Returns an iterator referring to the past-the-end element in the DequeBase container. More...
 
const_iterator end () const
 Returns a const_iterator referring to the past-the-end element in the DequeBase container. More...
 
const_iterator cbegin () const
 Returns a const_iterator pointing to the first element in the DequeBase container. More...
 
const_iterator cend () const
 Returns a const_iterator referring to the past-the-end element in the DequeBase container. More...
 

Additional Inherited Members

- Public Types inherited from iMS::DequeBase< CompensationPoint >
typedef std::deque< CompensationPoint >::iterator iterator
 Iterator defined for user manipulation of DequeBase.
 
typedef std::deque< CompensationPoint >::const_iterator const_iterator
 Const Iterator defined for user readback of DequeBase.
 

Detailed Description

A table of CompensationPoints storing look-up data that can be transferred to memory in the Synthesiser.

A CompensationTable always contains a list of CompensationPoints whose length is defined by the available memory depth in an iMS Synthesiser to which the CompensationTable is targetted.

For this reason, a valid IMSSystem object is required to be passed as a const reference to the Constructor because the table will be initialised to the length of the Synthesiser's look-up memory (read from IMSSynthesiser::Capabilities::LUTDepth). Note that a dummy IMSSystem object could also be created with this field set to the LUT depth (in bits, i.e. 12 => 4096 deep LUT). Once the CompensationTable has been constructed, the IMSSystem object is no longer required and may be destroyed.

The length of the CompensationTable cannot be altered after construction.

The CompensationTable can be constructed with all entries initialised to zero, or to a default value. Subsequently, random access is possible for both reading and modifying CompensationPoints, although a faster method for accessing contents is to use the iterators.

Each entry of a CompensationTable has a unique frequency associated with it. Although not part of the table contents itself, it can be readily calculated from the upper and lower frequency bounds of the Synthesiser. A helper function is available to do this calculation.

A CompensationTable may be saved to disk in a '.lut' file. A Constructor also exists to read back from a previously saved .lut file, creating a CompensationTable from the contents of the file.

Author
Dave Cowan
Date
2015-11-03
Since
1.0

Constructor & Destructor Documentation

iMS::CompensationTable::CompensationTable ( )

Default Constructor.

The default constructor should not normally be used by application code since the length of the table will be left undefined. However it is a required constructor to complete the ImageProject class. If using, the new object should then be assigned from another CompensationTable to ensure that it does not contain dangling pointers

Since
1.3
iMS::CompensationTable::CompensationTable ( const IMSSystem iMS)

Empty Constructor.

An IMSSystem object must be passed by const reference to the CompensationTable constructor in order to determine the correct depth of the LUT memory.

Parameters
[in]iMSthe IMSSystem object representing the system the CompensationTable will be constructed for
Since
1.0
iMS::CompensationTable::CompensationTable ( int  LUTDepth,
const MHz lower_freq,
const MHz upper_freq 
)

This Explicit Empty Constructor makes it possible to create Compensation Tables without being physically connected to an iMS System.

Parameters
[in]LUTDepththe number of entries in the Compensation Look-Up Table
[in]lower_freqthe Lowest Frequency reproducible by the Synthesiser
[in]upper_freqthe Highest Frequency reproducible by the Synthesiser
Since
1.3
iMS::CompensationTable::CompensationTable ( const IMSSystem iMS,
const CompensationPoint pt 
)

Fill Constructor.

Use this constructor to preload the CompensationTable with identical values of CompensationPoint

Parameters
[in]iMSthe IMSSystem object representing the system the CompensationTable will be constructed for
[in]ptThe CompensationPoint that will fill each of the new elements of the CompensationTable
Since
1.0
iMS::CompensationTable::CompensationTable ( int  LUTDepth,
const MHz lower_freq,
const MHz upper_freq,
const CompensationPoint pt 
)

This Explicit Fill Constructor makes it possible to create Compensation Tables without being physically connected to an iMS System.

Parameters
[in]LUTDepththe number of entries in the Compensation Look-Up Table
[in]lower_freqthe Lowest Frequency reproducible by the Synthesiser
[in]upper_freqthe Highest Frequency reproducible by the Synthesiser
[in]ptThe CompensationPoint that will fill each of the new elements of the CompensationTable
Since
1.3
iMS::CompensationTable::CompensationTable ( const IMSSystem iMS,
const std::string &  fileName 
)

File Read Constructor.

Use this constructor to preload the CompensationTable with data read in from a file on disk

Parameters
[in]iMSthe IMSSystem object representing the system the CompensationTable will be constructed for
[in]fileNameA string pointing to a '*.lut' file on the filesystem containing preexisting CompensationTable data
Since
1.0
iMS::CompensationTable::CompensationTable ( int  LUTDepth,
const MHz lower_freq,
const MHz upper_freq,
const std::string &  fileName 
)

This Explicit File Read Constructor makes it possible to create Compensation Tables without being physically connected to an iMS System.

Parameters
[in]LUTDepththe number of entries in the Compensation Look-Up Table
[in]lower_freqthe Lowest Frequency reproducible by the Synthesiser
[in]upper_freqthe Highest Frequency reproducible by the Synthesiser
[in]fileNameA string pointing to a '*.lut' file on the filesystem containing preexisting
Since
1.3
iMS::CompensationTable::CompensationTable ( const IMSSystem iMS,
const int  entry 
)

Non-volatile Memory Constructor.

Use this constructor to preload the CompensationTable with data recalled from an entry in the Synthesiser FileSystem.

Parameters
[in]iMSthe IMSSystem object representing the system the CompensationTable will be constructed for
[in]entrythe entry in the FileSystem Table from which to recall a Compensation Table CompensationTable data
Since
1.1

Member Function Documentation

const MHz iMS::CompensationTable::FrequencyAt ( const unsigned int  index) const

Returns the frequency represented by a given entry in the CompensationTable.

Each entry in the CompensationTable has an implied frequency at which it will become active.

Parameters
[in]indexThe CompensationTable entry to retrieve the associated Frequency for
Returns
The Frequency value which the CompensationTable entry represents
Since
1.0
const bool iMS::CompensationTable::Save ( const std::string &  fileName) const

Save Table contents to file using latest protocol version.

The contents of this CompensationTable can be saved to disk for retrieval at a later time. Calling this function will write out the contents of the table to a file which is opened at the filesystem location given by the string fileName.

Warning
If the file already exists, it is overwritten, without warning.

If the function cannot create the file, it will not save the table, and return false.

fileName can be any valid filesystem location and any name, but we recommend the use of the file extension '.lut'

Parameters
[in]fileNamethe name and location of the file to write CompensationTable data to
Returns
true if the save operation completed successfully
Since
1.0
const std::size_t iMS::CompensationTable::Size ( ) const

Returns the Number of Entries in the CompensationTable.

Returns
std::size_t representing the number of CompensationTable entries (which is defined in the Constructor)
Since
1.0

The documentation for this class was generated from the following file: