sdhserial.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2007 SCHUNK GmbH & Co. KG
00003  * Copyright (c) 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License");
00006  * you may not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  *   http://www.apache.org/licenses/LICENSE-2.0
00010 
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 //======================================================================
00045 //======================================================================
00046 
00047 #ifndef SDHSERIAL_H_
00048 #define SDHSERIAL_H_
00049 
00050 #include "sdhlibrary_settings.h"
00051 
00052 //----------------------------------------------------------------------
00053 // System Includes - include with <>
00054 //----------------------------------------------------------------------
00055 
00056 #include <assert.h>
00057 #if ! SDH_USE_VCC
00058 # include <unistd.h>
00059 #endif
00060 
00061 //----------------------------------------------------------------------
00062 // Project Includes - include with ""
00063 //----------------------------------------------------------------------
00064 
00065 #include "dbg.h"
00066 #include "sdhexception.h"
00067 #include "simplevector.h"
00068 #include "simplestringlist.h"
00069 #include "sdhbase.h"
00070 #include "serialbase.h"
00071 
00072 //----------------------------------------------------------------------
00073 // Defines, enums, unions, structs,
00074 //----------------------------------------------------------------------
00075 
00076 #include "sdh_codes.h"
00077 
00078 //----------------------------------------------------------------------
00079 // Global variables
00080 //----------------------------------------------------------------------
00081 
00082 
00083 //----------------------------------------------------------------------
00084 // Function declarations
00085 //----------------------------------------------------------------------
00086 
00087 
00088 //----------------------------------------------------------------------
00089 // Class declarations
00090 //----------------------------------------------------------------------
00091 
00092 NAMESPACE_SDH_START
00093 
00094 // forward declarations of privatly used structures:
00095 struct sSDHBinaryRequest;
00096 struct sSDHBinaryResponse;
00097 
00108 class VCC_EXPORT cSDHSerial : public cSDHBase
00109 {
00110   friend struct sSDHBinaryRequest;
00111   friend struct sSDHBinaryResponse;
00112 
00113 protected:
00119   double m_sequtime;
00120 
00122   char const* EOL;
00123 
00125   cSerialBase* com;
00126 
00127 
00129   cSimpleStringList reply;
00130 
00132   int nb_lines_to_ignore;
00133 
00134 public:
00135   //#################################################################
00143   //-----------------------------------------------------------------
00153   cSDHSerial(int _debug_level = 0);
00154 
00155 
00156   //-----------------------------------------------------------------
00160   virtual ~cSDHSerial()
00161   {}
00162 
00163 
00164   //-----------------------------------------------------------------
00183   void Open(cSerialBase* _com)
00184   throw(cSDHLibraryException*);
00185 
00186 
00190   void Close()
00191   throw (cSDHLibraryException*);
00192 
00193 
00197   virtual bool IsOpen(void);
00198 
00199 
00215   void Send(char const* s, int nb_lines = All, int nb_lines_total = All, int max_retries = 3)
00216   throw(cSDHLibraryException*);
00217 
00218 
00222   void ExtractFirmwareState()
00223   throw(cSDHErrorCommunication*);
00224 
00225 
00229   double GetDuration(char* line)
00230   throw(cSDHErrorCommunication*);
00231 
00232 
00240   double get_duration(void);
00241 
00245   void Sync()
00246   throw(cSDHErrorCommunication*);
00247 
00251   void BinarySync(double timeout_s = 0.5)
00252   throw(cSDHErrorCommunication*);
00253 
00257   void SyncUnknown()
00258   throw(cSDHErrorCommunication*);
00259 
00260 
00274   cSimpleVector AxisCommand(char const* command, int axis = All, double* value = NULL)
00275   throw (cSDHLibraryException*);
00276 
00290   cSimpleVector BinaryAxisCommand(eCommandCode command, int axis = All, double* value = NULL)
00291   throw (cSDHLibraryException*);
00292 
00293 
00294   //  end of doxygen name group sdhlibrary_cpp_csdhserial_internal
00296   //################################################################
00297 
00298   //################################################################
00305   //-----------------------------------------------------------------
00320   cSimpleVector pid(int axis, double* p = NULL, double* i = NULL, double* d = NULL)
00321   throw (cSDHLibraryException*);
00322 
00323   //-----------------------------------------------------------------
00341   cSimpleVector kv(int axis = All, double* kv = NULL)
00342   throw (cSDHLibraryException*);
00343 
00344   //-----------------------------------------------------------------
00357   cSimpleVector ilim(int axis = All, double* limit = NULL)
00358   throw (cSDHLibraryException*);
00359 
00360   //-----------------------------------------------------------------
00377   cSimpleVector power(int axis = All, double* flag = NULL)
00378   throw (cSDHLibraryException*);
00379 
00380   //  end of doxygen name group sdhlibrary_cpp_csdhserial_setup_commands
00382   //#################################################################
00383 
00384 
00385   //#################################################################
00392   //-----------------------------------------------------------------
00396   void demo(bool onoff);
00397 
00398   //-----------------------------------------------------------------
00407   int property(char const* propname, int value);
00408 
00409   //-----------------------------------------------------------------
00412   int user_errors(int value);
00413 
00414   //-----------------------------------------------------------------
00417   int terminal(int value);
00418 
00419   //-----------------------------------------------------------------
00422   int debug(int value);
00423 
00424   //-----------------------------------------------------------------
00425 
00426   //  end of doxygen name group sdhlibrary_cpp_csdhserial_misc_commands
00428   //#################################################################
00429 
00430   //#################################################################
00437   //-----------------------------------------------------------------
00461   cSimpleVector v(int axis = All, double* velocity = NULL)
00462   throw (cSDHLibraryException*);
00463 
00464   //-----------------------------------------------------------------
00486   cSimpleVector tvav(int axis = All, double* velocity = NULL)
00487   throw (cSDHLibraryException*);
00488 
00489   //-----------------------------------------------------------------
00504   cSimpleVector vlim(int axis = All, double* dummy = NULL)
00505   throw (cSDHLibraryException*);
00506 
00507   //-----------------------------------------------------------------
00522   cSimpleVector alim(int axis = All, double* dummy = NULL)
00523   throw (cSDHLibraryException*);
00524 
00525   //-----------------------------------------------------------------
00541   cSimpleVector a(int axis = All, double* acceleration = NULL)
00542   throw (cSDHLibraryException*);
00543 
00544   //-----------------------------------------------------------------
00560   cSimpleVector p(int axis = All, double* angle = NULL)
00561   throw (cSDHLibraryException*);
00562 
00563   //-----------------------------------------------------------------
00579   cSimpleVector tpap(int axis = All, double* angle = NULL)
00580   throw (cSDHLibraryException*);
00581 
00582   //-----------------------------------------------------------------
00596   double m(bool sequ)
00597   throw (cSDHLibraryException*);
00598 
00599   //-----------------------------------------------------------------
00605   void stop(void)
00606   throw(cSDHLibraryException*);
00607 
00608 
00609   //-----------------------------------------------------------------
00617   eVelocityProfile vp(eVelocityProfile velocity_profile = eVP_INVALID)
00618   throw (cSDHLibraryException*);
00619 
00620 
00621   //-----------------------------------------------------------------
00629   eControllerType con(eControllerType controller)
00630   throw (cSDHLibraryException*);
00631 
00632   //  end of doxygen name group sdhlibrary_cpp_csdhserial_movement_commands
00634   //#################################################################
00635 
00636   //#################################################################
00643   //-----------------------------------------------------------------
00661   cSimpleVector pos(int axis = All, double* dummy = NULL)
00662   throw (cSDHLibraryException*);
00663 
00675   //-----------------------------------------------------------------
00676   cSimpleVector pos_save(int axis = All, double* value = NULL)
00677   throw (cSDHLibraryException*);
00678 
00679   //-----------------------------------------------------------------
00680 
00694   cSimpleVector ref(int axis = All, double* value = NULL)
00695   throw (cSDHLibraryException*);
00696 
00697   //-----------------------------------------------------------------
00715   cSimpleVector vel(int axis = All, double* dummy = NULL)
00716   throw (cSDHLibraryException*);
00717 
00739   cSimpleVector rvel(int axis, double* dummy = NULL)
00740   throw (cSDHLibraryException*);
00741 
00742 
00743   //-----------------------------------------------------------------
00754   cSimpleVector state(int axis = All, double* dummy = NULL)
00755   throw (cSDHLibraryException*);
00756 
00757   //-----------------------------------------------------------------
00764   cSimpleVector temp(void)
00765   throw (cSDHLibraryException*);
00766 
00767   //-----------------------------------------------------------------
00776   cSimpleVector temp_electronics(void)
00777   throw (cSDHLibraryException*);
00778 
00779   //-----------------------------------------------------------------
00787   char* ver(void)
00788   throw (cSDHLibraryException*);
00789   //-----------------------------------------------------------------
00790 
00798   char* ver_date(void)
00799   throw (cSDHLibraryException*);
00800   //-----------------------------------------------------------------
00801 
00809   char* id(void)
00810   throw (cSDHLibraryException*);
00811 
00812   //-----------------------------------------------------------------
00820   char* sn(void)
00821   throw (cSDHLibraryException*);
00822 
00823   //-----------------------------------------------------------------
00831   char* soc(void)
00832   throw (cSDHLibraryException*);
00833 
00834   //-----------------------------------------------------------------
00842   char* soc_date(void)
00843   throw (cSDHLibraryException*);
00844 
00845   //-----------------------------------------------------------------
00849   int numaxis(void)
00850   throw (cSDHLibraryException*);
00851 
00852 
00853   //  end of doxygen name group sdhlibrary_cpp_csdhserial_diagnosis_commands
00855   //#################################################################
00856 
00857   //#################################################################
00864   //-----------------------------------------------------------------
00877   cSimpleVector igrip(int axis = All, double* limit = NULL)
00878   throw (cSDHLibraryException*);
00879 
00880   //-----------------------------------------------------------------
00893   cSimpleVector ihold(int axis = All, double* limit = NULL)
00894   throw (cSDHLibraryException*);
00895 
00896   //-----------------------------------------------------------------
00910   double selgrip(eGraspId grip, bool sequ)
00911   throw (cSDHLibraryException*);
00912 
00913   //-----------------------------------------------------------------
00928   double grip(double close, double velocity, bool sequ)
00929   throw (cSDHLibraryException*);
00930 
00931   //  end of doxygen name group sdhlibrary_cpp_csdhserial_grip_commands
00933   //#################################################################
00934 
00935 }; // end of class cSDHSerial
00936 //=====================================================================
00937 
00939 typedef cSimpleVector(cSDHSerial::*pSetFunction)(int, double*);
00940 
00942 typedef cSimpleVector(cSDHSerial::*pGetFunction)(int, double*);
00943 
00944 NAMESPACE_SDH_END
00945 
00946 #endif
00947 
00948 
00949 //======================================================================
00950 /*
00951   Here are some settings for the emacs/xemacs editor (and can be safely ignored):
00952   (e.g. to explicitely set C++ mode for *.h header files)
00953 
00954   Local Variables:
00955   mode:C++
00956   mode:ELSE
00957   End:
00958 */
00959 //======================================================================
00960 


schunk_sdh
Author(s): Mathias Luedtke , Florian Weisshardt
autogenerated on Sat Jun 8 2019 20:25:21