|
ifm3d
|
Device specialization for O3R. More...
#include <ifm3d/device/o3r.h>
Classes | |
| struct | SetTemporaryApplicationParameter |
Public Types | |
| using | Ptr = std::shared_ptr< O3R > |
Public Types inherited from ifm3d::Device | |
| enum class | BootMode : int { PRODUCTIVE = 0 , RECOVERY = 1 } |
| Device boot up modes: More... | |
| enum class | OperatingMode : int { RUN = 0 , EDIT = 1 } |
| Device operating modes: run (streaming pixel data), edit (configuring the device/applications). | |
| enum class | TriggerMode : int { FREE_RUN = 1 , SW = 2 } |
| Image acquisition trigger modes. | |
| enum class | ImportFlags : int { GLOBAL = 0x1 , NET = 0x2 , APPS = 0x10 } |
| Import flags used when importing a Vision Assistant configuration. | |
| enum class | SpatialFilter : int { OFF = 0x0 , MEDIAN = 0x1 , MEAN = 0x2 , BILATERAL = 0x3 } |
| Convenience constants for spatial filter types. | |
| enum class | TemporalFilter : int { OFF = 0x0 , MEAN = 0x1 , ADAPTIVE_EXP = 0x2 } |
| Convenience constants for temporal filter types. | |
| enum class | MedianfilterMaskSize : int { _3x3 = 0 , _5x5 = 1 } |
| Convenient constants for median filter mask sizes. | |
| enum class | DeviceFamily : int { UNKNOWN = 0 , O3D = 1 , O3X = 2 , O3R = 3 } |
| enum class | SWUVersion : int { SWU_NOT_SUPPORTED = 0 , SWU_V1 = 1 , SWU_V2 = 2 } |
| using | Ptr = std::shared_ptr< Device > |
Public Member Functions | |
| O3R (const std::string &ip=ifm3d::DEFAULT_IP, std::uint16_t xmlrpc_port=ifm3d::DEFAULT_XMLRPC_PORT) | |
| O3R (O3R &&)=delete | |
| O3R & | operator= (O3R &&)=delete |
| O3R (O3R &)=delete | |
| O3R & | operator= (O3R &)=delete |
| virtual void | FactoryReset (bool keep_network_settings) |
| Sets the device configuration back to the state in which it shipped from the ifm factory. More... | |
| json | GetSchema () |
| Return the current JSON schema configuration. More... | |
| json | GetSchema (std::variant< std::monostate, std::string, std::vector< std::string >> pointers) |
| Returns the current JSON schema configuration or a subset of it. More... | |
| json | GetSchema (std::initializer_list< std::string > pointers) |
| Returns the current JSON schema configuration or a subset of it. More... | |
| json | Get (const std::vector< std::string > &path=std::vector< std::string >()) |
| Returns the configuration formatted as JSON based on a path. More... | |
| json | ResolveConfig (const json::json_pointer &ptr) |
| Returns a part of the configuration formatted as JSON based on a JSON pointer. More... | |
| void | Set (const json &j) |
| Overwrites parts of the temporary JSON configuration which is achieved by merging the provided JSON fragment with the current temporary JSON. More... | |
| void | Remove (const std::string &json_pointer) |
| Removes an object from the JSON. More... | |
| void | Reset (const std::string &json_pointer) |
| Sets the default value of an object inside the JSON. More... | |
| json | GetInit () |
| Return the initial JSON configuration. More... | |
| void | SaveInit (const std::vector< std::string > &pointers={}) |
| Save to current temporary JSON configuration as initial JSON configuration, so it will be applied with the next transition to the INIT state (system boot up) More... | |
| std::vector< PortInfo > | Ports () |
| Returns a list containing information about all connected physical and application ports. More... | |
| PortInfo | Port (const std::string &port) |
| Returns information about a given physical or application port. More... | |
| json | GetDiagnostic () |
| Returns the content of the diagnostic memory formatted in JSON. More... | |
| json | GetDiagnosticFilterSchema () |
| Returns the JSON schema for the filter expression provided to the getFiltered() method. More... | |
| json | GetDiagnosticFiltered (const json &filter) |
| Returns the content of the diagnostic memory formatted in JSON and filtered according to the JSON filter expression. More... | |
| void | Reboot (const BootMode &mode=ifm3d::Device::BootMode::PRODUCTIVE) override |
| Reboot the device. More... | |
| void | RebootToRecovery () |
| Reboot the device into Recovery Mode. | |
| DeviceFamily | WhoAmI () override |
| This function can be used to retrieve the family of the connected device. More... | |
| ifm3d::Device::SWUVersion | SwUpdateVersion () override |
| Checks the swupdater version supported by device. More... | |
| json | ToJSON () override |
| Serializes the state of the device to JSON. More... | |
| void | FromJSON (const json &j) override |
| Configures the device based on the parameter values of the passed in JSON. More... | |
| void | DownloadServiceReport (const std::string &out_file) |
Public Member Functions inherited from ifm3d::Device | |
| Device (const std::string &ip=ifm3d::DEFAULT_IP, std::uint16_t xmlrpc_port=ifm3d::DEFAULT_XMLRPC_PORT) | |
| Initializes the device interface utilizing library defaults for password, ip, and xmlrpc port unless explicitly passed in. More... | |
| virtual | ~Device () |
| The dtor will cancel any open edit sessions with the device. | |
| Device (Device &&)=delete | |
| Device & | operator= (Device &&)=delete |
| Device (Device &)=delete | |
| Device & | operator= (Device &)=delete |
| virtual std::string | IP () |
| The IP address associated with this Device instance. | |
| virtual std::uint16_t | XMLRPCPort () |
| The XMLRPC Port associated with this Device instance. | |
| virtual void | ForceTrigger () |
| Sends a S/W trigger to the device over XMLRPC. More... | |
| virtual std::string | DeviceType (bool use_cached=true) |
| This is a convenience function for extracting out the device type of the connected device. More... | |
| virtual bool | AmI (DeviceFamily family) |
| This is a convenience function for checking whether a device is one of the specified device family. More... | |
| virtual std::string | DeviceParameter (const std::string &key) |
| Convenience accessor for extracting a device parameters (i.e., no edit session created on the device) | |
| virtual std::vector< std::string > | TraceLogs (int count) |
| Delivers the trace log from the device A session is not required to call this function. More... | |
| virtual std::string | ToJSONStr () |
A stringified version of the JSON object returned by ToJSON(). More... | |
| virtual void | FromJSONStr (const std::string &jstr) |
Accepts a string with properly formatted/escaped JSON text, converts it to a json object, and call FromJSON() on it. More... | |
| bool | CheckMinimumFirmwareVersion (unsigned int major, unsigned int minor, unsigned int patch) |
| Checks for a minimum ifm device software version. More... | |
| ifm3d::SemVer | FirmwareVersion () |
| get the firmware version of the device | |
| json | GetSWVersion () |
Additional Inherited Members | |
Static Public Member Functions inherited from ifm3d::Device | |
| static std::vector< ifm3d::IFMNetworkDevice > | DeviceDiscovery () |
| This function Provides a convinent way to find all ifm devices on the network. More... | |
| static void | SetTempIPAddress (const std::string &mac, const std::string &temp_ip) |
| This function Provides a way to set temporary IP. More... | |
| static Ptr | MakeShared (const std::string &ip=ifm3d::DEFAULT_IP, std::uint16_t xmlrpc_port=ifm3d::DEFAULT_XMLRPC_PORT, const std::string &password=ifm3d::DEFAULT_PASSWORD, bool throw_if_unavailable=true) |
| Factory function for instantiating the proper subclass based on h/w probing. More... | |
Protected Member Functions inherited from ifm3d::Device | |
| int | device_id () |
| Implements the serialization of the device state to JSON. More... | |
| bool | check_device_id (int device_id, int min_id, int max_id) |
| std::shared_ptr< XMLRPC > | x_wrapper () |
Protected Attributes inherited from ifm3d::Device | |
| std::unique_ptr< Impl > | _impl |
| std::string | _device_type |
| The cached device type of the connected device. | |
|
virtual |
Sets the device configuration back to the state in which it shipped from the ifm factory.
| [in] | keepNetworkSettings | a bool indicating wether to keep the current network settings |
|
overridevirtual |
Configures the device based on the parameter values of the passed in JSON.
This function is the way to tune the device/application/imager/etc. parameters.
| [in] | json | A json object encoding a camera configuration to apply to the hardware. |
| ifm3d::Error | upon error - if this throws an exception, you are encouraged to check the log file as a best effort is made to be as descriptive as possible as to the specific error that has occured. Equivalent to Set() followed by SaveInit() |
Reimplemented from ifm3d::Device.
| json ifm3d::O3R::Get | ( | const std::vector< std::string > & | path = std::vector< std::string >() | ) |
Returns the configuration formatted as JSON based on a path.
If the path is empty, returns the whole configuration. This function is blocking for firmware versions above 1.1.0.
| [in] | path | A List of JSON path fragments to retrieve the information for |
| json ifm3d::O3R::GetDiagnostic | ( | ) |
Returns the content of the diagnostic memory formatted in JSON.
Returns the content of the diagnostic memory formatted in JSON and filtered according to the JSON filter expression.
| filter | A filter expression in JSON format |
| json ifm3d::O3R::GetDiagnosticFilterSchema | ( | ) |
Returns the JSON schema for the filter expression provided to the getFiltered() method.
| json ifm3d::O3R::GetInit | ( | ) |
Return the initial JSON configuration.
| json ifm3d::O3R::GetSchema | ( | ) |
Return the current JSON schema configuration.
| json ifm3d::O3R::GetSchema | ( | std::initializer_list< std::string > | pointers | ) |
Returns the current JSON schema configuration or a subset of it.
This overload accepts an initializer list of JSON Pointers to extract specific parts of the schema.
| pointers | One or more JSON Pointers as strings to select a subset of the schema. |
| json ifm3d::O3R::GetSchema | ( | std::variant< std::monostate, std::string, std::vector< std::string >> | pointers | ) |
Returns the current JSON schema configuration or a subset of it.
This overload accepts a variant argument to support optional selection of specific portions of the schema using JSON Pointers.
| pointers | A variant that can be:
|
| PortInfo ifm3d::O3R::Port | ( | const std::string & | port | ) |
Returns information about a given physical or application port.
| [in] | port | the port for which to get the information |
| std::vector<PortInfo> ifm3d::O3R::Ports | ( | ) |
Returns a list containing information about all connected physical and application ports.
|
overridevirtual |
Reboot the device.
| [in] | mode | The system mode to boot into upon restart of the device |
| ifm3d::Error | upon error |
Reimplemented from ifm3d::Device.
| void ifm3d::O3R::Remove | ( | const std::string & | json_pointer | ) |
Removes an object from the JSON.
The scope of this method is limited to the following regular expressions
| [in] | jsonPointer | A JSON Pointer to the object to be removed. |
| void ifm3d::O3R::Reset | ( | const std::string & | json_pointer | ) |
Sets the default value of an object inside the JSON.
The object is addressed by a JSON Pointer. The object is reset to the values defined in the JSON schema. Note that this does not reset the init configuration, nor the parameters marked as "sticky".
| [in] | jsonPointer | A JSON Pointer to the object to be set to default. |
| json ifm3d::O3R::ResolveConfig | ( | const json::json_pointer & | ptr | ) |
Returns a part of the configuration formatted as JSON based on a JSON pointer.
| [in] | ptr | A JSON pointer to retrieve the information for |
| void ifm3d::O3R::SaveInit | ( | const std::vector< std::string > & | pointers = {} | ) |
Save to current temporary JSON configuration as initial JSON configuration, so it will be applied with the next transition to the INIT state (system boot up)
| [in] | pointers | A List of JSON pointers specifying which parts of the configuration should be saved as initial JSON. If no list is provided the whole config will be saved |
| void ifm3d::O3R::Set | ( | const json & | j | ) |
Overwrites parts of the temporary JSON configuration which is achieved by merging the provided JSON fragment with the current temporary JSON.
This function is blocking for firmware versions above 1.1.0.
| [in] | j | The new temporay JSON configuration of the device. |
|
overridevirtual |
Checks the swupdater version supported by device.
Reimplemented from ifm3d::Device.
|
overridevirtual |
Serializes the state of the device to JSON.
The JSON interface returned here is the excellent JSON for Modern C++.
This function (along with its std::string equivalent ToJSONStr()) provides the primary gateway into obtaining the current parameter settings for the device and PMD imager. Data returned from this function can be manipulated as a json object, then fed into FromJSON(...) to mutate parameter settings on the device.
| ifm3d::Error | upon error Equivalent to the Get() method |
Reimplemented from ifm3d::Device.
|
overridevirtual |
This function can be used to retrieve the family of the connected device.
Reimplemented from ifm3d::Device.