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 #include "instrument.h" 00029 00030 /* XSM Geräte Definitions */ 00031 00032 XSM_Instrument::XSM_Instrument(XSMRESOURCES &xsmres){ 00033 DigRangeIn = (long)xsmres.DigRangeIn; 00034 AnalogVMaxIn = xsmres.AnalogVMaxIn; 00035 DigRangeOut = (long)xsmres.DigRangeOut; 00036 AnalogVMaxOut = xsmres.AnalogVMaxOut; 00037 00038 for( int i=0; i<GAIN_POSITIONS; ++i) 00039 VList[i] = xsmres.V[i]; 00040 00041 Vx0 = Vx = VList[xsmres.VXdefault]; 00042 Vy0 = Vy = VList[xsmres.VYdefault]; 00043 Vz0 = Vz = VList[xsmres.VZdefault]; 00044 00045 offset_mode = xsmres.AnalogOffsetAdding ? OFM_ANALOG_OFFSET_ADDING : OFM_DSP_OFFSET_ADDING; 00046 00047 if (OffsetMode () == OFM_ANALOG_OFFSET_ADDING){ 00048 Vx0 = VList[xsmres.VX0default]; 00049 Vy0 = VList[xsmres.VY0default]; 00050 Vz0 = VList[xsmres.VZ0default]; 00051 } 00052 00053 xPsens = xsmres.XPiezoAV; 00054 yPsens = xsmres.YPiezoAV; 00055 zPsens = xsmres.ZPiezoAV; 00056 00057 xR = AnalogVMaxOut*xPsens; 00058 yR = AnalogVMaxOut*yPsens; 00059 zR = AnalogVMaxOut*zPsens; 00060 00061 xd = xR/(double)DigRangeOut; 00062 yd = yR/(double)DigRangeOut; 00063 zd = zR/(double)DigRangeOut; 00064 BiasGain = (double)xsmres.BiasGain; 00065 nAmpere2Volt = (double)xsmres.nAmpere2Volt; 00066 nNewton2Volt = (double)xsmres.nNewton2Volt; 00067 dHertz2Volt = (double)xsmres.dHertz2Volt; 00068 eV2Volt = (double)xsmres.EnergyCalibVeV; 00069 00070 type=NULL; 00071 name=NULL; 00072 xunitname=NULL; 00073 yunitname=NULL; 00074 zunitname=NULL; 00075 } 00076 00077 OFFSET_MODE XSM_Instrument::OffsetMode (OFFSET_MODE ofm){ 00078 return offset_mode; 00079 } 00080 00081 SPALEED_Instrument::SPALEED_Instrument(XSMRESOURCES &xsmres, double *E, double *Gt, long *M) : XSM_Instrument(xsmres){ 00082 type = g_strdup("SPALEED"); 00083 xunitname = g_strdup("V"); 00084 yunitname = g_strdup("V"); 00085 zunitname = g_strdup("Cps"); 00086 BZu = new BZUnit("%BZ","%BZ", xsmres.Sensitivity, 1.); 00087 Su = new SUnit("S","S", xsmres.SampleLayerDist, xsmres.ThetaChGunInt); 00088 En = E; // Pointer to actual Energy 00089 Gate = Gt; // Pointer to actual GateTime 00090 Mode = M; // Pointer to actual mapping mode BZ/Volt 00091 00092 xPsens = xsmres.XCalibVA; 00093 yPsens = xsmres.YCalibVA; 00094 00095 xR = AnalogVMaxOut*xPsens; 00096 yR = AnalogVMaxOut*yPsens; 00097 00098 xd = xR/(double)DigRangeOut; 00099 yd = yR/(double)DigRangeOut; 00100 00101 } 00102