Changeset 21 in Sophya for trunk


Ignore:
Timestamp:
Sep 27, 1996, 12:28:58 AM (29 years ago)
Author:
aubourg
Message:

EA, Chili + Mac + Divers

Location:
trunk/SophyaPI/PI
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Makefile

    r18 r21  
    99#     i.e. variables LIB, OBJ, EXE, INC
    1010#---------------------------------------------------------------------------
     11
    1112
    1213# define MACHEROS from uname
     
    4647else
    4748  FFLAGS   :=  -I${INC} -D${MACHEROSD} 
    48   CFLAGS       := -g -O -Wall -Wpointer-arith \
    49                 -Wmissing-prototypes -Wsynth -I$(INC)
    50   CXXFLAGS     := $(CFLAGS) -I$(CXI)
     49  CPPFLAGS :=  -I${INC} -D${MACHEROSD}
    5150endif
    5251AR       := /usr/bin/ar
    5352ARFLAGS  := -rcs
    54 
    5553
    5654ifeq ($(CC), gcc)
     
    8179#------------------------------------------------- End of Makefile.h -------
    8280 
    83 all: $(LIB)libPI.a 
    84 $(LIB)libPI.a : $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawwin.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o
     81all: $(LIB)libPI.a
     82$(LIB)libPI.a : $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidemo.o $(OBJ)pidrawwin.o $(OBJ)pierrdisp.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piqualmon.o $(OBJ)piscdrawwdg.o $(OBJ)pistatmon.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piup.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o
    8583        $(AR) $(ARFLAGS)  $@ $?
    8684 
     
    107105 $(INC)exceptions.h \
    108106 $(INC)defs.h \
    109  $(INC)fitsimage.h \
    110  $(INC)cimage.h \
    111  $(INC)rzimage.h \
    112  $(INC)rzvect.h \
    113  $(INC)machine.h \
    114  $(INC)datatypes.h \
    115  $(INC)fitsheader.h \
    116  $(INC)fitskeys.h pidemo.h \
     107 $(INC)peidainit.h \
     108 $(INC)ctimer.h \
     109 $(INC)peida.h \
     110 $(INC)utils.h \
     111 $(INC)machine.h \
     112 $(INC)fitsimage.h \
     113 $(INC)cimage.h \
     114 $(INC)rzimage.h \
     115 $(INC)rzvect.h \
     116 $(INC)imaginit.h \
     117 $(INC)datatypes.h \
     118 $(INC)fitsheader.h \
     119 $(INC)erosio.h \
     120 $(INC)fitskeys.h \
     121 $(INC)erostape.h \
     122 $(INC)strutil.h \
     123 $(INC)ptrarray.h \
     124 $(INC)voidptrarray.h \
     125 $(INC)basearray.h \
     126 $(INC)array.h \
     127 $(INC)lockfile.h \
     128 $(INC)erostarfile.h \
     129 $(INC)dates.h \
     130 $(INC)tarlib.h \
     131 $(INC)dynccd.h \
     132 $(INC)ppersist.h \
     133 $(INC)pclassids.h \
     134 $(CXI)strecinit.h \
     135 $(CXI)psf.h \
     136 $(CXI)star.h \
     137 $(CXI)starmacro.h \
     138 $(INC)generalfit.h \
     139 $(INC)matrix.h \
     140 $(INC)cvector.h \
     141 $(INC)nbmath.h \
     142 $(INC)pemath.h pidemo.h \
    117143 pisysdep.h piapplx.h piapplgen.h pimsghandler.h picontainerx.h \
    118144 picontainergen.h piwdgx.h piwdggen.h pimenubarx.h pimenubargen.h \
     
    122148 pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
    123149 picmapgen.h pihisto.h piscdrawwdg.h \
    124  $(INC)histos.h \
    125  $(INC)peida.h \
    126  $(INC)utils.h pidrawwin.h \
    127  $(INC)piup.h
     150 $(INC)histos.h pidrawwin.h \
     151 piup.h
    128152$(OBJ)pidrawwin.o: ./pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \
    129153 piwindowgen.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
    130  pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h
     154 pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h pistdwdgx.h \
     155 pistdwdggen.h
     156$(OBJ)pierrdisp.o: ./pierrdisp.cc pierrdisp.h pisysdep.h pibwdgx.h \
     157 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
     158 pistdwdggen.h picontainerx.h picontainergen.h piperiodx.h \
     159 $(INC)periodic.h \
     160 $(INC)errorhandlerc.h \
     161 $(INC)utils.h \
     162 $(INC)defs.h
    131163$(OBJ)pifilechogen.o: ./pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
    132164 piwdggen.h pimsghandler.h
     
    135167 picontainerx.h picontainergen.h
    136168$(OBJ)pihisto.o: ./pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \
    137  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
    138  $(INC)histos.h \
    139  $(INC)peida.h \
    140  $(INC)defs.h \
    141  $(INC)utils.h \
    142  $(INC)machine.h \
    143  $(INC)perrors.h \
    144  $(INC)exceptions.h
     169 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
     170 pistdwdggen.h $(INC)histos.h \
     171 $(INC)peida.h \
     172 $(INC)defs.h \
     173 $(INC)utils.h \
     174 $(INC)machine.h \
     175 $(INC)perrors.h \
     176 $(INC)exceptions.h \
     177 $(INC)peidainit.h
    145178$(OBJ)piimage.o: ./piimage.cc piimage.h \
    146179 $(INC)cimage.h \
     
    150183 $(INC)defs.h \
    151184 $(INC)exceptions.h \
    152  $(INC)perrors.h \
     185 $(INC)peidainit.h \
     186 $(INC)perrors.h \
     187 $(INC)imaginit.h \
    153188 $(INC)datatypes.h \
    154189 $(INC)lut.h pisysdep.h \
     
    159194 $(INC)fitsimage.h \
    160195 $(INC)fitsheader.h \
    161  $(INC)fitskeys.h
     196 $(INC)erosio.h \
     197 $(INC)fitskeys.h \
     198 $(INC)erostape.h \
     199 $(INC)strutil.h \
     200 $(INC)ptrarray.h \
     201 $(INC)voidptrarray.h \
     202 $(INC)basearray.h \
     203 $(INC)peida.h \
     204 $(INC)utils.h \
     205 $(INC)array.h \
     206 $(INC)lockfile.h \
     207 $(INC)erostarfile.h \
     208 $(INC)dates.h \
     209 $(INC)tarlib.h
    162210$(OBJ)pimenubargen.o: ./pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \
    163211 pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h piapplgen.h \
     
    177225 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
    178226 pimenux.h pimenugen.h pistdwdgx.h pistdwdggen.h
     227$(OBJ)piperiodx.o: ./piperiodx.cc piperiodx.h \
     228 $(INC)periodic.h
    179229$(OBJ)pipixmapgen.o: ./pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \
    180230 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \
    181231 picmapgen.h
    182 $(OBJ)piperiodx.o: ./piperiodx.cc ./piperiodx.h $(INC)periodic.h
    183232$(OBJ)pipixmapx.o: ./pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \
    184233 pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h \
    185234 picmapx.h picmapgen.h
     235$(OBJ)piqualmon.o: ./piqualmon.cc piqualmon.h pisysdep.h piscdrawwdg.h \
     236 pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
     237 pistdwdggen.h pioptmenux.h pioptmenugen.h picontainerx.h \
     238 picontainergen.h pimenux.h pimenugen.h piwindowx.h piwindowgen.h \
     239 $(CXI)qualite.h \
     240 $(INC)histos.h \
     241 $(INC)peida.h \
     242 $(INC)defs.h \
     243 $(INC)utils.h \
     244 $(INC)machine.h \
     245 $(INC)perrors.h \
     246 $(INC)exceptions.h \
     247 $(INC)peidainit.h \
     248 $(CXI)recostar.h \
     249 $(INC)cimage.h \
     250 $(INC)rzimage.h \
     251 $(INC)rzvect.h \
     252 $(INC)imaginit.h \
     253 $(INC)datatypes.h \
     254 $(CXI)stlist.h \
     255 $(INC)dynccd.h \
     256 $(INC)ppersist.h \
     257 $(INC)pclassids.h \
     258 $(CXI)star.h \
     259 $(CXI)strecinit.h \
     260 $(CXI)starmacro.h \
     261 $(CXI)psf.h \
     262 $(INC)generalfit.h \
     263 $(INC)matrix.h \
     264 $(INC)cvector.h \
     265 $(CXI)transfo.h \
     266 $(INC)poly.h \
     267 $(INC)erosfitsname.h \
     268 $(INC)dates.h \
     269 $(INC)fitsimage.h \
     270 $(INC)fitsheader.h \
     271 $(INC)erosio.h \
     272 $(INC)fitskeys.h \
     273 $(INC)erostape.h \
     274 $(INC)strutil.h \
     275 $(INC)ptrarray.h \
     276 $(INC)voidptrarray.h \
     277 $(INC)basearray.h \
     278 $(INC)array.h \
     279 $(INC)lockfile.h \
     280 $(INC)erostarfile.h \
     281 $(INC)tarlib.h
    186282$(OBJ)piscdrawwdg.o: ./piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \
    187  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
     283 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
     284 pistdwdggen.h \
    188285 $(INC)generalfit.h \
    189286 $(INC)exceptions.h \
    190287 $(INC)defs.h \
     288 $(INC)peidainit.h \
    191289 $(INC)matrix.h \
    192290 $(INC)peida.h \
     
    197295 $(INC)pclassids.h \
    198296 $(INC)cvector.h
     297$(OBJ)pistatmon.o: ./pistatmon.cc pistatmon.h pisysdep.h piscdrawwdg.h \
     298 pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h pistdwdgx.h \
     299 pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
     300 picontainergen.h \
     301 $(CXI)qualite.h \
     302 $(INC)histos.h \
     303 $(INC)peida.h \
     304 $(INC)defs.h \
     305 $(INC)utils.h \
     306 $(INC)machine.h \
     307 $(INC)perrors.h \
     308 $(INC)exceptions.h \
     309 $(INC)peidainit.h \
     310 $(CXI)recostar.h \
     311 $(INC)cimage.h \
     312 $(INC)rzimage.h \
     313 $(INC)rzvect.h \
     314 $(INC)imaginit.h \
     315 $(INC)datatypes.h \
     316 $(CXI)stlist.h \
     317 $(INC)dynccd.h \
     318 $(INC)ppersist.h \
     319 $(INC)pclassids.h \
     320 $(CXI)star.h \
     321 $(CXI)strecinit.h \
     322 $(CXI)starmacro.h \
     323 $(CXI)psf.h \
     324 $(INC)generalfit.h \
     325 $(INC)matrix.h \
     326 $(INC)cvector.h \
     327 $(CXI)transfo.h \
     328 $(INC)poly.h \
     329 $(INC)erosfitsname.h \
     330 $(INC)dates.h \
     331 $(INC)fitsimage.h \
     332 $(INC)fitsheader.h \
     333 $(INC)erosio.h \
     334 $(INC)fitskeys.h \
     335 $(INC)erostape.h \
     336 $(INC)strutil.h \
     337 $(INC)ptrarray.h \
     338 $(INC)voidptrarray.h \
     339 $(INC)basearray.h \
     340 $(INC)array.h \
     341 $(INC)lockfile.h \
     342 $(INC)erostarfile.h \
     343 $(INC)tarlib.h
    199344$(OBJ)pistdwdggen.o: ./pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \
    200345 piwdggen.h pimsghandler.h
    201346$(OBJ)pistdwdgx.o: ./pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \
    202347 piwdgx.h piwdggen.h pimsghandler.h
     348$(OBJ)piup.o: ./piup.cc \
     349 $(INC)ctimer.h \
     350 $(INC)peida.h \
     351 $(INC)defs.h \
     352 $(INC)utils.h \
     353 $(INC)machine.h \
     354 $(INC)perrors.h \
     355 $(INC)exceptions.h \
     356 $(INC)peidainit.h \
     357 $(INC)imageop.h \
     358 $(INC)cimage.h \
     359 $(INC)rzimage.h \
     360 $(INC)rzvect.h \
     361 $(INC)imaginit.h \
     362 $(INC)datatypes.h \
     363 $(INC)fitsimage.h \
     364 $(INC)fitsheader.h \
     365 $(INC)erosio.h \
     366 $(INC)fitskeys.h \
     367 $(INC)erostape.h \
     368 $(INC)strutil.h \
     369 $(INC)ptrarray.h \
     370 $(INC)voidptrarray.h \
     371 $(INC)basearray.h \
     372 $(INC)array.h \
     373 $(INC)lockfile.h \
     374 $(INC)erostarfile.h \
     375 $(INC)dates.h \
     376 $(INC)tarlib.h piup.h
    203377$(OBJ)piwdggen.o: ./piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \
    204378 pisysdep.h piwdgx.h
  • trunk/SophyaPI/PI/mkmfPI

    r8 r21  
    11#!/bin/csh
    2 # $Id: mkmfPI,v 1.1 1996-03-01 16:53:25 eros Exp $
     2# $Id: mkmfPI,v 1.2 1996-09-26 22:28:53 aubourg Exp $
    33
    44set libf='$(LIB)libPI.a'
     
    1010echo "CXX := g++" >> Makefile
    1111
    12 cat ../Mgr/Makefile.h >> Makefile
     12cat ../CodeCxx/Mgr/Makefile.h >> Makefile
    1313
    1414echo " " >> Makefile
    15 echo 'all:' $libf $slbf >> Makefile
    1615
    17 set files = `ls -1 *.cc | grep -v mac | grep -v pipp | grep -v attach | grep -v app.cc`
    18 echo $files
    19 #  Ca ne marche pas - Reza 1/3/96  10H00
    20 # echo $libf ':' \
    21 #  `echo $files | sed -e 's/\.cc/.o/g' | sed -e 's/^/$(OBJ)/'` >> Makefile
    22 # echo $files | sed -e 's/\.cc/.o/g' | sed -e 's/^/$(OBJ)/'
    23 set lstlo =   ( $libf ':' )
    24 foreach f ($files)
    25   set lstlo = ( $lstlo \$\(OBJ\)$f:r.o )
    26 end
    27 echo $lstlo >> Makefile
     16set files = `ls ./pi*.cc | grep -v mac | grep -v pipp | grep -v attach | grep -v app.cc`
     17set objfiles =
     18set apps = `ls *app.cc`
     19set appsm = `ls *app.cc | sed -e 's/.cc//g'`
     20
     21#echo 'all:' $libf $slbf $apps >> Makefile
     22echo 'all:' $libf $appsm >> Makefile
     23
     24
     25echo $libf ':' \
     26 `echo $files | sed -e 's/\.cc/.o/g' | sed -e 's/\.\//$(OBJ)/g'` >> Makefile
    2827echo '  ar -rs $@ $?' >> Makefile
    29 
    3028
    3129echo " " >> Makefile
     
    4341end
    4442
    45 foreach f ( *app.cc )
     43foreach f ( $apps )
    4644  gcc -MM -I$inc -I$incxx $f  \
    4745       | sed -e 's/.*\.o/\$(OBJ)&/'  \
     
    5250  echo '        ' >> Makefile
    5351
    54   echo '$(EXE)'$f:r ' : $(OBJ)'$f:r.o >> Makefile
     52  echo '$(EXE)'$f:r ' : $(OBJ)'$f:r.o $libf >> Makefile
    5553  echo '        g++ -o $(EXE)'$f:r' $(OBJ)'$f:r'.o -L$(LIB) -lPI -lImages -lOutils -lmath -lXm -lXt -lX11 -lm' >> Makefile
    5654end
  • trunk/SophyaPI/PI/pierrdisp.cc

    r15 r21  
    5656  ackButton = new PIButton(this, "OK", 5000, 40, 20, 155, 20);
    5757  updButton = new PIButton(this, "Upd", 5001, 40, 20, 155, 50);
     58  Start();
    5859}
    5960
  • trunk/SophyaPI/PI/piqualmon.cc

    r15 r21  
    1111:PIWindow(par, "Qualite Suivi", PIWK_normal, 660, 280, 160, 0)
    1212{
    13   ccd = 0;
     13  ccd = 100;
    1414  var1 = "FOND";
    15   var2 = "FOND";
     15  var2 = "SIGMA";
    1616  monitoring1    = new PIQualiteMon(this, "Fond", 300, 200, 20, 40);
    1717  monitoring2    = new PIQualiteMon(this, "Fond", 300, 200, 340,40);
    1818  menuccd        = new PIPUMenu(this, "CCD");
    19   menuccd->AppendItem("tous", 80000);
     19  menuccd->AppendItem("tous", 80100);
     20  menuccd->AppendItem("0", 80000);
    2021  menuccd->AppendItem("1", 80001);
    2122  menuccd->AppendItem("2", 80002);
     
    2526  menuccd->AppendItem("6", 80006);
    2627  menuccd->AppendItem("7", 80007);
    27   menuccd->AppendItem("8", 80008);
    2828
    2929  menudata[0]    = new PIPUMenu(this, "Data");
    3030  menudata[0]->AppendItem("FOND" , 90001);
     31  menudata[0]->AppendItem("SIGFOND" , 90005);
    3132  menudata[0]->AppendItem("SIGMA", 90002);
    3233  menudata[0]->AppendItem("NSTAR", 90003);
     34  menudata[0]->AppendItem("FOND/MIN", 90004);
    3335
    3436  menudata[1]    = new PIPUMenu(this, "Data");
    3537  menudata[1]->AppendItem("FOND" , 90011);
     38  menudata[1]->AppendItem("SIGFOND" , 90015);
    3639  menudata[1]->AppendItem("SIGMA", 90012);
    3740  menudata[1]->AppendItem("NSTAR", 90013);
     41  menudata[1]->AppendItem("FOND/MIN", 90014);
    3842
    3943  optMenuccd     = new PIOptMenu    (this, menuccd, 80, 20, 290, 15);
    40   optMenudata[0] = new PIOptMenu    (this, menudata[0], 80, 20, 130, 250);
    41   optMenudata[1] = new PIOptMenu    (this, menudata[1], 80, 20, 450, 250);
     44  optMenudata[0] = new PIOptMenu    (this, menudata[0], 100, 20, 120, 250);
     45  optMenudata[1] = new PIOptMenu    (this, menudata[1], 100, 20, 440, 250);
     46  optMenudata[1]->SetValue(90012);
     47
     48  butupdate      = new PIButton     (this, "UPDATE", 5001, 80,20,560,15);
     49
    4250  labccd         = new PILabel      (this, "CCD :", 50, 20, 240, 15);
    4351  labR           = new PILabel      (this, "Log R : ", 50, 20, 20, 3);
     
    6270  delete monitoring1;
    6371  delete monitoring2;
    64 }
    65 
    66 void PIQualiteWin::UpdateInfo(LImageInfo linfo, char color, string labflnm)
     72  delete butupdate;
     73}
     74
     75void
     76PIQualiteWin::UpdateInfo(LImageInfo linfor, LImageInfo linfob,
     77                         string labflnmr, string labflnmb)
    6778
    68   if (color == 'r') {
    69     linfoR = linfo;
    70     labfileR->SetLabel(labflnm);
    71   }
    72   else if (color == 'b') {
    73     linfoB = linfo;
    74     labfileB->SetLabel(labflnm);
    75   }
     79  linfoR = linfor;
     80  labfileR->SetLabel(labflnmr);
     81 
     82  linfoB = linfob;
     83  labfileB->SetLabel(labflnmb);
     84 
    7685  monitoring1->SetData(linfoR, linfoB, var1, ccd);
    7786  monitoring2->SetData(linfoR, linfoB, var2, ccd);
    7887}
    7988
    80 void PIQualiteWin::Process(long msg, PIMsgHandler *, void *)
     89void
     90PIQualiteWin::Process(long msg, PIMsgHandler *sender, void *data)
    8191{
    8292  switch (msg) {
    83   case 80000:
    84   case 80001: case 80002: case 80003: case 80004:
    85   case 80005: case 80006: case 80007: case 80008:
     93  case 80100:
     94  case 80000: case 80001: case 80002: case 80003:
     95  case 80004: case 80005: case 80006: case 80007:
    8696    ccd = msg - 80000;
    8797    monitoring1->SetData(linfoR, linfoB, var1, ccd);
     
    100110    monitoring1->SetData(linfoR, linfoB, var1, ccd);
    101111    break;
     112  case 90004:
     113    var1 = "FOND/MIN";
     114    monitoring1->SetData(linfoR, linfoB, var1, ccd);
     115    break;
     116  case 90005:
     117    var1 = "SIGFOND";
     118    monitoring1->SetData(linfoR, linfoB, var1, ccd);
     119    break;
    102120  case 90011:
    103121    var2 = "FOND";
     
    112130    monitoring2->SetData(linfoR, linfoB, var2, ccd);
    113131    break;
     132  case 90014:
     133    var2 = "FOND/MIN";
     134    monitoring2->SetData(linfoR, linfoB, var2, ccd);
     135    break;
     136  case 90015:
     137    var2 = "SIGFOND";
     138    monitoring2->SetData(linfoR, linfoB, var2, ccd);
     139    break;
    114140
    115141  default:
    116     cout << "Message " << msg << " non interprete" << endl;   
     142    //cout << "Message " << msg << " non interprete" << endl;   
     143    ReSend(msg, sender, data);
    117144  }   
    118145}
     
    125152{
    126153  SetAxesFlags(kBoxAxes | kTicks | kLabels);
    127   ndataR = ndataB = 0;
    128   xR = xB = NULL;
     154  ndataR = ndataB = nsepR = nsepB = 0;
     155  xR = xB = xsepR = xsepB = NULL;
    129156  y1R = y1B = NULL;
    130157  y2R = y2B = NULL;
     
    141168}
    142169
    143 void PIQualiteMon::SetData(LImageInfo linfoR, LImageInfo linfoB, string var,
     170void
     171PIQualiteMon::SetData(LImageInfo linfoR, LImageInfo linfoB, string var,
    144172                           int ccd)
    145173{
    146   ndataR = (int)linfoR.size();
    147   ndataB = (int)linfoB.size();
     174  // mise a zero des donnees deja existantes
     175
     176  RAZData(linfoR, var, ndataR, nsepR, xR, y1R, y2R, xsepR);
     177  RAZData(linfoB, var, ndataB, nsepB, xB, y1B, y2B, xsepB);
     178  ndataR = ndataB = nsepR = nsepB = 0;
     179
     180  // remplissage avec nouvelles valeurs
     181
     182  float valmin=100000, valmax=0, heuremin=36, heuremax=-36;
     183  FillData(linfoR, var, ccd, ndataR, nsepR, xR, y1R, y2R, xsepR,
     184           heuremin, heuremax, valmin, valmax);
     185  FillData(linfoB, var, ccd, ndataB, nsepB, xB, y1B, y2B, xsepB,
     186           heuremin, heuremax, valmin, valmax);
     187  float scaleh = heuremax-heuremin;
     188  float scalev = valmax-valmin;
     189  if (scaleh == 0) scaleh = 10;
     190  if (scalev == 0) scalev = 10;
     191  SetLimits(heuremin-scaleh/10, heuremax+scaleh/10,
     192            valmin-scalev/10, valmax+scalev/10);
     193
     194  Refresh();
     195}
     196
     197void
     198PIQualiteMon::RAZData(LImageInfo linfo, string var, int& ndata, int& nsep,
     199                           double*& x, double*& y1, double*& y2, double*& xsep)
     200{
     201  ndata = (int)linfo.size();
     202  nsep = (int)linfo.size();
    148203 
    149   // mise a zero des donnees deja existantes
    150 
    151   if (xR  != NULL) { delete[] xR;  xR  = NULL; }
    152   if (y1R != NULL) { delete[] y1R; y1R = NULL; }
    153   if (y2R != NULL) { delete[] y2R; y2R = NULL; }
    154   if (ndataR > 0) {
    155     if((xR = new double[ndataR]) == NULL) {
    156       printf("PIQualiteMon::SetData_Error memoire insuffisante pour xR\n");
     204  if (x  != NULL) { delete[] x;  x  = NULL; }
     205  if (y1 != NULL) { delete[] y1; y1 = NULL; }
     206  if (y2 != NULL) { delete[] y2; y2 = NULL; }
     207  if (xsep != NULL) { delete[] xsep; xsep = NULL; }
     208  if (ndata > 0) {
     209    if((x = new double[ndata]) == NULL) {
     210      printf("PIQualiteMon::SetData_Error memoire insuffisante pour x\n");
    157211      return;
    158212    }
    159     if((y1R = new double[ndataR]) == NULL) {
    160       printf("PIQualiteMon::SetData_Error memoire insuffisante pour y1R\n");
     213    if((y1 = new double[ndata]) == NULL) {
     214      printf("PIQualiteMon::SetData_Error memoire insuffisante pour y1\n");
    161215      return;
    162216    }
    163     if (var == "SIGMA") if((y2R = new double[ndataR]) == NULL) {
    164       printf("PIQualiteMon::SetData_Error memoire insuffisante pour y2R\n");
     217    if (var == "SIGMA") if((y2 = new double[ndata]) == NULL) {
     218      printf("PIQualiteMon::SetData_Error memoire insuffisante pour y2\n");
    165219      return;
    166220    }
     221    if((xsep = new double[ndata]) == NULL) {
     222      printf("PIQualiteMon::SetData_Error memoire insuffisante pour xsep\n");
     223      return;
     224    }
    167225  }
    168    
    169   if (xB  != NULL) { delete[] xB;  xB  = NULL; }
    170   if (y1B != NULL) { delete[] y1B; y1B = NULL; }
    171   if (y2B != NULL) { delete[] y2B; y2B = NULL; }
    172   if (ndataB >0) {
    173     if((xB = new double[ndataB]) == NULL) {
    174       printf("PIQualiteMon::SetData_Error memoire insuffisante pour xB\n");
    175       return;
    176     }
    177     if((y1B = new double[ndataB]) == NULL) {
    178       printf("PIQualiteMon::SetData_Error memoire insuffisante pour y1B\n");
    179       return;
    180     }
    181     if (var == "SIGMA") if((y2B = new double[ndataB]) == NULL) {
    182       printf("PIQualiteMon::SetData_Error memoire insuffisante pour y2B\n");
    183       return;
    184     }
    185   }
    186 
    187   // remplissage avec nouvelles valeurs
    188 
    189   ndataR = ndataB = 0;
    190   float valmin=100000, valmax=0, heuremin=36, heuremax=-36;
     226}
     227
     228void
     229PIQualiteMon::FillData(LImageInfo linfo, string var, int ccd,
     230                            int& ndata, int& nsep, double*& x, double*& y1,
     231                            double*& y2, double*& xsep, float& heuremin,
     232                            float& heuremax, float& valmin, float& valmax)
     233{
    191234  char time[10];
    192235  float heure,min,sec;
    193   for (LImageInfo::iterator i=linfoR.begin(); i!=linfoR.end(); i++) {
    194     if ((*i).nomimg.ccd == ccd || ccd == 0) {
    195       (*i).date.GetTimeStr(time);
     236  int objet = 0;
     237  for (LImageInfo::iterator i=linfo.begin(); i!=linfo.end(); i++) {
     238    if (!(*i).goodCCD) continue;
     239    if ((*i).nomimg.ccd == ccd || ccd == 100) {
     240      (*i).nomimg.date.GetTimeStr(time);
    196241      sscanf(time, "%f:%f:%f", &heure, &min, &sec);
    197       heure = heure + min/60 + sec/3600;
     242      heure = heure + min/60. + sec/3600.;
    198243      if (heure > 12) heure -= 24;
    199       xR[ndataR] = heure;
     244      x[ndata] = heure;
    200245      if (heure > heuremax) heuremax = heure;
    201246      if (heure < heuremin) heuremin = heure;
     247      if ((*i).nomimg.objet != objet) {
     248        if (objet != 0) {
     249          xsep[nsep] = heure;
     250          nsep++;
     251        }
     252        objet = (*i).nomimg.objet;
     253      }
    202254      if (var == "FOND") {
    203         if((y1R[ndataR] = (*i).fond) == -1) continue;
     255        if((y1[ndata] = (*i).fond) == -1) continue;
     256      }
     257      else if (var == "SIGFOND") {
     258        if((y1[ndata] = (*i).sigFond) == -1) continue;
    204259      }
    205260      else if (var == "SIGMA") {
    206         if((y1R[ndataR] = (*i).sigmaX) == -1) continue;
    207         if((y2R[ndataR] = (*i).sigmaY) == -1) continue;
    208         if (y2R[ndataR] > valmax) valmax = y2R[ndataR];
    209         if (y2R[ndataR] < valmin) valmin = y2R[ndataR] ;
     261        if((y1[ndata] = (*i).sigmaX) == -1) continue;
     262        if((y2[ndata] = (*i).sigmaY) == -1) continue;
     263        if (y2[ndata] > valmax) valmax = y2[ndata];
     264        if (y2[ndata] < valmin) valmin = y2[ndata] ;
    210265      }
    211266      else if (var == "NSTAR") {
    212         if((y1R[ndataR] = (*i).nStars) == -1) continue;
    213       }
    214       if (y1R[ndataR] > valmax) valmax = y1R[ndataR];
    215       if (y1R[ndataR] < valmin) valmin = y1R[ndataR];
    216       ndataR++;
     267        if((y1[ndata] = (*i).nStars) == -1) continue;
     268      }
     269      else if (var == "FOND/MIN") {
     270        if(((*i).tpos == 0) || ((*i).fond == -1)) continue;
     271        y1[ndata] = (*i).fond / (*i).tpos * 60;
     272      }
     273      if (y1[ndata] > valmax) valmax = y1[ndata];
     274      if (y1[ndata] < valmin) valmin = y1[ndata];
     275      ndata++;
    217276    }
    218277  }
    219   for (LImageInfo::iterator i=linfoB.begin(); i!=linfoB.end(); i++) {
    220     if ((*i).nomimg.ccd == ccd || ccd == 0) {
    221       (*i).date.GetTimeStr(time);
    222       sscanf(time, "%f:%f:%f", &heure, &min, &sec);
    223       heure = heure + min/60 + sec/3600;
    224       xB[ndataB] = heure;
    225       if (heure > 12) heure -= 24;
    226       if (heure > heuremax) heuremax = heure;
    227       if (heure < heuremin) heuremin = heure;
    228       if (var == "FOND") {
    229         if((y1B[ndataB] = (*i).fond) == -1) continue;
    230       }
    231       else if (var == "SIGMA") {
    232         if((y1B[ndataB] = (*i).sigmaX) == -1) continue;
    233         if((y2B[ndataB] = (*i).sigmaY) == -1) continue;
    234         if (y2B[ndataB] > valmax) valmax = y2B[ndataB];
    235         if (y2B[ndataB] < valmin) valmin = y2B[ndataB];
    236       }
    237       else if (var == "NSTAR") {
    238         if((y1B[ndataB] = (*i).nStars) == -1) continue;
    239      }
    240       if (y1B[ndataB] > valmax) valmax = y1B[ndataB];
    241       if (y1B[ndataB] < valmin) valmin = y1B[ndataB];
    242       ndataB++;
    243     }
    244   }
    245   float scale = heuremax-heuremin;
    246   if (scale == 0) scale = 10;
    247   SetLimits(heuremin-scale/10, heuremax+scale/10, valmin*.9, valmax*1.1);
    248 
    249   Refresh();
    250 }
    251 
    252 void PIQualiteMon::DrawSelf()
    253 {
     278}
     279
     280void
     281PIQualiteMon::DrawSelf()
     282{
     283  SelForeground(PI_Grey);
     284  SelLine(PI_ThinLine);
     285  for (int i=0;i<nsepR;i++) ScDrawLine(xsepR[i],-10000,xsepR[i],80000);
     286  for (int i=0;i<nsepB;i++) ScDrawLine(xsepB[i],-10000,xsepB[i],80000);
    254287  SelMarker(5,PI_FCircleMarker);
    255288  SelForeground(PI_Red);
    256289  if(ndataR) for (int i=0;i<ndataR;i++) {
    257290    ScDrawMarker(xR[i],y1R[i]);
    258     if(y2R != NULL) ScDrawFCircle(xR[i],y2R[i],0.2);
     291    if(y2R != NULL) {
     292      SelMarker(5,PI_CrossMarker);
     293      ScDrawMarker(xR[i],y2R[i]);
     294      SelMarker(5,PI_FCircleMarker);
     295    }
    259296  }
    260297  SelMarker(5,PI_FCircleMarker);
     
    262299  if(ndataB) for (int i=0;i<ndataB;i++) {
    263300    ScDrawMarker(xB[i],y1B[i]);
    264     if(y2B != NULL) ScDrawFCircle(xB[i],y2B[i],0.2);
     301    if(y2B != NULL) {
     302      SelMarker(5,PI_CrossMarker);
     303      ScDrawMarker(xB[i],y2B[i]);
     304      SelMarker(5,PI_FCircleMarker);
     305    }
    265306  }
    266307
    267308  SelForeground(PI_Black);
    268 }
     309  DrawString(235,194,"HEURE");
     310}
     311
     312
     313
     314
     315
     316
     317
  • trunk/SophyaPI/PI/piqualmon.h

    r15 r21  
    2121                      PIQualiteWin(PIMsgHandler* par);
    2222  virtual             ~PIQualiteWin();
    23   virtual void        UpdateInfo(LImageInfo linfo, char color, string labflnm);
     23  virtual void        UpdateInfo(LImageInfo linfor, LImageInfo linfob,
     24                                 string labflnmr, string labflnmb);
    2425  virtual void        Process(long msg, PIMsgHandler *sender, void *data);
    2526
     
    3132  PIOptMenu*          optMenudata[2];
    3233  PIPUMenu*           menudata[2];
     34  PIButton*           butupdate;
    3335  PILabel*            labccd;
    3436  PILabel*            labR;
     
    3840  LImageInfo          linfoR;
    3941  LImageInfo          linfoB;
    40   int                 ccd;  // 0 pour tous
     42  int                 ccd;  // 100 pour tous
    4143  string              var1;
    4244  string              var2;
     
    5254  void             SetData(LImageInfo linfoR, LImageInfo linfoB, string var,
    5355                           int ccd);
     56  void             RAZData(LImageInfo linfo, string var, int& ndata, int& nsep,
     57                          double*& x, double *&y1, double*& y2, double*& xsep);
     58  void             FillData(LImageInfo linfo, string var, int ccd,
     59                            int& ndata, int& nsep, double*& x, double*& y1,
     60                            double*& y2, double*& xsep, float& heuremin,
     61                            float& heuremax, float& valmin, float& valmax);
    5462 
    5563protected:
    5664  int             ndataR;
    5765  int             ndataB;
     66  int             nsepR;
     67  int             nsepB;
    5868  double*         xR;
    5969  double*         xB;
     
    6272  double*         y1B;
    6373  double*         y2B;
     74  double*         xsepR;
     75  double*         xsepB;
    6476};
    6577
  • trunk/SophyaPI/PI/pistatmon.cc

    r15 r21  
    1515  monitoring2 = new PIStatMon  (this, "Sat", 235, 160, 255, 30);
    1616  butquit     = new PIButton   (this, "QUIT", 1010, 45,20,10,5);
    17   string Nom = nom;
     17  string Nom = nom;   // c'est le titre de la fenetre
    1818  if (Nom.substr(Nom.rfind(" ")+1,3) == "pix") {
    1919    label1      = new PILabel    (this, "Pix. nuls (%)", 235,20,10,5);
     
    8989{
    9090  SetAxesFlags(kBoxAxes | kTicks | kLabels);
    91   for (int i=0;i<8;i++) {
     91  for (int i=0;i<8;i++) {  // pour tous les CCD
    9292    ndataR[i] = ndataB[i] = 0;
    9393    yR[i] = yB[i] = NULL;
     
    139139      ndataB[ccd]++;
    140140    }
    141     SetLimits(0, 15, valmin*.9, valmax*1.1);
    142141    break;
    143142  case 12:
     
    156155      ndataB[ccd]++;
    157156    }
    158     SetLimits(0, 15, valmin*.9, valmax*1.1);
    159157    break;
    160158  case 101:
     
    173171      ndataB[ccd]++;
    174172    }
    175     SetLimits(0, 15, valmin*.9, valmax*1.1);
    176173    break;
    177174  case 102:
     
    190187      ndataB[ccd]++;
    191188    }
    192     SetLimits(0, 15, valmin*.9, valmax*1.1);
    193189    break;
    194190  case 103:
     
    207203      ndataB[ccd]++;
    208204    }
    209     SetLimits(0, 15, valmin*.9, valmax*1.1);
    210205    break;
    211206  case 104:
     
    225220      ndataB[ccd]++;
    226221    }
    227     SetLimits(0, 15, valmin*.9, valmax*1.1);
    228222    break;
    229223   
     
    231225    cout << "Choix " << choix << " non interprete" << endl;     
    232226  }
     227  if ((valmin == 0) && (valmax == 0)) SetLimits(0, 15, -1, 1);
     228  else SetLimits(0, 15, valmin*.9, valmax*1.1);
    233229}
    234230
Note: See TracChangeset for help on using the changeset viewer.