CLProtocol 3.5.1
DeviceID.h
1//-----------------------------------------------------------------------------
2// (c) 2008 by Basler Vision Technologies
3// Section: Vision Components
4// Project: GenApi
5// Author: Fritz Dierks
6// $Header$
7//
8// License: This file is published under the license of the EMVA GENICAM_NAMESPACE Standard Group.
9// A text file describing the legal terms is included in your installation as 'GenICam_license.pdf'.
10// If for some reason you are missing this file please contact the EMVA or visit the website
11// (http://www.GENICAM_NAMESPACE.org) for a full copy.
12//
13// THIS SOFTWARE IS PROVIDED BY THE EMVA GENICAM_NAMESPACE STANDARD GROUP "AS IS"
14// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE EMVA GENICAM_NAMESPACE STANDARD GROUP
17// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
21// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23// POSSIBILITY OF SUCH DAMAGE.
24//-----------------------------------------------------------------------------
28#ifndef CLPROTOCOL_DEVICEID_H
29#define CLPROTOCOL_DEVICEID_H
30
31#include <Base/GCBase.h>
32#include <Base/GCUtilities.h>
33#include <GenApi/PortImpl.h>
34#include <CLProtocol/ClAllSerial.h>
35#include <CLProtocol/CLProtocol.h>
36#include <CLProtocol/ISerial.h>
37#include <CLProtocol/CVersion.h>
38#include <iostream>
39#include <fstream>
40
41namespace CLProtocol
42{
43
45
46 class CLPROTOCOL_DECL CDeviceID
47 {
48 public:
50 static const char* GetTokenSeparator();
51
53
55 GENICAM_DEPRECATED( static const char* GetTokenSeperator() );
56
57 public:
60
62 bool FromString(const GENICAM_NAMESPACE::gcstring &DeviceID);
63
65
69 GENICAM_NAMESPACE::gcstring GetDriverDirectory(const bool ReplaceEnvironmentVariables = true) const;
70
72 GENICAM_NAMESPACE::gcstring GetDriverFileName() const;
73
75 GENICAM_NAMESPACE::gcstring GetDriverPath() const;
76
78 GENICAM_NAMESPACE::gcstring GetCameraManufacturer() const;
79
81 GENICAM_NAMESPACE::gcstring GetCameraFamily() const;
82
84 GENICAM_NAMESPACE::gcstring GetCameraModel() const;
85
87 GENICAM_NAMESPACE::gcstring GetCameraVersion() const;
88
90 GENICAM_NAMESPACE::gcstring GetCameraSerialNumber() const;
91
93 GENICAM_NAMESPACE::gcstring GetShortDeviceID() const;
94
96 GENICAM_NAMESPACE::gcstring GetDeviceID(const bool ReplaceEnvironmentVariables = true) const;
97
98 private:
100 typedef enum
101 {
102 didDriverDirectory = 0,
103 didDriverFileName = 1,
104 didCameraManufacturer = 2,
105 didCameraFamily = 3,
106 didCameraModel = 4,
107 didCameraVersion = 5,
108 didCameraSerialNumber = 6
109 } EDeviceIDIndex;
110
112 GENICAM_NAMESPACE::gcstring_vector m_DeviceIDTokens;
113 };
114}
115#endif // CLPROTOCOL_DEVICEID_H
Helper class which can split DeviceIDs strings into tokens.
Definition DeviceID.h:47
CDeviceID()
Constructor.
GENICAM_NAMESPACE::gcstring GetDeviceID(const bool ReplaceEnvironmentVariables=true) const
retrieves the DeviceID without the DriverDriectory and the Driver FileName in front
GENICAM_NAMESPACE::gcstring GetCameraSerialNumber() const
retrieves the camera model's serial number in any format (may return empty string in case of a templa...
bool FromString(const GENICAM_NAMESPACE::gcstring &DeviceID)
parse string
GENICAM_NAMESPACE::gcstring GetCameraManufacturer() const
retrieves the manufacturer name of the camera
GENICAM_NAMESPACE::gcstring GetShortDeviceID() const
retrieves the ShortDeviceID/DeviceIDTemplate without the DriverDriectory and the Driver FileName in f...
GENICAM_NAMESPACE::gcstring GetCameraFamily() const
retrieves the camera family (may return empty string in case of a template)
GENICAM_DEPRECATED(static const char *GetTokenSeperator())
returns the token separator string
static const char * GetTokenSeparator()
returns the token separator string
GENICAM_NAMESPACE::gcstring GetDriverFileName() const
retrieves the file name of the CL protocol driver
GENICAM_NAMESPACE::gcstring GetDriverPath() const
retrieves the path of the CL protocol driver is located in
GENICAM_NAMESPACE::gcstring GetDriverDirectory(const bool ReplaceEnvironmentVariables=true) const
retrieves the directory the CL protocol driver is located in
GENICAM_NAMESPACE::gcstring GetCameraVersion() const
retrieves the camera model's version in any format (may return empty string in case of a template)
GENICAM_NAMESPACE::gcstring GetCameraModel() const
retrieves the camera model (may return empty string in case of a template)