/* * special.c * * * * Copyright (C) 2002 - 2002 Benninghaus, Rottweil * EMail: el@eb-themen.de * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _special_c #define _special_c #ifdef __cplusplus extern "C" { #endif /* This is called, whenever a correction should be do, or correction is done before, and now is position ok again */ void doCorrect( int ok ) { int azdir,altdir,az,alt; if(cfg.test){ if(ok){ fprintf(stdout,"ok\n"); } else { fprintf(stdout,"%d:%d:%d:%d\n",cv1.left,cv1.right,cv1.up,cv1.down); } return; } if(cfg.elctr){ if(ok){ ctrif_StopMotors(); } else { az = 0; alt = 0; azdir = 0; altdir = 0; if(cv1.left || cv1.right){ az = 1; if(cv1.left){ azdir = 1; } } if(cv1.up || cv1.down){ alt = 1; if(cv1.down){ altdir = 1; } } if(az || alt){ ctrif_Move( SPEED_SLOW ,az, azdir,alt, altdir, 0, 0 ); } } } } /* This handles fieldrotator, and is called every 50 milliseconds, when elctr.fruse, and cfg.control is on, and no motor is running currently This makes the steps for the fieldrotator, dependend on elctr.frleft (0 = right, 1 = left ). */ void fr_work( void ) { if(cfg.test){ ; } /* do needed fieldrotator actions */ } /* This handles automatical guiding, when calcultion of it is done before ( guideinit = 1 ), but only if cfg.control, and cfg.guide is on, and no motors running otherwise currently. */ void guide_work( void ) { if(cfg.test){ ; } /* do needed guiding actions */ } /* this is called, when count is exactly cfg.calctart, ( after last get picture of testing, before comparison starts ), cfg.guide is on, and currently no motor is running otherwise. This should make the necessary stuff for initiating values for later automaticall guiding. If this returns 1, guideinit will be set to 1 external, if 0 it will be not set. If this is called, last picture for testing is get, positions are found successfully, buffer is v_firstbuf filtervalues fv1 comparevalues cv1 after this phase test is ready, and phase comparison is started with getting a complete new image. */ int guide_initialisation_work( void ) { if(cfg.test){ ; } /* We should set a timer, wait some seconds, till position is depositioned, then getting a picture, and compare this to fv1/cv1. The difference we can use to calculate timings for makeing az/alt steps. */ return(0); } #ifdef __cplusplus } #endif #endif /*_special_c*/