Index: trunk/MagicSoft/Cosy/Changelog
===================================================================
--- trunk/MagicSoft/Cosy/Changelog	(revision 7296)
+++ trunk/MagicSoft/Cosy/Changelog	(revision 7297)
@@ -98,1655 +98,2 @@
        centerx[%05.1f] centery[%05.1f] n[%04d]
        bright[%03.1f] mjd[%12.6f]
-
-
-
- 2004/09/05 - Robert Wagner (La Palma)
-
-   * main/MStarguider.[cc,h]
-     - Start commissioning of a star guider for MAGIC.
-     - Display misspointing with an MGStarg object
-     - Rename the two video channels to "Starfield Camera" and "TPoint Camera"
-     - Swapped IDs of video channels, since a reset (errno=5) of video card 
-       changes to channel #0
-     - Rearranged menu structure, added starguider relevant items: Starguider
-       LED finder, Starguider FindStar (FindStar analysis of star on curtain
-       for crosschecks and calibration), Starguider Analysis (write relevant 
-       data to ROOT trees), Starguider (Starguider analysis of starfield 
-       picture)
-     - Rearranged GUI displays, added displays to show misspointing,
-       misspointing from FindStar algorithm, sky brightness
-     - Acquisition of center of the PMT camera from applying Caos algorithm 
-       to the three LEDs visible in the starfield camera
-     - Acquisition of sky brightness (average CCD pixel content in Starfield)
-       and comparison to last sky brightness
-     - MStarguider::TrackingError(): Modified histogram binning to enhance 
-       excess
-     - MStarguider::FindStar(): Now returns position of found star as ZdAz
-     - MStarguider::FindStar(): Cut and ROI box can now handed over as i
-       parameters
-     - MStarguider::FindStar(): Scale factor to compensate for different FOV
-       (TPoint camera vs. Starfield camera)
-     - MStarguider::ProcessFrame(): Modified structure to accomodate Starguider
-       algorithm and tools: 1) Find Center of PMT camera, find Star (if 
-       activated)
-       to obtain misspointing found from PMT camera.
-     - Set ROI for starfield in space not occupied by the PMT camera in the 
-       starfield camera FOV
-     - Calculate star positions and draw stars only in that ROI
-     - fStatus variable contains status of starguider (Error, Monitoring, 
-       Standby)
-     - Draw representation of MAGIC's FOV on starfield
-     - Send STARG-REPORTS unconditionally by using MDriveCom::SendStargReport 
-     - Add Ra/Dec in filename when writing pictures
-     - Introduced #define EXPERT to allow for debug output
-     - tracking_*.txt is only produced in case of EXPERT mode
-
-   * tcpip/MTcpIpIO.[h,cc], tcpip/MCeCoCom.[h,cc]
-     - added option force to MTcpIp::Send() which forces sending
-       of message     
-
-   * tcpip/MDriveCom.[h,cc]
-     - added MDriveCom::MSendStargReport()
-
-   * stars.txt
-     - added Albiero (3.08), Iota Pegasi (3.49), Tarazed (2.72), 
-       Unukalhay (2.65)
-     - corrected wrong position of Capella (0.08)
-
-   * gui/MGStarg.cc, gui/MGStarg.h gui/GuiLinkDef.h gui/Makefile 
-     - added GUI element similar to MGAccuracy to display
-       misspointing.
-
-   * stargleds.txt
-     - List of location of LEDs visible in starfield camera picture
-
-   * main/MStargHistograms.[cc,h], main/Makefile, main/MainLinkDef.h
-     - Filling trees with Starguider analysis relevant data
-
-   * caos/Led.h
-     - added Setters SetX(), SetY()
-
-   * main/MCosy.h
-     - added *GetDriveCom(), returns pointer to MDriveCom object
-
-   * starg.cc
-     - corrected typo
-
-   * prepos_magic.txt
-     - changed Park and Camera Access position coordinates
-
-   * caos/Rings.[cc,h]
-     - minimum number of required LEDs can be set via
-       SetMinNumberLeds(), default is 5
-
-   * main/MCaos.[cc,h]
-     - possibility to set size of box and cut in MCaos::Run()
-     - possibility to specify maximum and minimum acceptable ring 
-       radius
-
-   * catalog/StarCatalog.[cc,h]
-     - possibility to narrow field of view in CalcStars
-     - possibility to offset origin of FOV in CalcStars
-     - CalcStars and DrawStars flip the field in x direction
-       defaultwise
-     - CalcStars adds only stars visible in the chosen FOV to 
-       the star list
-     
-   * videodev/FilterLed.[cc,h]
-     - Added possibility to return average brightness found in
-       chosen FOV
-
-   * videodev/Writer.[cc,h]
-     - Ra/Dec in filename when writing pictures
-  
-
-
- 2004/08/23 - Thomas Bretz
-
-   * videodev/FilterLed.cc:
-     - tried to fix a possible crash in FindStar. Maybe the edges
-       exceeded the area of the image in memory
-
-
-
- 2004/08/16 - Thomas Bretz
-
-   * tpoint/gui.C:
-     - implemented TGFSFileDialog for reading and writing bending.txt
-     - plot deviations vs Magnitude
-
-
-
- 2004/08/12 - Thomas Bretz
-
-   * tpoint/gui.C:
-     - implemented TGFSFileDialog for reading the star data
-
-
-
- 2004/08/05 - Thomas Bretz
-
-   * main/MStarguider.cc:
-     - on request of the shift-crew I have changed the find-star cut
-       from 3.0 to 3.5
-
-
-
- 2004/06/28 - Thomas Bretz
-
-   * caos/Ring.[h,cc]:
-     - added magnitude fMag
-     - added interpolation of magnitude
-
-   * main/MStarguider.cc:
-     - added output of magnitudes
-
-   * tpoint/gui.C:
-     - implemented comment lines
-     - changed layout of output
-
-
-
- 2004/06/01 - Thomas Bretz
- 
-   * Makefile.conf.linux:
-     - removed obsolete -Wtraditional and -Wnested-externs
-
-   * caos/Leds.h:
-     - added empty Add(TObject*) function for correct overload
-
-   * main/MBending.cc:
-     - added MAGIC1 as a hysteresis
-
-   * main/MCosy.cc:
-     - added header to drive report
-
-   * main/MCosy.h:
-     - added getter-function to GetOutRep (used in FindStar)
-
-   * main/MStarguider.cc:
-     - added Output to report file
-     - added output of Star-Offset in pixels
-
-   * main/MTracking.cc:
-     - removed some 'unused variable'
-
-   * tcpip/MTcpIpIO.cc:
-     - removed nonsense setting of eGui when writing to the report file
-
-   * tpoint/gui.C:
-     - enhanced display
-
-
-
- 2004/05/15 - Thomas Bretz (La Palma)
-
-   * Makefile:
-     - added MGMenu links
-
-   * bending_magic.txt:
-     - last calculated pointing model (still has the hysteresis 
-       problem)
-
-   * cosy.cc:
-     - moved camera stuff to MStarguider
-     - added channel selection
-
-   * base/BaseLinkDef.h:
-     - updated
-
-   * base/MString.[h,cc]:
-     - removed (now in Mars)
-
-   * base/MThread.h, candrv/network.h, candrv/nodedrv.h,
-     candrv/vmodican.h, devdrv/macs.h, videodev/Camera.h:
-     - changed ifndef
-
-   * base/Makefile:
-     - updated
-
-   * candrv/nodedrv.cc:
-     - added cast to MTime
-
-   * candrv/vmodican.cc:
-     - changed priority from 10 to 1
-
-   * caos/Led.cc, caos/Ring.cc:
-     - changed Form to MString
-
-   * caos/Makefile:
-     - added include base
-
-   * caos/Ring.[h,cc]:
-     - added arguments to constructor
-
-   * catalog/CatalogLinkDef.h, catalog/Makefile:
-     - removed SaoFile
-
-   * catalog/Slalib.cc:
-     - removed some obsolete code
-
-   * catalog/StarCatalog.cc:
-     - added a size check for the bitmap
-
-   * devdrv/macs.cc:
-     - no guarding for the moment
-
-   * devdrv/shaftencoder.[h,cc]:
-     - added code to communicate with the Macs
-
-   * gui/GuiLinkDef.h, gui/Makefile:
-     - removed MGVelocity
-
-   * gui/MGCosy.[h,cc]:
-     - added weather data to display
-     - added image of the camera to window
-     - removed velocity from window
-     - replaced Form by MString
-
-   * main/MBending.cc:
-     - changed handling in GetAnAw - Hopefully correct???
-       the old handling gave problems
-
-   * main/MCosy.[h,cc]:
-     - added SetTrackingPosRE
-     - display interpolated position when tracking
-     - added SetMotor calls
-
-   * main/MStarguider.[h,cc]:
-     - added code to find star in the display
-     - added corresponding menus
-     - added code to support more than one ccd channel
-
-   * main/MTracking.[h,cc]:  
-     - complete change to the algorithm. The position which is 
-       send to CC need still some investigations. For more information
-       look at the code. The main difference is that the motor
-       encoders are taken better into account which fixes the SE 
-       handling on the elevation axis 
-
-   * main/MainLinkDef.h, main/Makefile:
-     - added MPointing
-     - added MTracking
-     
-   * tcpip/MCeCoCom.[h,cc]:  
-     - added alarm counter
-
-   * tcpip/MTcpIpIO.cc:
-     - do not write to output file if stream is locked
-
-   * tpoint/gui.C:
-     - fixed display so that it perfectly shows north, east, ...
-     - added error for residual
-     - simplified residual algorithm
-     - read new files
-     - changed displaying deviations a bit
-     - display result in the display (preliminary)
-     - set gIgnoreLevel to suppress strange color warnings
-
-   * videodev/FilterLed.cc:
-     - use MGMap for drawing...
-
-
-
- 2004/05/15 - Thomas Bretz (La Palma)
-
-   * .cosyrc_magic:
-     - updated with some comments
-
-   * Makefile:
-     - added many more links necessary for current make
-       (should be replaced by libmars.so in the future)
-
-   * Makefile.conf.general:
-     - added GX11 and HistPainter
-
-   * cosy.cc, starg.cc:
-     - Moved initialization of Camera to MStarguider
-     - added command line option to choose ccd channel
-
-   * leds.txt:
-     - replaced with new LED positions (OFFSETS MISSING)
-
-   * stars.txt:
-     - added many more stars
-
-   * base/coord.h:
-     - added operator/=(XY&)
-
-   * base/msgqueue.cc, candrv/sdolist.cc:
-     - added more output in case mutex is already locked by the same thread
-
-   * candrv/vmodican.cc:
-     - some changes to output
-
-   * catalog/SlaStars.cc:
-     - changed some comments
-
-   * catalog/StarCatalog.[h,cc]:
-     - replaced old algorithms by MAstroCatalog and new simplifications
-       to calculate star-positions accuratly by combining slalib with
-       MAstroCatalog
-
-   * devdrv/macs.h:
-     - added GetPosTime
-
-   * devdrv/shaftencoder.[h,cc]:
-     - added output to report file
-
-   * gui/MGAccuracy.[h,cc]:
-     - added time development curve (blue)
-
-   * gui/MGEmbeddedCanvas.h, gui/MGSkyPosition.h, 
-     gui/MGVelocity.h:
-     - changed ifndef define
-
-   * gui/MGImage.[h,cc]:
-     - enhancements in speed
-     - enhancements in mutex locking mechanism
-
-   * gui/MGPngReader.cc, gui/MGTPoint.cc:
-     - changed meaning of PixSize
-
-   * gui/MGVelocity.cc:
-     - fixed units
-
-   * main/MCaos.[h,cc]:
-     - changed ring radius from 266/272 to 266,268
-     - moved drawing circles to MStarguider
-
-   * main/MCosy.[h,cc]:
-     - moved big parts of the code to MPointing and MTracking
-     - removed old conversion constants (Se to RE, etc) and
-       replaced by more meaningful ones
-     - prepare displaying starguider image
-     - added GetFileName to globally prepare correct file names
-
-   * main/MPointing.cc:
-     - fixed missing SetDecelaration
-     - changed to new unit conversion constants
-     - Use SendStatus instead of Send
-
-   * main/MStarguider.cc:
-     - added update and support of cosy-image display
-     - added channel swicthing for the frame grabber
-     - added algorithm to find star position FindStar
-     - commented out starguider algorithms
-     - draw support lines and grid stuff
-
-   * main/MTracking.[h,cc]:
-     - changed to new unit conversion constants
-     - added output of RE stuff to report file
-     - some simplification to tracking thread
-
-   * base/MString.[h,cc]:
-     - added as a thread safe replacement for Form()
-
-   * tcpip/MCeCoCom.[h,cc]:
-     - changed support for Weather information
-
-   * tcpip/MDriveCom.[h,cc]:
-     - changed output
-     - added SendStatus
-
-   * tcpip/MTcpIpIO.cc:
-     - changed output
-     - output reports to report file
-
-   * tpoint/gui.C:
-     - read new starg_* files
-
-   * videodev/Camera.[h,cc]:
-     - some enhancements to ioctl call
-     - some changes to output
-     - changes a bit the bahaviour of mutices
-     - replaced fRunning by mutex
-     - changes to ExitLoop and IsRunning
-     - added support for several frame grabber channels
-
-   * videodev/FilterLed.[h,cc]
-     - added new algorithms to find star
-     - small updates to star finding support
-
-   * videodev/PixGetter.h:
-     - added a virtual empty destructor (IMPORTANT)
-
-
-
- 2003/12/29 - Thomas Bretz
-
-   * base/MObservatory.cc:
-     - By fixing a bug evaluating the '-'-sign in latitude
-       the bending correction changed
- 
-   * bending_magic.txt:
-     - new calculation with sign-fix. AnAw became unimportant
-
-
-
- 2003/12/07 - Thomas Bretz
-
-   * tcpip/MDriveCom.cc:
-     - log CC-COMMANDS to log-file
-
-   * main/MStarguider.cc:
-     - fixed handling of DISPLAY variable
-
-   * main/MCosy.cc:
-     - undef EXPERT
-     - removed comments before CheckNetwork
-
-   * gui/MGImage.cc:
-     - fixed some image copy algorithm
-     - removed nonsense ==13 check for TryLock
-
-   * devdrv/macs.cc:
-     - shift crew reported problems: changed timeout from 250ms to 400ms
-
-   * stars.txt:
-     - added Capella
-     - added Dark Patch 3/4
-     - added Zeta Tauri
-
-   * Makefile:
-     - added 'install'
-
-   * bending_magic.txt:
-     - small chenges to correct AN, AW correction (new fit)
-     
-   * cosy.cc, candrv/nodedrv.cc, devdrv/macs.[h,cc],
-     devdrv/shaftencoder.[h,cc], gui/MGCosy.cc,
-     gui/MGPngReader.cc, gui/MGTPoint.cc, main/MBending.cc,
-     main/MCaos.cc, main/MCosy.cc, main/MStarguider.[h,cc],
-     tcpip/MCeCoCom.[h,cc], tcpip/MDriveCom.cc,
-     videodev/Writer.cc:
-     - replaced Timer by MTime
-     
-   * base/BaseLinkDef.h:
-     - added MTime
-     - added MAstro
-     
-   * base/Makefile:
-     - added MTime
-     - added MAstro
-     
-   * catalog/SlaStars.[h,cc], catalog/Slalib.[h,cc]:
-     - made independant of derivement from Timer
-     - added old Timer as new MTime fTime data member
-
-   * catalog/Slalib.h:
-     - removed conversion functions - use MAstro instead
-
-   * gui/MGCosy.cc, gui/MGSkyPosition.cc, tcpip/MDriveCom.cc:
-     - replaced static Slalib:: methody by MAstro
-     
-   * main/MBending.[h,cc]:
-     - added corrected An/Aw algorithm
-     - removed 360deg ambiguity
-
-   * Makefile.conf.general:
-     - added defintion __LINUX__ for Mars classes (used in MTime.cc)
-
-
-
- 2003/11/25 - Thomas Bretz (La Palma)
-
-   * slog:
-    - added this small script to analyze log-files
-    
-   * bending_magic.txt:
-     - changed to new values comming from new fit
-       with the new algorithm
-       
-   * cosy.cc:
-     - removed old style InitGUI stuff
-     - removed TROOT instance
-     - changed to support gcc 3.3
-     - added come log-output
-     - undeclared HAVE_CAMERA
-
-   * stars.txt:
-     - added some magnitudes
-     - removed Mars
-     
-   * main/MBending.cc:
-     - exchanged order: moved NPAE and CA behind AN and AW
-     - replaced the approximation for AN/AW by the correct algorithm.
-       For Magic (1.5deg) the small angle approximation is wrong
-     - added some DEBUG option
-     
-   * tpoint/gui.C:
-     - small changes
-
-
-
- 2003/11/17 - Thomas Bretz (La Palma)
- 
-   * Makefile.conf.general:
-     - added libThread.a
-     
-   * prepos_magic.txt:
-     - exchanged order
-     - fixed positions
-     
-   * stars.txt:
-     - added many sources taken from the CC input file
-     
-   * base/MTimeout.[h,cc]:
-     - changed to use check system time (using timers
-       always resulted in trouble)
-       
-   * base/msgqueue.[h,cc]:
-     - replaced Posix mutex by TMutex
-     
-   * base/timer.cc:
-     - display hour with two digits
-     
-   * candrv/canopen.[h,cc]:
-     - replaced Posix semaphores bt TCondition
-     
-   * candrv/network.cc:
-     - minor change to output
-     
-   * candrv/nodedrv.[h,cc]:
-     - removed old timer stuff, replaced by a watch-dog thread
-     - added MGuard
-     - removed HandleTimer
-     - added argument to SetZombie
-     - nodedrv don't derive from TObject anymore
-     
-   * candrv/sdolist.[h,cc]:
-     - replaced Posix sempahores by TMutex
-     
-   * candrv/vmodican.cc:
-     - minor change to Send()
-     
-   * devdrv/macs.cc:
-     - added to HandleSDO: 0x100c, 0x100d
-     - added to HandleSDOOk: 0x1000, 0x100c, 0x100d, 0x1800, 0x6000,
-       0x6002, 0x6003 
-     - Enabled Guarding for Macs
-     
-   * devdrv/shaftencoder.cc:
-     - added HandleSDOOk: 0x1802, 0x6001, 0x6002, 0x6003
-
-   * gui/MGAccuracy.[h,cc]:
-     - added fBar
-
-   * gui/MGCosy.cc:
-     - added button for Endswitch alignment printout
-     - merged Move and Resize to MoveResize
-     - fixed UpdateZdAz (uses Slalib now)
-     
-   * gui/MGImage.[h,cc]:
-     - replaced Posix sempahores by TMutex
-     - added DrawColImg16
-
-   * main/MCosy.[h,cc]:
-     - some changes to output
-     - some changes to state transmission
-     - fixed (hopefully) treating of endswitch positions
-     - fixed positioning mode for tracking
-     - do not display weird values in case of Zombie
-       Shaftencoders anymore
-     
-   * main/MStarguider.cc:
-     - if display is not set locally use 125 avaraged pictures
-       by default.
-       
-   * tcpip/MCeCoCom.[h,cc]:
-     - some small fixes
-     - some changes to output
-     - read 30 instead of 29 dummy tokens
-     - added solar radiation and wind speed
-     - moved corresponding code to InterpreteReport
-     
-   * tcpip/MDriveCom.[h,cc]:
-     - added ReadAngle for interpretation of Angle in CC commands
-     - added ReadPosition
-     - added Command*
-     - implemented CC commands
-     
-   * tcpip/MTcpIpIO.cc:
-     - Stop thread before deleting data members
-     - replace -1 for fRxSocket by 0
-     
-   * videodev/Camera.[h,cc]:
-     - replaced Posix sempahores by TMutex and TCondition
-
-
- 2003/11/14 - Thomas Bretz (La Palma)
-
-   * gui/MGCosy.cc:
-     - replaced a wrong 'h' (dec) by 'd'
-     
-   * gui/MGImage.[h,cc]:
-     - replaced 32 by 24
-     
-   * tcpip/MCeCoCom.[h,cc]:
-     - added fHumidity and fTemperature
-     
-   * tcpip/MTcpIpIO.cc:
-     - added DEBUG directive
-
-
-
- 2003/10/20 - Thomas Bretz
- 
-   * base/File.cc:
-     - only close file if f!=NULL
-     
-   * base/MThread.cc:
-     - added debug output (depending on DEBUG macro)
-     
-   * candrv/vmodican.cc:
-     - do not call exit in case the module couldn't be opened
-     - changes some comments
-     
-   * catalog/StarCatalog.cc:
-     - do not exit in case the catalog was not found
-     - initialize fSao and fSrt with NULL
-     - only delete fSao and fSrt if != NULL
-     - only calculate stars if catalog was loaded successfully
-     
-   * main/MBending.[h,cc]:
-     - added file header
-     - added class decription
-     - added FLOP, TF and TX
-     - changed such that adding new stuff is easier
-     - changed order in correction
-     - replaced all switch statement by simple loops
-     
-   * tpoint/gui.C:
-     - full support for fitting a pointing correction
-
-
-
- 2003/10/15 - Thomas Bretz (La Palma)
- 
-   * Makefile:
-     - added tcpip directory
-     
-   * cosy.cc:
-     - undefine EXPERT
-     - implemented HAVE_CAMERA
-     
-   * base/log.h:
-     - changed LOG_H to COSY_Log
-     
-   * base/timer.h:
-     - changed order of members
-     - added a new Set-function used for the CC communication
-     - added new Getter functions
-
-   * gui/MGCosy.cc:
-     - undef EXPERT
-     - added HAS_DEMO (undefined)
-     - added demo for inauguration
-     - changed bits for status to MDriveCom::
-     
-   * gui/MGImage.[h,cc]:
-     - fixed the color depth problem (still doesn't work with
-       other color depth than 32 bit, but doesn't crash anymore)
-       
-   * gui/Makefile:
-     - added tcpip
-     
-   * main/MCosy.[h,cc]:
-     - changed bits to MDriveCom::
-     - added a 'single-positioning' while tracking for inauguration
-       (WM_POSITION1)
-     - added fCom and sending reports
-     
-   * main/Makefile:
-     - added tcpip
-     
-   * tcpip/MDriveCom.[h,cc]:
-     - fixed output to current status
-     - added status bits
-     
-   * tcpip/MTcpIpIO.[h,cc]:
-     - added some dbg output in the destructor
-     - added Clear
-     - set members to NULL if deleted
-     - added Log as a base class
-     
-   * tcpip/Makefile:
-     - added catalog
-
-
-
- 2003/10/03 - Thomas Bretz (La Palma)
- 
-   * tcpip/*
-     - added communication classes
-
-
-
- 2003/09/03 - Thomas Bretz
- 
-   * aposs/Magic.m:
-     - updated to V0.69
-
-
-
- 2003/07/16 - Thomas Bretz (La Palma)
-
-   * bending_magic.txt:
-     - new bending correction. Calculated from new stars and
-       recalculated old ones (old positions where wrong due
-       to a bug in the observatory coordinates)
-       
-   * catalog/Slalib.[h,cc]:
-     - fixed a bug in the Hms2Deg and Dms2Deg (negative hours, degs
-       where treated incorrect!)
-     - added many new conversion functions
-     
-   * devdrv/macs.[h,cc]:
-     - commented SetHome
-     
-   * gui/MGCosy.[h,cc]:
-     - implemented button to write prepos
-     - implemented star list
-     
-   * gui/MGSkyPosition.cc:
-     - changed calculation of h,m,s etc to new Slalib functions
-     
-   * main/MCaos.cc:
-     - changed detection limit from 4.0 to 3.0
-
-
-     
- 2003/07/15 - Thomas Bretz (La Palma)
-
-   * leds.txt:
-     - new configuration file
-     
-   * main/MCaos.[h,cc]:
-     - added
-
-   * main/MStarguider.[h,cc]:
-     - added
-     
-   * videodev/PixGetter.[h,cc]:
-     - added
-     
-   * videodev/FilterLed.[h,cc]:
-     - added
-     - highly optimized for speed!
-     
-   * Makefile.conf.linux:
-     - added -O5 optimization option
-     
-   * bending_magic.txt:
-     - changed to newly determined bending correction
-     
-   * cosy.cc:
-     - included starguider
-     - do not overwrite log file
-     - added EXPERT mode
-     
-   * starg.cc:
-     - changed from MGStarguider to MStarguider
-     - simplified by use of PixGetter
-
-   * aposs/Manual.m:
-     - removed a wrong character
-     
-   * base/coord.h:
-     - changed operator<<
-     
-   * base/timer.[h,cc]:
-     - const argument for copy constructor
-     - added operator<<
-
-   * candrv/network.[h,cc], candrv/nodedrv.[h,cc]:
-     - added data argument to HandleSDOOK
-     
-   * candrv/vmodican.cc:
-     - return from constructor if Module not found
-     
-   * caos/Led.[h,cc]:
-     - included TROOT
-     - formated Print-output
-     - Initialize fDx, fDy and fDphi
-     - added AddOffset
-     
-   * caos/Leds.[h,cc]:
-     - added Add
-     
-   * caos/Ring.[h,cc]:
-     - added constructor
-     - use hypot
-     - devide by n instead of n-1
-     - formated Print-output
-
-   * caos/Rings.[h,cc]:
-     - Do not calculated Center for less than 5 rings
-     - included Radius filter
-     
-   * catalog/StarCatalog.cc:
-     - Do not output Alt/Az, fAzCnt, fAltMin, etc.
-     
-   * devdrv/macs.[h,cc]:
-     - added data argument to HandleSDOOK
-     - implemented StartNode() and check for initialization
-     - changed minimum MACS software version to 0.69
-     - moved SetNoWait to the MACS software
-     - removed StopMotor
-     
-   * devdrv/shaftencoder.[h,cc]:
-     - initialize all values to 0
-
-   * gui/GuiLinkDef.h:
-     - removed MGStarguider
-     
-   * gui/MGAccuracy.cc:
-     - small change
-     
-   * gui/MGCosy.[h,cc]:
-     - added moving in Zd/Az by buttons while tracking (Experts only)
-     - some changes to the menu bar
-     - removed displaying offsets
-     - changed EXPERT mode
-
-   * gui/MGEmbeddedCanvas.[h,cc]:
-     - changed range argument in constructor to double (problems
-       with the optimization - strange!)
-
-   * gui/MGImage.[h,cc]:
-     - switched from my own code completely to tVirtualX code
-       + requires root 3.05./05!
-     - highly optimized for speed!
-     - at the moment only 32 bit screen depth is supported!
-     
-   * gui/MGSkyPosition.[h,cc]:
-     - fixed position of vega
-     - added new bright star
-     - cut displaying position into two. \n not supported by
-       root 3.05/05
-     
-   * gui/MGVelocity.[h,cc]:
-     - removed displaying numbers
-     
-   * gui/Makefile:
-     - removed MGStarguider
-     
-   * main/MCosy.[h,cc]:
-     - added output of time when tracking is started or stopped
-     - added output of time when slewing is started or stopped
-     - removed sign changing limits in LimitSpeed
-     - changed EXPERT mode
-     - added MStarguider support
-     - fixed Calc-Alt/Az
-     - added GetPointingPos     
-     - removed fOffset from Update
-     
-   * main/MainLinkDef.h, main/Makefile:
-     - added MStarguider
-
-   * main/MStarguider.[h,cc]:
-     - added
-     
-   * tpoint/tpointfit.C:
-     - fixed reading of data
-     - removed absolute path
-
-   * videodev/Camera.[h,cc]:
-     - small simplification
-     - derived from new PixGetter
-     
-   * videodev/CaosFilter.[h,cc], videodev/Filter.[h,cc]:
-     - optimized, but not used anymore, will be removed soon
-     
-   * videodev/Makefile, videodev/VideodevLinkDef.h:
-     - added PixGetter to Makefile
-     - removed Filter
-     - removed Filter2
-     - removed CaosFilter
-     - added FilterLed
-     
-   * videodev/PngReader.h:
-     - derived from PixGetter
-
-
-     
- 2003/05/05 - Thomas Bretz
-
-   * gui/MGCosy.[h,cc]:
-     - exchanged TGListBox for logging by TGTextView
-
-
-
- 2003/04/28 - Thomas Bretz
-
-   * .cosyrc_magic:
-     - removed Time2ReachHome
-     - changed Gear Ratio
-   
-   * bending_magic.txt:
-     - added bening model calculated in March
-     
-   * cosy.cc:
-     - added disable output to screen
-
-   * prepos_magic.txt:
-     - made positions fit the present bending model
-   
-   * candrv/nodedrv.[h,cc]:
-     - added posibility to implement fake guarding (eg. check a 
-       PDO frequence)
-
-   * devdrv/macs.cc:
-     - added HandleNodeguard to handling of PDO
-   
-   * main/MCosy.[h,cc]:
-     - GetSePos declared const
-     - AlignTrackingPos declared const
-     - define EXPERT
-     - implemented EXPERT mode
-     - implemented Gear while positioning for Elevation axes
-     - fixed some bugs in LimitSpeed - to be chacked again!
-     - implemented preliminary version of starguider
-     - some small changes to the tracking
-     - changed default end positions
-     - fixed display of fZdAzSoll and fTrackingError
-   
-   * videodev/Filter.cc:
-     fixed dealing with values above max and below min when stretching
-
-
-
- 2003/04/13 - Thomas Bretz
-
-   * base/timer.cc:
-     - added cast to _suseconds_t
-   
-   * candrv/nodedrv.cc:
-     - set starting timeout
-   
-   * devdrv/macs.cc:
-     - after requsting error[0] check Zombie-status
-     - Software version 0.66 --> 0.68
-     - added all known MACS error messages
-
-   * gui/MGStarguider.cc, videodev/Filter.[h,cc]:
-     - added stretching of the picture
-
-
-
- 2003/04/12 - Thomas Bretz
-
-   * prepos_magic.txt:
-     - added
-     
-   * bend.cc: 
-     - added
-
-   * Makefile:
-     - bend added
-     
-   * bending_magic.txt:
-     - new bending
-
-   * cosy.cc:
-     - fixed typo
-     - disable console output
-     
-   * testse.cc:
-     - accept commandline options
-     
-   * base/MThread.cc, base/msgqueue.cc:
-     - added DEBUG-stuff
-   
-   * candrv/network.cc:
-     - fixed wrong handling of SDO messages with less than 4 bytes
-     
-   * candrv/nodedrv.cc:
-     - do not switch timer off if it isn't switched on
-   
-   * candrv/vmodican.cc:
-     - added EXPERT mode
-   
-   * catalog/SlaStars.h:
-     - added CalcAltAz/ZdAz with mjd
-   
-   * catalog/StarCatalog.[h,cc]:
-     - included rotation angle
-   
-   * devdrv/macs.cc:
-     - added request for present error code
-     - added #71 error message
-     
-   * devdrv/shaftencoder.[h,cc]:
-     - fixes to support multiturn encoders correctly
-     - removed velocity and acceleration from gui
-
-   * gui/MGAccuracy.cc:
-     - mega mini change
-   
-   * gui/MGCosy.[h,cc]:
-     - added EXPERT mode
-     - added TrackPos
-     - removed shaftencoder label for velocity and acceleration
-     - commented out MAC3
-     - fixed reading of predefined positions
-     - commented out everything related to the demo mode
-     - changed some displayed text
-
-   * gui/MGStarguider.[h,cc]:
-     - added support for rotation angle
-     
-   * main/MBending.h:
-     - added constructor with filename
-
-   * main/MCosy.[h,cc]:
-     - for gear display both axis
-     - some more output in WaitForEndMovement
-     - added CheckRange
-     - added AlignTrackingPos
-     - changed timing in tracking procedure from 3s/50ms to 5s/1s
-     - added TrackPos
-     - replaced some code by AlignTrackingPos
-     - commented out CALIB and PRESET
-
-   * slalib/oapqk.c:
-     - fixed a bug checking validity of arguments for atan2
-
-   * videodev/Writer.cc:
-     - fixed names
-
-
-
- 2003/03/31 - Daniela Dorner:
- 
-   * caos/Ring.cc: 
-    - fixed a small bug
-   
-   
-
- 2003/03/12 - Daniela Dorner, Thomas Bretz:
-
-   * MStarguider.[h,cc], Starguider.[h,cc]:
-     - removed
-
-   * gui/MGPngReader.[h,cc]:
-     - moved code to MGStarguider.[h,cc]
-     - removed
-
-   * gui/Makefile, gui/GuiLinkDef.h:
-     - updated
-
-   * gui/MGPngReader.cc, gui/MGStarguider.cc, videodev/Writer.[h,cc]:
-     - changed output file names to contain mjd
-     - fixed a cast warning
-
-   * main/MCosy.[h,cc]:
-     - Do not change acceleration and deceleration for positioning
-       (SetPosVelocity)
-     - some output if WintForEnDMovement aborted
-     - some output to correct for the elevation gear asymmetry
-     - changed handling of acceleration and velocity
-     - changed velocities
-     - call StopMovement only if positioning failed
-     - changed acceleration/deceleration from 0.9 to 0.2 in
-       InitTracking
-     - added some workarounds to be able to reach 290deg
-     - changed control time in tracking from 1 to 3 sec
-     - added a flag to SetPosition indicating tracking mode 
-       (not yet used)
-     - added some workarounds to be able to track 290deg
-     - changed deceleration from 0.5 to 0.3 in StopMovement
-     - added StopTracking (not yet used)
-     - changed tpoint output (+mjd, +ra/dec)
-
-
-
- 2003/03/11 - Daniela Dorner, Thomas Bretz:
-
-   * .cosyrc_magic, .cosyrc_model:
-     - added
-   
-   * caos/Leds.h, caos/Rings.h:
-     - changed from operator[] to At()
-   
-   * caos/Ring.cc:
-     - changed Floats to Doubles
-    
-   * caos/Rings.cc:
-     - replaced Expand by Clear
-
-   * base/MStar.h:
-     - added Compare
-     
-   * base/MStarList.cc:
-     - some small bugfixes
-   
-   * base/MStarList.h:
-     - added Sort
-     - added Expand
-     
-   * base/timer.[h,cc]:
-     - Added GetTimeval
-
-   * gui/MGAccuracy.cc:
-     - Exchanged zd/az in calculation of Residual!!!
-   
-   * gui/MGPngReader.[h,cc]:
-     - set default lim mag to 7.0
-     - added new ouput for the pointing position fPZdAz
-     - added/fixed TrackingError/CalcTrackingError
-     - changed Filter2 to CaosFilter
-     - reordered starguider stuff in Execute
-     - changed color of circles
-     
-   * main/MBending.[h,cc]:
-     - removed MAGIC1 and MAGIC2
-     - removed '-' from writing
-     - fixed some bugs in the enumerations of the coefficients
-     - added some formating option for output
-
-   * tpoint/tpointfit.C:
-     - removed usage of MyAdjust
-     - fixed the Calculation of the residuals
-     - fixed reading
-     - added some correction in case of an overflow (360deg/0deg)
-     - fixed drawing
-     - added second Migrad turn...
-     - changed the screen and graphical output
-     
-   * videodev/CaosFilter.[h,cc]:
-     - changed RemoveTwins to accept a radius
-
-
-
- 2003/03/02 - Daniela Dorner, Thomas Bretz (LaPalma):
-
-   * tpoint/tpointfit.C:
-     - added
-   
-   * main/MBending.[h,cc]:
-     - adapted to Magic bending model
-
-   * candrv/nodedrv.cc:
-     - some changes to the output
-  
-   * candrv/vmodican.cc:
-     - minor changes
-  
-   * devdrv/macs.[h,cc]:
-     - implemented 
-     - removed guarding
-     - removed motor off
-    
-   * devdrv/shaftencoder.cc:
-     - removed Gaurding
-     
-   * gui/MGEmbeddedCanvas.[h,cc]:
-     - added overloads for Resize
-   
-   * gui/MGSkyPosition.[h,cc]:
-     - added SetDotRange
-
-   * gui/MGStarguider.cc:
-     - write interpolated pictures
-     
-   * videodev/PngReader.cc:
-     - removed unused variable
-     
-   * videodev/Writer.cc:
-     - added warning if file couldn't be opened
-
-   * videodev/CaosFilter.[h,cc], videodev/PngReader.[h,cc]:
-     - added
-
-   * catalog/StarCatalog.[h,cc]:
-     - added GetPixSize
-
-   * main/MCosy.cc:
-     - some minor change sto the output
-
-  * Makefile: 
-     - removed dummy
-     - exchnged caos, candrv
-     - removed MCint.o
-     - added cosy.so
- 
-   * starg.cc:
-     - echanged to use png reading mode
-   
-   * caos/Led.[h,cc], caos/Leds.[h,cc], caos/Ring.[h,cc], 
-     caos/Ring.[h,cc]:
-     - added Print
-
-   * caos/Led.h:
-     - added compare
-     - added issortable
-
-   * caos/Ring.cc:
-     - changed output
-
-   * caos/Rings.cc:
-     - fixed some minor bugs
-
-   * gui/GuiLinkDef.h, gui/Makefile;
-     - added MGPngReader.[h,cc]
-
-   * gui/MGPngReader.[h,cc]:
-     - added
-     
-   * gui/MGStarguider.cc:
-     - release grabbed mouse
-     - removed ExitLoop
-     
-   * gui/MGStarguider.h:
-     - changed derivement from Camera to PixClient
-
-   * videodev/Camera.[h,cc]:
-     - changed to use PixClient
-   
-   * videodev/Makefile, videodev/VideodevLinkDef.h:
-     - added PixClient
-
-   * videodev/PixClient.[h,cc]
-     - added 
-
-
-
- 2003/02/27 - Thomas Bretz (LaPalma):
-
-   * caos, caos/Makefile, caos/CaosLinKDef.h, caos/CaosIncl.h, 
-     caos/Led.[h,cc], caos/Leds.[h,cc], caos/Ring.[h,cc], 
-     caos/Rings.[h,cc], gui/MGMenu.[h,cc]:
-     - added
-
-
-
- 2003/02/25 - Thomas Bretz (La Palma):
-
-   * Makefile
-     - changed order of binaries
-     - added make links
-     - added make magic
-     - added make model
-   
-   * base/timer.cc:
-     - corrected calculation of fMs (/1000 missing)
-   
-   * gui/MGCosy.cc:
-     - added new tab Gear
-     
-   * gui/MGSkyPosition.[h,cc]:
-     - fixed memory leak by not changing positions or having object
-       outside
-     - removed fake-statics
-   
-   * main/MCosy.[h,cc]:
-     - adapted GetSePos to present shaftencoders
-     - changed speed to 0.15 and acc to 0.4 in positioning
-     - changed tracking cycle from 0.05s to 0.25s
-     - added WM_GEAR
-     - added WM_DISPLAY
-     - fixed displaying the SE offsets
-     - added TalkThreadGear
-     - changed DisplayHistTestSe
-     - added DisplayHistGear
-     - added check for second Zd-SE
-     - removed lout.SetOutputGui(NULL, kFALSE) because it crashes
-       when closing the spplication while tracking
-
-
-
- 2003/02/21 - Thomas Bretz (La Palma):
-
-   * gui/MGSkyPosition.[h,cc]:
-     - some changes trying to get rid of a strange memory leak
-
-   * candrv/nodedrv.cc:
-     - changed output
-
-   * catalog/Slalib.h:
-     - added Hms2DegRad and Dms2Rad
-
-
-
- 2003/02/16 - Thomas Bretz (La Palma):
-
-   * base/MStarList.h:
-     - added default for mag to Add
-
-   * base/coord.h:
-     - replaced kRadDeg by including MAGIC.h
-   
-   * base/timer.[h,cc]:
-     - changed Now to call virtual function SetMjd
-
-   * gui/MGAccuracy.cc:
-     - fixed a bug causing the display to display error%60
-   
-   * gui/MGCosy.[h,cc]:
-     - added combo box for predifed positions
-     - update display of time only when time changed
-
-   * gui/MGSkyPosition.[h,cc]:
-     - added bright stars
-     
-   * main/MCosy.[h,cc]:
-     - some changes to output
-     - replaced HasZombie by a preliminary one
-     - changed dT to 3s
-     - removed time correction factor in Tracking algorithm
-     - PRELIMINARY TalkThreadTracking
-
-
-
- 2003/02/14 - Thomas Bretz (La Palma):
- 
-   * .cosyrc:
-     - added prototypes for the telescope allowed range
-   
-   * Makefile:
-     - changed test to testse
-   
-   * candrv/vmodican.cc:
-     - added the possibility to start cosy without the CANbus card
-       installed
-   
-   * catalog/SlaPlanets.cc:
-     - fixed the ephemeris configuration
-   
-   * catalog/SlaStars.cc:
-     - added some more comments
-   
-   * catalog/Slalib.[h,cc]:
-     - changed Wuerzburg location to LaPalma location
-     - added Height to the data members
-   
-   * main/MCosy.[h,cc]:
-     - added range checks in positioning and tracking
-   
-   * slalib/Makefile:
-     - added rdplan
-     - added pvobs
-     - added dtt
-     - added dat
-     - added rcc
-
-   * starg.cc, catalog/SlaStars.[h,cc], catalog/Slalib.[h,cc],
-     catalog/StarCatalog.[h,cc], devdrv/macs.cc, devdrv/shaftencoder.cc,
-     gui/MGCosy.[h,cc], gui/MGSkyPosition.[h,cc], gui/MGStarguider.[h,cc]:
-     - changed to use MObservatory
-     - changed usage of timer to new style
-   
-   * catalog/SlaPlanets.[h,cc]:
-     - removed old style calculation
-     - added fTt
-
-   * gui/MGCosy.cc:
-     - added new tab for SE Test
-
-   * main/MCosy.[h,cc]:
-     - don't use second SE when only one is attached
-     - added SE Test stuff
-
-   * base/BaseLinkDef.h, base/Makefile:
-     - added MParContainer
-     - added MObservatory
-
-   * base/timer.[h,cc]:
-     - changed the calculation of the date according to slalib
-
-
-     
- 2003/01/23 - Thomas Bretz:
- 
-   * .cosyrc:
-     - changed maximum time to reach home from 100 to 150
-  
-   * Makefile:
-     - added devdrv
-  
-   * Makefile.rules, candrv/Makefile, devdrv/Makefile:
-     - changed some ordering
-  
-   * devdrv/shaftencoder.cc:
-     - changed Guarding from 2x125 to 2x175
-  
-   * main/MCosy.cc:
-     - fixed StopWaitingForSDO bug (if this was raised once the
-       'shutdown' never waited correctly for an SDo anymore)
-     - fixed the usage of the bending correction in some places
-
-   * testse.cc:
-     - added
-
-
- 2003/01/23 - Thomas Bretz:
- 
-   * cosy.cc:
-     - changed baudrate to 125kbps
-   
-   * base/msgqueue.cc:
-     - changed output
-     - ignore pending messages
-   
-   * candrv/canopen.[h,cc]:
-     - added Emergency Message
-     - added EnableNodeguard
-     - added SendNodeguard
-     
-   * candrv/network.[h,cc]:
-     - call handles only if Fnodes[node]!=NULL
-     - added time to HandleSDOOK
-     - changed output
-     - added HandleNodeguard
-     - added HandleEmergency
-
-   * candrv/nodedrv.[h,cc]:
-     - added fTimeout for Nodeguarding
-     - Enable Nodeguard and Emergency messages
-     - added time to HandleSDOOK
-     - added SendNodeguard
-     - added StartGuarding
-     - added StopGuarding
-     - added HandleTimer
-     - added HandleNodeguard
-     - added SetZombie
-
-   * candrv/vmodican.[h,cc]:
-     - fixed a typo
-     - added rtr to SendCanFrame
-   
-   * devdrv/macs.[h,cc]:
-     - removed guarding stuff (moved to nodedrv)
-     - changed 0x4000 handling to 0.63 style
-     - added check for software version
-     - added time to HandleSDOOk
-     - set node to Zombie in case of error
-     - don't do any error handling for the moment
-     - removed ReqTimeoutTime
-     - overload SendNodeguard
-     - removed EnableTimeout
-     - removed HandleTimer
-     - removed ResetTimeout
-     - added Start/StopHostGuarding
-
-   * devdrv/shaftencoder.[h,cc]:
-     - added 0x100c, 0x100d, 0x100e
-     - added Start/StopGuarding to Init
-
-   * gui/MGCosy.cc:
-     - enhanced labels for Offset
-     - changed 'soll' to 'nominal'
-     - changed the demo mode for tests
-   
-   * gui/MGSkyPosition.[h,cc]:
-     - added saturn
-     - changed the colors a bit
-
-
-
- 2003/01/20 - Thomas Bretz:
-
-   * aposs/Manual.m
-     - added support for the elevation axis brake 
-     - enabled check for operation mode (remote control/pc)      
-     - added 'reset' label                                       
-     - moved syncv/cstart to setting rf                          
-
-
-
- 2003/01/14 - Thomas Bretz:
-
-   * cosy.cc:
-     - added output
-   
-   * candrv/network.[cc,h]:
-     - small change to Start
-     - added CheckConnections
-
-   * candrv/nodedrv.[h,cc]:
-     - new Init
-     - new CheckConnections
-     - replaced virtual InitDevice by a common function
-     - replaced virtual Reboot by a common function
-     - Don't send anything to a Zombie node
-     - Delete SDO from list in case of Zombie status instead of waiting
-     
-   * candrv/vmodican.cc:
-     - Don't terminate when having a noisy network 
-   
-   * devdrv/macs.[h,cc], devdrv/shaftencoder.[h,cc]:
-     - added fSoftVersion
-     - added SDO 0x100b
-     - moved init stuff from InitDevice to Init
-     - removed InitDevice and Reboot
-     - added CheckConnection
-
-   * devdrv/shaftencoder.[h,cc]:
-     - Don't display something when having Zombie status
-   
-   * main/MCosy.[h,cc]:
-     - reworked all Zombie-stuff
-     - implemented checking of network
-
-
-
- 2003/01/13 - Thomas Bretz:
-
-   * bending.txt:
-     - changed to fit the parameters of the model
-     
-   * cosy.cc:
-     - made the 'standard mode' the default
-
-   * base/MTimeout.h:
-     - fixed the change of the base member function name of Notify
-
-   * candrv/network.[h,cc]:
-     - don't set fNodes[i] to NULL if Node is Zombie
-     - implemented HasZombie and RebootZomies
-     
-   * candrv/nodedrv.[h,cc]:
-     - implemented a base function Reboot
-     - set node to Zombie status if waitforsdo timed out
-
-   * candrv/vmodican.cc:
-     - added more precise output for CTXcon
-   
-   * devdrv/macs.[h,cc]:
-     - if first waitforsdo fails set don't go on
-     - implemented fStatus
-     - implemented enum for fStatus
-
-   * gui/MGAccuracy.cc, gui/MGSkyPosition.cc, gui/MGVelocity.cc:
-     - call SetNoContextMenu in constructor
-     
-   * gui/MGCosy.[h,cc]:
-     - some new labels
-     - implemented SetLabelColor
-     
-   * gui/MGEmbeddedCanvas.[h,cc]:
-     - implemented SetNoContextMenu
-
-   * main/MCosy.cc:
-     - exchanged all conditionals for the pointers to the nodes
-       by IsZombieNode
-     - implemented check for zombies in Proc
-
-
-
- 2003/01/10 - Thomas Bretz:
-
-   * candrv/network.cc, devdrv/macs.cc, devdrv/shaftencoder.cc:
-     - changed output
-   
-   * devdrv/macs.[h,cc]:
-     - request encoder resolution when starting
-   
-   * devdrv/shaftencoder.cc:
-     - some fixed in HandleSDO output
-     - fixed a missing return in HandleSDO
-   
-   * gui/MGAccuracy.cc, gui/MGVelocity.cc:
-     - set label offset
-
-   * gui/MGCosy.[h,cc]:
-     - added some new gui elements and its handling
-
-   * main/MCosy.[h,cc]:
-     - impemented fZdAzSoll
-     - slight changes to the output
-     - implemented WM_HOME
-     - fixed workaround for the encoder resolutions of the MACS
-
-   * base/MGLIst.h
-     - removed (use the one from Mars)
-
-
-
- 2003/01/08 - Thomas Bretz:
- 
-   * bending.txt:
-     - added (preliminary)
-
-   * .cosyrc:
-     - added
-	> Az_GearRatio[U_mot/U_tel]: 5891.7
-	> Zd_GearRatio[U_mot/U_tel]: 2475.6
-	> Az_ResRE[re/U_mot]: 500
-	> Zd_ResRE[re/U_mot]: 500
-	> Az_Id-MAC1: 1
-	> Az_Id-MAC2: 3
-	> Zd_Id-MAC:  2
-	> Zd_Id-MAC1: 4
-	> Zd_Id-MAC2: 5
-	> Az_Id-MAC:  6
-
-   * Makefile:
-     - removed cosy.so
-
-   * Makefile.conf.linux-gnu:
-     - removed optimization (causes problems) --> TO BE FIXED
-
-   * candrv/canopen.h:
-     - added return value to WaitForSDO
-
-   * devdrv/macs.cc:
-     - fixed a typo
-
-   * gui/MGCosy.cc:
-     - added 'Reset Bending'
-
-   * main/MBending.[h,cc]
-     - added Reset
-     - fixed a problem with the units in the correction
-     - added CorrectBack functions
-
-   * main/MCosy.[h,cc]:
-     - changed the bahaviour in case no MAC3 is found
-     - fixed that the MAC3 didn't synchronize anymore
-     - added the bending correction to the displayed position
-     - added a workaround for the wrong (0) Gear Ratios --> TO BE FIXED
-     - added Reset Bending
-     - changed the MAC and SE Id to be a resource value (from .cosyrc)
Index: trunk/MagicSoft/Cosy/Changelog.03
===================================================================
--- trunk/MagicSoft/Cosy/Changelog.03	(revision 7297)
+++ trunk/MagicSoft/Cosy/Changelog.03	(revision 7297)
@@ -0,0 +1,1239 @@
+                                                                  -*-*- END -*-*-
+
+ 2003/12/29 - Thomas Bretz
+
+   * base/MObservatory.cc:
+     - By fixing a bug evaluating the '-'-sign in latitude
+       the bending correction changed
+ 
+   * bending_magic.txt:
+     - new calculation with sign-fix. AnAw became unimportant
+
+
+
+ 2003/12/07 - Thomas Bretz
+
+   * tcpip/MDriveCom.cc:
+     - log CC-COMMANDS to log-file
+
+   * main/MStarguider.cc:
+     - fixed handling of DISPLAY variable
+
+   * main/MCosy.cc:
+     - undef EXPERT
+     - removed comments before CheckNetwork
+
+   * gui/MGImage.cc:
+     - fixed some image copy algorithm
+     - removed nonsense ==13 check for TryLock
+
+   * devdrv/macs.cc:
+     - shift crew reported problems: changed timeout from 250ms to 400ms
+
+   * stars.txt:
+     - added Capella
+     - added Dark Patch 3/4
+     - added Zeta Tauri
+
+   * Makefile:
+     - added 'install'
+
+   * bending_magic.txt:
+     - small chenges to correct AN, AW correction (new fit)
+     
+   * cosy.cc, candrv/nodedrv.cc, devdrv/macs.[h,cc],
+     devdrv/shaftencoder.[h,cc], gui/MGCosy.cc,
+     gui/MGPngReader.cc, gui/MGTPoint.cc, main/MBending.cc,
+     main/MCaos.cc, main/MCosy.cc, main/MStarguider.[h,cc],
+     tcpip/MCeCoCom.[h,cc], tcpip/MDriveCom.cc,
+     videodev/Writer.cc:
+     - replaced Timer by MTime
+     
+   * base/BaseLinkDef.h:
+     - added MTime
+     - added MAstro
+     
+   * base/Makefile:
+     - added MTime
+     - added MAstro
+     
+   * catalog/SlaStars.[h,cc], catalog/Slalib.[h,cc]:
+     - made independant of derivement from Timer
+     - added old Timer as new MTime fTime data member
+
+   * catalog/Slalib.h:
+     - removed conversion functions - use MAstro instead
+
+   * gui/MGCosy.cc, gui/MGSkyPosition.cc, tcpip/MDriveCom.cc:
+     - replaced static Slalib:: methody by MAstro
+     
+   * main/MBending.[h,cc]:
+     - added corrected An/Aw algorithm
+     - removed 360deg ambiguity
+
+   * Makefile.conf.general:
+     - added defintion __LINUX__ for Mars classes (used in MTime.cc)
+
+
+
+ 2003/11/25 - Thomas Bretz (La Palma)
+
+   * slog:
+    - added this small script to analyze log-files
+    
+   * bending_magic.txt:
+     - changed to new values comming from new fit
+       with the new algorithm
+       
+   * cosy.cc:
+     - removed old style InitGUI stuff
+     - removed TROOT instance
+     - changed to support gcc 3.3
+     - added come log-output
+     - undeclared HAVE_CAMERA
+
+   * stars.txt:
+     - added some magnitudes
+     - removed Mars
+     
+   * main/MBending.cc:
+     - exchanged order: moved NPAE and CA behind AN and AW
+     - replaced the approximation for AN/AW by the correct algorithm.
+       For Magic (1.5deg) the small angle approximation is wrong
+     - added some DEBUG option
+     
+   * tpoint/gui.C:
+     - small changes
+
+
+
+ 2003/11/17 - Thomas Bretz (La Palma)
+ 
+   * Makefile.conf.general:
+     - added libThread.a
+     
+   * prepos_magic.txt:
+     - exchanged order
+     - fixed positions
+     
+   * stars.txt:
+     - added many sources taken from the CC input file
+     
+   * base/MTimeout.[h,cc]:
+     - changed to use check system time (using timers
+       always resulted in trouble)
+       
+   * base/msgqueue.[h,cc]:
+     - replaced Posix mutex by TMutex
+     
+   * base/timer.cc:
+     - display hour with two digits
+     
+   * candrv/canopen.[h,cc]:
+     - replaced Posix semaphores bt TCondition
+     
+   * candrv/network.cc:
+     - minor change to output
+     
+   * candrv/nodedrv.[h,cc]:
+     - removed old timer stuff, replaced by a watch-dog thread
+     - added MGuard
+     - removed HandleTimer
+     - added argument to SetZombie
+     - nodedrv don't derive from TObject anymore
+     
+   * candrv/sdolist.[h,cc]:
+     - replaced Posix sempahores by TMutex
+     
+   * candrv/vmodican.cc:
+     - minor change to Send()
+     
+   * devdrv/macs.cc:
+     - added to HandleSDO: 0x100c, 0x100d
+     - added to HandleSDOOk: 0x1000, 0x100c, 0x100d, 0x1800, 0x6000,
+       0x6002, 0x6003 
+     - Enabled Guarding for Macs
+     
+   * devdrv/shaftencoder.cc:
+     - added HandleSDOOk: 0x1802, 0x6001, 0x6002, 0x6003
+
+   * gui/MGAccuracy.[h,cc]:
+     - added fBar
+
+   * gui/MGCosy.cc:
+     - added button for Endswitch alignment printout
+     - merged Move and Resize to MoveResize
+     - fixed UpdateZdAz (uses Slalib now)
+     
+   * gui/MGImage.[h,cc]:
+     - replaced Posix sempahores by TMutex
+     - added DrawColImg16
+
+   * main/MCosy.[h,cc]:
+     - some changes to output
+     - some changes to state transmission
+     - fixed (hopefully) treating of endswitch positions
+     - fixed positioning mode for tracking
+     - do not display weird values in case of Zombie
+       Shaftencoders anymore
+     
+   * main/MStarguider.cc:
+     - if display is not set locally use 125 avaraged pictures
+       by default.
+       
+   * tcpip/MCeCoCom.[h,cc]:
+     - some small fixes
+     - some changes to output
+     - read 30 instead of 29 dummy tokens
+     - added solar radiation and wind speed
+     - moved corresponding code to InterpreteReport
+     
+   * tcpip/MDriveCom.[h,cc]:
+     - added ReadAngle for interpretation of Angle in CC commands
+     - added ReadPosition
+     - added Command*
+     - implemented CC commands
+     
+   * tcpip/MTcpIpIO.cc:
+     - Stop thread before deleting data members
+     - replace -1 for fRxSocket by 0
+     
+   * videodev/Camera.[h,cc]:
+     - replaced Posix sempahores by TMutex and TCondition
+
+
+ 2003/11/14 - Thomas Bretz (La Palma)
+
+   * gui/MGCosy.cc:
+     - replaced a wrong 'h' (dec) by 'd'
+     
+   * gui/MGImage.[h,cc]:
+     - replaced 32 by 24
+     
+   * tcpip/MCeCoCom.[h,cc]:
+     - added fHumidity and fTemperature
+     
+   * tcpip/MTcpIpIO.cc:
+     - added DEBUG directive
+
+
+
+ 2003/10/20 - Thomas Bretz
+ 
+   * base/File.cc:
+     - only close file if f!=NULL
+     
+   * base/MThread.cc:
+     - added debug output (depending on DEBUG macro)
+     
+   * candrv/vmodican.cc:
+     - do not call exit in case the module couldn't be opened
+     - changes some comments
+     
+   * catalog/StarCatalog.cc:
+     - do not exit in case the catalog was not found
+     - initialize fSao and fSrt with NULL
+     - only delete fSao and fSrt if != NULL
+     - only calculate stars if catalog was loaded successfully
+     
+   * main/MBending.[h,cc]:
+     - added file header
+     - added class decription
+     - added FLOP, TF and TX
+     - changed such that adding new stuff is easier
+     - changed order in correction
+     - replaced all switch statement by simple loops
+     
+   * tpoint/gui.C:
+     - full support for fitting a pointing correction
+
+
+
+ 2003/10/15 - Thomas Bretz (La Palma)
+ 
+   * Makefile:
+     - added tcpip directory
+     
+   * cosy.cc:
+     - undefine EXPERT
+     - implemented HAVE_CAMERA
+     
+   * base/log.h:
+     - changed LOG_H to COSY_Log
+     
+   * base/timer.h:
+     - changed order of members
+     - added a new Set-function used for the CC communication
+     - added new Getter functions
+
+   * gui/MGCosy.cc:
+     - undef EXPERT
+     - added HAS_DEMO (undefined)
+     - added demo for inauguration
+     - changed bits for status to MDriveCom::
+     
+   * gui/MGImage.[h,cc]:
+     - fixed the color depth problem (still doesn't work with
+       other color depth than 32 bit, but doesn't crash anymore)
+       
+   * gui/Makefile:
+     - added tcpip
+     
+   * main/MCosy.[h,cc]:
+     - changed bits to MDriveCom::
+     - added a 'single-positioning' while tracking for inauguration
+       (WM_POSITION1)
+     - added fCom and sending reports
+     
+   * main/Makefile:
+     - added tcpip
+     
+   * tcpip/MDriveCom.[h,cc]:
+     - fixed output to current status
+     - added status bits
+     
+   * tcpip/MTcpIpIO.[h,cc]:
+     - added some dbg output in the destructor
+     - added Clear
+     - set members to NULL if deleted
+     - added Log as a base class
+     
+   * tcpip/Makefile:
+     - added catalog
+
+
+
+ 2003/10/03 - Thomas Bretz (La Palma)
+ 
+   * tcpip/*
+     - added communication classes
+
+
+
+ 2003/09/03 - Thomas Bretz
+ 
+   * aposs/Magic.m:
+     - updated to V0.69
+
+
+
+ 2003/07/16 - Thomas Bretz (La Palma)
+
+   * bending_magic.txt:
+     - new bending correction. Calculated from new stars and
+       recalculated old ones (old positions where wrong due
+       to a bug in the observatory coordinates)
+       
+   * catalog/Slalib.[h,cc]:
+     - fixed a bug in the Hms2Deg and Dms2Deg (negative hours, degs
+       where treated incorrect!)
+     - added many new conversion functions
+     
+   * devdrv/macs.[h,cc]:
+     - commented SetHome
+     
+   * gui/MGCosy.[h,cc]:
+     - implemented button to write prepos
+     - implemented star list
+     
+   * gui/MGSkyPosition.cc:
+     - changed calculation of h,m,s etc to new Slalib functions
+     
+   * main/MCaos.cc:
+     - changed detection limit from 4.0 to 3.0
+
+
+     
+ 2003/07/15 - Thomas Bretz (La Palma)
+
+   * leds.txt:
+     - new configuration file
+     
+   * main/MCaos.[h,cc]:
+     - added
+
+   * main/MStarguider.[h,cc]:
+     - added
+     
+   * videodev/PixGetter.[h,cc]:
+     - added
+     
+   * videodev/FilterLed.[h,cc]:
+     - added
+     - highly optimized for speed!
+     
+   * Makefile.conf.linux:
+     - added -O5 optimization option
+     
+   * bending_magic.txt:
+     - changed to newly determined bending correction
+     
+   * cosy.cc:
+     - included starguider
+     - do not overwrite log file
+     - added EXPERT mode
+     
+   * starg.cc:
+     - changed from MGStarguider to MStarguider
+     - simplified by use of PixGetter
+
+   * aposs/Manual.m:
+     - removed a wrong character
+     
+   * base/coord.h:
+     - changed operator<<
+     
+   * base/timer.[h,cc]:
+     - const argument for copy constructor
+     - added operator<<
+
+   * candrv/network.[h,cc], candrv/nodedrv.[h,cc]:
+     - added data argument to HandleSDOOK
+     
+   * candrv/vmodican.cc:
+     - return from constructor if Module not found
+     
+   * caos/Led.[h,cc]:
+     - included TROOT
+     - formated Print-output
+     - Initialize fDx, fDy and fDphi
+     - added AddOffset
+     
+   * caos/Leds.[h,cc]:
+     - added Add
+     
+   * caos/Ring.[h,cc]:
+     - added constructor
+     - use hypot
+     - devide by n instead of n-1
+     - formated Print-output
+
+   * caos/Rings.[h,cc]:
+     - Do not calculated Center for less than 5 rings
+     - included Radius filter
+     
+   * catalog/StarCatalog.cc:
+     - Do not output Alt/Az, fAzCnt, fAltMin, etc.
+     
+   * devdrv/macs.[h,cc]:
+     - added data argument to HandleSDOOK
+     - implemented StartNode() and check for initialization
+     - changed minimum MACS software version to 0.69
+     - moved SetNoWait to the MACS software
+     - removed StopMotor
+     
+   * devdrv/shaftencoder.[h,cc]:
+     - initialize all values to 0
+
+   * gui/GuiLinkDef.h:
+     - removed MGStarguider
+     
+   * gui/MGAccuracy.cc:
+     - small change
+     
+   * gui/MGCosy.[h,cc]:
+     - added moving in Zd/Az by buttons while tracking (Experts only)
+     - some changes to the menu bar
+     - removed displaying offsets
+     - changed EXPERT mode
+
+   * gui/MGEmbeddedCanvas.[h,cc]:
+     - changed range argument in constructor to double (problems
+       with the optimization - strange!)
+
+   * gui/MGImage.[h,cc]:
+     - switched from my own code completely to tVirtualX code
+       + requires root 3.05./05!
+     - highly optimized for speed!
+     - at the moment only 32 bit screen depth is supported!
+     
+   * gui/MGSkyPosition.[h,cc]:
+     - fixed position of vega
+     - added new bright star
+     - cut displaying position into two. \n not supported by
+       root 3.05/05
+     
+   * gui/MGVelocity.[h,cc]:
+     - removed displaying numbers
+     
+   * gui/Makefile:
+     - removed MGStarguider
+     
+   * main/MCosy.[h,cc]:
+     - added output of time when tracking is started or stopped
+     - added output of time when slewing is started or stopped
+     - removed sign changing limits in LimitSpeed
+     - changed EXPERT mode
+     - added MStarguider support
+     - fixed Calc-Alt/Az
+     - added GetPointingPos     
+     - removed fOffset from Update
+     
+   * main/MainLinkDef.h, main/Makefile:
+     - added MStarguider
+
+   * main/MStarguider.[h,cc]:
+     - added
+     
+   * tpoint/tpointfit.C:
+     - fixed reading of data
+     - removed absolute path
+
+   * videodev/Camera.[h,cc]:
+     - small simplification
+     - derived from new PixGetter
+     
+   * videodev/CaosFilter.[h,cc], videodev/Filter.[h,cc]:
+     - optimized, but not used anymore, will be removed soon
+     
+   * videodev/Makefile, videodev/VideodevLinkDef.h:
+     - added PixGetter to Makefile
+     - removed Filter
+     - removed Filter2
+     - removed CaosFilter
+     - added FilterLed
+     
+   * videodev/PngReader.h:
+     - derived from PixGetter
+
+
+     
+ 2003/05/05 - Thomas Bretz
+
+   * gui/MGCosy.[h,cc]:
+     - exchanged TGListBox for logging by TGTextView
+
+
+
+ 2003/04/28 - Thomas Bretz
+
+   * .cosyrc_magic:
+     - removed Time2ReachHome
+     - changed Gear Ratio
+   
+   * bending_magic.txt:
+     - added bening model calculated in March
+     
+   * cosy.cc:
+     - added disable output to screen
+
+   * prepos_magic.txt:
+     - made positions fit the present bending model
+   
+   * candrv/nodedrv.[h,cc]:
+     - added posibility to implement fake guarding (eg. check a 
+       PDO frequence)
+
+   * devdrv/macs.cc:
+     - added HandleNodeguard to handling of PDO
+   
+   * main/MCosy.[h,cc]:
+     - GetSePos declared const
+     - AlignTrackingPos declared const
+     - define EXPERT
+     - implemented EXPERT mode
+     - implemented Gear while positioning for Elevation axes
+     - fixed some bugs in LimitSpeed - to be chacked again!
+     - implemented preliminary version of starguider
+     - some small changes to the tracking
+     - changed default end positions
+     - fixed display of fZdAzSoll and fTrackingError
+   
+   * videodev/Filter.cc:
+     fixed dealing with values above max and below min when stretching
+
+
+
+ 2003/04/13 - Thomas Bretz
+
+   * base/timer.cc:
+     - added cast to _suseconds_t
+   
+   * candrv/nodedrv.cc:
+     - set starting timeout
+   
+   * devdrv/macs.cc:
+     - after requsting error[0] check Zombie-status
+     - Software version 0.66 --> 0.68
+     - added all known MACS error messages
+
+   * gui/MGStarguider.cc, videodev/Filter.[h,cc]:
+     - added stretching of the picture
+
+
+
+ 2003/04/12 - Thomas Bretz
+
+   * prepos_magic.txt:
+     - added
+     
+   * bend.cc: 
+     - added
+
+   * Makefile:
+     - bend added
+     
+   * bending_magic.txt:
+     - new bending
+
+   * cosy.cc:
+     - fixed typo
+     - disable console output
+     
+   * testse.cc:
+     - accept commandline options
+     
+   * base/MThread.cc, base/msgqueue.cc:
+     - added DEBUG-stuff
+   
+   * candrv/network.cc:
+     - fixed wrong handling of SDO messages with less than 4 bytes
+     
+   * candrv/nodedrv.cc:
+     - do not switch timer off if it isn't switched on
+   
+   * candrv/vmodican.cc:
+     - added EXPERT mode
+   
+   * catalog/SlaStars.h:
+     - added CalcAltAz/ZdAz with mjd
+   
+   * catalog/StarCatalog.[h,cc]:
+     - included rotation angle
+   
+   * devdrv/macs.cc:
+     - added request for present error code
+     - added #71 error message
+     
+   * devdrv/shaftencoder.[h,cc]:
+     - fixes to support multiturn encoders correctly
+     - removed velocity and acceleration from gui
+
+   * gui/MGAccuracy.cc:
+     - mega mini change
+   
+   * gui/MGCosy.[h,cc]:
+     - added EXPERT mode
+     - added TrackPos
+     - removed shaftencoder label for velocity and acceleration
+     - commented out MAC3
+     - fixed reading of predefined positions
+     - commented out everything related to the demo mode
+     - changed some displayed text
+
+   * gui/MGStarguider.[h,cc]:
+     - added support for rotation angle
+     
+   * main/MBending.h:
+     - added constructor with filename
+
+   * main/MCosy.[h,cc]:
+     - for gear display both axis
+     - some more output in WaitForEndMovement
+     - added CheckRange
+     - added AlignTrackingPos
+     - changed timing in tracking procedure from 3s/50ms to 5s/1s
+     - added TrackPos
+     - replaced some code by AlignTrackingPos
+     - commented out CALIB and PRESET
+
+   * slalib/oapqk.c:
+     - fixed a bug checking validity of arguments for atan2
+
+   * videodev/Writer.cc:
+     - fixed names
+
+
+
+ 2003/03/31 - Daniela Dorner:
+ 
+   * caos/Ring.cc: 
+    - fixed a small bug
+   
+   
+
+ 2003/03/12 - Daniela Dorner, Thomas Bretz:
+
+   * MStarguider.[h,cc], Starguider.[h,cc]:
+     - removed
+
+   * gui/MGPngReader.[h,cc]:
+     - moved code to MGStarguider.[h,cc]
+     - removed
+
+   * gui/Makefile, gui/GuiLinkDef.h:
+     - updated
+
+   * gui/MGPngReader.cc, gui/MGStarguider.cc, videodev/Writer.[h,cc]:
+     - changed output file names to contain mjd
+     - fixed a cast warning
+
+   * main/MCosy.[h,cc]:
+     - Do not change acceleration and deceleration for positioning
+       (SetPosVelocity)
+     - some output if WintForEnDMovement aborted
+     - some output to correct for the elevation gear asymmetry
+     - changed handling of acceleration and velocity
+     - changed velocities
+     - call StopMovement only if positioning failed
+     - changed acceleration/deceleration from 0.9 to 0.2 in
+       InitTracking
+     - added some workarounds to be able to reach 290deg
+     - changed control time in tracking from 1 to 3 sec
+     - added a flag to SetPosition indicating tracking mode 
+       (not yet used)
+     - added some workarounds to be able to track 290deg
+     - changed deceleration from 0.5 to 0.3 in StopMovement
+     - added StopTracking (not yet used)
+     - changed tpoint output (+mjd, +ra/dec)
+
+
+
+ 2003/03/11 - Daniela Dorner, Thomas Bretz:
+
+   * .cosyrc_magic, .cosyrc_model:
+     - added
+   
+   * caos/Leds.h, caos/Rings.h:
+     - changed from operator[] to At()
+   
+   * caos/Ring.cc:
+     - changed Floats to Doubles
+    
+   * caos/Rings.cc:
+     - replaced Expand by Clear
+
+   * base/MStar.h:
+     - added Compare
+     
+   * base/MStarList.cc:
+     - some small bugfixes
+   
+   * base/MStarList.h:
+     - added Sort
+     - added Expand
+     
+   * base/timer.[h,cc]:
+     - Added GetTimeval
+
+   * gui/MGAccuracy.cc:
+     - Exchanged zd/az in calculation of Residual!!!
+   
+   * gui/MGPngReader.[h,cc]:
+     - set default lim mag to 7.0
+     - added new ouput for the pointing position fPZdAz
+     - added/fixed TrackingError/CalcTrackingError
+     - changed Filter2 to CaosFilter
+     - reordered starguider stuff in Execute
+     - changed color of circles
+     
+   * main/MBending.[h,cc]:
+     - removed MAGIC1 and MAGIC2
+     - removed '-' from writing
+     - fixed some bugs in the enumerations of the coefficients
+     - added some formating option for output
+
+   * tpoint/tpointfit.C:
+     - removed usage of MyAdjust
+     - fixed the Calculation of the residuals
+     - fixed reading
+     - added some correction in case of an overflow (360deg/0deg)
+     - fixed drawing
+     - added second Migrad turn...
+     - changed the screen and graphical output
+     
+   * videodev/CaosFilter.[h,cc]:
+     - changed RemoveTwins to accept a radius
+
+
+
+ 2003/03/02 - Daniela Dorner, Thomas Bretz (LaPalma):
+
+   * tpoint/tpointfit.C:
+     - added
+   
+   * main/MBending.[h,cc]:
+     - adapted to Magic bending model
+
+   * candrv/nodedrv.cc:
+     - some changes to the output
+  
+   * candrv/vmodican.cc:
+     - minor changes
+  
+   * devdrv/macs.[h,cc]:
+     - implemented 
+     - removed guarding
+     - removed motor off
+    
+   * devdrv/shaftencoder.cc:
+     - removed Gaurding
+     
+   * gui/MGEmbeddedCanvas.[h,cc]:
+     - added overloads for Resize
+   
+   * gui/MGSkyPosition.[h,cc]:
+     - added SetDotRange
+
+   * gui/MGStarguider.cc:
+     - write interpolated pictures
+     
+   * videodev/PngReader.cc:
+     - removed unused variable
+     
+   * videodev/Writer.cc:
+     - added warning if file couldn't be opened
+
+   * videodev/CaosFilter.[h,cc], videodev/PngReader.[h,cc]:
+     - added
+
+   * catalog/StarCatalog.[h,cc]:
+     - added GetPixSize
+
+   * main/MCosy.cc:
+     - some minor change sto the output
+
+  * Makefile: 
+     - removed dummy
+     - exchnged caos, candrv
+     - removed MCint.o
+     - added cosy.so
+ 
+   * starg.cc:
+     - echanged to use png reading mode
+   
+   * caos/Led.[h,cc], caos/Leds.[h,cc], caos/Ring.[h,cc], 
+     caos/Ring.[h,cc]:
+     - added Print
+
+   * caos/Led.h:
+     - added compare
+     - added issortable
+
+   * caos/Ring.cc:
+     - changed output
+
+   * caos/Rings.cc:
+     - fixed some minor bugs
+
+   * gui/GuiLinkDef.h, gui/Makefile;
+     - added MGPngReader.[h,cc]
+
+   * gui/MGPngReader.[h,cc]:
+     - added
+     
+   * gui/MGStarguider.cc:
+     - release grabbed mouse
+     - removed ExitLoop
+     
+   * gui/MGStarguider.h:
+     - changed derivement from Camera to PixClient
+
+   * videodev/Camera.[h,cc]:
+     - changed to use PixClient
+   
+   * videodev/Makefile, videodev/VideodevLinkDef.h:
+     - added PixClient
+
+   * videodev/PixClient.[h,cc]
+     - added 
+
+
+
+ 2003/02/27 - Thomas Bretz (LaPalma):
+
+   * caos, caos/Makefile, caos/CaosLinKDef.h, caos/CaosIncl.h, 
+     caos/Led.[h,cc], caos/Leds.[h,cc], caos/Ring.[h,cc], 
+     caos/Rings.[h,cc], gui/MGMenu.[h,cc]:
+     - added
+
+
+
+ 2003/02/25 - Thomas Bretz (La Palma):
+
+   * Makefile
+     - changed order of binaries
+     - added make links
+     - added make magic
+     - added make model
+   
+   * base/timer.cc:
+     - corrected calculation of fMs (/1000 missing)
+   
+   * gui/MGCosy.cc:
+     - added new tab Gear
+     
+   * gui/MGSkyPosition.[h,cc]:
+     - fixed memory leak by not changing positions or having object
+       outside
+     - removed fake-statics
+   
+   * main/MCosy.[h,cc]:
+     - adapted GetSePos to present shaftencoders
+     - changed speed to 0.15 and acc to 0.4 in positioning
+     - changed tracking cycle from 0.05s to 0.25s
+     - added WM_GEAR
+     - added WM_DISPLAY
+     - fixed displaying the SE offsets
+     - added TalkThreadGear
+     - changed DisplayHistTestSe
+     - added DisplayHistGear
+     - added check for second Zd-SE
+     - removed lout.SetOutputGui(NULL, kFALSE) because it crashes
+       when closing the spplication while tracking
+
+
+
+ 2003/02/21 - Thomas Bretz (La Palma):
+
+   * gui/MGSkyPosition.[h,cc]:
+     - some changes trying to get rid of a strange memory leak
+
+   * candrv/nodedrv.cc:
+     - changed output
+
+   * catalog/Slalib.h:
+     - added Hms2DegRad and Dms2Rad
+
+
+
+ 2003/02/16 - Thomas Bretz (La Palma):
+
+   * base/MStarList.h:
+     - added default for mag to Add
+
+   * base/coord.h:
+     - replaced kRadDeg by including MAGIC.h
+   
+   * base/timer.[h,cc]:
+     - changed Now to call virtual function SetMjd
+
+   * gui/MGAccuracy.cc:
+     - fixed a bug causing the display to display error%60
+   
+   * gui/MGCosy.[h,cc]:
+     - added combo box for predifed positions
+     - update display of time only when time changed
+
+   * gui/MGSkyPosition.[h,cc]:
+     - added bright stars
+     
+   * main/MCosy.[h,cc]:
+     - some changes to output
+     - replaced HasZombie by a preliminary one
+     - changed dT to 3s
+     - removed time correction factor in Tracking algorithm
+     - PRELIMINARY TalkThreadTracking
+
+
+
+ 2003/02/14 - Thomas Bretz (La Palma):
+ 
+   * .cosyrc:
+     - added prototypes for the telescope allowed range
+   
+   * Makefile:
+     - changed test to testse
+   
+   * candrv/vmodican.cc:
+     - added the possibility to start cosy without the CANbus card
+       installed
+   
+   * catalog/SlaPlanets.cc:
+     - fixed the ephemeris configuration
+   
+   * catalog/SlaStars.cc:
+     - added some more comments
+   
+   * catalog/Slalib.[h,cc]:
+     - changed Wuerzburg location to LaPalma location
+     - added Height to the data members
+   
+   * main/MCosy.[h,cc]:
+     - added range checks in positioning and tracking
+   
+   * slalib/Makefile:
+     - added rdplan
+     - added pvobs
+     - added dtt
+     - added dat
+     - added rcc
+
+   * starg.cc, catalog/SlaStars.[h,cc], catalog/Slalib.[h,cc],
+     catalog/StarCatalog.[h,cc], devdrv/macs.cc, devdrv/shaftencoder.cc,
+     gui/MGCosy.[h,cc], gui/MGSkyPosition.[h,cc], gui/MGStarguider.[h,cc]:
+     - changed to use MObservatory
+     - changed usage of timer to new style
+   
+   * catalog/SlaPlanets.[h,cc]:
+     - removed old style calculation
+     - added fTt
+
+   * gui/MGCosy.cc:
+     - added new tab for SE Test
+
+   * main/MCosy.[h,cc]:
+     - don't use second SE when only one is attached
+     - added SE Test stuff
+
+   * base/BaseLinkDef.h, base/Makefile:
+     - added MParContainer
+     - added MObservatory
+
+   * base/timer.[h,cc]:
+     - changed the calculation of the date according to slalib
+
+
+     
+ 2003/01/23 - Thomas Bretz:
+ 
+   * .cosyrc:
+     - changed maximum time to reach home from 100 to 150
+  
+   * Makefile:
+     - added devdrv
+  
+   * Makefile.rules, candrv/Makefile, devdrv/Makefile:
+     - changed some ordering
+  
+   * devdrv/shaftencoder.cc:
+     - changed Guarding from 2x125 to 2x175
+  
+   * main/MCosy.cc:
+     - fixed StopWaitingForSDO bug (if this was raised once the
+       'shutdown' never waited correctly for an SDo anymore)
+     - fixed the usage of the bending correction in some places
+
+   * testse.cc:
+     - added
+
+
+ 2003/01/23 - Thomas Bretz:
+ 
+   * cosy.cc:
+     - changed baudrate to 125kbps
+   
+   * base/msgqueue.cc:
+     - changed output
+     - ignore pending messages
+   
+   * candrv/canopen.[h,cc]:
+     - added Emergency Message
+     - added EnableNodeguard
+     - added SendNodeguard
+     
+   * candrv/network.[h,cc]:
+     - call handles only if Fnodes[node]!=NULL
+     - added time to HandleSDOOK
+     - changed output
+     - added HandleNodeguard
+     - added HandleEmergency
+
+   * candrv/nodedrv.[h,cc]:
+     - added fTimeout for Nodeguarding
+     - Enable Nodeguard and Emergency messages
+     - added time to HandleSDOOK
+     - added SendNodeguard
+     - added StartGuarding
+     - added StopGuarding
+     - added HandleTimer
+     - added HandleNodeguard
+     - added SetZombie
+
+   * candrv/vmodican.[h,cc]:
+     - fixed a typo
+     - added rtr to SendCanFrame
+   
+   * devdrv/macs.[h,cc]:
+     - removed guarding stuff (moved to nodedrv)
+     - changed 0x4000 handling to 0.63 style
+     - added check for software version
+     - added time to HandleSDOOk
+     - set node to Zombie in case of error
+     - don't do any error handling for the moment
+     - removed ReqTimeoutTime
+     - overload SendNodeguard
+     - removed EnableTimeout
+     - removed HandleTimer
+     - removed ResetTimeout
+     - added Start/StopHostGuarding
+
+   * devdrv/shaftencoder.[h,cc]:
+     - added 0x100c, 0x100d, 0x100e
+     - added Start/StopGuarding to Init
+
+   * gui/MGCosy.cc:
+     - enhanced labels for Offset
+     - changed 'soll' to 'nominal'
+     - changed the demo mode for tests
+   
+   * gui/MGSkyPosition.[h,cc]:
+     - added saturn
+     - changed the colors a bit
+
+
+
+ 2003/01/20 - Thomas Bretz:
+
+   * aposs/Manual.m
+     - added support for the elevation axis brake 
+     - enabled check for operation mode (remote control/pc)      
+     - added 'reset' label                                       
+     - moved syncv/cstart to setting rf                          
+
+
+
+ 2003/01/14 - Thomas Bretz:
+
+   * cosy.cc:
+     - added output
+   
+   * candrv/network.[cc,h]:
+     - small change to Start
+     - added CheckConnections
+
+   * candrv/nodedrv.[h,cc]:
+     - new Init
+     - new CheckConnections
+     - replaced virtual InitDevice by a common function
+     - replaced virtual Reboot by a common function
+     - Don't send anything to a Zombie node
+     - Delete SDO from list in case of Zombie status instead of waiting
+     
+   * candrv/vmodican.cc:
+     - Don't terminate when having a noisy network 
+   
+   * devdrv/macs.[h,cc], devdrv/shaftencoder.[h,cc]:
+     - added fSoftVersion
+     - added SDO 0x100b
+     - moved init stuff from InitDevice to Init
+     - removed InitDevice and Reboot
+     - added CheckConnection
+
+   * devdrv/shaftencoder.[h,cc]:
+     - Don't display something when having Zombie status
+   
+   * main/MCosy.[h,cc]:
+     - reworked all Zombie-stuff
+     - implemented checking of network
+
+
+
+ 2003/01/13 - Thomas Bretz:
+
+   * bending.txt:
+     - changed to fit the parameters of the model
+     
+   * cosy.cc:
+     - made the 'standard mode' the default
+
+   * base/MTimeout.h:
+     - fixed the change of the base member function name of Notify
+
+   * candrv/network.[h,cc]:
+     - don't set fNodes[i] to NULL if Node is Zombie
+     - implemented HasZombie and RebootZomies
+     
+   * candrv/nodedrv.[h,cc]:
+     - implemented a base function Reboot
+     - set node to Zombie status if waitforsdo timed out
+
+   * candrv/vmodican.cc:
+     - added more precise output for CTXcon
+   
+   * devdrv/macs.[h,cc]:
+     - if first waitforsdo fails set don't go on
+     - implemented fStatus
+     - implemented enum for fStatus
+
+   * gui/MGAccuracy.cc, gui/MGSkyPosition.cc, gui/MGVelocity.cc:
+     - call SetNoContextMenu in constructor
+     
+   * gui/MGCosy.[h,cc]:
+     - some new labels
+     - implemented SetLabelColor
+     
+   * gui/MGEmbeddedCanvas.[h,cc]:
+     - implemented SetNoContextMenu
+
+   * main/MCosy.cc:
+     - exchanged all conditionals for the pointers to the nodes
+       by IsZombieNode
+     - implemented check for zombies in Proc
+
+
+
+ 2003/01/10 - Thomas Bretz:
+
+   * candrv/network.cc, devdrv/macs.cc, devdrv/shaftencoder.cc:
+     - changed output
+   
+   * devdrv/macs.[h,cc]:
+     - request encoder resolution when starting
+   
+   * devdrv/shaftencoder.cc:
+     - some fixed in HandleSDO output
+     - fixed a missing return in HandleSDO
+   
+   * gui/MGAccuracy.cc, gui/MGVelocity.cc:
+     - set label offset
+
+   * gui/MGCosy.[h,cc]:
+     - added some new gui elements and its handling
+
+   * main/MCosy.[h,cc]:
+     - impemented fZdAzSoll
+     - slight changes to the output
+     - implemented WM_HOME
+     - fixed workaround for the encoder resolutions of the MACS
+
+   * base/MGLIst.h
+     - removed (use the one from Mars)
+
+
+
+ 2003/01/08 - Thomas Bretz:
+ 
+   * bending.txt:
+     - added (preliminary)
+
+   * .cosyrc:
+     - added
+	> Az_GearRatio[U_mot/U_tel]: 5891.7
+	> Zd_GearRatio[U_mot/U_tel]: 2475.6
+	> Az_ResRE[re/U_mot]: 500
+	> Zd_ResRE[re/U_mot]: 500
+	> Az_Id-MAC1: 1
+	> Az_Id-MAC2: 3
+	> Zd_Id-MAC:  2
+	> Zd_Id-MAC1: 4
+	> Zd_Id-MAC2: 5
+	> Az_Id-MAC:  6
+
+   * Makefile:
+     - removed cosy.so
+
+   * Makefile.conf.linux-gnu:
+     - removed optimization (causes problems) --> TO BE FIXED
+
+   * candrv/canopen.h:
+     - added return value to WaitForSDO
+
+   * devdrv/macs.cc:
+     - fixed a typo
+
+   * gui/MGCosy.cc:
+     - added 'Reset Bending'
+
+   * main/MBending.[h,cc]
+     - added Reset
+     - fixed a problem with the units in the correction
+     - added CorrectBack functions
+
+   * main/MCosy.[h,cc]:
+     - changed the bahaviour in case no MAC3 is found
+     - fixed that the MAC3 didn't synchronize anymore
+     - added the bending correction to the displayed position
+     - added a workaround for the wrong (0) Gear Ratios --> TO BE FIXED
+     - added Reset Bending
+     - changed the MAC and SE Id to be a resource value (from .cosyrc)
Index: trunk/MagicSoft/Cosy/Changelog.04
===================================================================
--- trunk/MagicSoft/Cosy/Changelog.04	(revision 7297)
+++ trunk/MagicSoft/Cosy/Changelog.04	(revision 7297)
@@ -0,0 +1,412 @@
+                                                                  -*-*- END -*-*-
+
+ 2004/09/05 - Robert Wagner (La Palma)
+
+   * main/MStarguider.[cc,h]
+     - Start commissioning of a star guider for MAGIC.
+     - Display misspointing with an MGStarg object
+     - Rename the two video channels to "Starfield Camera" and "TPoint Camera"
+     - Swapped IDs of video channels, since a reset (errno=5) of video card 
+       changes to channel #0
+     - Rearranged menu structure, added starguider relevant items: Starguider
+       LED finder, Starguider FindStar (FindStar analysis of star on curtain
+       for crosschecks and calibration), Starguider Analysis (write relevant 
+       data to ROOT trees), Starguider (Starguider analysis of starfield 
+       picture)
+     - Rearranged GUI displays, added displays to show misspointing,
+       misspointing from FindStar algorithm, sky brightness
+     - Acquisition of center of the PMT camera from applying Caos algorithm 
+       to the three LEDs visible in the starfield camera
+     - Acquisition of sky brightness (average CCD pixel content in Starfield)
+       and comparison to last sky brightness
+     - MStarguider::TrackingError(): Modified histogram binning to enhance 
+       excess
+     - MStarguider::FindStar(): Now returns position of found star as ZdAz
+     - MStarguider::FindStar(): Cut and ROI box can now handed over as i
+       parameters
+     - MStarguider::FindStar(): Scale factor to compensate for different FOV
+       (TPoint camera vs. Starfield camera)
+     - MStarguider::ProcessFrame(): Modified structure to accomodate Starguider
+       algorithm and tools: 1) Find Center of PMT camera, find Star (if 
+       activated)
+       to obtain misspointing found from PMT camera.
+     - Set ROI for starfield in space not occupied by the PMT camera in the 
+       starfield camera FOV
+     - Calculate star positions and draw stars only in that ROI
+     - fStatus variable contains status of starguider (Error, Monitoring, 
+       Standby)
+     - Draw representation of MAGIC's FOV on starfield
+     - Send STARG-REPORTS unconditionally by using MDriveCom::SendStargReport 
+     - Add Ra/Dec in filename when writing pictures
+     - Introduced #define EXPERT to allow for debug output
+     - tracking_*.txt is only produced in case of EXPERT mode
+
+   * tcpip/MTcpIpIO.[h,cc], tcpip/MCeCoCom.[h,cc]
+     - added option force to MTcpIp::Send() which forces sending
+       of message     
+
+   * tcpip/MDriveCom.[h,cc]
+     - added MDriveCom::MSendStargReport()
+
+   * stars.txt
+     - added Albiero (3.08), Iota Pegasi (3.49), Tarazed (2.72), 
+       Unukalhay (2.65)
+     - corrected wrong position of Capella (0.08)
+
+   * gui/MGStarg.cc, gui/MGStarg.h gui/GuiLinkDef.h gui/Makefile 
+     - added GUI element similar to MGAccuracy to display
+       misspointing.
+
+   * stargleds.txt
+     - List of location of LEDs visible in starfield camera picture
+
+   * main/MStargHistograms.[cc,h], main/Makefile, main/MainLinkDef.h
+     - Filling trees with Starguider analysis relevant data
+
+   * caos/Led.h
+     - added Setters SetX(), SetY()
+
+   * main/MCosy.h
+     - added *GetDriveCom(), returns pointer to MDriveCom object
+
+   * starg.cc
+     - corrected typo
+
+   * prepos_magic.txt
+     - changed Park and Camera Access position coordinates
+
+   * caos/Rings.[cc,h]
+     - minimum number of required LEDs can be set via
+       SetMinNumberLeds(), default is 5
+
+   * main/MCaos.[cc,h]
+     - possibility to set size of box and cut in MCaos::Run()
+     - possibility to specify maximum and minimum acceptable ring 
+       radius
+
+   * catalog/StarCatalog.[cc,h]
+     - possibility to narrow field of view in CalcStars
+     - possibility to offset origin of FOV in CalcStars
+     - CalcStars and DrawStars flip the field in x direction
+       defaultwise
+     - CalcStars adds only stars visible in the chosen FOV to 
+       the star list
+     
+   * videodev/FilterLed.[cc,h]
+     - Added possibility to return average brightness found in
+       chosen FOV
+
+   * videodev/Writer.[cc,h]
+     - Ra/Dec in filename when writing pictures
+  
+
+
+ 2004/08/23 - Thomas Bretz
+
+   * videodev/FilterLed.cc:
+     - tried to fix a possible crash in FindStar. Maybe the edges
+       exceeded the area of the image in memory
+
+
+
+ 2004/08/16 - Thomas Bretz
+
+   * tpoint/gui.C:
+     - implemented TGFSFileDialog for reading and writing bending.txt
+     - plot deviations vs Magnitude
+
+
+
+ 2004/08/12 - Thomas Bretz
+
+   * tpoint/gui.C:
+     - implemented TGFSFileDialog for reading the star data
+
+
+
+ 2004/08/05 - Thomas Bretz
+
+   * main/MStarguider.cc:
+     - on request of the shift-crew I have changed the find-star cut
+       from 3.0 to 3.5
+
+
+
+ 2004/06/28 - Thomas Bretz
+
+   * caos/Ring.[h,cc]:
+     - added magnitude fMag
+     - added interpolation of magnitude
+
+   * main/MStarguider.cc:
+     - added output of magnitudes
+
+   * tpoint/gui.C:
+     - implemented comment lines
+     - changed layout of output
+
+
+
+ 2004/06/01 - Thomas Bretz
+ 
+   * Makefile.conf.linux:
+     - removed obsolete -Wtraditional and -Wnested-externs
+
+   * caos/Leds.h:
+     - added empty Add(TObject*) function for correct overload
+
+   * main/MBending.cc:
+     - added MAGIC1 as a hysteresis
+
+   * main/MCosy.cc:
+     - added header to drive report
+
+   * main/MCosy.h:
+     - added getter-function to GetOutRep (used in FindStar)
+
+   * main/MStarguider.cc:
+     - added Output to report file
+     - added output of Star-Offset in pixels
+
+   * main/MTracking.cc:
+     - removed some 'unused variable'
+
+   * tcpip/MTcpIpIO.cc:
+     - removed nonsense setting of eGui when writing to the report file
+
+   * tpoint/gui.C:
+     - enhanced display
+
+
+
+ 2004/05/15 - Thomas Bretz (La Palma)
+
+   * Makefile:
+     - added MGMenu links
+
+   * bending_magic.txt:
+     - last calculated pointing model (still has the hysteresis 
+       problem)
+
+   * cosy.cc:
+     - moved camera stuff to MStarguider
+     - added channel selection
+
+   * base/BaseLinkDef.h:
+     - updated
+
+   * base/MString.[h,cc]:
+     - removed (now in Mars)
+
+   * base/MThread.h, candrv/network.h, candrv/nodedrv.h,
+     candrv/vmodican.h, devdrv/macs.h, videodev/Camera.h:
+     - changed ifndef
+
+   * base/Makefile:
+     - updated
+
+   * candrv/nodedrv.cc:
+     - added cast to MTime
+
+   * candrv/vmodican.cc:
+     - changed priority from 10 to 1
+
+   * caos/Led.cc, caos/Ring.cc:
+     - changed Form to MString
+
+   * caos/Makefile:
+     - added include base
+
+   * caos/Ring.[h,cc]:
+     - added arguments to constructor
+
+   * catalog/CatalogLinkDef.h, catalog/Makefile:
+     - removed SaoFile
+
+   * catalog/Slalib.cc:
+     - removed some obsolete code
+
+   * catalog/StarCatalog.cc:
+     - added a size check for the bitmap
+
+   * devdrv/macs.cc:
+     - no guarding for the moment
+
+   * devdrv/shaftencoder.[h,cc]:
+     - added code to communicate with the Macs
+
+   * gui/GuiLinkDef.h, gui/Makefile:
+     - removed MGVelocity
+
+   * gui/MGCosy.[h,cc]:
+     - added weather data to display
+     - added image of the camera to window
+     - removed velocity from window
+     - replaced Form by MString
+
+   * main/MBending.cc:
+     - changed handling in GetAnAw - Hopefully correct???
+       the old handling gave problems
+
+   * main/MCosy.[h,cc]:
+     - added SetTrackingPosRE
+     - display interpolated position when tracking
+     - added SetMotor calls
+
+   * main/MStarguider.[h,cc]:
+     - added code to find star in the display
+     - added corresponding menus
+     - added code to support more than one ccd channel
+
+   * main/MTracking.[h,cc]:  
+     - complete change to the algorithm. The position which is 
+       send to CC need still some investigations. For more information
+       look at the code. The main difference is that the motor
+       encoders are taken better into account which fixes the SE 
+       handling on the elevation axis 
+
+   * main/MainLinkDef.h, main/Makefile:
+     - added MPointing
+     - added MTracking
+     
+   * tcpip/MCeCoCom.[h,cc]:  
+     - added alarm counter
+
+   * tcpip/MTcpIpIO.cc:
+     - do not write to output file if stream is locked
+
+   * tpoint/gui.C:
+     - fixed display so that it perfectly shows north, east, ...
+     - added error for residual
+     - simplified residual algorithm
+     - read new files
+     - changed displaying deviations a bit
+     - display result in the display (preliminary)
+     - set gIgnoreLevel to suppress strange color warnings
+
+   * videodev/FilterLed.cc:
+     - use MGMap for drawing...
+
+
+
+ 2004/05/15 - Thomas Bretz (La Palma)
+
+   * .cosyrc_magic:
+     - updated with some comments
+
+   * Makefile:
+     - added many more links necessary for current make
+       (should be replaced by libmars.so in the future)
+
+   * Makefile.conf.general:
+     - added GX11 and HistPainter
+
+   * cosy.cc, starg.cc:
+     - Moved initialization of Camera to MStarguider
+     - added command line option to choose ccd channel
+
+   * leds.txt:
+     - replaced with new LED positions (OFFSETS MISSING)
+
+   * stars.txt:
+     - added many more stars
+
+   * base/coord.h:
+     - added operator/=(XY&)
+
+   * base/msgqueue.cc, candrv/sdolist.cc:
+     - added more output in case mutex is already locked by the same thread
+
+   * candrv/vmodican.cc:
+     - some changes to output
+
+   * catalog/SlaStars.cc:
+     - changed some comments
+
+   * catalog/StarCatalog.[h,cc]:
+     - replaced old algorithms by MAstroCatalog and new simplifications
+       to calculate star-positions accuratly by combining slalib with
+       MAstroCatalog
+
+   * devdrv/macs.h:
+     - added GetPosTime
+
+   * devdrv/shaftencoder.[h,cc]:
+     - added output to report file
+
+   * gui/MGAccuracy.[h,cc]:
+     - added time development curve (blue)
+
+   * gui/MGEmbeddedCanvas.h, gui/MGSkyPosition.h, 
+     gui/MGVelocity.h:
+     - changed ifndef define
+
+   * gui/MGImage.[h,cc]:
+     - enhancements in speed
+     - enhancements in mutex locking mechanism
+
+   * gui/MGPngReader.cc, gui/MGTPoint.cc:
+     - changed meaning of PixSize
+
+   * gui/MGVelocity.cc:
+     - fixed units
+
+   * main/MCaos.[h,cc]:
+     - changed ring radius from 266/272 to 266,268
+     - moved drawing circles to MStarguider
+
+   * main/MCosy.[h,cc]:
+     - moved big parts of the code to MPointing and MTracking
+     - removed old conversion constants (Se to RE, etc) and
+       replaced by more meaningful ones
+     - prepare displaying starguider image
+     - added GetFileName to globally prepare correct file names
+
+   * main/MPointing.cc:
+     - fixed missing SetDecelaration
+     - changed to new unit conversion constants
+     - Use SendStatus instead of Send
+
+   * main/MStarguider.cc:
+     - added update and support of cosy-image display
+     - added channel swicthing for the frame grabber
+     - added algorithm to find star position FindStar
+     - commented out starguider algorithms
+     - draw support lines and grid stuff
+
+   * main/MTracking.[h,cc]:
+     - changed to new unit conversion constants
+     - added output of RE stuff to report file
+     - some simplification to tracking thread
+
+   * base/MString.[h,cc]:
+     - added as a thread safe replacement for Form()
+
+   * tcpip/MCeCoCom.[h,cc]:
+     - changed support for Weather information
+
+   * tcpip/MDriveCom.[h,cc]:
+     - changed output
+     - added SendStatus
+
+   * tcpip/MTcpIpIO.cc:
+     - changed output
+     - output reports to report file
+
+   * tpoint/gui.C:
+     - read new starg_* files
+
+   * videodev/Camera.[h,cc]:
+     - some enhancements to ioctl call
+     - some changes to output
+     - changes a bit the bahaviour of mutices
+     - replaced fRunning by mutex
+     - changes to ExitLoop and IsRunning
+     - added support for several frame grabber channels
+
+   * videodev/FilterLed.[h,cc]
+     - added new algorithms to find star
+     - small updates to star finding support
+
+   * videodev/PixGetter.h:
+     - added a virtual empty destructor (IMPORTANT)
Index: trunk/MagicSoft/Cosy/caos/Ring.h
===================================================================
--- trunk/MagicSoft/Cosy/caos/Ring.h	(revision 7296)
+++ trunk/MagicSoft/Cosy/caos/Ring.h	(revision 7297)
@@ -26,9 +26,9 @@
     Double_t sqr(Double_t x) { return x*x; }
 
-    void Swap(int *m, int *n)
+    void Swap(int &m, int &n)
     {
-        int dummy = *m;
-        *m = *n;
-        *n = dummy;
+        int dummy = m;
+        m = n;
+        n = dummy;
     }
 
Index: trunk/MagicSoft/Cosy/caos/Rings.cc
===================================================================
--- trunk/MagicSoft/Cosy/caos/Rings.cc	(revision 7296)
+++ trunk/MagicSoft/Cosy/caos/Rings.cc	(revision 7297)
@@ -16,5 +16,6 @@
     int nPoints = leds.GetEntries();
 
-    if (nPoints<fMinNumberLeds) 
+    // A minimum of at least 3 points is mandatory!
+    if (nPoints<fMinNumberLeds || nPoints<3)
         return;
 
Index: trunk/MagicSoft/Cosy/caos/Rings.h
===================================================================
--- trunk/MagicSoft/Cosy/caos/Rings.h	(revision 7296)
+++ trunk/MagicSoft/Cosy/caos/Rings.h	(revision 7297)
@@ -21,8 +21,5 @@
 
 public:
-    Rings() : TClonesArray("Ring", 1) 
-	{
-	    fMinNumberLeds=5;
-	}
+    Rings() : TClonesArray("Ring", 1) : fMinNumberLeds(5) { }
 
     void SetMinNumberLeds(Short_t n) { fMinNumberLeds=n; }
Index: trunk/MagicSoft/Cosy/devdrv/shaftencoder.h
===================================================================
--- trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 7296)
+++ trunk/MagicSoft/Cosy/devdrv/shaftencoder.h	(revision 7297)
@@ -80,4 +80,13 @@
     Int_t    GetDirChangedOffset() const { return fDirChangedOffset; }
 
+    Int_t GetPosDirCorrected() const
+    {
+        return DirHasChanged() ? GetDirChangedPos() : GetPos();
+    }
+    Int_t GetOffsetDirCorrected() const
+    {
+        return DirHasChanged() ? GetDirChangedOffset() : GetOffset();
+    }
+
     void     SetOffset(Int_t off) { fOffset = off; }
 
@@ -98,13 +107,15 @@
     void SetHysteresisPos(Float_t f) { fHysteresisPos = f; }
 
-    Float_t GetPosCorrected() const { 
-      switch (fDirection) { 
-      case kUndefined: 
-	return GetPos(); 
-      case kForward: 
-	return GetPos()-fHysteresisPos; 
-      case kBackward: 
-	return GetPos()+fHysteresisNeg; 
-      }
+    Float_t GetPosCorrected() const
+    {
+        switch (fDirection)
+        {
+        case kUndefined:
+            return GetPos();
+        case kForward:
+            return GetPos()-fHysteresisPos;
+        case kBackward:
+            return GetPos()+fHysteresisNeg;
+        }
     }
 
Index: trunk/MagicSoft/Cosy/main/MStarguider.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 7296)
+++ trunk/MagicSoft/Cosy/main/MStarguider.cc	(revision 7297)
@@ -498,5 +498,5 @@
     fStargCaos = new MCaos;
     fStargCaos->ReadResources("stargleds.txt");
-    fStargCaos->SetMinNumberRings(2);
+    fStargCaos->SetMinNumberRings(3);
     fStargCaos->SetRadii(158,164);
 
@@ -1206,7 +1206,10 @@
     f.FindStarCircle(leds, (Int_t)center.GetX(), (Int_t)center.GetY());
 
+    if (leds.GetEntries()<0)
+        return ZdAz(0, 0);
+
     // Check whether star found
     Led *star = (Led*)leds.At(0);
-    if (!star || leds.GetEntries()<1)
+    if (!star)
         return ZdAz(.0,.0);
 
Index: trunk/MagicSoft/Cosy/main/MTracking.cc
===================================================================
--- trunk/MagicSoft/Cosy/main/MTracking.cc	(revision 7296)
+++ trunk/MagicSoft/Cosy/main/MTracking.cc	(revision 7297)
@@ -247,21 +247,26 @@
      const XY re = fCosy->kGearTot/fCosy->kResSE; //[re/se]
 
+     // Check wether moving direction has changed
      const bool bool1 = fCosy->fZd1->DirHasChanged();
      const bool bool2 = fCosy->fZd2->DirHasChanged();
 
-     if (bool1 && bool2) {
-       fCosy->fZd1->ResetDirHasChanged();
-       fCosy->fZd2->ResetDirHasChanged();
+     // If both directions have changed reset the flags
+     if (bool1 && bool2)
+     {
+         fCosy->fZd1->ResetDirHasChanged();
+         fCosy->fZd2->ResetDirHasChanged();
      }
- 
-     Int_t pzd1 = !bool1 ? fCosy->fZd1->GetPos() : fCosy->fZd1->GetDirChangedPos();
-     Int_t pzd2 = !bool2 ? fCosy->fZd2->GetPos() : fCosy->fZd2->GetDirChangedPos();
-     Int_t paz  =          fCosy->fAz->GetPos();
- 
+
+     // Get shaftencoder positions
+     // Ignore the shaftencoder which has not yet changed its value
+     const Int_t pzd1 = fCosy->fZd1->GetPosDirCorrected();
+     const Int_t pzd2 = fCosy->fZd2->GetPosDirCorrected();
+     const Int_t paz  = fCosy->fAz->GetPos();
+
      // Get current shaftencoder position of the telescope
      Double_t seposzd1 = ((pzd1+8192)%16384)*re.X();
      Double_t seposzd2 = ((pzd2+8192)%16384)*re.X();
      Double_t seposaz  =   paz              *re.Y();
- 
+
      // distance between (To+dt) and To [re]
      // position time difference < 5usec
@@ -269,8 +274,10 @@
      // Shaft- and the rotary encoders
      const ZdAz repos = pdo ? fCosy->GetRePosPdo() : fCosy->GetRePos();
- 
-     const Int_t offset1 = !bool1 ? fCosy->fZd1->GetOffset() : fCosy->fZd1->GetDirChangedOffset();
-     const Int_t offset2 = !bool2 ? fCosy->fZd2->GetOffset() : fCosy->fZd2->GetDirChangedOffset();
- 
+
+     // Get rotary encoder positions
+     // Get stored offset if one SE has not changed its direction yet
+     const Int_t offset1 = fCosy->fZd1->GetOffsetDirCorrected();
+     const Int_t offset2 = fCosy->fZd2->GetOffsetDirCorrected();
+
      // Calculate the part of one SE which the motors moved
      // since the last SE has changed its value
@@ -278,5 +285,5 @@
      const Double_t offzd2 = repos.Zd() - offset2;
      const Double_t offaz  = repos.Az() - fCosy->fAz->GetOffset();
- 
+
      // Correct for the direction in which the motor is moving
      // (in which the shaftencoders should change its values)
@@ -287,5 +294,18 @@
      if (offzd2<0)
          seposzd2 += re.X();
- 
+
+     // If the correction exceeds one shaftencoder step stop interpolation
+     // of shaftencoder positions using rotary encoder values.
+     //ofstream fout("offsets.log", ios::app);
+     //fout << MTime(-1) << " " << offaz << " " << offzd1 << " " << offzd2 << endl;
+     /*
+      if (TMath::Abs(offaz)>re.Y())
+         offaz = TMath::Sign(re.Y(), offaz);
+      if (TMath::Abs(offzd1)>re.X())
+         offzd1 = TMath::Sign(re.X(), offzd1);
+      if (TMath::Abs(offzd2)>re.X())
+         offzd2 = TMath::Sign(re.X(), offzd2);
+         */
+
      // and interpolate the shaftencoder steps using the motor
      // encoder positon (Be carefull the minus-sign is important)
@@ -293,21 +313,7 @@
      seposzd2 -= offzd2;
      seposaz  += offaz;
- 
-
 
      return ZdAz((seposzd1-seposzd2)/2, seposaz);
 }
