Added rot_move function

git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@867 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.3
Francois Retief 2002-01-16 16:52:33 +00:00
rodzic 60b68946bb
commit f29a49c765
3 zmienionych plików z 37 dodań i 24 usunięć

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Dummy backend - main file * Hamlib Dummy backend - main file
* Copyright (c) 2001,2002 by Stephane Fillod * Copyright (c) 2001,2002 by Stephane Fillod
* *
* $Id: rot_dummy.c,v 1.1 2001-12-28 20:29:33 fillods Exp $ * $Id: rot_dummy.c,v 1.2 2002-01-16 16:48:52 fgretief Exp $
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as * it under the terms of the GNU Library General Public License as
@ -140,6 +140,12 @@ static int dummy_rot_reset(ROT *rot, rot_reset_t reset)
return RIG_OK; return RIG_OK;
} }
static int dummy_rot_move(ROT *rot, int direction, int speed)
{
rig_debug(RIG_DEBUG_VERBOSE,__FUNCTION__ " called\n");
return RIG_OK;
}
static const char *dummy_rot_get_info(ROT *rot) static const char *dummy_rot_get_info(ROT *rot)
{ {
@ -181,6 +187,7 @@ const struct rot_caps dummy_rot_caps = {
park: dummy_rot_park, park: dummy_rot_park,
stop: dummy_rot_stop, stop: dummy_rot_stop,
reset: dummy_rot_reset, reset: dummy_rot_reset,
move: dummy_rot_move,
get_info: dummy_rot_get_info, get_info: dummy_rot_get_info,
}; };

Wyświetl plik

@ -2,7 +2,7 @@
* Hamlib Interface - Rotator API header * Hamlib Interface - Rotator API header
* Copyright (c) 2000,2001 by Stephane Fillod * Copyright (c) 2000,2001 by Stephane Fillod
* *
* $Id: rotator.h,v 1.2 2001-12-28 20:30:58 fillods Exp $ * $Id: rotator.h,v 1.3 2002-01-16 16:52:33 fgretief Exp $
* *
* This library is free software; you can redistribute it and/or modify * This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as * it under the terms of the GNU Library General Public License as
@ -26,7 +26,7 @@
#include <hamlib/rig.h> #include <hamlib/rig.h>
#include <hamlib/rotlist.h> #include <hamlib/rotlist.h>
#include <stdio.h> /* required for FILE definition */ #include <stdio.h> /* required for FILE definition */
#include <sys/time.h> /* required for struct timeval */ #include <time.h> /* required for time_t definition */
__BEGIN_DECLS __BEGIN_DECLS
@ -47,16 +47,20 @@ typedef int rot_reset_t;
#define ROT_FLAG_AZIMUTH (1<<1) #define ROT_FLAG_AZIMUTH (1<<1)
#define ROT_FLAG_ELEVATION (1<<2) #define ROT_FLAG_ELEVATION (1<<2)
#define ROT_TYPE_OTHER 0
#define ROT_TYPE_OTHER 0 #define ROT_MOVE_UP (1<<1)
#define ROT_MOVE_DOWN (1<<2)
#define ROT_MOVE_LEFT (1<<3)
#define ROT_MOVE_CCW ROT_MOVE_LEFT
#define ROT_MOVE_RIGHT (1<<4)
#define ROT_MOVE_CW ROT_MOVE_RIGHT
/* Basic rot type, can store some useful /* Basic rot type, can store some useful
* info about different rotators. Each lib must * info about different rotators. Each lib must
* be able to populate this structure, so we can make * be able to populate this structure, so we can make
* useful enquiries about capablilities. * useful enquiries about capablilities.
*/ */
/* /*
* The main idea of this struct is that it will be defined by the backend * The main idea of this struct is that it will be defined by the backend
@ -68,7 +72,7 @@ typedef int rot_reset_t;
* sharing the struct rot_caps of the backend, while keeping their own * sharing the struct rot_caps of the backend, while keeping their own
* customized data. * customized data.
* NB: don't move fields around, as backend depends on it when initializing * NB: don't move fields around, as backend depends on it when initializing
* their caps. * their caps.
*/ */
struct rot_caps { struct rot_caps {
rot_model_t rot_model; rot_model_t rot_model;
@ -129,8 +133,8 @@ struct rot_caps {
int (*stop)(ROT *rot); int (*stop)(ROT *rot);
int (*park)(ROT *rot); int (*park)(ROT *rot);
int (*reset)(ROT *rot, rot_reset_t reset); int (*reset)(ROT *rot, rot_reset_t reset);
int (*move)(ROT *rot, int direction, int speed);
/* get firmware info, etc. */ /* get firmware info, etc. */
const char* (*get_info)(ROT *rot); const char* (*get_info)(ROT *rot);
@ -185,8 +189,6 @@ struct rot {
struct rot_state state; struct rot_state state;
}; };
/* --------------- API function prototypes -----------------*/ /* --------------- API function prototypes -----------------*/
extern HAMLIB_EXPORT(ROT *) rot_init HAMLIB_PARAMS((rot_model_t rot_model)); extern HAMLIB_EXPORT(ROT *) rot_init HAMLIB_PARAMS((rot_model_t rot_model));
@ -200,16 +202,14 @@ extern HAMLIB_EXPORT(int) rot_get_conf HAMLIB_PARAMS((ROT *rot, token_t token, c
* General API commands, from most primitive to least.. ) * General API commands, from most primitive to least.. )
* List Set/Get functions pairs * List Set/Get functions pairs
*/ */
extern HAMLIB_EXPORT(int) rot_set_position HAMLIB_PARAMS((ROT *rot, azimuth_t azimuth, elevation_t elevation)); extern HAMLIB_EXPORT(int) rot_set_position HAMLIB_PARAMS((ROT *rot, azimuth_t azimuth, elevation_t elevation));
extern HAMLIB_EXPORT(int) rot_get_position HAMLIB_PARAMS((ROT *rot, azimuth_t *azimuth, elevation_t *elevation)); extern HAMLIB_EXPORT(int) rot_get_position HAMLIB_PARAMS((ROT *rot, azimuth_t *azimuth, elevation_t *elevation));
extern HAMLIB_EXPORT(int) rot_stop HAMLIB_PARAMS((ROT *rot)); extern HAMLIB_EXPORT(int) rot_stop HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int) rot_park HAMLIB_PARAMS((ROT *rot)); extern HAMLIB_EXPORT(int) rot_park HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int) rot_reset HAMLIB_PARAMS((ROT *rot, rot_reset_t reset)); extern HAMLIB_EXPORT(int) rot_reset HAMLIB_PARAMS((ROT *rot, rot_reset_t reset));
extern HAMLIB_EXPORT(int) rot_move HAMLIB_PARAMS((ROT *rot, int direction, int speed));
extern HAMLIB_EXPORT(const char*) rot_get_info HAMLIB_PARAMS((ROT *rot)); extern HAMLIB_EXPORT(const char*) rot_get_info HAMLIB_PARAMS((ROT *rot));
extern HAMLIB_EXPORT(int) rot_register HAMLIB_PARAMS((const struct rot_caps *caps)); extern HAMLIB_EXPORT(int) rot_register HAMLIB_PARAMS((const struct rot_caps *caps));
extern HAMLIB_EXPORT(int) rot_unregister HAMLIB_PARAMS((rot_model_t rot_model)); extern HAMLIB_EXPORT(int) rot_unregister HAMLIB_PARAMS((rot_model_t rot_model));
extern HAMLIB_EXPORT(int) rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps*, rig_ptr_t), rig_ptr_t data)); extern HAMLIB_EXPORT(int) rot_list_foreach HAMLIB_PARAMS((int (*cfunc)(const struct rot_caps*, rig_ptr_t), rig_ptr_t data));

