phidgetik.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *   http://www.apache.org/licenses/LICENSE-2.0
00009 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016  
00017 
00018 #ifndef _PHIDGETIK_H_
00019 #define _PHIDGETIK_H_
00020 
00021 #include <cob_phidgets/phidget.h>
00022 
00023 class PhidgetIK: public Phidget
00024 {
00025 public:
00026         PhidgetIK(SensingMode mode);
00027         ~PhidgetIK();
00028 
00029         auto init(int serial_number) -> int;
00030 
00031         auto getInputCount() -> int;
00032         auto getOutputCount() -> int;
00033         auto getSensorCount() -> int;
00034 
00035         auto getInputState(int index) -> int;
00036 
00037         auto getOutputState(int index) -> int;
00038         auto setOutputState(int index, int state) -> int;
00039 
00040         auto getSensorValue(int index) -> int;
00041         auto getSensorRawValue(int index) -> int;
00042 
00043         auto getSensorChangeTrigger(int index) -> int;
00044         auto setSensorChangeTrigger(int index, int trigger) -> int;
00045 
00046         auto getRatiometric() -> int;
00047         auto setRatiometric(int ratiometric) -> int;
00048 
00049         auto getDataRate(int index) -> int;
00050         auto setDataRate(int index, int datarate) -> int;
00051 
00052         auto getDataRateMax(int index) -> int;
00053         auto getDataRateMin(int index) -> int;
00054 
00055         auto getError() -> int;
00056 
00057         virtual auto update() -> void;
00058 
00059 protected:
00060         CPhidgetInterfaceKitHandle _iKitHandle;
00061 
00062         virtual int attachHandler();
00063         virtual int detachHandler();
00064 
00065         virtual int inputChangeHandler(int index, int inputState);
00066         virtual int outputChangeHandler(int index, int outputState);
00067         virtual int sensorChangeHandler(int index, int sensorValue);
00068 
00069 private:
00070         static auto attachDelegate(CPhidgetHandle phid, void *userptr) -> int;
00071 
00072         static auto inputChangeDelegate(CPhidgetInterfaceKitHandle phid,
00073                         void *userPtr, int index, int inputState) -> int;
00074         static auto outputChangeDelegate(CPhidgetInterfaceKitHandle phid,
00075                         void *userPtr, int index, int outputState) -> int;
00076         static auto sensorChangeDelegate(CPhidgetInterfaceKitHandle phid,
00077                         void *userPtr, int index, int sensorValue) -> int;
00078 };
00079 #endif //_PHIDGETIK_H_


cob_phidgets
Author(s): Florian Weisshardt
autogenerated on Sat Jun 8 2019 21:02:14