-/*
-    if (fCosy->fZd1->DirHasChanged() != fCosy->fZd2->DirHasChanged())
-    {
-        pzd1 -= fCosy->fZd1->GetDirection();
-        pzd2 -= fCosy->fZd2->GetDirection();
-    }
-    else
-    {
-        fCosy->fZd1->ResetDirHasChanged();
-        fCosy->fZd2->ResetDirHasChanged();
-    }
-  */
 
 void MTracking::TrackPosition(const RaDec &dst) // ra, dec [rad]
Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7296)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7297)
@@ -18,4 +18,28 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2005/08/22 Thomas Bretz
+
+   * mgeom/MGeomPix.h:
+     - added new function GetDist returning the distance between two
+       pixels
+
+   * mhist/MHCamera.h:
+     - added new function (also to context menu) SetMinMax
+
+   * mhist/MHEvent.[h,cc]:
+     - added the possibility to set min and max values for the displayed
+       data
+     - added a new option to display the arrival time after cleaning
+
+   * mmain/MEventDisplay.cc:
+     - added the arrival time after cleaning to display
+     - set the min value in some displays to 0
+
+   * msignal/MSignalCam.cc:
+     - added the possibility to return the arrival time after cleaning
+
+
+
  2005/08/18
 
Index: trunk/MagicSoft/Mars/mgeom/MGeomCam.cc
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7296)
+++ trunk/MagicSoft/Mars/mgeom/MGeomCam.cc	(revision 7297)
@@ -141,4 +141,18 @@
 // --------------------------------------------------------------------------
 //
