comedi_hwi.h

Go to the documentation of this file.
00001 /* Gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999,2000,2001,2002,2003 Percy Zahl
00006  *
00007  * Authors: Percy Zahl <zahl@users.sf.net>
00008  * additional features: Andreas Klust <klust@users.sf.net>
00009  * WWW Home: http://gxsm.sf.net
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025 
00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
00027 
00028 #ifndef __COMEDI_HWI_H
00029 #define __COMEDI_HWI_H
00030 
00031 /*
00032  * general hardware abstraction class for comedi compatible hardware
00033  * - instrument independent device support part
00034  * =================================================================
00035  */
00036 class comedi_hwi_dev : public XSM_Hardware{
00037 public: 
00038         comedi_hwi_dev();
00039         virtual ~comedi_hwi_dev();
00040 
00041         virtual void StoreParameter(void){;};
00042         virtual void RestoreParameter(void){;};
00043         virtual void ExecCmd(int Cmd);
00044         virtual int  WaitExec(int data);
00045 
00046         /* Parameter  */
00047         virtual long GetMaxPointsPerLine(){ return max_points_per_line; };
00048         virtual long GetMaxLines(){ return -1L; };   // no limit here
00049         virtual long GetMaxChannels(){ return 1L; }; // not used
00050 
00051         virtual void SetParameter(PARAMETER_SET &hps, int scanflg=FALSE);
00052         virtual void GetParameter(PARAMETER_SET &hps);
00053         virtual size_t ReadData(void *buf, size_t count);
00054         virtual int ReadScanData(int y_index, int num_srcs, Mem2d *m[MAX_SRCS_CHANNELS]);
00055         virtual int ReadProbeData(int nsrcs, int nprobe, int kx, int ky,
00056                                   Mem2d *m, double scale=1.);
00057         virtual gchar* get_info();
00058 
00059 protected:
00060         int ScanningFlg;
00061         int KillFlg;
00062         // add data shared w upper spm class here
00063 
00064 private:
00065         int max_points_per_line;
00066 
00067         // COMEDI_DEVICE_TYPE *comedi_drv;
00068         // add private data/var here!
00069 };
00070 
00071 
00072 /*
00073  * SPM hardware abstraction class for use with comedi compatible hardware
00074  * ======================================================================
00075  */
00076 class comedi_hwi_spm : public comedi_hwi_dev{
00077 public:
00078         comedi_hwi_spm();
00079         virtual ~comedi_hwi_spm();
00080 
00081         virtual void PutParameter(void *src, int grp=0);
00082 
00083         virtual void SetDxDy(int dx, int dy);
00084         virtual void SetOffset(long x, long y);
00085         virtual void SetNx(long nx);
00086         virtual void SetAlpha(double alpha);
00087 
00088         virtual void MovetoXY (long x,long y);
00089         virtual void StartScan2D();
00090         virtual void ScanLineM(int yindex, int xdir, int muxmode, 
00091                                Mem2d *Mob[MAX_SRCS_CHANNELS], int ix0=0 );
00092         virtual void EndScan2D();
00093         virtual void PauseScan2D();
00094         virtual void ResumeScan2D();
00095         virtual void KillScan2D(){ KillFlg=TRUE; };
00096 
00097 private:
00098         DSP_Param dspPar;
00099 };
00100 
00101 #endif
00102 

Generated on Sat Apr 1 09:04:15 2006 for GXSM by  doxygen 1.4.6