LAN_rhk_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 __LAN_RHK_HWI_H
00029 #define __LAN_RHK_HWI_H
00030 
00031 
00032 /*
00033  * general hardware abstraction class for interfacing with an external socket program
00034  * =================================================================
00035  */
00036 class LAN_rhk_hwi_dev : public XSM_Hardware {
00037 public:
00038         LAN_rhk_hwi_dev();
00039         virtual ~LAN_rhk_hwi_dev();
00040 
00041         int SendCommand(char *);
00042         int ReceiveData(char *, int n);
00043         virtual void StoreParameter(void){;};
00044         virtual void RestoreParameter(void){;};
00045         virtual void ExecCmd(int Cmd);
00046         virtual int  WaitExec(int data);
00047 
00048         /* Parameter  */
00049         virtual long GetMaxPointsPerLine(){ return max_points_per_line; };
00050         virtual long GetMaxLines(){ return -1L; };   // no limit here
00051         virtual long GetMaxChannels(){ return 1L; }; // not used
00052 
00053         virtual void SetParameter(PARAMETER_SET &hps, int scanflg=FALSE);
00054         virtual void GetParameter(PARAMETER_SET &hps);
00055         virtual size_t ReadData(void *buf, size_t count);
00056         virtual int ReadScanData(int y_index, int num_srcs, Mem2d *m[MAX_SRCS_CHANNELS]);
00057         virtual int ReadProbeData(int nsrcs, int nprobe, int kx, int ky,
00058                                   Mem2d *m, double scale=1.);
00059         virtual gchar* get_info();
00060 
00061 protected:
00062         int ScanningFlg;
00063         int KillFlg;
00064         // add data shared w upper spm class here
00065 
00066 private:
00067         int max_points_per_line;
00068         int socket_descriptor;
00069 };
00070 
00071 
00072 /*
00073  * SPM hardware abstraction class for use with RHK compatible hardware through an external socket program
00074  * ======================================================================
00075  */
00076 class LAN_rhk_hwi_spm : public LAN_rhk_hwi_dev{
00077 public:
00078         LAN_rhk_hwi_spm();
00079         virtual ~LAN_rhk_hwi_spm();
00080         virtual void PutParameter(void *src, int grp);
00081         virtual void ExecCmd(int Cmd);
00082         virtual void SetDxDy(int dx, int dy);
00083         virtual void SetOffset(long x, long y);
00084         virtual void SetNx(long nx);
00085         virtual void SetAlpha(double alpha);
00086 
00087         virtual void MovetoX(long x);
00088         virtual void MovetoY(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         SCAN_DATA ScanData;
00099 //      DSP_Param dspPar;
00100 //      Scan_Param scanPar;
00101 };
00102 
00103 
00104 #endif
00105 

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