+// Returns the distance between the pixels i and j. -1 if an index
+// doesn't exist. The default for j is 0. Assuming that 0 is the index
+// for a central pixel you can get the distance to the camera center.
+//
+Float_t MGeomCam::GetDist(UShort_t i, UShort_t j) const
+{
+    if (i>=fNumPixels || j>=fNumPixels)
+        return -1;
+
+    return (*this)[i].GetDist((*this)[j]);
+}
+
+// --------------------------------------------------------------------------
+//
 //  Set the kIsOuterRing flag for all pixels which have a outermost pixel
 //  as Next Neighbor and don't have the kIsOutermostRing flag itself.
Index: trunk/MagicSoft/Mars/mgeom/MGeomPix.h
===================================================================
--- trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 7296)
+++ trunk/MagicSoft/Mars/mgeom/MGeomPix.h	(revision 7297)
@@ -63,4 +63,6 @@
     UInt_t  GetSector() const { return fSector; }
 
+    Float_t GetDist(const MGeomPix & pix) const  { return TMath::Hypot(fX-pix.fX, fY-pix.fY); }
+
     Float_t GetA() const    { return fA; /*fD*fD*gsTan60/2;*/ }
     Int_t   GetAidx() const { return fAidx; }
Index: trunk/MagicSoft/Mars/mhist/MHCamera.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 7296)
+++ trunk/MagicSoft/Mars/mhist/MHCamera.h	(revision 7297)
@@ -221,6 +221,4 @@
     void     SetInvDeepBlueSeaPalette(); // *MENU*
 
