LabJackScaffold.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_DEVICES_LABJACK_LABJACKSCAFFOLD_H
#define SURGSIM_DEVICES_LABJACK_LABJACKSCAFFOLD_H
#include <memory>
namespace SurgSim
{
namespace DataStructures
{
class DataGroup;
};
namespace Framework
{
class Logger;
}
namespace Devices
{
class LabJackDevice;
class LabJackThread;
class LabJackScaffold
{
public:
struct DeviceData;
LabJackScaffold();
~LabJackScaffold();
static std::shared_ptr<LabJackScaffold> getOrCreateSharedInstance();
void configureDevice(DeviceData* device);
private:
struct StateData;
class Handle;
friend class LabJackDevice;
friend class LabJackThread;
friend struct StateData;
bool registerDevice(LabJackDevice* device);
bool unregisterDevice(const LabJackDevice* device);
bool runInputFrame(DeviceData* info);
bool updateDevice(DeviceData* info);
bool destroyPerDeviceThread(DeviceData* data);
bool configureClockAndTimers(DeviceData* deviceData);
bool configureNumberOfTimers(DeviceData* deviceData);
bool configureClock(DeviceData* deviceData);
bool configureTimers(DeviceData* deviceData);
bool configureDigital(DeviceData* deviceData);
bool configureAnalog(DeviceData* deviceData);
static DataStructures::DataGroup buildDeviceInputData();
std::shared_ptr<Framework::Logger> m_logger;
std::unique_ptr<StateData> m_state;
};
}; // namespace Devices
}; // namespace SurgSim
#endif // SURGSIM_DEVICES_LABJACK_LABJACKSCAFFOLD_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Devices::LabJackThread
A class implementing the thread context for communicating with LabJack devices.
Definition: LabJackThread.h:31
SurgSim::Devices::LabJackScaffold::Handle
Definition: LabJackScaffold.cpp:183
SurgSim::Devices::LabJackScaffold::m_logger
std::shared_ptr< Framework::Logger > m_logger
Logger used by the scaffold and all devices.
Definition: LabJackScaffold.h:136
SurgSim::Devices::LabJackDevice
A class implementing the communication with a LabJack data acquisition (DAQ) device.
Definition: LabJackDevice.h:274
SurgSim::Devices::LabJackScaffold
A class that implements the behavior of LabJackDevice objects.
Definition: LabJackScaffold.h:41
SurgSim::DataStructures::DataGroup
A collection of NamedData objects.
Definition: DataGroup.h:68
SurgSim::Devices::LabJackScaffold::StateData
The per-scaffold data (in comparison to DeviceData the per-device data).
Definition: LabJackScaffold.cpp:491
SurgSim::Devices::LabJackScaffold::m_state
std::unique_ptr< StateData > m_state
Internal scaffold state.
Definition: LabJackScaffold.h:139
SurgSim::Devices::LabJackScaffold::DeviceData
The per-device data.
Definition: LabJackScaffold.cpp:369