Wyświetl plik

@ -91,6 +91,7 @@ type
park : function(rot: PRot): integer; cdecl; park : function(rot: PRot): integer; cdecl;
reset : function(rot: PRot; reset: rot_reset_t): integer; cdecl; reset : function(rot: PRot; reset: rot_reset_t): integer; cdecl;
move : function(rot: PRot; direction: integer; speed: integer): integer; cdecl;
{* get firmware info, etc. *} {* get firmware info, etc. *}
get_info : function(rot: PRot): PChar; cdecl; get_info : function(rot: PRot): PChar; cdecl;
@ -193,6 +194,9 @@ function rot_get_position(rot: PRot; var az: azimuth_t; var el: elevation_t): in
function rot_stop(rot: PRot): integer; cdecl; function rot_stop(rot: PRot): integer; cdecl;
function rot_park(rot: PRot): integer; cdecl; function rot_park(rot: PRot): integer; cdecl;
function rot_reset(rot: PRot; reset: rot_reset_t): integer; cdecl; function rot_reset(rot: PRot; reset: rot_reset_t): integer; cdecl;
function rot_move(rot: PRot; direction: integer; speed: integer): integer; cdecl;
function rot_set_position_at(rot: PRot; az: azimuth_t; el: elevation_t; when: longint): integer; cdecl;
function rot_get_info(rot: PRot): PChar; cdecl; function rot_get_info(rot: PRot): PChar; cdecl;
function rot_register(caps: PRotCaps): integer; cdecl; function rot_register(caps: PRotCaps): integer; cdecl;
@ -229,6 +233,8 @@ function rot_get_position; external hamlib_modulename name 'rot_get_position';
function rot_stop; external hamlib_modulename name 'rot_stop'; function rot_stop; external hamlib_modulename name 'rot_stop';
function rot_park; external hamlib_modulename name 'rot_park'; function rot_park; external hamlib_modulename name 'rot_park';
function rot_reset; external hamlib_modulename name 'rot_reset'; function rot_reset; external hamlib_modulename name 'rot_reset';
function rot_move; external hamlib_modulename name 'rot_move';
function rot_set_position_at; external hamlib_modulename name 'rot_set_position_at';
function rot_get_info; external hamlib_modulename name 'rot_get_info'; function rot_get_info; external hamlib_modulename name 'rot_get_info';
function rot_register; external hamlib_modulename name 'rot_register'; function rot_register; external hamlib_modulename name 'rot_register';
function rot_unregister; external hamlib_modulename name 'rot_unregister'; function rot_unregister; external hamlib_modulename name 'rot_unregister';