-    void     SetAutoScale() { fMinimum = fMaximum = -1111; } // *MENU*
-
     void     SetFreezed(Bool_t f=kTRUE) { f ? SetBit(kFreezed) : ResetBit(kFreezed); } // *TOGGLE* *GETTER=IsFreezed
     Bool_t   IsFreezed() const { return TestBit(kFreezed); }
@@ -228,4 +226,7 @@
 
     void     SetAbberation(Float_t f=0.0713) { fAbberation=f; } // *MENU*
+
+    void     SetAutoScale() { fMinimum = fMaximum = -1111; } // *MENU*
+    void     SetMinMax(Double_t min=-1111, Double_t max=-1111) { SetMinimum(min); SetMaximum(max); } // *MENU*
 
     void     AddNotify(TObject *event);
Index: trunk/MagicSoft/Mars/mhist/MHEvent.cc
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 7296)
+++ trunk/MagicSoft/Mars/mhist/MHEvent.cc	(revision 7297)
@@ -71,5 +71,6 @@
 // --------------------------------------------------------------------------
 //
-MHEvent::MHEvent(EventType_t type) : fHist(NULL), fType(type)
+MHEvent::MHEvent(EventType_t type) : fHist(NULL), fType(type),
+    fMinimum(-1111), fMaximum(-1111)
 {
     fName = "MHEvent";
@@ -121,4 +122,7 @@
     fHist = new MHCamera(*cam);
     fHist->AddNotify(fClone);
+
+    fHist->SetMinimum(fMinimum);
+    fHist->SetMaximum(fMaximum);
 
     switch (fType)
@@ -167,4 +171,5 @@
         break;
      case kEvtArrTime:
+     case kEvtArrTimeCleaned:
         fHist->SetName("Arrival Time");
         fHist->SetYTitle("t [slice id]");
@@ -241,4 +246,7 @@
     case kEvtArrTime:
         fHist->SetCamContent(*event, 6);
+        break; 
+    case kEvtArrTimeCleaned:
+        fHist->SetCamContent(*event, 8);
         break; 
     case kEvtTrigPix:
Index: trunk/MagicSoft/Mars/mhist/MHEvent.h
===================================================================
--- trunk/MagicSoft/Mars/mhist/MHEvent.h	(revision 7296)
+++ trunk/MagicSoft/Mars/mhist/MHEvent.h	(revision 7297)
@@ -25,5 +25,6 @@
         kEvtPedPhot, kEvtPedPhotRMS,
         kEvtCleaningLevels, kEvtCleaningData,
-        kEvtIdxMax, kEvtArrTime, kEvtTrigPix, kEvtIslandIndex
+        kEvtIdxMax, kEvtArrTime, kEvtArrTimeCleaned,
+        kEvtTrigPix, kEvtIslandIndex
     };
 
