Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
SignalPath.h
Go to the documentation of this file.
1 /*-----------------------------------------------------------------------------
2 / Title : Signal Path Operations Header
3 / Project : Isomet Modular Synthesiser System
4 /------------------------------------------------------------------------------
5 / File : $URL: http://nutmeg.qytek.lan/svn/sw/trunk/09-Isomet/iMS_SDK/API/SignalPath/h/SignalPath.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 
39 
40 #ifndef IMS_SIGNALPATH_H__
41 #define IMS_SIGNALPATH_H__
42 
43 #include "IMSSystem.h"
44 #include "IEventHandler.h"
45 #include "IMSTypeDefs.h"
46 
47 #include <memory>
48 #include <array>
49 #include <chrono>
50 
52 #if defined _WIN32 || defined __CYGWIN__
53  #ifdef __GNUC__
54  #define DLL_EXPORT __attribute__ ((dllexport))
55  #define DLL_IMPORT __attribute__ ((dllimport))
56  #else
57  #define DLL_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
58  #define DLL_IMPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax.
59  #endif
60  #define DLL_LOCAL
61 #else
62  #if __GNUC__ >= 4
63  #define DLL_EXPORT __attribute__ ((visibility ("default")))
64  #define DLL_IMPORT __attribute__ ((visibility ("default")))
65  #define DLL_LOCAL __attribute__ ((visibility ("hidden")))
66  #else
67  #define DLL_EXPORT
68  #define DLL_IMPORT
69  #define DLL_LOCAL
70  #endif
71 #endif
72 
73 #if defined(_EXPORTING_IMS)
74  #define LIBSPEC DLL_EXPORT
75  #define LIBLOCAL DLL_LOCAL
76  #define EXPIMP_TEMPLATE
77 #elif defined(_STATIC_IMS)
78  #define LIBSPEC
79  #define LIBLOCAL
80  #define EXPIMP_TEMPLATE
81 #else
82  #define LIBSPEC DLL_IMPORT
83  #define LIBLOCAL DLL_LOCAL
84  #define EXPIMP_TEMPLATE extern
85 #endif
86 
88 namespace iMS
89 {
99  class LIBSPEC SignalPathEvents
100  {
101  public:
103  enum Events {
110  Count
111  };
112  };
113 
115  struct VelocityConfiguration;
116 
132  class LIBSPEC SignalPath
133  {
134  public:
142  enum class AmplitudeControl
143  {
145  OFF,
147  EXTERNAL,
149  WIPER_1,
151  WIPER_2
152  };
153 
167  enum class ToneBufferControl
168  {
170  HOST,
172  EXTERNAL,
174  EXTERNAL_EXTENDED,
176  OFF
177  };
178 
189  enum class Compensation : bool
190  {
192  ACTIVE = true,
194  BYPASS = false
195  };
196 
200  enum class SYNC_SRC
201  {
202  FREQUENCY_CH1,
203  FREQUENCY_CH2,
204  FREQUENCY_CH3,
205  FREQUENCY_CH4,
206  AMPLITUDE_CH1,
207  AMPLITUDE_CH2,
208  AMPLITUDE_CH3,
209  AMPLITUDE_CH4,
210  AMPLITUDE_PRE_COMP_CH1,
211  AMPLITUDE_PRE_COMP_CH2,
212  AMPLITUDE_PRE_COMP_CH3,
213  AMPLITUDE_PRE_COMP_CH4,
214  PHASE_CH1,
215  PHASE_CH2,
216  PHASE_CH3,
217  PHASE_CH4,
218  LOOKUP_FIELD_CH1,
219  LOOKUP_FIELD_CH2,
220  LOOKUP_FIELD_CH3,
221  LOOKUP_FIELD_CH4,
222  IMAGE_ANLG_A,
223  IMAGE_ANLG_B,
224  IMAGE_DIG
225  };
226 
230  enum class SYNC_SINK
231  {
232  ANLG_A,
233  ANLG_B,
234  DIG
235  };
236 
247  enum class ENCODER_MODE
248  {
249  QUADRATURE,
250  COUNT_DIRECTION
251  };
252 
267  enum class VELOCITY_MODE
268  {
269  FAST,
270  SLOW
271  };
272 
287  enum class ENCODER_CHANNEL
288  {
289  CH_X,
290  CH_Y
291  };
292 
295 
296  SignalPath(const IMSSystem& ims);
312  ~SignalPath();
314 
317 
318  bool UpdateDDSPowerLevel(const Percent& power);
330  //void GetDDSPowerLevel();
345  bool UpdateRFAmplitude(const AmplitudeControl src, const Percent& ampl);
353  bool SwitchRFAmplitudeControlSource(const AmplitudeControl src);
354 
364  bool UpdatePhaseTuning(const RFChannel& channel, const Degrees& phase);
373  bool SetChannelReversal(bool reversal);
374 
387  bool EnableImagePathCompensation(SignalPath::Compensation amplComp, SignalPath::Compensation phaseComp);
388 
401  bool EnableXYPhaseCompensation(bool XYCompEnable);
403 
405 
406  bool SetCalibrationTone(const FAP& fap);
425  bool ClearTone();
427 
429 
430  bool AssignSynchronousOutput(const SYNC_SINK& sink, const SYNC_SRC& src) const;
449  bool ConfigureSyncDigitalOutput(::std::chrono::nanoseconds delay = ::std::chrono::nanoseconds::zero(),
450  ::std::chrono::nanoseconds pulse_length = ::std::chrono::nanoseconds::zero());
452 
455 
456  bool UpdateLocalToneBuffer(const ToneBufferControl& tbc, const unsigned int index
484  bool UpdateLocalToneBuffer(const ToneBufferControl& tbc);
486  bool UpdateLocalToneBuffer(const SignalPath::Compensation AmplitudeComp, const SignalPath::Compensation PhaseComp);
488  bool UpdateLocalToneBuffer(const unsigned int index);
490 
525 
526  bool UpdateEncoder(const VelocityConfiguration& velcomp);
536  bool DisableEncoder();
550  bool ReportEncoderVelocity(ENCODER_CHANNEL chan);
552 
555 
556  void SignalPathEventSubscribe(const int message, IEventHandler* handler);
580  void SignalPathEventUnsubscribe(const int message, const IEventHandler* handler);
582  private:
583  // Makes this object non-copyable
584  SignalPath(const SignalPath &);
585  const SignalPath &operator =(const SignalPath &);
586 
587  class Impl;
588  Impl * p_Impl;
589  };
590 
599  struct LIBSPEC VelocityConfiguration
600  {
602  SignalPath::ENCODER_MODE EncoderMode { SignalPath::ENCODER_MODE::QUADRATURE };
604  SignalPath::VELOCITY_MODE VelocityMode { SignalPath::VELOCITY_MODE::FAST };
606  std::uint16_t TrackingLoopProportionCoeff { 4000 };
608  std::uint16_t TrackingLoopIntegrationCoeff { 10000 };
610  std::array<std::int16_t, 2> VelocityGain;
611 
621  void SetVelGain(const IMSSystem& ims, SignalPath::ENCODER_CHANNEL chan, kHz EncoderFreq, MHz DesiredFreqDeviation, bool Reverse = false);
622 
623  VelocityConfiguration() : VelocityGain({ { 500, 500 } }) {}
624  };
625 }
626 
627 #undef EXPIMP_TEMPLATE
628 #undef LIBSPEC
629 #endif
Returns DDS Power setting.
Definition: SignalPath.h:105
ToneBufferControl
Selects Control Source for the Local Tone Buffer.
Definition: SignalPath.h:167
Type Definition for all operations that require an angle specification in degrees.
Definition: IMSTypeDefs.h:314
SYNC_SINK
The Synchronous Output to which to assign Synchronous Data.
Definition: SignalPath.h:230
Use the Compensation Look-up Path.
Interface Class for User Application code to receive and process events from the iMS library...
An object representing the overall configuration of an attached iMS System and permits applications t...
Definition: IMSSystem.h:361
FAP (Frequency/Amplitude/Phase) triad stores the instantaneous definition of a single RF output...
Definition: IMSTypeDefs.h:387
All the different types of events that can be triggered by the SignalPath class.
Definition: SignalPath.h:99
Sets the parameters required to control the operation of the Encoder Input / Velocity Compensation fu...
Definition: SignalPath.h:599
The entire API is encapsulated by the iMS namespace.
Definition: Auxiliary.h:95
Type that represents the integer values 1, 2, 3 and 4, one each for the RF Channels of an iMS Synthes...
Definition: IMSTypeDefs.h:425
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...
Events
List of Events raised by the Signal Path module.
Definition: SignalPath.h:103
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
VELOCITY_MODE
Selects the method of velocity calculation.
Definition: SignalPath.h:267
Controls Signal routing and other parameters related to the RF output signals.
Definition: SignalPath.h:132
AmplitudeControl
Selects Amplitude Control source for each of the 4 RF Channel outputs.
Definition: SignalPath.h:142
Type Definition for all operations that require a frequency specification in kiloHertz.
Definition: IMSTypeDefs.h:148
std::array< std::int16_t, 2 > VelocityGain
Controls the extent to which a given value of velocity causes a deviation in synthesiser frequency...
Definition: SignalPath.h:610
Compensation
Controls whether to use the Compensation Look-Up Table path for pixel data.
Definition: SignalPath.h:189
SYNC_SRC
Selects a source of Synchronous Output Data.
Definition: SignalPath.h:200
Returns current Encoder X Channel Velocity.
Definition: SignalPath.h:107
ENCODER_CHANNEL
Selects which of two available encoder channels.
Definition: SignalPath.h:287
Useful Type Definitions for working with iMS Systems.
ENCODER_MODE
Selects the type of encoder connected to the Synthesiser.
Definition: SignalPath.h:247
Returns current Encoder Y Channel Velocity.
Definition: SignalPath.h:109