IRSOL
C++ code implementing socket server for interacting with Baumer camera.
irsol::server::handlers::InquiryIntegrationTimeHandler Class Reference

Handler for inquiry of the camera integration time (exposure). More...

#include <inquiry_integration_time.hpp>

Inheritance diagram for irsol::server::handlers::InquiryIntegrationTimeHandler:
irsol::server::handlers::internal::HandlerBase< T, >

Public Member Functions

 InquiryIntegrationTimeHandler (std::shared_ptr< Context > ctx)
 Constructs the InquiryIntegrationTimeHandler.
 
- Public Member Functions inherited from irsol::server::handlers::internal::HandlerBase< T, >
virtual std::vector< out_message_toperator() (const irsol::types::client_id_t &clientId, T &&message)
 Invokes the handler for a given client and message.
 

Protected Member Functions

std::vector< out_message_tprocess (std::shared_ptr< irsol::server::ClientSession > session, protocol::Inquiry &&message) final override
 Processes an inquiry message to retrieve the integration time.
 
- Protected Member Functions inherited from irsol::server::handlers::internal::HandlerBase< T, >
 HandlerBase (std::shared_ptr< Context > ctx)
 Constructs the handler base.
 
virtual std::vector< out_message_tprocess (std::shared_ptr< irsol::server::ClientSession > session, T &&message)=0
 Processes the protocol message for the given session.
 

Additional Inherited Members

- Protected Attributes inherited from irsol::server::handlers::internal::HandlerBase< T, >
std::shared_ptr< Contextctx
 Handler context (provides access to app and utilities).
 

Detailed Description

Handler for inquiry of the camera integration time (exposure).

Processes inquiry messages to retrieve the current camera integration time.

Definition at line 24 of file inquiry_integration_time.hpp.

Constructor & Destructor Documentation

◆ InquiryIntegrationTimeHandler()

irsol::server::handlers::InquiryIntegrationTimeHandler::InquiryIntegrationTimeHandler ( std::shared_ptr< Context ctx)

Constructs the InquiryIntegrationTimeHandler.

Parameters
ctxHandler context.

Definition at line 11 of file inquiry_integration_time.cpp.

13{}
std::shared_ptr< Context > ctx
Handler context (provides access to app and utilities).
Definition base.hpp:81
internal::HandlerBase< protocol::Inquiry > InquiryHandler
Handler type for inquiry messages.
Definition base.hpp:92

Member Function Documentation

◆ process()

std::vector< out_message_t > irsol::server::handlers::InquiryIntegrationTimeHandler::process ( std::shared_ptr< irsol::server::ClientSession session,
protocol::Inquiry &&  message 
)
finaloverrideprotected

Processes an inquiry message to retrieve the integration time.

Parameters
sessionThe client session.
messageThe inquiry message.
Returns
Vector of outbound messages containing the integration time.

Definition at line 16 of file inquiry_integration_time.cpp.

19{
20 auto& cam = session->app().camera();
21 auto exposure = cam.getExposure();
22
23 std::vector<out_message_t> result;
25 message,
26 static_cast<int>(
27 1.0 * std::chrono::duration_cast<std::chrono::microseconds>(exposure).count() / 1000)));
28 return result;
29}
constexpr auto makeHandler(std::shared_ptr< Context > ctx, Args &&... args)
Constructs a handler instance of the given type.
Definition factory.hpp:28
static Success from(const Assignment &msg, std::optional< irsol::types::protocol_value_t > overrideValue=std::nullopt)
Creates a success message from an Assignment.
Definition success.hpp:75
auto result

The documentation for this class was generated from the following files: