94 lines
3.6 KiB
C++
94 lines
3.6 KiB
C++
//======================================================================================================
|
|
// Copyright 2016, NaturalPoint Inc.
|
|
//======================================================================================================
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include "AnalogSystemBuildConfig.h"
|
|
#include "PropertySet.h"
|
|
|
|
#pragma warning( push )
|
|
#pragma warning( disable: 4251 )
|
|
|
|
namespace tinyxml2wc
|
|
{
|
|
class XMLElement;
|
|
}
|
|
|
|
namespace AnalogSystem
|
|
{
|
|
class AnalogChannelDescriptor;
|
|
class IDeviceManager;
|
|
|
|
// Channel properties
|
|
static const char* ChannelProp_Enabled = "AnalogChannel_Enabled";
|
|
static const char* ChannelProp_EnabledLabel = "Enabled";
|
|
static const char* ChannelProp_Name = "AnalogChannel_Name";
|
|
static const char* ChannelProp_NameLabel = "Channel Name";
|
|
static const char* ChannelProp_TerminalName = "AnalogChannel_TerminalName";
|
|
static const char* ChannelProp_TerminalNameLabel = "Terminal Name";
|
|
static const char* ChannelProp_DataType = "AnalogChannel_DataType";
|
|
static const char* ChannelProp_MinVoltage = "AnalogChannel_MinVoltage";
|
|
static const char* ChannelProp_MinVoltageLabel = "Min. Voltage";
|
|
static const char* ChannelProp_MaxVoltage = "AnalogChannel_MaxVoltage";
|
|
static const char* ChannelProp_MaxVoltageLabel = "Max. Voltage";
|
|
static const char* ChannelProp_TerminalType = "AnalogChannel_TerminalType";
|
|
static const char* ChannelProp_TerminalTypeLabel = "Terminal Type";
|
|
static const char* ChannelProp_Units = "AnalogChannel_Units";
|
|
static const char* ChannelProp_Selected = "AnalogChannel_Selected";
|
|
static const char* ChannelProp_OwnerSerial = "AnalogChannel_OwnerSerial";
|
|
|
|
/// <summary>
|
|
/// Channel physical signal type (Analog capture devices)
|
|
/// </summary>
|
|
enum TerminalConfigurationType
|
|
{
|
|
Terminal_RSE = 0, // Referenced single ended. Measurement with respect to ground (e.g. AI_GND) (Default)
|
|
Terminal_NRSE, // NonReferenced single ended. Measurement with respect to single analog input (e.g. AISENSE)
|
|
Terminal_Diff, // Differential. Measurement between two inputs (e.g. AI0+, AI0-)
|
|
Terminal_PseudoDiff // Differential. Measurement between two inputs and impeded common ground.
|
|
};
|
|
|
|
/// <summary>
|
|
/// Channel data type
|
|
/// </summary>
|
|
enum ChannelDataType
|
|
{
|
|
ChannelType_Int = 0,
|
|
ChannelType_Float,
|
|
ChannelType_Double,
|
|
ChannelType_Unknown
|
|
};
|
|
|
|
/// <summary>
|
|
/// AnalogChannelDescriptor describes a device's physical channel for exposing in the UI,
|
|
/// including channel name (user-definable), channel signal type, measurement range.
|
|
/// </summary>
|
|
class ANALOGSYSTEM_API AnalogChannelDescriptor : public cPropertySet
|
|
{
|
|
public:
|
|
AnalogChannelDescriptor();
|
|
~AnalogChannelDescriptor();
|
|
|
|
// IProfileSubscriber Interface
|
|
virtual std::wstring ProfileTypeName() const;
|
|
virtual std::wstring ProfileLabel() const;
|
|
virtual std::wstring ProfileDescription() const;
|
|
virtual void SaveToProfile( tinyxml2wc::XMLElement& saveTo ) const;
|
|
virtual bool LoadFromProfile( const tinyxml2wc::XMLElement& source );
|
|
|
|
private:
|
|
// Create the channel property definitions
|
|
void CreatePropertyDefinitions();
|
|
|
|
std::wstring mProfileName;
|
|
static Core::cUID sPropertyDefinitionsID;
|
|
|
|
AnalogChannelDescriptor( const AnalogChannelDescriptor& other ) = delete;
|
|
AnalogChannelDescriptor& operator=( const AnalogChannelDescriptor& other ) = delete;
|
|
};
|
|
}
|
|
|
|
#pragma warning( pop )
|