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 __XSM_H 00029 #define __XSM_H 00030 00031 // "C++" headers 00032 #include <iostream> 00033 #include <fstream> 00034 00035 // "C" headers 00036 #include <cstdio> 00037 #include <cstdlib> 00038 #include <cmath> 00039 #include <cstring> 00040 00041 // system headers 00042 #include <unistd.h> 00043 00044 // Gxsm headers 00045 #ifndef __INSTRUMENT_H 00046 #include "instrument.h" 00047 #endif 00048 00049 #ifndef __XSMHARD_H 00050 #include "xsmhard.h" 00051 #endif 00052 00053 #ifndef __XSMTYPES_H 00054 #include "xsmtypes.h" 00055 #endif 00056 00057 #ifndef __UNIT_H 00058 #include "unit.h" 00059 #endif 00060 00061 #ifndef __LIMITS_H 00062 #include "limits.h" 00063 #endif 00064 00065 class gxsm_hwi_plugins; 00066 class App; 00067 00068 class Xsm{ 00069 public: 00070 Xsm (); 00071 virtual ~Xsm (); 00072 00073 double XStepMin(){ return Inst->XResolution(); }; 00074 double XStepMax(){ return Inst->XRangeMax()/50.; }; 00075 double YStepMin(){ return Inst->YResolution(); }; 00076 double YStepMax(){ return Inst->YRangeMax()/50.; }; 00077 00078 double XMinPoints(){ return 1.; }; 00079 double XMaxPoints(){ return hardware->GetMaxPointsPerLine(); }; 00080 double YMinPoints(){ return 1.; }; 00081 double YMaxPoints(){ return MAXDATALINES; }; 00082 00083 double MaxValues(){ return MAXVALUES; }; 00084 00085 double XRangeMin(){ return Inst->XResolution(); }; 00086 double XRangeMax(){ return Inst->XScanRangeMax(); }; 00087 double YRangeMin(){ return Inst->YResolution(); }; 00088 double YRangeMax(){ return Inst->YScanRangeMax(); }; 00089 00090 double XOffsetMin(){ return -Inst->X0RangeMax(); }; 00091 double XOffsetMax(){ return +Inst->X0RangeMax(); }; 00092 double YOffsetMin(){ return -Inst->Y0RangeMax(); }; 00093 double YOffsetMax(){ return +Inst->Y0RangeMax(); }; 00094 00095 UnitObj *MakeUnit(const gchar *alias, const gchar *label); 00096 00097 void SetModeFlg(long m){ ModeFlg = m | (ModeFlg&~m); UpdateUnits(); }; 00098 void UpdateUnits(); 00099 void ClrModeFlg(long m){ ModeFlg = (ModeFlg&~m); }; 00100 gboolean IsMode(long m){ return(ModeFlg&m); }; 00101 long MausMode(long m=0){ if(m) MausModeFlg=m; return(MausModeFlg); }; 00102 00103 void reload_hardware_interface (App *app); 00104 00105 static gint HwI_Plugin_Check (const gchar *category); 00106 XSM_Hardware *HwI_Plugin_Load (App* app); 00107 gxsm_hwi_plugins *HwI_plugins; /* GXSM Hardware Interface Plugin */ 00108 00109 XSM_Instrument *Inst; /* XSM Instrument - Gerätedaten */ 00110 XSM_Hardware *hardware; /* Universellen Hardware-Objekt */ 00111 00112 SCAN_DATA data; /* Daten zum verändern */ 00113 00114 UnitObj *Unity; 00115 UnitObj *LenUnit; 00116 UnitObj *LenUnitZ; 00117 00118 UnitObj *ArcUnit; 00119 UnitObj *HzUnit; 00120 UnitObj *RadUnit; 00121 UnitObj *VoltUnit; 00122 UnitObj *BZSymUnit; 00123 UnitObj *TimeUnitms; 00124 UnitObj *TimeUnit; 00125 UnitObj *EnergyUnit; 00126 CPSCNTUnit *CPSUnit; 00127 CPSCNTUnit *CPSHiLoUnit; 00128 BZUnit *BZ_Unit; 00129 SUnit *YSUnit; 00130 UnitObj *CurrentUnit; 00131 00132 UnitsTable *AktUnit; 00133 UnitObj *X_Unit; 00134 UnitObj *Y_Unit; 00135 UnitObj *Z_Unit; 00136 00137 int counter; /* File Counter */ 00138 int subcounter; /* second File Counter for enumerating autosaves */ 00139 00140 double mradius; // radius for 2D convolution kernels 00141 00142 long MausModeFlg; 00143 long ModeFlg; 00144 long ZoomFlg; 00145 00146 private: 00147 00148 }; 00149 00150 #endif