Projects
mass
turbina-core-dimm
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 15
View file
turbina-core-dimm.changes
Changed
@@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Wed Nov 1 11:05:03 UTC 2017 - matwey@sai.msu.ru + +- Version 2.51 + +------------------------------------------------------------------- Thu Oct 26 08:56:27 UTC 2017 - matwey@sai.msu.ru - Version 2.50
View file
turbina-core-dimm.spec
Changed
@@ -42,7 +42,7 @@ License: GPL-2.0+ Group: Productivity/Scientific/Astronomy Name: turbina-core-dimm -Version: 2.50 +Version: 2.51 Release: 0 Url: http://curl.sai.msu.ru/hg/dimm_tool Source: %{tarname}-%{version}.tar.bz2
View file
_service
Added
@@ -0,0 +1,14 @@ +<services> + <service name="tar_scm" mode="disabled"> + <param name="url">http://curl.sai.msu.ru/hg/dimm_tool</param> + <param name="revision">2.51</param> + <param name="versionformat">{latesttag}</param> + <param name="scm">hg</param> + </service> + <service name="recompress" mode="disabled"> + <param name="compression">bz2</param> + <param name="file">*.tar</param> + </service> + <service name="set_version" mode="disabled"> + </service> +</services>
View file
dimm_tool-2.50.tar.bz2/.hg_archival.txt
Deleted
@@ -1,6 +0,0 @@ -repo: 4c4cf3d013dfac9fc25b77065f15e7168fd8d20b -node: 28401ec3077b6d37ab5c24be6c2c84af3523f892 -branch: default -latesttag: 2.50 -latesttagdistance: 1 -changessincelatesttag: 1
View file
dimm_tool-2.50.tar.bz2/pwc-ioctl.h
Deleted
@@ -1,292 +0,0 @@ -#ifndef PWC_IOCTL_H -#define PWC_IOCTL_H - -/* (C) 2001-2004 Nemosoft Unv. - (C) 2004 Luc Saillard (luc@saillard.org) - - NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx - driver and thus may have bugs that are not present in the original version. - Please send bug reports and support requests to <luc@saillard.org>. - The decompression routines have been implemented by reverse-engineering the - Nemosoft binary pwcx module. Caveat emptor. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* This is pwc-ioctl.h belonging to PWC 8.12.1 - It contains structures and defines to communicate from user space - directly to the driver. - */ - -/* - Changes - 2001/08/03 Alvarado Added ioctl constants to access methods for - changing white balance and red/blue gains - 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE - 2003/12/13 Nemosft Unv. Some modifications to make interfacing to - PWCX easier - */ - -/* These are private ioctl() commands, specific for the Philips webcams. - They contain functions not found in other webcams, and settings not - specified in the Video4Linux API. - - The #define names are built up like follows: - VIDIOC VIDeo IOCtl prefix - PWC Philps WebCam - G optional: Get - S optional: Set - ... the function - */ - - - /* Enumeration of image sizes */ -#define PSZ_SQCIF 0x00 -#define PSZ_QSIF 0x01 -#define PSZ_QCIF 0x02 -#define PSZ_SIF 0x03 -#define PSZ_CIF 0x04 -#define PSZ_VGA 0x05 -#define PSZ_MAX 6 - - -/* The frame rate is encoded in the video_window.flags parameter using - the upper 16 bits, since some flags are defined nowadays. The following - defines provide a mask and shift to filter out this value. - - In 'Snapshot' mode the camera freezes its automatic exposure and colour - balance controls. - */ -#define PWC_FPS_SHIFT 16 -#define PWC_FPS_MASK 0x00FF0000 -#define PWC_FPS_FRMASK 0x003F0000 -#define PWC_FPS_SNAPSHOT 0x00400000 - - -/* structure for transfering x & y coordinates */ -struct pwc_coord -{ - int x, y; /* guess what */ - int size; /* size, or offset */ -}; - - -/* Used with VIDIOCPWCPROBE */ -struct pwc_probe -{ - char name32; - int type; -}; - -struct pwc_serial -{ - char serial30; /* String with serial number. Contains terminating 0 */ -}; - -/* pwc_whitebalance.mode values */ -#define PWC_WB_INDOOR 0 -#define PWC_WB_OUTDOOR 1 -#define PWC_WB_FL 2 -#define PWC_WB_MANUAL 3 -#define PWC_WB_AUTO 4 - -/* Used with VIDIOCPWCSGAWB (Auto White Balance). - Set mode to one of the PWC_WB_* values above. - *red and *blue are the respective gains of these colour components inside - the camera; range 0..65535 - When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read; - otherwise undefined. - 'read_red' and 'read_blue' are read-only. -*/ -struct pwc_whitebalance -{ - int mode; - int manual_red, manual_blue; /* R/W */ - int read_red, read_blue; /* R/O */ -}; - -/* - 'control_speed' and 'control_delay' are used in automatic whitebalance mode, - and tell the camera how fast it should react to changes in lighting, and - with how much delay. Valid values are 0..65535. -*/ -struct pwc_wb_speed -{ - int control_speed; - int control_delay; - -}; - -/* Used with VIDIOCPWCSGLED */ -struct pwc_leds -{ - int led_on; /* Led on-time; range = 0..25000 */ - int led_off; /* Led off-time; range = 0..25000 */ -}; - -/* Image size (used with GREALSIZE) */ -struct pwc_imagesize -{ - int width; - int height; -}; - -/* Defines and structures for Motorized Pan & Tilt */ -#define PWC_MPT_PAN 0x01 -#define PWC_MPT_TILT 0x02 -#define PWC_MPT_TIMEOUT 0x04 /* for status */ - -/* Set angles; when absolute != 0, the angle is absolute and the - driver calculates the relative offset for you. This can only - be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns - absolute angles. - */ -struct pwc_mpt_angles -{ - int absolute; /* write-only */ - int pan; /* degrees * 100 */ - int tilt; /* degress * 100 */ -}; - -/* Range of angles of the camera, both horizontally and vertically. - */ -struct pwc_mpt_range -{ - int pan_min, pan_max; /* degrees * 100 */ - int tilt_min, tilt_max; -}; - -struct pwc_mpt_status -{ - int status; - int time_pan; - int time_tilt; -}; - - -/* This is used for out-of-kernel decompression. With it, you can get - all the necessary information to initialize and use the decompressor - routines in standalone applications. - */ -struct pwc_video_command -{ - int type; /* camera type (645, 675, 730, etc.) */ - int release; /* release number */ - - int size; /* one of PSZ_* */ - int alternate; - int command_len; /* length of USB video command */ - unsigned char command_buf13; /* Actual USB video command */ - int bandlength; /* >0 = compressed */ - int frame_size; /* Size of one (un)compressed frame */ -}; - -/* Flags for PWCX subroutines. Not all modules honour all flags. */ -#define PWCX_FLAG_PLANAR 0x0001 -#define PWCX_FLAG_BAYER 0x0008 - - -/* IOCTL definitions */ - - /* Restore user settings */ -#define VIDIOCPWCRUSER _IO('v', 192) - /* Save user settings */ -#define VIDIOCPWCSUSER _IO('v', 193) - /* Restore factory settings */ -#define VIDIOCPWCFACTORY _IO('v', 194) - - /* You can manipulate the compression factor. A compression preference of 0 - means use uncompressed modes when available; 1 is low compression, 2 is - medium and 3 is high compression preferred. Of course, the higher the - compression, the lower the bandwidth used but more chance of artefacts - in the image. The driver automatically chooses a higher compression when - the preferred mode is not available. - */ - /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */ -#define VIDIOCPWCSCQUAL _IOW('v', 195, int) - /* Get preferred compression quality */ -#define VIDIOCPWCGCQUAL _IOR('v', 195, int) - - -/* Retrieve serial number of camera */ -#define VIDIOCPWCGSERIAL _IOR('v', 198, struct pwc_serial) - - /* This is a probe function; since so many devices are supported, it - becomes difficult to include all the names in programs that want to - check for the enhanced Philips stuff. So in stead, try this PROBE; - it returns a structure with the original name, and the corresponding - Philips type. - To use, fill the structure with zeroes, call PROBE and if that succeeds, - compare the name with that returned from VIDIOCGCAP; they should be the - same. If so, you can be assured it is a Philips (OEM) cam and the type - is valid. - */ -#define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe) - - /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */ -#define VIDIOCPWCSAGC _IOW('v', 200, int) - /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */ -#define VIDIOCPWCGAGC _IOR('v', 200, int) - /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */ -#define VIDIOCPWCSSHUTTER _IOW('v', 201, int) - - /* Color compensation (Auto White Balance) */ -#define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance) -#define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance) - - /* Auto WB speed */ -#define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed) -#define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed) - - /* LEDs on/off/blink; int range 0..65535 */ -#define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds) -#define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds) - - /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */ -#define VIDIOCPWCSCONTOUR _IOW('v', 206, int) -#define VIDIOCPWCGCONTOUR _IOR('v', 206, int) - - /* Backlight compensation; 0 = off, otherwise on */ -#define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int) -#define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int) - - /* Flickerless mode; = 0 off, otherwise on */ -#define VIDIOCPWCSFLICKER _IOW('v', 208, int) -#define VIDIOCPWCGFLICKER _IOR('v', 208, int) - - /* Dynamic noise reduction; 0 off, 3 = high noise reduction */ -#define VIDIOCPWCSDYNNOISE _IOW('v', 209, int) -#define VIDIOCPWCGDYNNOISE _IOR('v', 209, int) - - /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */ -#define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize) - - /* Motorized pan & tilt functions */ -#define VIDIOCPWCMPTRESET _IOW('v', 211, int) -#define VIDIOCPWCMPTGRANGE _IOR('v', 211, struct pwc_mpt_range) -#define VIDIOCPWCMPTSANGLE _IOW('v', 212, struct pwc_mpt_angles) -#define VIDIOCPWCMPTGANGLE _IOR('v', 212, struct pwc_mpt_angles) -#define VIDIOCPWCMPTSTATUS _IOR('v', 213, struct pwc_mpt_status) - - /* Get the USB set-video command; needed for initializing libpwcx */ -#define VIDIOCPWCGVIDCMD _IOR('v', 215, struct pwc_video_command) -struct pwc_table_init_buffer { - int len; - char *buffer; - -}; -#define VIDIOCPWCGVIDTABLE _IOR('v', 216, struct pwc_table_init_buffer) - -#endif
View file
dimm_tool-2.50.tar.bz2/webcam.cpp
Deleted
@@ -1,107 +0,0 @@ -#include <errno.h> -#include <string.h> -#include <stdio.h> -#include <stdlib.h> -#include <math.h> -#include <sys/ioctl.h> -#include <sys/poll.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <unistd.h> -#include <iostream> - -#include "webcam.h" -namespace { - const char *device = "/dev/video0"; - int fd_video = -1; - int gain = 0; - unsigned int nfds = 1; - struct pollfd vfds = {-1,POLLIN,0}; - struct video_window vwin; - struct v4l2_control vctl; -} -//using namespace std; - -void Video::openDev(void) { - if( (fd_video = open(device, O_RDWR|O_NONBLOCK)) < 0 ) { - fprintf(stderr, "Error while accessing device %s: %s\n", device, strerror(errno)); -// exit(1); - } - vfds.fd = fd_video; -} - -void Video::closeDev(void) { - if( fd_video > 0) close( fd_video ); -} - -int Video::readFrame( int xsize, int ysize, unsigned char *buff ) { - int c; - if( (c=(int)read( fd_video, (void*)buff, xsize*ysize*3/2 )) == xsize*ysize*3/2 ) return SUCCESS; - std::cerr << "Frame error " << c << " errno " << errno - << " xsize " << xsize << " ysize " << ysize << std::endl; - return FAIL; -} - -int Video::waitFrame( void ){ - if( poll( &vfds, nfds, 1000000 ) == 1 && vfds.revents&(POLLIN) ) return SUCCESS; - std::cerr << "No wanted frame" << std::endl; - return FAIL; -} - -void Video::setGain( int gain ) { - int val = (gain < 0)? -1 : (( gain > 63 )? 63 : gain ); - val = 1024*val; - if( ioctl(fd_video, VIDIOCPWCSAGC, &val ) < 0 ) fprintf( stderr, "Set gain error\n" ); -} - -int Video::getGain( void ) { - int dummy; - if( ioctl(fd_video, VIDIOCPWCGAGC, &dummy) < 0 ) fprintf( stderr, "Get gain error\n" ); - else gain = dummy/1024; - return( gain ); -} - -int Video::getImageSize( int *xs, int *ys ) { - if(ioctl(fd_video, VIDIOCGWIN, &vwin, sizeof(vwin)) < 0 ) fprintf( stderr, "Get video_win error\n" ); - *xs = vwin.width; - *ys = vwin.height; - return 0; -} - -int Video::setImageSize( int *xs, int *ys ) { - vwin.width = *xs; - vwin.height = *ys; - if(ioctl(fd_video, VIDIOCSWIN, &vwin, sizeof(vwin)) < 0 ) fprintf( stderr, "Set video_win error\n" ); - return 0; -} - -void Video::setFrameRate( int fms ) { - if(ioctl(fd_video, VIDIOCGWIN, &vwin, sizeof(vwin)) < 0 ) fprintf( stderr, "Get video_win error\n" ); - if(vwin.flags & PWC_FPS_FRMASK) { /* set new framerate */ - vwin.flags &= ~PWC_FPS_FRMASK; - vwin.flags |= ( fms << PWC_FPS_SHIFT ); - if(ioctl(fd_video, VIDIOCSWIN, &vwin, sizeof(vwin)) < 0 ) fprintf( stderr, "Set video_win error\n" ); - } else { - fprintf(stderr, "This device doesn't support setting the framerate.\n"); - exit(1); - } -} - -int Video::getFrameRate( void ) { - if( !(vwin.flags&PWC_FPS_FRMASK) ) return -1; - return ((vwin.flags & PWC_FPS_FRMASK ) >> PWC_FPS_SHIFT ); -} - -void Video::setExposure( double ex ) { - // ex = T*fps !! - int dummy = 256*(int)ceil(22.2222*log(0.001*ex)+248); - if( ioctl(fd_video, VIDIOCPWCSSHUTTER, &dummy ) < 0 ) fprintf( stderr, "Set exposure error\n" ); -} - -double Video::getExposure( void ) { - vctl.id = V4L2_CID_EXPOSURE; - if( ioctl(fd_video, VIDIOC_G_CTRL , &vctl ) < 0 ) fprintf( stderr, "Get exposure error\n" ); - double ex = 1000.0*exp(0.045*(vctl.value-248)); - return ex; -}
View file
dimm_tool-2.50.tar.bz2/webcam.h
Deleted
@@ -1,23 +0,0 @@ -#ifndef _WEBCAMERA_H -#define _WEBCAMERA_H -#define _LINUX_TIME_H 1 /* to get things compile on kernel 2.6.x */ -#include <linux/videodev.h> -#include <linux/videodev2.h> -#include "pwc-ioctl.h" -#include "deftypes.h" - -namespace Video { - void openDev( void ); - void closeDev( void ); - void setGain( int ); - int getGain( void ); - int getImageSize( int*, int* ); - int setImageSize( int*, int* ); - void setFrameRate( int ); - int getFrameRate( void ); - void setExposure( double ); - double getExposure( void ); - int readFrame( int, int, unsigned char * ); - int waitFrame( void ); -} -#endif
View file
dimm_tool-2.51.tar.bz2/.
Added
+(directory)
View file
dimm_tool-2.50.tar.bz2/Makefile -> dimm_tool-2.51.tar.bz2/Makefile
Changed
@@ -10,7 +10,7 @@ DIMM_SOURCES = main.o comms.o dimm.o modes.o find.o frame_proc.o camera.o iidc.o functions.o results.o client_handler.o server.o socket.o astrotime.o configs.o errlog.o camera_impl.o camera_test.o camera_iidc.o PREAT = preat PREAT_SOURCES = preat.o parameter_set.o processing.o coordinates.o astrotime.o -VERSION = 2.50 +VERSION = 2.51 CXX = g++ INSTALL_PROGRAM = install CXXFLAGS += -std=c++98 -Wall -O2 -DVERSION=\"$(VERSION)\" -I./infras -I./server
View file
dimm_tool-2.50.tar.bz2/camera.cpp -> dimm_tool-2.51.tar.bz2/camera.cpp
Changed
@@ -26,11 +26,15 @@ } Record::Record( Camera* cam, win<int> w ): camera_(*cam) { - int nbuffs = min( 128, 4000000/(w.xdim()*w.ydim())); try { - frame = std::auto_ptr<Fprocess>(new Fprocess( w - w.beg() )); cam->setROI(w); + + roi_ = cam->getROI(); + const int nbuffs = std::min(128, 4000000/(roi_.xdim()*roi_.ydim())); + + frame = std::auto_ptr<Fprocess>(new Fprocess(roi_ - roi_.beg())); stream.reset(cam->setupCapture(nbuffs)); + this->getFrame(); } catch ( const std::exception& e ) { throw ErrFat( ERR_ALG, e.what() ); @@ -66,6 +70,9 @@ void Camera::setROI(win<int> roi) { pimpl_->setROI(roi); } +win<int> Camera::getROI() { + return pimpl_->getROI(); +} VideoStream<Camera::data_type>* Camera::setupCapture(unsigned int nbuffs) { return pimpl_->setupCapture(nbuffs); }
View file
dimm_tool-2.50.tar.bz2/camera.h -> dimm_tool-2.51.tar.bz2/camera.h
Changed
@@ -47,6 +47,7 @@ Geometry getField(); double effFPS(Settings& ); void setROI(win<int> roi); + win<int> getROI(); VideoStream<data_type>* setupCapture(unsigned int nbuffs); void stopCapture(VideoStream<data_type>* stream); }; @@ -55,10 +56,12 @@ std::auto_ptr<VideoStream<unsigned short> > stream; std::auto_ptr<Fprocess> frame; Camera& camera_; + win<int> roi_; public: Record( Camera*, win<int> ); ~Record(); const Sframe& getFrame(); + inline win<int> getROI() { return roi_; } }; #endif
View file
dimm_tool-2.50.tar.bz2/camera_iidc.cpp -> dimm_tool-2.51.tar.bz2/camera_iidc.cpp
Changed
@@ -78,6 +78,18 @@ ErrlogSingl::instance().wthrow( ERR_CAM_ERR, e.what() ); } } +win<int> CameraImplIIDC::getROI() { + try { + std::pair<unsigned int, unsigned int> size = camera_.getFormat7ImageSize(); + std::pair<unsigned int, unsigned int> pos = camera_.getFormat7ImagePosition(); + + return win<int>(pos.first, pos.second, pos.first + size.first, pos.second + size.second); + } catch ( const IIDC::Error& e ) { + ErrlogSingl::instance().wthrow( ERR_CAM_ERR, e.what() ); + } + return win<int>(); +} + VideoStream<CameraImplIIDC::data_type>* CameraImplIIDC::setupCapture(unsigned int nbuffs) { try { camera_.setupCapture(nbuffs);
View file
dimm_tool-2.50.tar.bz2/camera_iidc.h -> dimm_tool-2.51.tar.bz2/camera_iidc.h
Changed
@@ -40,6 +40,7 @@ virtual void setParameters(Settings&); virtual double gain() const; virtual void setROI(win<int> roi); + virtual win<int> getROI(); virtual VideoStream<data_type>* setupCapture(unsigned int nbuffs); virtual void stopCapture(VideoStream<data_type>* stream);
View file
dimm_tool-2.50.tar.bz2/camera_impl.h -> dimm_tool-2.51.tar.bz2/camera_impl.h
Changed
@@ -43,6 +43,7 @@ virtual Geometry field() const; virtual double effFPS(Settings&) const; virtual void setROI(win<int> roi) = 0; + virtual win<int> getROI() = 0; virtual VideoStream<data_type>* setupCapture(unsigned int nbuffs) = 0; virtual void stopCapture(VideoStream<data_type>* stream) = 0;
View file
dimm_tool-2.50.tar.bz2/camera_test.cpp -> dimm_tool-2.51.tar.bz2/camera_test.cpp
Changed
@@ -32,6 +32,9 @@ void CameraImplTest::setROI(win<int> roi) { roi_ = roi; } +win<int> CameraImplTest::getROI() { + return roi_; +} CameraImplTest::VideoStream::VideoStream(win<int> roi): roi_(roi) { }
View file
dimm_tool-2.50.tar.bz2/camera_test.h -> dimm_tool-2.51.tar.bz2/camera_test.h
Changed
@@ -35,6 +35,7 @@ virtual void setParameters(Settings&); virtual double getGain(); virtual void setROI(win<int> roi); + virtual win<int> getROI(); virtual ::VideoStream<data_type>* setupCapture(unsigned int nbuffs); virtual void stopCapture(::VideoStream<data_type>* stream);
View file
dimm_tool-2.51.tar.bz2/data
Added
+(directory)
View file
dimm_tool-2.51.tar.bz2/data/data
Added
+(directory)
View file
dimm_tool-2.51.tar.bz2/data/log
Added
+(directory)
View file
dimm_tool-2.51.tar.bz2/data/out
Added
+(directory)
View file
dimm_tool-2.51.tar.bz2/data/spectra
Added
+(directory)
View file
dimm_tool-2.51.tar.bz2/doc
Added
+(directory)
View file
dimm_tool-2.51.tar.bz2/etc
Added
+(directory)
View file
dimm_tool-2.50.tar.bz2/find.cpp -> dimm_tool-2.51.tar.bz2/find.cpp
Changed
@@ -386,7 +386,7 @@ else return gravcenter_th( image, m, bias.mean(), sqrt(bias.vars()), gain, radius, th, st ); } -int Proc::aperture_find( Sframe* image, win<int>& ccd, point<double>& levs, +int Proc::aperture_find( Sframe* image, point<double>& levs, double threshold, point<double>& cen, point<double>& dif, point<double>& rads ) { double thres = ( 1.0 - threshold)*levs.x() + threshold*levs.y();
View file
dimm_tool-2.50.tar.bz2/find.h -> dimm_tool-2.51.tar.bz2/find.h
Changed
@@ -6,7 +6,7 @@ int spots_find( Sframe*, win<int>&, double, std::vector<spot> & ); void gravcenter( Sframe*, double, point<double>, double, double, spot&, star& ); bool brighter( const spot&, const spot& ); - int aperture_find( Sframe*, win<int>& , point<double>&, double, point<double>&, point<double>&, point<double>& ); + int aperture_find( Sframe*, point<double>&, double, point<double>&, point<double>&, point<double>& ); } #endif
View file
dimm_tool-2.51.tar.bz2/iidc
Added
+(directory)
View file
dimm_tool-2.50.tar.bz2/iidc/iidc.cpp -> dimm_tool-2.51.tar.bz2/iidc/iidc.cpp
Changed
@@ -388,52 +388,57 @@ void IIDC::Camera::setFormat7ImageROI( unsigned int x, unsigned int y, unsigned int w, unsigned int h ) { dc1394error_t err; - dc1394color_coding_t color_coding; - dc1394video_mode_t video_mode=dc1394video_mode_t( getVideoMode() ); - //err = dc1394_format7_set_image_size( m_camera, dc1394video_mode_t( getVideoMode() ), w, h); - err = dc1394_format7_get_color_coding(m_camera, video_mode, &color_coding); - if ( err != DC1394_SUCCESS ) throw Error( err ); - err = dc1394_format7_set_roi( m_camera, - video_mode, color_coding, DC1394_QUERY_FROM_CAMERA, - x, y, w ,h ); - if ( err != DC1394_SUCCESS ) throw Error( err ); + dc1394video_mode_t video_mode = dc1394video_mode_t(getVideoMode()); + dc1394color_coding_t color_coding = dc1394color_coding_t(DC1394_QUERY_FROM_CAMERA); + uint32_t h_unit, v_unit, h_unit_pos, v_unit_pos; + + err = dc1394_format7_get_unit_size(m_camera, video_mode, &h_unit, &v_unit); + if (err != DC1394_SUCCESS) throw Error(err); + + err = dc1394_format7_get_unit_position(m_camera, video_mode, &h_unit_pos, &v_unit_pos); + if (err != DC1394_SUCCESS) throw Error(err); + + int32_t real_x = (x / h_unit_pos) * h_unit_pos; + int32_t real_y = (y / v_unit_pos) * v_unit_pos; + int32_t real_w = static_cast<int32_t>(x + w - real_x - 1) / h_unit * h_unit + h_unit; + int32_t real_h = static_cast<int32_t>(y + h - real_y - 1) / v_unit * v_unit + v_unit; + + err = dc1394_format7_set_roi(m_camera, video_mode, color_coding, DC1394_QUERY_FROM_CAMERA, real_x, real_y, real_w, real_h); + if (err != DC1394_SUCCESS) throw Error(err); } -void IIDC::Camera::setFormat7ImageSize( unsigned int w, unsigned int h ) { +void IIDC::Camera::setFormat7ColorCoding( ColorCoding c ) { dc1394error_t err; - dc1394color_coding_t color_coding; - dc1394video_mode_t video_mode=dc1394video_mode_t( getVideoMode() ); - //err = dc1394_format7_set_image_size( m_camera, dc1394video_mode_t( getVideoMode() ), w, h); - err = dc1394_format7_get_color_coding(m_camera, video_mode, &color_coding); - if ( err != DC1394_SUCCESS ) throw Error( err ); - err = dc1394_format7_set_roi( m_camera, - video_mode, color_coding, DC1394_QUERY_FROM_CAMERA, - DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA, - w ,h ); - if ( err != DC1394_SUCCESS ) throw Error( err ); -} -void IIDC::Camera::setFormat7ImagePos( unsigned int x, unsigned int y ) { + dc1394video_mode_t video_mode = dc1394video_mode_t(getVideoMode()); + dc1394color_coding_t color_coding = dc1394color_coding_t(c); + err = dc1394_format7_set_roi(m_camera, video_mode, color_coding, DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA); + if (err != DC1394_SUCCESS) throw Error(err); +} + +std::pair<unsigned int, unsigned int> IIDC::Camera::getFormat7ImageSize() { + std::pair<unsigned int, unsigned int> ret; + dc1394error_t err; - dc1394color_coding_t color_coding; - dc1394video_mode_t video_mode=dc1394video_mode_t( getVideoMode() ); - //err = dc1394_format7_set_image_position( m_camera, dc1394video_mode_t( getVideoMode() ), x, y); - err = dc1394_format7_get_color_coding(m_camera, video_mode, &color_coding); - if ( err != DC1394_SUCCESS ) throw Error( err ); - err = dc1394_format7_set_roi( m_camera, - video_mode, color_coding, DC1394_QUERY_FROM_CAMERA, - x, y, - DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA ); - if ( err != DC1394_SUCCESS ) throw Error( err ); + dc1394video_mode_t video_mode = dc1394video_mode_t(getVideoMode()); + + err = dc1394_format7_get_image_size(m_camera, video_mode, &ret.first, &ret.second); + if (err != DC1394_SUCCESS) throw Error(err); + + return ret; } -void IIDC::Camera::setFormat7ColorCoding( ColorCoding c ) { + +std::pair<unsigned int, unsigned int> IIDC::Camera::getFormat7ImagePosition() { + std::pair<unsigned int, unsigned int> ret; + dc1394error_t err; - //err = dc1394_format7_set_color_coding( m_camera, dc1394video_mode_t( getVideoMode() ), dc1394color_coding_t(c) ); - err = dc1394_format7_set_roi( m_camera, - dc1394video_mode_t( getVideoMode() ), dc1394color_coding_t(c), DC1394_QUERY_FROM_CAMERA, - DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA, - DC1394_QUERY_FROM_CAMERA, DC1394_QUERY_FROM_CAMERA ); - if ( err != DC1394_SUCCESS ) throw Error( err ); -} + dc1394video_mode_t video_mode = dc1394video_mode_t(getVideoMode()); + + err = dc1394_format7_get_image_position(m_camera, video_mode, &ret.first, &ret.second); + if (err != DC1394_SUCCESS) throw Error(err); + + return ret; +} + void IIDC::Camera::stopCapture(){ m_queue.reset(); }
View file
dimm_tool-2.50.tar.bz2/iidc/iidc.h -> dimm_tool-2.51.tar.bz2/iidc/iidc.h
Changed
@@ -304,9 +304,10 @@ const Format7Info getFormat7Info(); void setFormat7ImageROI( unsigned int x, unsigned int y, unsigned int w, unsigned int h ); - void setFormat7ImageSize( unsigned int w, unsigned int h ); - void setFormat7ImagePos( unsigned int x, unsigned int y ); void setFormat7ColorCoding( ColorCoding c ); + + std::pair<unsigned int, unsigned int> getFormat7ImageSize(); + std::pair<unsigned int, unsigned int> getFormat7ImagePosition(); /* capture */ void stopCapture();
View file
dimm_tool-2.51.tar.bz2/infras
Added
+(directory)
View file
dimm_tool-2.50.tar.bz2/modes.cpp -> dimm_tool-2.51.tar.bz2/modes.cpp
Changed
@@ -94,7 +94,8 @@ int nframe = (int)rint( accumtime*cam->effFPS(camera)); cent_win &= cam->ccdFormat(); // Limit window by CCD format Record camrec( cam, cent_win ); // Window against CCD - win<int> cent_image = cent_win - cent_win.beg(); // Window against image + win<int> real_cent_win = camrec.getROI(); + win<int> cent_image = real_cent_win - real_cent_win.beg(); // Window against image double acquis_end = utc.currentSec() + accumtime - 0.001*camera.exposure; for( nframe = 0; utc.currentSec() < acquis_end && !timer.out() && !break_mode ; nframe++ ) { @@ -114,7 +115,7 @@ if( !(L_spots.size() && R_spots.size()) ) throw ErrFat ( ERR_CENT_EMPTY, "No two star images" ); L_star = Stat::average( L_spots ); R_star = Stat::average( R_spots ); - common = L_star.pos() + cent_win.beg(); // Transformation to CCD coordinates + common = L_star.pos() + real_cent_win.beg(); // Transformation to CCD coordinates differ = R_star.pos(); check(); out->centResult( subs_center, bias, fluxes(), offset(), separation() ); @@ -188,6 +189,7 @@ if( common.distance(focal.optic_axis) > focal.field - focal.separation ) throw ErrFat ( ERR_NORM_SHIF, "Images are very far from center" ); if( common.distance(focal.optic_axis) > 0.5*focal.field ) ErrlogSingl::instance().warning( "Images are far from center", focal.field ); Record camrec( cam, wbox ); + win<int> real_wbox = camrec.getROI(); int fskipped = 0; for( nframe = 0; utc.currentSec() < acquis_end && !timer.out(); nframe++ ) { image = camrec.getFrame(); @@ -214,7 +216,7 @@ if( submode == 1 ) out->rawData( nframe, L_current, R_current ); R_current.set( R_current.pos() - L_current.pos() ); L_current.set( L_current.pos() + R_current.pos()/2.0 ); - L_current.set( L_current.pos() + wbox.beg() ); // ROI transformation to CCD coordinates + L_current.set( L_current.pos() + real_wbox.beg() ); // ROI transformation to CCD coordinates if( !bound_alert ) { // If no problems add to vector L_spots.push_back(L_current); R_spots.push_back(R_current); @@ -280,21 +282,22 @@ int separation_x = (int)separation().x(); int H_size = box_yside + separation_x/2; win<int> ccd_box( -H_size+V_size, -V_size, H_size-V_size, V_size ); // üÔÏ ÏËÎÏ × ËÏÏÒÄÉÎÁÔÁÈ ÍÁÔÒÉÃÙ - int frame = ccd_box.xdim()*ccd_box.ydim(); - double acquis_end = utc.currentSec() + accumtime; win<int> wbox = ccd_box + common; - unsigned short* record = new unsigned short 2*nframe*ccd_box.xdim()*ccd_box.ydim(); - unsigned short* pos = record; Record camrec( cam, wbox ); + win<int> real_wbox = camrec.getROI(); + int frame = real_wbox.xdim()*real_wbox.ydim(); + double acquis_end = utc.currentSec() + accumtime; + unsigned short* record = new unsigned short 2*nframe*frame; + unsigned short* pos = record; for( nframe = 0; utc.currentSec() < acquis_end && !timer.out(); nframe++ ) { image = camrec.getFrame(); // ëÁÄÒ ÚÁÐÉÓÙ×ÁÅÔÓÑ × ÌÀÂÏÍ ÌÕÞÁÅ memcpy( pos, image.start, sizeof(unsigned short)*frame ); pos += frame; } - Sframe film = Sframe( record, ccd_box.xdim(), nframe*ccd_box.ydim() ); + Sframe film = Sframe( record, real_wbox.xdim(), nframe*real_wbox.ydim() ); out->writeFrame( &film, program_img + "boxrecord.fits" ); // æÕÎËÃÉÑ ×Ù×ÏÄÁ ÒÅÚÕÌØÔÁÔÏ× - out->recordResult( name, nframe, wbox, program_img + "boxrecord.fits" ); + out->recordResult( name, nframe, real_wbox, program_img + "boxrecord.fits" ); delete record; } @@ -317,9 +320,10 @@ while( (levs.y() < lflux || levs.y() > uflux) && nframe-- > 0 && !timer.out() && !break_mode ) { cam->setParameters( camera ); Record camrec( cam, ccd ); // 120 ms needed ? + win<int> real_ccd = camrec.getROI(); image = camrec.getFrame(); - levs = Stat::black_white( &image, ccd ); - if( levs.y() > lflux && levs.y() < uflux && Proc::aperture_find( &image, ccd, levs, threshold, common, differ, radius ) > 0 ){ + levs = Stat::black_white(&image, real_ccd); + if( levs.y() > lflux && levs.y() < uflux && Proc::aperture_find( &image, levs, threshold, common, differ, radius ) > 0 ){ out->writeFrame( &image, program_img + "fieldtest.fits" ); } else { camera.exposure *= rint(2*(lflux+uflux)/(levs.y()-levs.x()))/4; @@ -337,14 +341,16 @@ point<int> oax = common; // Inside aperture only point<int> rap = radius/2; win<int> aper_box( oax - rap, oax + rap ); + cam->setROI(aper_box); + win<int> real_aper_box = cam->getROI(); std::vector< win<int> > ovl; - ovl.push_back(aper_box-aper_box.beg()); + ovl.push_back(real_aper_box - real_aper_box.beg()); std::vector< point<double> > data; std::vector< point<double> > vars; while( camera.exposure > 0.1 && !timer.out() && !break_mode ) { double nf = ceil(log( 2.0*optimal_expos/camera.exposure)+0.5); cam->setParameters( camera ); - Record camrec( cam, aper_box ); + Record camrec(cam, real_aper_box); point<double> difs; point<double> levs1; point<double> levs2;
View file
dimm_tool-2.51.tar.bz2/server
Added
+(directory)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.