@@ -45,4 +46,7 @@
     EventType_t fType;
 
+    Double_t fMinimum;
+    Double_t fMaximum;
+
     TH1 *GetHistByName(const TString name) const { return (TH1*)fHist; }
 
@@ -53,4 +57,7 @@
     MHEvent(EventType_t type=kEvtSignalRaw);
     ~MHEvent();
+
+    void SetMinimum(Double_t min=-1111) { fMinimum=min; }
+    void SetMaximum(Double_t max=-1111) { fMaximum=max; }
 
     MHCamera *GetHist() { return fHist; }
Index: trunk/MagicSoft/Mars/mmain/MEventDisplay.cc
===================================================================
--- trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7296)
+++ trunk/MagicSoft/Mars/mmain/MEventDisplay.cc	(revision 7297)
@@ -223,4 +223,5 @@
     MHEvent *evt07 = new MHEvent(MHEvent::kEvtIdxMax);
     MHEvent *evt08 = new MHEvent(MHEvent::kEvtArrTime);
+    MHEvent *evt09 = new MHEvent(MHEvent::kEvtArrTimeCleaned);
     //MHEvent *evt09 = new MHEvent(MHEvent::kEvtTrigPix);
     MHEvent *evt10 = new MHEvent(MHEvent::kEvtIslandIndex);
