6 #ifndef IFM3D_DEVICE_LEGACY_DEVICE_H
7 #define IFM3D_DEVICE_LEGACY_DEVICE_H
9 #include <ifm3d/device/device.h>
16 using Ptr = std::shared_ptr<LegacyDevice>;
25 using device_family = ifm3d::Device::DeviceFamily;
48 const std::string& ip = ifm3d::DEFAULT_IP,
49 std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
50 const std::string& password = ifm3d::DEFAULT_PASSWORD);
64 std::uint16_t xmlrpc_port = ifm3d::DEFAULT_XMLRPC_PORT,
65 const std::string& password = ifm3d::DEFAULT_PASSWORD);
150 virtual std::unordered_map<std::string, std::string> NetInfo();
151 virtual std::unordered_map<std::string, std::string> TimeInfo();
171 const std::unordered_map<std::string, std::string>& params);
245 const std::string& type = DEFAULT_APPLICATION_TYPE);
298 std::uint16_t flags = 0x0);
331 std::unique_ptr<Impl> _impl;
349 const std::function<
void(
const std::string&,
350 const std::string&)>& set_func,
351 const std::function<
void()>& save_func,
352 const std::string& name,
365 json to_json(
bool open_session =
true);
367 json get_application_infos_to_json();
369 void apply_device_config(
json& current,
const json& root);
370 void apply_apps_config(
json& current,
const json& root);
371 void apply_time_config(
json& current,
const json& root);
372 void apply_network_config(
json& current,
const json& root);
Software interface to an ifm 3D device.
Definition: device.h:134
ImportFlags
Import flags used when importing a Vision Assistant configuration.
Definition: device.h:173
TriggerMode
Image acquisition trigger modes.
Definition: device.h:164
MedianfilterMaskSize
Convenient constants for median filter mask sizes.
Definition: device.h:204
SpatialFilter
Convenience constants for spatial filter types.
Definition: device.h:183
OperatingMode
Device operating modes: run (streaming pixel data), edit (configuring the device/applications).
Definition: device.h:155
BootMode
Device boot up modes:
Definition: device.h:145
TemporalFilter
Convenience constants for temporal filter types.
Definition: device.h:194
Definition: legacy_device.h:14
virtual bool CancelSession(const std::string &sid)
Attempts to cancel a session with a particular session id.
virtual void SetTemporaryApplicationParameters(const std::unordered_map< std::string, std::string > ¶ms)
Sets temporary application parameters in run mode.
void from_json(const json &j_curr, const json &j_new, const std::function< void(const std::string &, const std::string &)> &set_func, const std::function< void()> &save_func, const std::string &name, int idx=-1)
Handles parsing a selected sub-tree of a potential input JSON file, setting the parameters as appropr...
virtual int Heartbeat(int hb)
Heartbeat messages are used to keep a session with the sensor alive.
virtual void SetPassword(const std::string &password="")
Sets or disable the password on the device.
virtual int CreateApplication(const std::string &type=DEFAULT_APPLICATION_TYPE)
Creates a new application on the device of the given type.
virtual bool CancelSession()
Explictly stops the current session with the sensor.
virtual void ImportIFMConfig(const std::vector< std::uint8_t > &bytes, std::uint16_t flags=0x0)
Imports an entire device configuration from a format compatible with Vision Assistant.
virtual int CopyApplication(int idx)
Creates a new application by copying the configuration of another application.
virtual std::vector< std::uint8_t > UnitVectors()
For devices that support fetching the Unit Vectors over XML-RPC, this function will return those data...
virtual void SetCurrentTime(int epoch_secs=-1)
Explicitly sets the current time on the device.
virtual std::string Password()
The password associated with this Device instance.
json ToJSON() override
Serializes the state of the device to JSON.
virtual int ImportIFMApp(const std::vector< std::uint8_t > &bytes)
Import the IFM-encoded application.
static bool get_app_json(int index, const json &j, json &app)
Return json of an app with given index from device configuration json.
virtual std::vector< std::string > ImagerTypes()
Lists the valid imager types supported by the sensor.
virtual int ActiveApplication()
Returns the integer index of the active application.
virtual std::vector< std::string > ApplicationTypes()
Lists the valid application types supported by the sensor.
void FromJSON(const json &j) override
Configures the device based on the parameter values of the passed in JSON.
LegacyDevice(const std::string &ip=ifm3d::DEFAULT_IP, std::uint16_t xmlrpc_port=ifm3d::DEFAULT_XMLRPC_PORT, const std::string &password=ifm3d::DEFAULT_PASSWORD)
Initializes the device interface utilizing library defaults for password, ip, and xmlrpc port unless ...
virtual void FactoryReset()
Sets the device configuration back to the state in which it shipped from the ifm factory.
virtual void DeleteApplication(int idx)
Deletes the application at the specified index from the sensor.
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)
Factory function for instantiating the proper subclass based on h/w probing.
virtual std::string RequestSession()
Requests an edit-mode session with the device.
virtual std::string SessionID()
Retrieves the active session id.
virtual std::vector< std::uint8_t > ExportIFMApp(int idx)
Export the application at the specified index into a byte array suitable for writing to a file.
virtual json ApplicationList()
Delivers basic information about all applications stored on the device.
virtual std::vector< std::uint8_t > ExportIFMConfig()
Exports the entire device configuration in a format compatible with Vision Assistant.
void ForceTrigger() override
Sends a S/W trigger to the device over XMLRPC.