DSPPeakFind.C

Go to the documentation of this file.
00001 /* Gnome gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Gxsm Plugin Name: DSPPeakFind.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
00034  * --------------------------------------------------------------------------------
00035 % BeginPlugInDocuSection
00036 % PlugInDocuCaption: SPA--LEED peak finder and monitor (OBSOLETE)
00037 % PlugInName: DSPPeakFind
00038 % PlugInAuthor: Percy Zahl
00039 % PlugInAuthorEmail: zahl@users.sf.net
00040 % PlugInMenuPath: Windows/DSP PeakFind
00041 
00042 % PlugInDescription
00043  For SPA--LEED users Gxsm offers a peak intensity monitor and peak
00044  finder to follow a shifting peak. It is designed for both: Focus
00045  adjustment and peak intensity monitoring. It can handle a unlimited
00046  number of peaks simultaneous.
00047 
00048 
00049 % PlugInUsage
00050  Open \GxsmMenu{Windows/DSP PeakFind}.
00051 
00052 % OptPlugInConfig
00053  Lots of controls\dots Since I do not know about other SPA--LEED users I'll
00054  not spend more time here!
00055 
00056 %% OptPlugInFiles
00057 %Does it uses, needs, creates any files? Put info here!
00058 
00059 %% OptPlugInRefs
00060 %Any references?
00061 
00062 % OptPlugInKnownBugs
00063  The long term peak intensity monitor is unstable and beta. I need more
00064  feedback from SPA--LEED users\dots
00065 
00066 % OptPlugInNotes
00067  This code is still beta and was not tested for a long time with newer
00068  Gxsm version, except in simulation mode. There is a SPA--LEED
00069  simulator kernel module:\\
00070  \GxsmFile{Gxsm/plug-ins/hard/modules/dspspaemu.o}
00071 
00072 
00073 % OptPlugInHints
00074  Set the X/Y sign checkbox correct if the finder corrects in the wrong direction.
00075 
00076 % EndPlugInDocuSection
00077  * -------------------------------------------------------------------------------- 
00078  */
00079 
00080 
00081 #include "app_peakfind.h"
00082 
00083 static void DSPPeakFind_about( void );
00084 static void DSPPeakFind_query( void );
00085 static void DSPPeakFind_cleanup( void );
00086 
00087 static void DSPPeakFind_show_callback( GtkWidget*, void* );
00088 
00089 GxsmPlugin DSPPeakFind_pi = {
00090                 NULL,
00091                 NULL,
00092                 0,
00093                 NULL,
00094                 "DSPPeakFind",
00095                 "+spaHARD +SPALEED",
00096                 NULL,
00097                 "Percy Zahl",
00098                 N_("_Windows/"),
00099                 N_("DSP PeakFind"),
00100                 N_("open the DSP Peak Finder controlwindow"),
00101                 "DSP peak find control",
00102                 NULL,
00103                 NULL,
00104                 NULL,
00105                 DSPPeakFind_query,
00106                 DSPPeakFind_about,
00107                 NULL,
00108                 NULL,
00109                 DSPPeakFind_cleanup
00110 };
00111 
00112 static const char *about_text = N_("Gxsm DSPPeakFind Plugin:\n"
00113                                                                    "This plugin runs a controls window to send "
00114                                                                    "general \"PeakFind-Requests\" to the DSP. "
00115                                                                    "PeakFindmodes are used to follow and monitor"
00116                                                                    "Peakintensities by SPA-LEED."
00117                 );
00118 
00119 GxsmPlugin *get_gxsm_plugin_info ( void ){ 
00120                 DSPPeakFind_pi.description = g_strdup_printf(N_("Gxsm DSPPeakFind plugin %s"), VERSION);
00121                 return &DSPPeakFind_pi; 
00122 }
00123 
00124 DSPPeakFindControl *DSPPeakFindClass = NULL;
00125 
00126 GSList *DSPPF_RemoteActionList = NULL;
00127 // of remote_action_cb->{cmd, RemoteCb, widget, data}
00128 
00129 
00130 static void DSPPeakFind_query(void)
00131 {
00132                 static GnomeUIInfo menuinfo[] = { 
00133                                 { GNOME_APP_UI_ITEM, 
00134                                   DSPPeakFind_pi.menuentry, DSPPeakFind_pi.help,
00135                                   (gpointer) DSPPeakFind_show_callback, NULL,
00136                                   NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BLANK, 
00137                                   0, GDK_CONTROL_MASK, NULL },
00138 
00139                                 GNOMEUIINFO_END
00140                 };
00141 
00142                 PI_DEBUG (DBG_L2, "Query: Insert Menu Entry" );
00143 
00144                 gnome_app_insert_menus(GNOME_APP(DSPPeakFind_pi.app->getApp()), 
00145                                                            DSPPeakFind_pi.menupath, menuinfo);
00146 
00147                 // new ...
00148   
00149                 PI_DEBUG (DBG_L2, "Query: Create PF Control Class " );
00150 
00151                 DSPPeakFindClass = new DSPPeakFindControl
00152                                 ( DSPPeakFind_pi.app->xsm->hardware,
00153                                   & DSPPeakFind_pi.app->RemoteEntryList
00154                                                 );
00155 
00156                 DSPPeakFindClass->SetResName ("WindowPeakFindControl", "false", xsmres.geomsave);
00157 
00158                 //  DSPPeakFind_pi.app->ConnectPluginToStartScanEvent
00159                 //    ( DSPPeakFind_StartScan_callback );
00160 
00161                 if(DSPPeakFind_pi.status) g_free(DSPPeakFind_pi.status); 
00162                 DSPPeakFind_pi.status = g_strconcat(N_("Plugin query has attached "),
00163                                                                                         DSPPeakFind_pi.name, 
00164                                                                                         N_(": DSPPeakFind is created."),
00165                                                                                         NULL);
00166 }
00167 
00168 static void DSPPeakFind_about(void)
00169 {
00170                 const gchar *authors[] = { "Percy Zahl", NULL};
00171                 gtk_widget_show(gnome_about_new ( DSPPeakFind_pi.name,
00172                                                                                   VERSION,
00173                                                                                   N_("(C) 2000 the Free Software Foundation"),
00174                                                                                   about_text,
00175                                                                                   authors,
00176                                                                                   NULL, NULL, NULL
00177                                                                 ));
00178 }
00179 
00180 // of remote_action_cb->{cmd, RemoteCb, widget, data}
00181 static void remove_from_gapp_ralist(remote_action_cb* ra, gpointer data){
00182                 PI_DEBUG (DBG_L2, "Remove_Remote List" );
00183                 gapp->RemoteActionList = g_slist_remove 
00184                                 (gapp->RemoteActionList, ra);
00185                 g_free(ra->cmd);
00186                 g_free(ra);
00187 }
00188 
00189 static void DSPPeakFind_cleanup( void ){
00190                 PI_DEBUG (DBG_L2, "Cleanup: removing MenuEntry" );
00191 
00192                 gchar *mp = g_strconcat(DSPPeakFind_pi.menupath, DSPPeakFind_pi.menuentry, NULL);
00193                 gnome_app_remove_menus (GNOME_APP( DSPPeakFind_pi.app->getApp() ), mp, 1);
00194                 g_free(mp);
00195 
00196                 PI_DEBUG (DBG_L2, "DSPPeakFind Plugin Cleanup: Window" );
00197 
00198                 // cleanup remote list entries from gapp
00199 
00200                 if(DSPPF_RemoteActionList){
00201                                 g_slist_foreach(DSPPF_RemoteActionList, (GFunc) remove_from_gapp_ralist, NULL);
00202                                 g_slist_free(DSPPF_RemoteActionList);
00203                 }
00204 
00205                 //  delete ...
00206                 if( DSPPeakFindClass )
00207                                 delete DSPPeakFindClass ;
00208 
00209                 DSPPeakFindClass = NULL;
00210                 PI_DEBUG (DBG_L2, "DSPPeakFind Plugin Cleanup: done." );
00211 }
00212 
00213 static void DSPPeakFind_show_callback( GtkWidget* widget, void* data){
00214                 if( DSPPeakFindClass )
00215                                 DSPPeakFindClass->show();
00216 }

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