@@ -228,12 +229,17 @@
     evt01->SetName("Signal");
     evt02->SetName("Cleaned");
-    evt03->SetName("Pedestal");
+    evt03->SetName("Ped");
     evt04->SetName("PedRMS");
     evt06a->SetName("CleanData");
-    evt06b->SetName("CleanLevels");
-    evt07->SetName("Max Slice Idx");
-    evt08->SetName("Arrival Time");
-    //evt09->SetName("Trigger");
+    evt06b->SetName("Levels");
+    evt07->SetName("MaxSliceIdx");
+    evt08->SetName("ArrTime");
+    evt09->SetName("Time");
     evt10->SetName("Islands");
+
+    evt01->SetMinimum(0);
+    evt03->SetMinimum(0);
+    evt04->SetMinimum(0);
+    evt06a->SetMinimum(0);
 
     // This makes sure, that the containers are deleted...
@@ -246,5 +252,5 @@
     plist->AddToList(evt07);
     plist->AddToList(evt08);
-    //plist->AddToList(evt09);
+    plist->AddToList(evt09);
     plist->AddToList(evt10);
 
@@ -336,5 +342,7 @@
     {
         MFillH *fill08 = new MFillH(evt08, "MSignalCam", "MFillH8");
+        MFillH *fill09 = new MFillH(evt09, "MSignalCam", "MFillH9");
         tlist->AddToList(fill08);
+        tlist->AddToList(fill09);
     }
     tlist->AddToList(hcalc);
Index: trunk/MagicSoft/Mars/msignal/MSignalCam.cc
===================================================================
--- trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7296)
+++ trunk/MagicSoft/Mars/msignal/MSignalCam.cc	(revision 7297)
@@ -600,5 +600,5 @@
     MSignalPix *pix = GetPixById(idx);
 
-    if ((!pix || !pix->IsPixelUsed()) && type<6)
+    if ((!pix || !pix->IsPixelUsed()) && (type<6 || type==8))
         return kFALSE;
 
@@ -632,4 +632,7 @@
         val = pix->GetArrivalTime();
         break;
+    case 8:
+        val = pix->GetArrivalTime();
+        break;
     default:
         val = pix->GetNumPhotons()*ratio;
