00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include <locale.h>
00029 #include <libintl.h>
00030
00031
00032 #include "view.h"
00033 #include "mem2d.h"
00034 #include "xsmmasks.h"
00035 #include "glbvars.h"
00036 #include "app_profile.h"
00037
00038
00039
00040 Profiles::Profiles(Scan *sc, int ChNo):View(sc, ChNo){
00041 XSM_DEBUG (DBG_L2, "Profiles::Profiles");
00042 profile = NULL;
00043 }
00044
00045 Profiles::Profiles():View(){
00046 profile = NULL;
00047 }
00048
00049 Profiles::~Profiles(){
00050 XSM_DEBUG (DBG_L2, "Profiles::~");
00051 hide();
00052 }
00053
00054 void Profiles::hide(){
00055 XSM_DEBUG (DBG_L2, "Profiles::hide");
00056 if(profile)
00057 delete profile;
00058 profile=NULL;
00059 }
00060
00061 int Profiles::update(int y1, int y2){
00062 if(!profile)
00063 return 0;
00064
00065 if(y2 < y1){
00066 if(ChanNo == gapp->xsm->ActiveChannel)
00067 profile->SetActive(TRUE);
00068 else
00069 profile->SetActive(FALSE);
00070 return 0;
00071 }
00072
00073 mem2d->SetDataPktMode(data->display.ViewFlg);
00074
00075
00076
00077
00078
00079
00080 profile->NewData(scan, y1, FALSE);
00081
00082
00083
00084 return 0;
00085 }
00086
00087 int Profiles::draw(int zoomoverride){
00088 gchar *titel=NULL;
00089
00090 if(!mem2d) {
00091 XSM_DEBUG (DBG_L2, "Profiles: no mem2d !");
00092 return 1;
00093 }
00094
00095 if(ChanNo > 0)
00096 titel = g_strdup_printf("Ch%d: %s %s",
00097 ChanNo+1,data->ui.name, mem2d->GetEname());
00098 else
00099 titel = g_strdup_printf("Probe: %s %s",
00100 data->ui.name, mem2d->GetEname());
00101
00102 if(!profile){
00103 profile = new ProfileControl(titel);
00104 profile->NewData(scan, 0, FALSE);
00105
00106
00107 }
00108
00109
00110
00111
00112
00113
00114
00115 profile->UpdateArea();
00116
00117 profile->SetTitle(titel);
00118 g_free(titel);
00119 profile->show();
00120
00121 XSM_DEBUG (DBG_L5, "Profiles::draw ret");
00122
00123 return 0;
00124 }