repair_cs.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: repair_cs.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 /* Please do not change the Begin/End lines of this comment section!
00029  * this is a LaTeX style section used for auto generation of the PlugIn Manual 
00030  * Chapter. Add a complete PlugIn documentation inbetween the Begin/End marks!
00031  * All "% PlugInXXX" commentary tags are mandatory
00032  * All "% OptPlugInXXX" tags are optional
00033  * --------------------------------------------------------------------------------
00034 % BeginPlugInDocuSection
00035 % PlugInDocuCaption: Repair filter
00036 % PlugInName: repair_cs
00037 % PlugInAuthor: Percy Zahl
00038 % PlugInAuthorEmail: zahl@users.sf.net
00039 % PlugInMenuPath: Math/Filter 1D/Repair
00040 
00041 % PlugInDescription
00042 This filter is obsolete for all Gxsm only users. It just fixes a
00043 high/low words order bug -- occured while data transport from DSP to
00044 host -- in line data, e.g. data points on columns $X_2n$ and
00045 $X_{2n+1}$ are swapped, which happened in one special old version of
00046 Xxsm (the predictor of Gxsm). It's here, because the original old data
00047 are backed up and may be needed to be processed with this filter to
00048 fix.
00049 
00050 % PlugInUsage
00051 Call \GxsmMenu{Math/Filter 1D/Repair} to execute.
00052 
00053 % OptPlugInSources
00054 The active channel is used as data source.
00055 
00056 % OptPlugInDest
00057 The computation result is placed into an existing math channel, else into a new created math channel.
00058 
00059 %% OptPlugInNotes
00060 %If you have any additional notes
00061 
00062 % EndPlugInDocuSection
00063  * -------------------------------------------------------------------------------- 
00064  */
00065 
00066 #include <gtk/gtk.h>
00067 #include "config.h"
00068 #include "gxsm/plugin.h"
00069 
00070 static void repair_cs_init( void );
00071 static void repair_cs_about( void );
00072 static void repair_cs_configure( void );
00073 static void repair_cs_cleanup( void );
00074 static gboolean repair_cs_run( Scan *Src, Scan *Dest );
00075 
00076 GxsmPlugin repair_cs_pi = {
00077   NULL,
00078   NULL,
00079   0,
00080   NULL,
00081   "Repair_Cs-M1S-F1D",
00082   "+noHARD +STM",
00083   NULL,
00084   "Percy Zahl",
00085   "_Math/Filter _1D/",
00086   N_("Repair"),
00087   N_("Fix buggy Scans (from special xxsm version): do column swap"),
00088   "no more info",
00089   NULL,
00090   NULL,
00091   repair_cs_init,
00092   NULL,
00093   repair_cs_about,
00094   repair_cs_configure,
00095   NULL,
00096   repair_cs_cleanup
00097 };
00098 
00099 GxsmMathOneSrcPlugin repair_cs_m1s_pi = {
00100   repair_cs_run
00101 };
00102 
00103 static const char *about_text = N_("Gxsm Repair_Cs Plugin\n\n"
00104                                    "Bug Fix for some old scans (Xxsm).");
00105 
00106 GxsmPlugin *get_gxsm_plugin_info ( void ){ 
00107   repair_cs_pi.description = g_strdup_printf(N_("Gxsm MathOneArg repair_cs plugin %s"), VERSION);
00108   return &repair_cs_pi; 
00109 }
00110 
00111 GxsmMathOneSrcPlugin *get_gxsm_math_one_src_plugin_info( void ) { 
00112   return &repair_cs_m1s_pi; 
00113 }
00114 
00115 static void repair_cs_init(void)
00116 {
00117   PI_DEBUG (DBG_L2, "Repair_Cs Plugin Init");
00118 }
00119 
00120 static void repair_cs_about(void)
00121 {
00122   const gchar *authors[] = { repair_cs_pi.authors, NULL};
00123   gtk_widget_show(gnome_about_new ( repair_cs_pi.name,
00124                                     VERSION,
00125                                     N_("(C) 2000 the Free Software Foundation"),
00126                                     about_text,
00127                                     authors,
00128                                     NULL, NULL, NULL
00129                                     ));
00130 }
00131 
00132 static void repair_cs_configure(void)
00133 {
00134   if(repair_cs_pi.app)
00135     repair_cs_pi.app->message("Repair_Cs Plugin Configuration");
00136 }
00137 
00138 static void repair_cs_cleanup(void)
00139 {
00140   PI_DEBUG (DBG_L2, "Repair_Cs Plugin Cleanup");
00141 }
00142 
00143 static gboolean repair_cs_run(Scan *Src, Scan *Dest)
00144 {
00145 // Column Swap
00146 // (was used to fix a bug in some early version of the DSP software)
00147   int col, line;
00148 
00149   for(line = 0; line < Src->mem2d->GetNy(); line++)
00150     for(col = 0; col < Src->mem2d->GetNx(); col++)
00151       Dest->mem2d->PutDataPkt(Src->mem2d->GetDataPkt(col^1, line), col, line);
00152   return MATH_OK;
00153 }

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