sranger_hwi.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 Hardware Interface Plugin Name: sranger_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: Signal Ranger Hardware Interface
00037 % PlugInName: sranger_hwi
00038 % PlugInAuthor: Percy Zahl
00039 % PlugInAuthorEmail: zahl@users.sf.net
00040 % PlugInMenuPath: Tools/SR-DSP ControL
00041 
00042 % PlugInDescription
00043 This provides the Signal Ranger-STD and -SP2 hardware interface (HwI)
00044 for GXSM.  It provided all hardware close and specific settings and
00045 controls for feedback, scanning, all kind of probing (spectroscopy and
00046 manipulations) and coase motion control including teh auto approach
00047 controller. Invisible for the user it interacts with the SRanger DSP,
00048 manages all DSP parameters and data streaming for scan and probe.
00049 
00050 
00051 
00052 %The \GxsmEntry{SR DSP Control} Dialog is divided into 6 sections.
00053 %1) Feedback & Scan: This folder contains all necessary options regarding feedback and scan.
00054 %2) Advanced: Different settings for advanced features of the Signal Ranger.
00055 %3) STS: Parameter for dI/dV spectroscopy can be defined here.
00056 %4) FZ: In this section information about force - distance curves can be set.
00057 %5) LM: For manipulation of x, y, or z use this dialog.
00058 %6) LockIn: This slice contains the parameter set for the build in LockIn.
00059 %7) Graphs: Choose sources and decide how to plot them.
00060 
00061 
00062 % OptPlugInSection: SR-DSP Feedback and Scan Control
00063 The Feedback \& Scan folder contains all necessary options regarding
00064 feedback and scan.  Here the feedback parameters and tunneling/force
00065 settings are adjusted. The second purpose of this control panel is the adjustment of
00066 all scan parameters of the digital vector scan generator like speed.
00067 
00068 \begin{figure}[hbt]
00069 \center { \fighalf{SR-DSP-Control-FB}\fighalf{SR-DSP-Control-Advanced} }
00070 \caption{GXSM SR DSP Control window, left: Feedback and Scan Control page, right: Advanced settings page}
00071 \label{fig:SR-DSP:FB:ADV}
00072 \end{figure}
00073 
00074 \begin{description}
00075 
00076 \item[Bias] Voltage that is applied to OUT6. Beware: The entered value
00077 will be divided by the \GxsmPref{InstSPM}{BiasGain} value. Without an
00078 additional amplification the \GxsmEntry{Instrument/BiasGain} value has
00079 to be set to 1.
00080 
00081 \item[Current(STM) / SetPoint(AFM)] Set point the DSP is trying to
00082 reach. For a correct conversion of Current / SetPoint to incoming
00083 voltages at IN5 the values of \GxsmPref{InstSPM}{nAmpere2Volt} and
00084 \GxsmPref{InstSPM}{nNewton2Volt} have to be set correctly.
00085 
00086 \item[CP, CI] Parameters for the feedback loop. CP is proportional to
00087 the difference between the set point and the current value at IN5. CI
00088 integrates this difference. Higher values for CP / CI mean a faster
00089 loop.
00090 
00091 \item[MoveSpd, ScanSpd] MoveSpd is valid for movements without taking
00092 data (e.g. change xy-offset or moving to the starting point of an area
00093 scan). ScanSpd is valid if the DSP is taking data.  PiezoDriveSetting:
00094 Usually a high voltage amplifier has different gains. A change of the
00095 gain can easily be mentioned in GXSM by activating the appropriate
00096 factor. A change of this values acts instantly. The available gain
00097 values can be defined in the \GxsmPref{InstSPM}{Analog/V1-V9}. After
00098 changing the preferences GXSM needs to be restarted to take
00099 effect. Remark: Piezo constants and other parameters have to be
00100 charged. Please use the \GxsmPref{InstSPM}{Instrument/PiezoAV} for
00101 this odd values.  
00102 \end{description}
00103 
00104 \GxsmHint{Good conservative start values for the feedback loop gains
00105 CP and CI are 0.01 for both. Typically they can be increased up to
00106 0.1, depending on the the system, tip and sample. In general CP can be
00107 about 150\% of CI to gain more stability with same CI. }
00108 
00109 
00110 % OptPlugInSection: Advanced Feedback and Probe Control
00111 
00112 Advanced is a collection of different settings, to handle the advanced
00113 capabilities of the Signal Ranger DSP. It is quite a mixture of
00114 different tools.
00115 
00116 \begin{description}
00117 \item[FB Switch] This option enables or disables the feedback
00118 loop. Disabling will keep the current Z-position.  
00119 
00120 \item[Automatic Raster Probe] In general spectra can easily be taken
00121 while doing an area scan. Activating this feature forces the DSP to
00122 take spectra every line with an intended misalignment. A value of 1
00123 means a spectrum will be taken every scan point. A value of 9 means a
00124 distance of 9 area scan points between two spectra. The driven
00125 spectrum depends on the probe control that is selected (STS, Z, PL).
00126 Single spectra of a Raster Probe Scan easily can be handled by using
00127 the \GxsmPopup{Events}{Show Probe} feature in the area plot. For a
00128 conversion into a layer based image please use the
00129 \GxsmMenu{Math/Probe/ImageExtract} plugin.
00130 
00131 \item[Show Exper Controls] This option hides or reveals some advanced options in
00132 different folders. In this help file controls will be mentioned as
00133 Expert Controls, if they are revealed by this option.  
00134 
00135 \item[DynZoom] With the Signal Ranger DSP it is possible to dynamical zoom
00136 while scanning.  
00137 
00138 \item[PrePts] Problems with drift in x-direction can be reduced by scanning
00139 a larger distance. The DSP adds equivalent points at both ends of a
00140 line which will be ignored in the resulting scan data. The total
00141 scansize will get larger in x by a factor of $(1 + 2 * PrePts / ScanPointsX)$.
00142 Use the PanView plugin to prevent trouble with the maximum scan size.
00143 \end{description}
00144 
00145 
00146 
00147 % OptPlugInSubSection: IV-Type Spectroscopy
00148 
00149 \begin{figure}[hbt]
00150 \center { \fighalf{SR-DSP-Control-Advanced-Raster}\fighalf{SR-DSP-Control-STS} }
00151 \caption{GXSM SR DSP Control window, left: Advanced with Raster settings, right: STS folder}
00152 \label{fig:SR-DSP:ADVRASTER:STS}
00153 \end{figure}
00154 
00155 This is the dialog for scanning tunneling spectroscopy (STS). Sources
00156 can be chosen in the Graphs Folder (Please have a look at the Graphs
00157 section for details).
00158 
00159 \begin{description}
00160 \item[IV-Start-End] These are the start and the end values of the
00161 spectrum. Optional a repetition counter is shown (Expert Control
00162 option). This forces the Signal Ranger to do the STS spectrum n times.
00163 
00164 \item[IV-dz] Lowering of the tip can improve the signal to noise ratio
00165 especially at low voltages. IV-dz is the maximum lowerage which is
00166 reached at 0V. The lowerage is equal to zero if the the I/V curve
00167 meets the bias voltage. Lowering the tip means a decrease of the
00168 tunneling gap. An automatic correction of the resistance is
00169 implemented by means of several (\#) dI/dz spectra at the bias voltage
00170 (Expert Control option).  
00171 
00172 \item[Points] Number of points the spectrum will have. Please have a look at
00173 \GxsmEntry{Int} for additional informations.  
00174 
00175 \item[IV-Slope] Slope while collecting data.  
00176 
00177 \item[Slope-Ramp] Slope while just moving.  
00178 
00179 \item[Final-Delay] After running a spectrum this is the time the DSP waits
00180 to enable the feedback again.  
00181 
00182 \item[Recover] This is the time between two spectra where the feedback is
00183 activated for a readjustment of the distance (Expert Control option).
00184 
00185 \item[Status] Gives information about the ongoing spectrum:
00186 
00187 \item[Tp] Total time the probe needs.  
00188 
00189 \item[dU] Maximum difference of the voltages that will be applied.
00190 
00191 \item[dUs] Stepsize of the datapoints.  
00192 
00193 \item[Feedback On] Decides whether the feedback will be on or off while
00194 taking a spektrum.  
00195 
00196 \item[Dual] When activated the DSP will take two spectra. One spectrum is
00197 running from Start to End directly followed by a spectrum from the End
00198 to the Start value.  
00199 
00200 \item[Int] When activated the DSP will average all fetched data between two
00201 points. It can easily be seen, that decreasing the values of IV-Slope
00202 or Points will increase the oversampling and therefore will improve
00203 the quality of the spectrum.See note ($*$) below.
00204 
00205 \item[Ramp] This option forces the DSP to stream all data to the PC
00206 including the Slope-Ramps.  
00207 
00208 \item[Save] When activated, GXSM will save spectra automatically to your
00209 home directory.  
00210 
00211 \item[Plot] When activated, GXSM will automatically show/update the plots
00212 chosen in the Graphs dialog.
00213 \end{description}
00214 
00215 
00216 \GxsmNote{$*$ The sampling rate of the Signal Ranger is 22.1 kHz so the
00217 time between two points of a spectrum leads directly to the number of
00218 interim points that can be used for oversampling.
00219 %
00220 total time for the spectrum:
00221 \[ ts = dU / IV-Slope \]
00222 %
00223 time per point:
00224 \[ tp = ts / Points = dU / (IV-Slope * Points) \]
00225 %
00226 number of samples at one point:
00227 \[ N = tp * 22100 Hz = 22100 Hz * dU / (IV-Slope * Points) \]
00228 }
00229 
00230 
00231 % OptPlugInSubSection: Vertical (Z) Manipulation
00232 Manipulation in general is controled or forced top motion in one or
00233 more dimensions for any desired purpose.
00234 This is the dialog for distance spectroscopy and forced Z/tip manipulation.
00235 
00236 \begin{figure}[hbt]
00237 \center { \fighalf{SR-DSP-Control-Z}\fighalf{SR-DSP-Control-LM} }
00238 \caption{GXSM SR DSP Control window, left: Z manipulation, right: LM, lateral and Z manipulation}
00239 \label{fig:SR-DSP:Z:LM}
00240 \end{figure}
00241 
00242 
00243 \begin{description}
00244 \item[Z-Start-End] These are the start and the end values of the spectrum in
00245 respect to the current position.  
00246 
00247 \item[Points] Number of points the spectrum will have. Please have a look at
00248 \GxsmEntry{Int} for additional informations.
00249 
00250 \item[Z-Slope] Slope while collecting data.
00251 
00252 \item[Slope-Ramp] Slope while just moving.
00253 
00254 \item[Final-Delay] After running a spectrum this is the time the DSP waits
00255 to enable the feedback again.
00256 
00257 \item[Status] Gives information about the ongoing spectrum:
00258 
00259 \item[Tp] Total time the probe needs. 
00260 \end{description}
00261 
00262 Informations about the check options can be found in STS.
00263 
00264 
00265 
00266 % OptPlugInSubSection: Lateral Manipulation 
00267 With LM a lateral manipulation of the tip/sample is possible.
00268 But also the Z-dimension can be manipulated at the same time if dZ set to a non zero value.
00269 
00270 \begin{description}
00271 \item[dxyz] Distance vector that will be covered.
00272 
00273 \item[Points] While moving it is possible to collect data. Points defines the number of collected data points.
00274 
00275 \item[LM-Slope] Speed of the tip/sample.
00276 
00277 \item[Final-Delay] Timeout after lateral manipulation.
00278 
00279 \item[Status] Gives information about the ongoing move.
00280 \end{description}
00281 
00282 Informations about the check options can be found in STS.
00283 
00284 
00285 
00286 
00287 % OptPlugInSubSection: Tip Enhancements and Field based Manipulation
00288 There are several possibilities to prepare a tip. One is to dip the
00289 tip into the sample in a controlled manner (use \GxsmEntry{Z} for
00290 this). Another option is applying a charge pulse using this \GxsmEntry{PL} dialog.
00291 
00292 \begin{figure}[hbt]
00293 \center { \fighalf{SR-DSP-Control-PL}}
00294 \caption{GXSM SR DSP Control window, left: PL, puls mode, right: LockIn settings}
00295 \label{fig:SR-DSP:PL}
00296 \end{figure}
00297 
00298 \begin{description}
00299 \item[Duration] Determines the duration of the pulse.
00300 \item[Volts] Applied voltage.
00301 
00302 \item[Slope] Slope to reach \GxsmEntry{Volts}.
00303 
00304 \item[Final Delay] Delay for relaxing the I/V-converter after pulsing.
00305 
00306 \item[Repetitions] How many pulses are applied.
00307 
00308 \item[Status] Gives information about the ongoing pulse. 
00309 \end{description}
00310 
00311 Informations about the check options can be found in STS.
00312 
00313 
00314 
00315 
00316 % OptPlugInSubSection: Control of the Slow Speed DSP software LockIn
00317 LockIn provides all settings concerning the build in Lock In functionality.
00318 
00319 \begin{figure}[hbt]
00320 \center { \fighalf{SR-DSP-Control-LockIn} }
00321 \caption{GXSM SR DSP Control window, left: PL, puls mode, right: LockIn settings}
00322 \label{fig:SR-DSP:LockIn}
00323 \end{figure}
00324 
00325 \begin{description}
00326 \item[AC-Amplitude] The amplitude of the LockIn voltage.
00327 \item[AC-Frequency] The base frequency of the LockIn.
00328 \item[AC-Phase-AB] Phase of the 1st and 2nd order (see Graphs for derails).
00329 \end{description}
00330 
00331 Informations about the check options can be found in STS.
00332 
00333 
00334 
00335 
00336 % OptPlugInSubSection: Data Sources and Graphing Control
00337 In the Graphs folder all available data channels are listed. If a
00338 Source is activated, measured data will be transferred into the
00339 buffer. Saving the buffer will automatically save all activated
00340 sources.  Additionally it is possible to define a source as to be
00341 displayed. 
00342 
00343 
00344 \begin{figure}[hbt]
00345 \center { \fighalf{SR-DSP-Control-Graphs}}
00346 \caption{GXSM SR DSP Control window, Graphs page: Plot and Data sources setup.}
00347 \label{fig:SR-DSP:Graphs}
00348 \end{figure}
00349 
00350 
00351 \GxsmHint{Beware: If a channel is not marked as a Source there will be no data
00352 to be displayed even if X or Y is checked.}
00353 
00354 
00355 
00356 
00357 
00358 
00359 % OptPlugInSection: SR-DSP Mover and Approach Control
00360 
00361 GXSM with the SRanger also provides ramp like signal generation for
00362 slip-stick type slider/mover motions which are often used for coarse
00363 positioning aud tip approach. Set
00364 \GxsmPref{User}{User/SliderControlType} to \GxsmEntry{mover} to get
00365 the most configurable Mover Control dialog. If set to
00366 \GxsmEntry{silder} (default setting) the dialog will be simplified for
00367 Z/approach only. The different tabs are only for users convenience to
00368 store different speed/step values, the output will always occurr as
00369 configured on the \GxsmEntry{Config} folder.
00370 
00371 \begin{figure}[hbt]
00372 \center { \fighalf{SR-DSP-Mover}\fighalf{SR-DSP-Mover-Auto} }
00373 \caption{GXSM SR DSP Control window, left: PL, puls mode, right: LockIn settings}
00374 \label{fig:SR-DSP:Mover}
00375 \end{figure}
00376 
00377 \begin{figure}[hbt]
00378 \center { \fighalf{SR-DSP-MoverConfig}}
00379 \caption{GXSM SR DSP configuration of SRanger inertial driver engine.}
00380 \label{fig:SR-DSP:MoverConfig}
00381 \end{figure}
00382 
00383 
00384 
00385 % OptPlugInSection: Extra Python SR-DSP Control and Configuration Scripts
00386 
00387 \begin{figure}[hbt]
00388 \center { \fighalf{SR-CR-Stage-LVDT-Control}}
00389 \caption{GXSM SR DSP Stage/LVDT Control}
00390 \label{fig:SR-DSP:SR-CR-Stage}
00391 \end{figure}
00392 
00393 \begin{figure}[hbt]
00394 \center { \fighalf{SR-DSP-AIC-Offset-Control}}
00395 \caption{GXSM SR DSP AIC Offset Control}
00396 \label{fig:SR-DSP:SR-AIC-Offset}
00397 \end{figure}
00398 
00399 \begin{figure}[hbt]
00400 \center { \fighalf{SR-DSP-SPM-Settings}}
00401 \caption{GXSM SR DSP SPM-Control: Settings}
00402 \label{fig:SR-DSP:SR-Settings}
00403 \end{figure}
00404 
00405 \clearpage
00406 
00407 % PlugInUsage
00408 Set the \GxsmPref{Hardware}{Card} to ''SRanger:SPM''.
00409 Launch\\ \filename{/SRanger/TiCC-project-files/FB\_spmcontrol/Release/FB\_spmcontrol.out}\\
00410 on the SR before starting GXSM!
00411 
00412 %% OptPlugInSources
00413 
00414 %% OptPlugInDest
00415 
00416 % OptPlugInNote
00417 Special features and behaviours to be documented here!
00418 
00419 % EndPlugInDocuSection
00420 * -------------------------------------------------------------------------------- 
00421 */
00422 
00423 #include <sys/ioctl.h>
00424 
00425 #include "config.h"
00426 #include "gxsm/plugin.h"
00427 #include "gxsm/xsmhard.h"
00428 #include "gxsm/glbvars.h"
00429 
00430 // Define HwI PlugIn reference name here, this is what is listed later within "Preferenced Dialog"
00431 // i.e. the string selected for "Hardware/Card"!
00432 #define THIS_HWI_PLUGIN_NAME "SRanger:SPM"
00433 
00434 // Plugin Prototypes
00435 static void sranger_hwi_init( void );
00436 static void sranger_hwi_about( void );
00437 static void sranger_hwi_configure( void );
00438 static void sranger_hwi_query( void );
00439 static void sranger_hwi_cleanup( void );
00440 
00441 // Fill in the GxsmPlugin Description here
00442 GxsmPlugin sranger_hwi_pi = {
00443         NULL,                   // filled in and used by Gxsm, don't touch !
00444         NULL,                   // filled in and used by Gxsm, don't touch !
00445         0,                      // filled in and used by Gxsm, don't touch !
00446         NULL,                   // The Gxsm-App Class Ref.pointer (called "gapp" in Gxsm) is 
00447         // filled in here by Gxsm on Plugin load, 
00448         // just after init() is called !!!
00449         // ----------------------------------------------------------------------
00450         // Plugins Name, CodeStly is like: Name-M1S|M2S-BG|F1D|F2D|ST|TR|Misc
00451         "sranger_hwi-"
00452         "HW-INT-1S-SHORT",
00453         // Plugin's Category - used to autodecide on Pluginloading or ignoring
00454         // In this case of Hardware-Interface-Plugin here is the interface-name required
00455         // this is the string selected for "Hardware/Card"!
00456         THIS_HWI_PLUGIN_NAME,
00457         // Description, is shown by PluginViewer (Plugin: listplugin, Tools->Plugin Details)
00458         "SRanger hardware interface.",
00459         // Author(s)
00460         "Percy Zahl",
00461         // Menupath to position where it is appendet to -- not used by HwI PIs
00462         N_("Hardware/"),
00463         // Menuentry -- not used by HwI PIs
00464         N_(THIS_HWI_PLUGIN_NAME"-HwI"),
00465         // help text shown on menu
00466         N_("This is the "THIS_HWI_PLUGIN_NAME" - GXSM Hardware Interface."),
00467         // more info...
00468         "N/A",
00469         NULL,          // error msg, plugin may put error status msg here later
00470         NULL,          // Plugin Status, managed by Gxsm, plugin may manipulate it too
00471         // init-function pointer, can be "NULL", 
00472         // called if present at plugin load
00473         sranger_hwi_init,  
00474         // query-function pointer, can be "NULL", 
00475         // called if present after plugin init to let plugin manage it install itself
00476         sranger_hwi_query, // query can be used (otherwise set to NULL) to install
00477         // additional control dialog in the GXSM menu
00478         // about-function, can be "NULL"
00479         // can be called by "Plugin Details"
00480         sranger_hwi_about,
00481         // configure-function, can be "NULL"
00482         // can be called by "Plugin Details"
00483         sranger_hwi_configure,
00484         // run-function, can be "NULL", if non-Zero and no query defined, 
00485         // it is called on menupath->"plugin"
00486         NULL, // run should be "NULL" for Gxsm-Math-Plugin !!!
00487         // cleanup-function, can be "NULL"
00488         // called if present at plugin removeal
00489         sranger_hwi_cleanup
00490 };
00491 
00492 
00493 // Text used in Aboutbox, please update!!
00494 static const char *about_text = N_("GXSM sranger_hwi Plugin\n\n"
00495                                    "Signal Ranger Hardware Interface for SPM.");
00496 
00497 /* Here we go... */
00498 
00499 #include "sranger_hwi.h"
00500 #include "sranger_hwi_control.h"
00501 
00502 /*
00503  * PI global
00504  */
00505 
00506 // #define PI_DEBUG(L, DBGTXT) std::cout << "** (" << __FILE__ << ": " << __FUNCTION__ << ") Gxsm-PI-DEBUG-MESSAGE **: " << std::endl << " - " << DBGTXT << std::endl
00507 
00508 gchar *sranger_hwi_configure_string = NULL;   // name of the currently in GXSM configured HwI (Hardware/Card)
00509 sranger_hwi_dev *sranger_hwi_hardware = NULL; // instance of the HwI derived XSM_Hardware class
00510 
00511 gchar *DSPControl_menupath  = N_("_Windows/");
00512 gchar *DSPControl_menuentry = N_("SR-DSP Control");
00513 gchar *DSPControl_menuhelp  = N_("open the SR-DSP control window");
00514 
00515 gchar *DSPMover_menuentry = N_("SR-DSP Mover");
00516 gchar *DSPMover_menuhelp  = N_("open the SR-DSP mover control window");
00517 
00518 DSPControl *DSPControlClass = NULL;
00519 DSPMoverControl *DSPMoverClass = NULL;
00520 
00521 static void DSPControl_show_callback ( GtkWidget*, void* );
00522 static void DSPMover_show_callback ( GtkWidget*, void* );
00523 
00524 static void DSPControl_StartScan_callback ( gpointer );
00525 
00526 static void DSPControl_SaveValues_callback ( gpointer );
00527 static void DSPControl_LoadValues_callback ( gpointer );
00528 
00529 
00530 
00531 /* 
00532  * PI essential members
00533  */
00534 
00535 // Symbol "get_gxsm_plugin_info" is resolved by dlsym from Gxsm, used to get Plugin's info!! 
00536 // Essential Plugin Function!!
00537 GxsmPlugin *get_gxsm_plugin_info ( void ){ 
00538         sranger_hwi_pi.description = g_strdup_printf(N_("GXSM HwI sranger_hwi plugin %s"), VERSION);
00539         return &sranger_hwi_pi; 
00540 }
00541 
00542 // Symbol "get_gxsm_hwi_hardware_class" is resolved by dlsym from Gxsm for all HwI type PIs, 
00543 // Essential Plugin Function!!
00544 XSM_Hardware *get_gxsm_hwi_hardware_class ( void *data ) {
00545         PI_DEBUG (DBG_L2, "sranger_hwi HardwareInterface Init");
00546         sranger_hwi_configure_string = g_strdup ((gchar*)data);
00547         sranger_hwi_hardware = new sranger_hwi_spm ();
00548         return sranger_hwi_hardware;
00549 }
00550 
00551 // init-Function
00552 static void sranger_hwi_init(void)
00553 {
00554         PI_DEBUG (DBG_L2, "sranger_hwi Plugin Init");
00555         sranger_hwi_hardware = NULL;
00556 }
00557 
00558 // about-Function
00559 static void sranger_hwi_about(void)
00560 {
00561         const gchar *authors[] = { sranger_hwi_pi.authors, NULL};
00562         gtk_widget_show(gnome_about_new ( sranger_hwi_pi.name,
00563                                           VERSION,
00564                                           N_("(C) 2000 the Free Software Foundation"),
00565                                           about_text,
00566                                           authors,
00567                                           NULL, NULL, NULL
00568                                 ));
00569 }
00570 
00571 // configure-Function
00572 static void sranger_hwi_configure(void)
00573 {
00574         PI_DEBUG (DBG_L2, "sranger_hwi Plugin HwI-Configure");
00575         if(sranger_hwi_pi.app)
00576                 sranger_hwi_pi.app->message("sranger_hwi Plugin Configuration");
00577 }
00578 
00579 // query-Function
00580 static void sranger_hwi_query(void)
00581 {
00582         g_print ("SR-HwI::sranger_hwi_query:: <%s>\n",sranger_hwi_configure_string);
00583         PI_DEBUG (DBG_L2, "sranger_hwi Plugin Query: " << sranger_hwi_configure_string);
00584 
00585 
00586         static GnomeUIInfo menuinfo[] = { 
00587                 { GNOME_APP_UI_ITEM, 
00588                   DSPControl_menuentry, DSPControl_menuhelp,
00589                   (gpointer) DSPControl_show_callback, NULL,
00590                   NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BLANK, 
00591                   0, GDK_CONTROL_MASK, NULL },
00592 
00593                 { GNOME_APP_UI_ITEM, 
00594                   DSPMover_menuentry, DSPMover_menuhelp,
00595                   (gpointer) DSPMover_show_callback, NULL,
00596                   NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BLANK, 
00597                   0, GDK_CONTROL_MASK, NULL },
00598 
00599                 GNOMEUIINFO_END
00600         };
00601 
00602         gnome_app_insert_menus
00603                 ( GNOME_APP(sranger_hwi_pi.app->getApp()), 
00604                   DSPControl_menupath, menuinfo );
00605 
00606 //      SR DSP Control Window
00607 // ==================================================
00608         DSPControlClass = new DSPControl;
00609         DSPControlClass->SetResName ("WindowSR-DSPControl", "false", xsmres.geomsave);
00610         sranger_hwi_pi.app->ConnectPluginToStartScanEvent (DSPControl_StartScan_callback);
00611 
00612         g_print ("SR-HwI::sranger_hwi_query:: ConnectPluginToCDFSaveEvent\n");
00613         // connect to GXSM nc-fileio
00614         sranger_hwi_pi.app->ConnectPluginToCDFSaveEvent (DSPControl_SaveValues_callback);
00615         sranger_hwi_pi.app->ConnectPluginToCDFLoadEvent (DSPControl_LoadValues_callback);
00616 
00617 //      SR DSP Mover Control Window
00618 // ==================================================
00619         DSPMoverClass = new DSPMoverControl;
00620         DSPMoverClass->SetResName ("WindowMoverControl", "false", xsmres.geomsave);
00621 
00622 
00623         sranger_hwi_pi.status = g_strconcat(N_("Plugin query has attached "),
00624                                            sranger_hwi_pi.name, 
00625                                            N_(": SR-DSPControl is created."),
00626                                            NULL);
00627 }
00628 
00629 static void DSPControl_show_callback( GtkWidget* widget, void* data){
00630         if ( DSPControlClass )
00631                 DSPControlClass->show();
00632 }
00633 
00634 static void DSPMover_show_callback( GtkWidget* widget, void* data){
00635         if ( DSPMoverClass )
00636                 DSPMoverClass->show();
00637 }
00638 
00639 static void DSPControl_StartScan_callback( gpointer ){
00640         g_print ("SR-HwI::DSPControl_StartScan_callback");
00641         if ( DSPControlClass )
00642                 DSPControlClass->update();
00643 }
00644 
00645 static void DSPControl_SaveValues_callback ( gpointer ncf ){
00646         g_print ("SR-HwI::SPControl_SaveValues_callback\n");
00647         if ( DSPControlClass )
00648                 DSPControlClass->save_values ((NcFile *) ncf);
00649 }
00650 
00651 static void DSPControl_LoadValues_callback ( gpointer ncf ){
00652         g_print ("SR-HwI::SPControl_LoadValues_callback\n");
00653         if ( DSPControlClass )
00654                 DSPControlClass->load_values ((NcFile *) ncf);
00655 }
00656 
00657 // cleanup-Function
00658 static void sranger_hwi_cleanup(void)
00659 {
00660         g_print ("SR-HwI::sranger_hwi_cleanup -- Plugin Cleanup, --Menu\n");
00661         PI_DEBUG (DBG_L2, "sranger_hwi Plugin Cleanup");
00662 
00663         gchar *mp = g_strconcat(DSPControl_menupath, DSPControl_menuentry, NULL);
00664         gnome_app_remove_menus (GNOME_APP( sranger_hwi_pi.app->getApp() ), mp, 1);
00665         g_free(mp);
00666 
00667         mp = g_strconcat(DSPControl_menupath, DSPMover_menuentry, NULL);
00668         gnome_app_remove_menus (GNOME_APP( sranger_hwi_pi.app->getApp() ), mp, 1);
00669         g_free(mp);
00670 
00671         // delete ...
00672         g_print ("SR-HwI::sranger_hwi_cleanup -- Plugin Cleanup --DSPCoCl\n");
00673         if( DSPControlClass )
00674                 delete DSPControlClass ;
00675         DSPControlClass = NULL;
00676 
00677         if( DSPMoverClass )
00678                 delete DSPMoverClass ;
00679         DSPMoverClass = NULL;
00680 
00681         g_print ("SR-HwI::sranger_hwi_cleanup -- Plugin Cleanup --sr_hwi\n");
00682         if (sranger_hwi_hardware)
00683                 delete sranger_hwi_hardware;
00684         sranger_hwi_hardware = NULL;
00685 
00686         g_print ("SR-HwI::sranger_hwi_cleanup -- Plugin Cleanup --Info\n");
00687         g_free (sranger_hwi_configure_string);
00688         sranger_hwi_configure_string = NULL;
00689 
00690         g_print ("SR-HwI::sranger_hwi_cleanup -- Plugin Cleanup done.\n");
00691 }
00692 

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