00001 /* Gnome gxsm - Gnome X Scanning Microscopy 00002 * universal STM/AFM/SARLS/SPALEED/... controlling and 00003 * data analysis software 00004 * 00005 * Gxsm Hardware Interface Plugin Name: innovative_dsp_hwi.C 00006 * =============================================== 00007 * 00008 * Copyright (C) 1999 The Free Software Foundation 00009 * 00010 * Authors: Percy Zahl <zahl@fkp.uni-hannover.de> 00011 * additional features: Andreas Klust <klust@fkp.uni-hannover.de> 00012 * 00013 * This program is free software; you can redistribute it and/or modify 00014 * it under the terms of the GNU General Public License as published by 00015 * the Free Software Foundation; either version 2 of the License, or 00016 * (at your option) any later version. 00017 * 00018 * This program is distributed in the hope that it will be useful, 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 * GNU General Public License for more details. 00022 * 00023 * You should have received a copy of the GNU General Public License 00024 * along with this program; if not, write to the Free Software 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. 00026 */ 00027 00028 00029 /* Please do not change the Begin/End lines of this comment section! 00030 * this is a LaTeX style section used for auto generation of the PlugIn Manual 00031 * Chapter. Add a complete PlugIn documentation inbetween the Begin/End marks! 00032 * All "% PlugInXXX" commentary tags are mandatory 00033 * All "% OptPlugInXXX" tags are optional and can be removed or commented in 00034 * -------------------------------------------------------------------------------- 00035 % BeginPlugInDocuSection 00036 % PlugInDocuCaption: Innovative DSP Hardware Interface for PC31 and PCI32 (OBSOLETE or to be ported) 00037 % PlugInName: innovative_dsp_hwi 00038 % PlugInAuthor: Percy Zahl 00039 % PlugInAuthorEmail: zahl@users.sf.net 00040 % PlugInMenuPath: Hardware/Innovative_DSP:SPM:SPA-HwI 00041 00042 % PlugInDescription 00043 This provides the Innovative DSP hardware interface for GXSM. 00044 Supported are PC31 and PCI32. 00045 00046 % PlugInUsage 00047 Set the \GxsmPref{Hardware}{Card} to ''Innovative\_Dsp:SPM'' or 00048 ''Innovative\_Dsp::SPA''. 00049 00050 %% OptPlugInSources 00051 00052 %% OptPlugInDest 00053 00054 % OptPlugInNote 00055 This is an experimental code since GXSM2 and HwI. Use GXSM-1 (''Gxsm'' 00056 CVS branch) for a stable version. 00057 00058 % EndPlugInDocuSection 00059 * -------------------------------------------------------------------------------- 00060 */ 00061 00062 #include <sys/ioctl.h> 00063 00064 #include "config.h" 00065 #include "gxsm/plugin.h" 00066 #include "gxsm/xsmhard.h" 00067 00068 // Define HwI PlugIn reference name here, this is what is listed later within "Preferenced Dialog" 00069 // i.e. the string selected for "Hardware/Card"! 00070 00071 #define THIS_HWI_PLUGIN_NAME "Innovative_DSP:SPM:SPA" 00072 00073 // Plugin Prototypes 00074 static void innovative_dsp_hwi_init( void ); 00075 static void innovative_dsp_hwi_about( void ); 00076 static void innovative_dsp_hwi_configure( void ); 00077 static void innovative_dsp_hwi_cleanup( void ); 00078 00079 // Fill in the GxsmPlugin Description here 00080 GxsmPlugin innovative_dsp_hwi_pi = { 00081 NULL, // filled in and used by Gxsm, don't touch ! 00082 NULL, // filled in and used by Gxsm, don't touch ! 00083 0, // filled in and used by Gxsm, don't touch ! 00084 NULL, // The Gxsm-App Class Ref.pointer (called "gapp" in Gxsm) is 00085 // filled in here by Gxsm on Plugin load, 00086 // just after init() is called !!! 00087 // ---------------------------------------------------------------------- 00088 // Plugins Name, CodeStly is like: Name-M1S|M2S-BG|F1D|F2D|ST|TR|Misc 00089 "innovative_dsp_hwi-" 00090 "HW-INT-1S-SHORT", 00091 // Plugin's Category - used to autodecide on Pluginloading or ignoring 00092 // In this case of Hardware-Interface-Plugin here is the interface-name required 00093 // this is the string selected for "Hardware/Card"! 00094 THIS_HWI_PLUGIN_NAME, 00095 // Description, is shown by PluginViewer (Plugin: listplugin, Tools->Plugin Details) 00096 "Innovative_Dsp hardware interface.", 00097 // Author(s) 00098 "Percy Zahl", 00099 // Menupath to position where it is appendet to -- not used by HwI PIs 00100 N_("Hardware/"), 00101 // Menuentry -- not used by HwI PIs 00102 N_(THIS_HWI_PLUGIN_NAME"-HwI"), 00103 // help text shown on menu 00104 N_("This is the "THIS_HWI_PLUGIN_NAME" - GXSM Hardware Interface."), 00105 // more info... 00106 "N/A", 00107 NULL, // error msg, plugin may put error status msg here later 00108 NULL, // Plugin Status, managed by Gxsm, plugin may manipulate it too 00109 // init-function pointer, can be "NULL", 00110 // called if present at plugin load 00111 innovative_dsp_hwi_init, 00112 // query-function pointer, can be "NULL", 00113 // called if present after plugin init to let plugin manage it install itself 00114 NULL, // query should be "NULL" for Gxsm-Math-Plugin !!! 00115 // about-function, can be "NULL" 00116 // can be called by "Plugin Details" 00117 innovative_dsp_hwi_about, 00118 // configure-function, can be "NULL" 00119 // can be called by "Plugin Details" 00120 innovative_dsp_hwi_configure, 00121 // run-function, can be "NULL", if non-Zero and no query defined, 00122 // it is called on menupath->"plugin" 00123 NULL, // run should be "NULL" for Gxsm-Math-Plugin !!! 00124 // cleanup-function, can be "NULL" 00125 // called if present at plugin removeal 00126 innovative_dsp_hwi_cleanup 00127 }; 00128 00129 00130 // Text used in Aboutbox, please update!! 00131 static const char *about_text = N_("GXSM innovative_dsp_hwi Plugin\n\n" 00132 "Innovative_Dsp Hardware Interface for SPM and SPA-LEED."); 00133 00134 /* Here we go... */ 00135 00136 #include "innovative_dsp_hwi.h" 00137 00138 /* 00139 * PI global 00140 */ 00141 00142 innovative_dsp_hwi_dev *innovative_dsp_hwi_hardware = NULL; 00143 00144 /* 00145 * PI essential members 00146 */ 00147 00148 // Symbol "get_gxsm_plugin_info" is resolved by dlsym from Gxsm, used to get Plugin's info!! 00149 // Essential Plugin Function!! 00150 GxsmPlugin *get_gxsm_plugin_info ( void ){ 00151 innovative_dsp_hwi_pi.description = g_strdup_printf(N_("GXSM HwI innovative_dsp_hwi plugin %s"), VERSION); 00152 return &innovative_dsp_hwi_pi; 00153 } 00154 00155 // Symbol "get_gxsm_hwi_hardware_class" is resolved by dlsym from Gxsm for all HwI type PIs, 00156 // Essential Plugin Function!! 00157 XSM_Hardware *get_gxsm_hwi_hardware_class ( void *data ) { 00158 00159 // THIS_HWI_PLUGIN_NAME is "Innovative_DSP:SPM:SPA" 00160 00161 if ( !strcmp ((char*)data, "Innovative_DSP:SPM") ) 00162 return (innovative_dsp_hwi_hardware = new innovative_dsp_hwi_spm ()); 00163 00164 if ( !strcmp ((char*)data, "Innovative_DSP:SPA") ) 00165 return (innovative_dsp_hwi_hardware = new innovative_dsp_hwi_spa ()); 00166 00167 return NULL; 00168 } 00169 00170 // init-Function 00171 static void innovative_dsp_hwi_init(void) 00172 { 00173 PI_DEBUG (DBG_L2, "innovative_dsp_hwi Plugin Init"); 00174 innovative_dsp_hwi_hardware = NULL; // not yet selected interface type 00175 } 00176 00177 // about-Function 00178 static void innovative_dsp_hwi_about(void) 00179 { 00180 const gchar *authors[] = { innovative_dsp_hwi_pi.authors, NULL}; 00181 gtk_widget_show(gnome_about_new ( innovative_dsp_hwi_pi.name, 00182 VERSION, 00183 N_("(C) 2000 the Free Software Foundation"), 00184 about_text, 00185 authors, 00186 NULL, NULL, NULL 00187 )); 00188 } 00189 00190 // configure-Function 00191 static void innovative_dsp_hwi_configure(void) 00192 { 00193 if(innovative_dsp_hwi_pi.app) 00194 innovative_dsp_hwi_pi.app->message("innovative_dsp_hwi Plugin Configuration"); 00195 } 00196 00197 // cleanup-Function 00198 static void innovative_dsp_hwi_cleanup(void) 00199 { 00200 PI_DEBUG (DBG_L2, "innovative_dsp_hwi Plugin Cleanup"); 00201 delete innovative_dsp_hwi_hardware; 00202 innovative_dsp_hwi_hardware = NULL; 00203 } 00204