33#include "DeviCounterConnection.h"
34#include "DeviCounterBattery.h"
35#include <NDEVR/DistanceEncoder.h>
36#include <NDEVR/Translator.h>
37#include <NDEVR/FileResource.h>
38#include <NDEVR/INIFactory.h>
62 void attemptConnect();
65 void setEncoderSettings(
const EncoderSettings& settings,
bool send_to_device);
75 void settingsChangedSignal();
76 void connectionChangedSignal(
bool is_connected);
Network connection implementation for communicating with a DeviCounter device.
INI-based settings for DeviCounter connection behavior, timing, and simulation mode.
bool m_try_to_connect
Whether to attempt connection on next update.
bool m_data_recieved
Whether data has been received from the device.
bool m_is_connected
Whether the device is currently connected.
virtual bool isInUse() const override
Checks whether this encoder is currently in use.
void setDeploymentInfo(const DeploymentInfo &info) final override
Sets the deployment info for managing deployment sessions.
TimeSpan updateInterval() const final override
Returns the time interval between automatic updates.
uint04 m_num_of_failures_in_row
Consecutive connection failures.
ConnectionInfo m_connection_info
Connection parameters for the device.
DeviCounterConnection * m_connection
Active connection to the device.
LogPtr m_raw_log
Raw data log for debugging.
EncoderSettings m_encoder_settings
Current encoder configuration.
void calibrateToLength(fltp08 length) final override
Calibrates the encoder scale so that the current raw reading maps to the given length.
Time m_last_connection_attempt_time
Timestamp of last connection attempt.
void update(Time time) final override
Called to update the device with only the current time.
DistanceEncoder(const Model &model, LogPtr log=LogPtr(), QObject *parent=nullptr)
Constructs a DistanceEncoder device.
virtual fltp08 length() const
Returns the calibrated length, applying scale and offset to the raw reading.
A light-weight base class for Log that allows processes to update, without the need for additional in...
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
The core String class for the NDEVR API.
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
A structure designed to store information about a specific Connection.
Parameters describing a deployment session for a DistanceEncoder and its associated sensor.
Configuration settings for a DeviCounter rotary encoder device.
fltp08 initial_offset
Initial distance offset in meters.
String ssid
SSID of the encoder's wireless network.
uint04 count
Number of encoder ticks per revolution.
bool is_clockwise
Whether the encoder counts clockwise.