Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
Compensation.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2 / Title : Compensation Functions Header
3 / Project : Isomet Modular Synthesiser System
4 /------------------------------------------------------------------------------
5 / File : $URL: http://nutmeg.qytek.lan/svn/sw/trunk/09-Isomet/iMS_SDK/API/Compensation/h/Compensation.h $
6 / Author : $Author: dave $
7 / Company : Isomet (UK) Ltd
8 / Created : 2015-04-09
9 / Last update: $Date: 2017-09-11 23:55:34 +0100 (Mon, 11 Sep 2017) $
10 / Platform :
11 / Standard : C++11
12 / Revision : $Rev: 300 $
13 /------------------------------------------------------------------------------
14 / Description:
15 /------------------------------------------------------------------------------
16 / Copyright (c) 2015 Isomet (UK) Ltd. All Rights Reserved.
17 /------------------------------------------------------------------------------
18 / Revisions :
19 / Date Version Author Description
20 / 2015-04-09 1.0 dc Created
21 /
22 /----------------------------------------------------------------------------*/
23 
61 
62 #ifndef IMS_COMPENSATION_H__
63 #define IMS_COMPENSATION_H__
64 
65 #include "Containers.h"
66 #include "IMSSystem.h"
67 #include "IEventHandler.h"
68 #include "IMSTypeDefs.h"
69 #include "IBulkTransfer.h"
70 #include "FileSystem.h"
71 
72 #include <memory>
73 #include <deque>
74 
76 #if defined _WIN32 || defined __CYGWIN__
77  #ifdef __GNUC__
78  #define DLL_EXPORT __attribute__ ((dllexport))
79  #define DLL_IMPORT __attribute__ ((dllimport))
80  #else
81  #define DLL_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
82  #define DLL_IMPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
83  #endif
84  #define DLL_LOCAL
85 #else
86  #if __GNUC__ >= 4
87  #define DLL_EXPORT __attribute__ ((visibility ("default")))
88  #define DLL_IMPORT __attribute__ ((visibility ("default")))
89  #define DLL_LOCAL __attribute__ ((visibility ("hidden")))
90  #else
91  #define DLL_EXPORT
92  #define DLL_IMPORT
93  #define DLL_LOCAL
94  #endif
95 #endif
96 
97 #if defined(_EXPORTING_IMS)
98  #define LIBSPEC DLL_EXPORT
99  #define LIBLOCAL DLL_LOCAL
100  #define EXPIMP_TEMPLATE
101 #elif defined(_STATIC_IMS)
102  #define LIBSPEC
103  #define LIBLOCAL
104  #define EXPIMP_TEMPLATE
105 #else
106  #define LIBSPEC DLL_IMPORT
107  #define LIBLOCAL DLL_LOCAL
108  #define EXPIMP_TEMPLATE extern
109 #endif
110 
112 namespace iMS
113 {
123  class LIBSPEC CompensationEvents
124  {
125  public:
127  enum Events {
138  Count
139  };
140  };
141 
156  class LIBSPEC CompensationPoint
157  {
158  public:
161 
162  CompensationPoint(Percent ampl = 0.0, Degrees phase = 0.0, unsigned int sync_dig = 0, double sync_anlg = 0.0);
171 
175  CompensationPoint &operator =(const CompensationPoint &);
176 
179  bool operator==(CompensationPoint const& rhs) const;
180 
183 
184  void Amplitude(const Percent& ampl);
193  const Percent& Amplitude() const;
201  void Phase(const Degrees& phase);
204  const Degrees& Phase() const;
213  void SyncDig(const unsigned int& sync);
216  const std::uint32_t& SyncDig() const;
226  void SyncAnlg(const double& sync);
229  const double& SyncAnlg() const;
231  private:
232  class Impl;
233  Impl * p_Impl;
234  };
235 
253  {
254  public:
257 
266 
271 
274  bool operator==(CompensationPointSpecification const& rhs) const;
275 
277  void Freq(const MHz& f);
279  const MHz& Freq();
280 
282  void Spec(const CompensationPoint& pt);
284  const CompensationPoint& Spec();
285  private:
286  class Impl;
287  Impl * p_Impl;
288  };
289 
305  class LIBSPEC CompensationFunction : public ListBase < CompensationPointSpecification >
306  {
307  public:
310 
322  CompensationFunction &operator =(const CompensationFunction &);
324 
325  private:
326  class Impl;
327  Impl * p_Impl;
328  };
329 
361  class LIBSPEC CompensationTable : public DequeBase < CompensationPoint >
362  {
363  public:
366 
389  CompensationTable(int LUTDepth, const MHz& lower_freq, const MHz& upper_freq);
398  CompensationTable(const IMSSystem& iMS, const CompensationPoint& pt);
406  CompensationTable(int LUTDepth, const MHz& lower_freq, const MHz& upper_freq, const CompensationPoint& pt);
415  CompensationTable(const IMSSystem& iMS, const std::string& fileName);
423  CompensationTable(int LUTDepth, const MHz& lower_freq, const MHz& upper_freq, const std::string& fileName);
433  CompensationTable(const IMSSystem& iMS, const int entry);
436 
440  CompensationTable &operator =(const CompensationTable &);
442 
444 
445  const std::size_t Size() const;
455  const MHz FrequencyAt(const unsigned int index) const;
457 
459 
460  const bool Save(const std::string& fileName) const;
477 
478  private:
479  class Impl;
480  Impl * p_Impl;
481  };
482 
490  {
491  public:
494 
518 
520 
521  bool StartDownload();
522  bool StartVerify();
524 
527 
528  int GetVerifyError();
530 
533 
534  void CompensationTableDownloadEventSubscribe(const int message, IEventHandler* handler);
558  void CompensationTableDownloadEventUnsubscribe(const int message, const IEventHandler* handler);
560 
562 
563  const FileSystemIndex Store(FileDefault def, const std::string& FileName) const;
581 
582  private:
583  // Makes this object non-copyable
585  const CompensationTableDownload &operator =(const CompensationTableDownload &);
586 
587  class Impl;
588  Impl * p_Impl;
589  };
590 
591 }
592 
593 #undef EXPIMP_TEMPLATE
594 #undef LIBSPEC
595 #endif
Not used.
Definition: Compensation.h:129
Events
List of Events raised by the Compensation Class and Compensation Table Downloader.
Definition: Compensation.h:127
Class for performing Compensation related functions with the Synthesiser.
Definition: Compensation.h:305
All the different types of events that can be triggered by the Compensation and CompensationTableDown...
Definition: Compensation.h:123
Type Definition for all operations that require an angle specification in degrees.
Definition: IMSTypeDefs.h:314
Classes for reading, writing and managing the file system built into an iMS Synthesiser.
FileDefault
Default flag tags a file entry for execution at startup (only one per filetype)
Definition: FileSystem.h:141
Interface Specification class for sending large binary data objects to the iMS.
Definition: IBulkTransfer.h:102
Template Class encapsulating a list object and acting as a base list class for other classes in the l...
Definition: Containers.h:91
Interface Class for User Application code to receive and process events from the iMS library...
Event raised on completion of a download verify, if the download was successfully verified...
Definition: Compensation.h:135
Stores 4 data fields containing amplitude, phase, sync analogue and sync digital compensation data...
Definition: Compensation.h:156
Provides a mechanism for downloading and verifying Compensation Tables to a Synthesiser's Look-Up mem...
Definition: Compensation.h:489
An object representing the overall configuration of an attached iMS System and permits applications t...
Definition: IMSSystem.h:361
Event raised each time the CompensationTableDownload class registers an error in the download process...
Definition: Compensation.h:133
int FileSystemIndex
FileSystemIndex represents the entry number for a particular file in the FileSystemTable.
Definition: FileSystem.h:150
The entire API is encapsulated by the iMS namespace.
Definition: Auxiliary.h:95
Type Definition for all operations that require a percentage specification.
Definition: IMSTypeDefs.h:241
Classes within this group are used to store information about an iMS System and to Connect / Disconne...
Container Classes for storing various types of data related to Image classes and others.
A table of CompensationPoints storing look-up data that can be transferred to memory in the Synthesis...
Definition: Compensation.h:361
Type Definition for all operations that require a frequency specification in MegaHertz.
Definition: IMSTypeDefs.h:191
Interface Class for an Event Handler to be defined in User Code and subscribed to library events...
Definition: IEventHandler.h:146
Interface Specification class for sending large binary data objects to the iMS.
Template Class encapsulating a deque object and acting as a base deque class for other classes in the...
Definition: Containers.h:302
Completely specifies the desired compensation at a spot frequency.
Definition: Compensation.h:252
Event raised on completion of a download verify, if the download failed. param contains the number of...
Definition: Compensation.h:137
Event raised when CompensationTableDownload has confirmed that the iMS Controller received all of the...
Definition: Compensation.h:131
Useful Type Definitions for working with iMS Systems.