From fdc6b051c9e38d3b472a1dc574c3035709d292b1 Mon Sep 17 00:00:00 2001 From: cvs Date: Mon, 7 Feb 2000 10:38:55 +0000 Subject: [PATCH] Initial revision --- .log | 2722 +++ .rfl | 27 + Components.txt | 161 + Dbg.c | 1206 ++ Dbg.h | 46 + Dbg_cmd.c | 64 + HistDriv.i | 93 + HistMem.h | 94 + HistMem.i | 35 + Makefile | 78 + SCinter.c | 528 + SCinter.h | 133 + SICSmain.c | 87 + Scommon.h | 81 + access.c | 16 + alias.c | 214 + alias.h | 20 + amor.dic | 210 + amor2t.c | 634 + amor2t.h | 22 + amor2t.i | 27 + amor2t.tex | 176 + amor2t.w | 122 + amorpar.tcl | 23 + amorscan.c | 140 + amorscan.h | 15 + amorscan.tex | 71 + amorscan.w | 57 + amorstat.c | 772 + amorstat.h | 21 + amorstat.i | 29 + amorstat.tex | 138 + amorstat.w | 102 + amortest.tcl | 268 + ati.tcl | 7 + author.txt | 46 + autofile.tcl | 211 + backup.tcl | 137 + bare.tcl | 47 + base.tcl | 791 + beam.tcl | 20 + beamdt.tcl | 20 + bit.h | 17 + bruker.c | 999 + bruker.h | 25 + bruker.tex | 64 + bruker.w | 64 + buffer.c | 593 + buffer.h | 94 + callback.c | 228 + center.tex | 79 + center.w | 58 + chadapter.c | 322 + chadapter.h | 38 + choco.c | 247 + choco.h | 36 + choco.tex | 351 + choco.w | 264 + circular.c | 122 + circular.h | 31 + codri.h | 44 + coll.tcl | 229 + comentry.h | 54 + commandlog.c | 422 + commandlog.h | 19 + configfu.h | 26 + conman.c | 1427 ++ conman.h | 115 + copyright.h | 31 + costa.c | 198 + costa.h | 29 + costa.i | 15 + costa.tex | 108 + costa.w | 68 + cotop.tcl | 37 + countdriv.c | 723 + countdriv.h | 88 + counter.c | 1026 + counter.h | 56 + countf.tcl | 50 + cron.tex | 16 + cron.w | 16 + danu.c | 293 + danu.dat | 3 + danu.h | 41 + danu.tex | 92 + danu.w | 77 + defines.h | 19 + devexec.c | 922 + devexec.h | 146 + devexec.tex | 322 + devexec.w | 282 + dict.c | 81 + difrac.c | 539 + difrac.h | 14 + difrac/CAD4COMM | 728 + difrac/COMDIF | 54 + difrac/IATSIZ | 5 + difrac/Makefile | 43 + difrac/alfnum.f | 51 + difrac/align.f | 637 + difrac/ang180.f | 8 + difrac/ang360.f | 13 + difrac/angcal.f | 285 + difrac/angl.f | 14 + difrac/angrw.f | 76 + difrac/angval.f | 20 + difrac/basinp.f | 722 + difrac/begin.f | 436 + difrac/bigchi.f | 146 + difrac/blind.f | 730 + difrac/burger.f | 174 + difrac/cad4io.f | 517 + difrac/cad4l.f | 454 + difrac/cad4l.mak | 14 + difrac/cartc.f | 18 + difrac/cellls.f | 628 + difrac/cellsd.f | 123 + difrac/cent8.f | 405 + difrac/centre.f | 482 + difrac/cfind.f | 56 + difrac/cinput.f | 55 + difrac/cntref.f | 88 + difrac/comptn.f | 69 + difrac/creduc.f | 340 + difrac/demo1e.f | 138 + difrac/dhgen.f | 215 + difrac/dif.asc | Bin 0 -> 131702 bytes difrac/dif.mak | 34 + difrac/dif.wpd | Bin 0 -> 184931 bytes difrac/difini.f | 248 + difrac/difint.f | 716 + difrac/difrac.f | 245 + difrac/eulkap.f | 50 + difrac/fndsys.f | 399 + difrac/freefm.f | 263 + difrac/goloop.f | 433 + difrac/goniom.ini | 39 + difrac/grid.f | 195 + difrac/gwrite.f | 115 + difrac/ibmfil.f | 179 + difrac/iedevs.f | 49 + difrac/inchkl.f | 81 + difrac/indmes.f | 466 + difrac/keyget.f | 28 + difrac/latmod.f | 38 + difrac/linprf.f | 151 + difrac/list.dat | 80 + difrac/lister.f | 257 + difrac/lotem.f | 24 + difrac/lsormt.f | 547 + difrac/matrix.f | 234 + difrac/mesint.f | 401 + difrac/mod360.f | 8 + difrac/nexseg.f | 58 + difrac/orcel2.f | 318 + difrac/ormat3.f | 211 + difrac/oscil.f | 93 + difrac/params.f | 21 + difrac/pcdraw.f | 330 + difrac/pcount.f | 149 + difrac/peaksr.f | 209 + difrac/pfind.f | 54 + difrac/pltprf.f | 144 + difrac/prnbas.f | 289 + difrac/prnint.f | 423 + difrac/profil.f | 471 + difrac/prompt.f | 157 + difrac/prtang.f | 12 + difrac/pscan.f | 86 + difrac/qio.f | 204 + difrac/ralf.f | 1121 ++ difrac/range.f | 13 + difrac/rcpcor.f | 122 + difrac/readme.dif | 128 + difrac/reindx.f | 105 + difrac/sammes.f | 115 + difrac/setiou.f | 87 + difrac/setop.f | 715 + difrac/setrow.f | 184 + difrac/sgerrs.f | 41 + difrac/sglatc.f | 657 + difrac/sglpak.f | 12 + difrac/sgmtml.f | 24 + difrac/sgprnh.f | 126 + difrac/sgrmat.f | 31 + difrac/sgroup.f | 562 + difrac/sgtrcf.f | 69 + difrac/sinmat.f | 87 + difrac/stdmes.f | 168 + difrac/swrite.f | 109 + difrac/sysang.f | 74 + difrac/tcentr.f | 217 + difrac/tfind.f | 50 + difrac/trics.f | 353 + difrac/wrbas.f | 77 + difrac/wxw2t.f | 71 + difrac/yesno.f | 47 + dilludriv.c | 272 + dilludriv.h | 15 + dilu.tem | 41 + dmc.c | 54 + dmc.h | 19 + dmc.tcl | 187 + dmc.tex | 48 + dmc.w | 27 + dmca.tcl | 174 + dmccom.tcl | 13 + dmcscan.tcl | 8 + dmcsim.tcl | 167 + doc/manager/alias.htm | 45 + doc/manager/client.htm | 55 + doc/manager/cliinst.htm | 68 + doc/manager/command.htm | 217 + doc/manager/cron.htm | 18 + doc/manager/hwini.htm | 190 + doc/manager/ini.htm | 39 + doc/manager/inifile.htm | 26 + doc/manager/iscan.htm | 116 + doc/manager/keepalive | 9 + doc/manager/macroman.htm | 82 + doc/manager/manager.htm | 49 + doc/manager/managerman | 59 + doc/manager/motor.tex | 64 + doc/manager/move.htm | 59 + doc/manager/mug | 82 + doc/manager/mug.tex | 173 + doc/manager/mug.txt | 86 + doc/manager/option.htm | 60 + doc/manager/serial.htm | 103 + doc/manager/setup.htm | 89 + doc/manager/sicsinstall | 221 + doc/manager/sicsnews.htm | 33 + doc/manager/sicsstat.tcl | 264 + doc/manager/special.htm | 21 + doc/manager/sps.htm | 58 + doc/manager/startsics | 36 + doc/manager/status.htm | 63 + doc/manager/template.htm | 11 + doc/manager/trouble.htm | 207 + doc/manager/var.htm | 86 + doc/programmer/...aux | 1 + doc/programmer/README | 5 + doc/programmer/SCinter.tex | 140 + doc/programmer/alias.tex | 37 + doc/programmer/amor2t.tex | 176 + doc/programmer/amorscan.tex | 71 + doc/programmer/amorstat.tex | 138 + doc/programmer/bruker.tex | 64 + doc/programmer/buffer.tex | 81 + doc/programmer/center.tex | 75 + doc/programmer/choco.tex | 351 + doc/programmer/costa.tex | 108 + doc/programmer/counter.tex | 180 + doc/programmer/cron.tex | 16 + doc/programmer/danu.tex | 92 + doc/programmer/devexec.tex | 322 + doc/programmer/difrac.tex | 52 + doc/programmer/dmc.tex | 48 + doc/programmer/dmccom.eps | 30254 ++++++++++++++++++++++++++++++ doc/programmer/dmccom.gif | Bin 0 -> 13537 bytes doc/programmer/drive.tex | 22 + doc/programmer/dynar.tex | 140 + doc/programmer/emonitor.tex | 218 + doc/programmer/evcontroller.tex | 321 + doc/programmer/evdrivers.tex | 110 + doc/programmer/event.tex | 143 + doc/programmer/faverage.tex | 70 + doc/programmer/fowrite.tex | 22 + doc/programmer/fupa.tex | 83 + doc/programmer/hart.eps | 463 + doc/programmer/hart.gif | Bin 0 -> 6113 bytes doc/programmer/histogram.tex | 656 + doc/programmer/histsim.tex | 50 + doc/programmer/hkl.tex | 215 + doc/programmer/hklscan.tex | 111 + doc/programmer/ini.tex | 32 + doc/programmer/integrate.tex | 52 + doc/programmer/inter.tex | 69 + doc/programmer/interface.tex | 497 + doc/programmer/interrupt.tex | 53 + doc/programmer/itc4.tex | 107 + doc/programmer/kernelguide.tex | 355 + doc/programmer/macro.tex | 49 + doc/programmer/mesure.tex | 126 + doc/programmer/motor.tex | 209 + doc/programmer/mumo.tex | 49 + doc/programmer/napi.tex | 1850 ++ doc/programmer/nconman.tex | 383 + doc/programmer/network.tex | 38 + doc/programmer/newsics.eps | 660 + doc/programmer/newsics.gif | Bin 0 -> 7930 bytes doc/programmer/nread.tex | 160 + doc/programmer/nserver.tex | 123 + doc/programmer/nxamor.tex | 69 + doc/programmer/nxdata.tex | 192 + doc/programmer/nxdict.tex | 3053 +++ doc/programmer/nxsans.tex | 42 + doc/programmer/o2t.tex | 42 + doc/programmer/obpar.tex | 44 + doc/programmer/ofac.tex | 24 + doc/programmer/oguide.tex | 804 + doc/programmer/optimise.tex | 194 + doc/programmer/overview.tex | 437 + doc/programmer/passwd.tex | 20 + doc/programmer/perfmon.tex | 119 + doc/programmer/pimotor.tex | 67 + doc/programmer/progold.data | 47 + doc/programmer/programmer.tex | 37 + doc/programmer/proto.tex | 61 + doc/programmer/pub.tex | 346 + doc/programmer/reference.tex | 313 + doc/programmer/ruli.tex | 45 + doc/programmer/sanswave.tex | 100 + doc/programmer/scan.tex | 329 + doc/programmer/selector.tex | 131 + doc/programmer/serial.tex | 37 + doc/programmer/serialsinq.tex | 168 + doc/programmer/serialwait.tex | 64 + doc/programmer/servlog.tex | 22 + doc/programmer/sicsexit.tex | 8 + doc/programmer/sinqhmdriv.tex | 107 + doc/programmer/splitter.tex | 40 + doc/programmer/sps.tex | 198 + doc/programmer/status.tex | 42 + doc/programmer/stringdict.tex | 91 + doc/programmer/task.tex | 135 + doc/programmer/tclev.tex | 169 + doc/programmer/telnet.tex | 108 + doc/programmer/template.tex | 44 + doc/programmer/token.tex | 82 + doc/programmer/tricsnex.tex | 100 + doc/programmer/udpquieck.tex | 94 + doc/programmer/varlog.tex | 91 + doc/programmer/velo.tex | 412 + doc/programmer/velodorn.tex | 98 + doc/programmer/xytable.tex | 129 + doc/user/Makefile | 23 + doc/user/README | 9 + doc/user/amor2t.htm | 60 + doc/user/basic.htm | 57 + doc/user/batch.htm | 19 + doc/user/buffer.htm | 39 + doc/user/chopper.htm | 68 + doc/user/cliinst.htm | 67 + doc/user/commandlog.htm | 41 + doc/user/config.htm | 46 + doc/user/count.htm | 21 + doc/user/counter.htm | 59 + doc/user/ctrl.htm | 49 + doc/user/dmc.htm | 70 + doc/user/dmcdev.htm | 98 + doc/user/dmchw.htm | 24 + doc/user/dmcinvoc.htm | 99 + doc/user/dmcman | 50 + doc/user/dmcman.tex | 1628 ++ doc/user/dmco.htm | 165 + doc/user/drive.htm | 16 + doc/user/focus.htm | 61 + doc/user/focussps.htm | 58 + doc/user/foman | 61 + doc/user/foman.tex | 1738 ++ doc/user/fomo.htm | 57 + doc/user/fowrite.htm | 30 + doc/user/general.htm | 29 + doc/user/histogram.htm | 144 + doc/user/hkl.htm | 60 + doc/user/hklscan.htm | 34 + doc/user/illprog.htm | 693 + doc/user/illprog.txt | 693 + doc/user/index.html | 20 + doc/user/logbook.htm | 28 + doc/user/logging.htm | 30 + doc/user/macro.htm | 31 + doc/user/mesure.htm | 123 + doc/user/motor.htm | 42 + doc/user/nextrics.htm | 23 + doc/user/nxpeek.htm | 47 + doc/user/optimise.htm | 76 + doc/user/powdtcl.htm | 46 + doc/user/psish.htm | 31 + doc/user/saco.htm | 132 + doc/user/samenv.htm | 605 + doc/user/sans.htm | 64 + doc/user/sanscom.htm | 123 + doc/user/sansdev.htm | 21 + doc/user/sanslist.htm | 56 + doc/user/sansman | 63 + doc/user/sansman.tex | 1784 ++ doc/user/sharpend1.gif | Bin 0 -> 8027 bytes doc/user/sharpend2.gif | Bin 0 -> 15222 bytes doc/user/sharpend3.gif | Bin 0 -> 10777 bytes doc/user/short.htm | 107 + doc/user/sicsinvoc.htm | 118 + doc/user/sicsinvoc.txt | 62 + doc/user/sicsnews.txt | 24 + doc/user/system.htm | 38 + doc/user/tchm.htm | 134 + doc/user/telnet.inc | 36 + doc/user/token.htm | 35 + doc/user/topco.htm | 219 + doc/user/topdev.htm | 48 + doc/user/topdev_n.htm | 567 + doc/user/tophw.htm | 22 + doc/user/topinvoc.htm | 87 + doc/user/topman | 52 + doc/user/topman.tex | 1601 ++ doc/user/topscan.htm | 104 + doc/user/topsi.htm | 68 + doc/user/trics.htm | 64 + doc/user/tricsgen.htm | 32 + doc/user/tricsingle.htm | 88 + doc/user/tricsman | 346 + doc/user/tricsman.tex | 1720 ++ doc/user/tricspsd.htm | 17 + doc/user/trimot.htm | 21 + doc/user/trouble.htm | 207 + doc/user/velocity.htm | 81 + doc/user/velolambda.htm | 26 + doc/user/xytable.htm | 36 + docho.c | 738 + drive.c | 439 + drive.h | 37 + dynar.tex | 140 + dynar.w | 99 + dynstring.c | 247 + dynstring.h | 89 + ecode.c | 26 + el734dc.c | 914 + el734driv.c | 933 + el755driv.c | 318 + el755driv.h | 15 + emergency.dat | 187 + emin.i | 13 + emon.c | 386 + emon.h | 44 + emon.i | 22 + emonitor.tex | 218 + emonitor.w | 177 + eurodriv.c | 395 + eurodriv.h | 23 + evcontroller.c | 1373 ++ evcontroller.h | 49 + evcontroller.i | 41 + evcontroller.tex | 321 + evcontroller.w | 260 + evdriver.c | 71 + evdriver.i | 35 + event.c | 67 + event.h | 55 + event.tex | 144 + event.w | 97 + faverage.c | 270 + faverage.h | 20 + faverage.tex | 70 + faverage.w | 50 + fcircle.tcl | 355 + fetest.tcl | 4 + fitcenter.c | 473 + fitcenter.h | 40 + focus.dic | 104 + fortify.c | 917 + fortify.doc | 409 + fortify.h | 83 + fowrite.c | 715 + fowrite.h | 21 + ftest.tcl | 178 + fupa.c | 173 + fupa.h | 58 + hakle.tcl | 273 + hardsup/Makefile | 26 + hardsup/README | 4 + hardsup/asynsrv_def.h | 49 + hardsup/asynsrv_errcodes.h | 66 + hardsup/asynsrv_mark.c | 1465 ++ hardsup/asynsrv_utility.c | 1762 ++ hardsup/c_interfaces.c | 472 + hardsup/dillutil.c | 478 + hardsup/dillutil.h | 108 + hardsup/el734_def.h | 73 + hardsup/el734_errcodes.h | 28 + hardsup/el734_utility.c | 2194 +++ hardsup/el734fix.h | 29 + hardsup/el734tcl.c | 644 + hardsup/el737_def.h | 67 + hardsup/el737_errcodes.h | 26 + hardsup/el737_utility.c | 1478 ++ hardsup/el737fix.h | 33 + hardsup/el737tcl.c | 400 + hardsup/el755_def.h | 31 + hardsup/el755_errcodes.h | 27 + hardsup/el755_errorlog.c | 26 + hardsup/el755_utility.c | 1445 ++ hardsup/err.c | 105 + hardsup/failinet.c | 109 + hardsup/geterrno.c | 96 + hardsup/itc4util.c | 421 + hardsup/itc4util.h | 124 + hardsup/makeprint.c | 203 + hardsup/rs232c_def.h | 179 + hardsup/serialsinq.c | 915 + hardsup/serialsinq.h | 56 + hardsup/sinq_defs.h | 108 + hardsup/sinq_prototypes.h | 546 + hardsup/sinqhm.c | 1440 ++ hardsup/sinqhm.h | 98 + hardsup/sinqhm.i | 51 + hardsup/sinqhm.tex | 572 + hardsup/sinqhm.w | 400 + hardsup/sinqhm_client.c | 1434 ++ hardsup/sinqhm_ctrl.c | 1057 ++ hardsup/sinqhm_def.h | 374 + hardsup/stredit.c | 415 + hardsup/strjoin.c | 142 + hardsup/table.c | 175 + hardsup/table.h | 35 + hardsup/velsel_def.h | 83 + hardsup/velsel_utility.c | 928 + helium.tcl | 34 + histdriv.c | 303 + histmem.c | 1741 ++ histogram.tex | 656 + histogram.w | 503 + histsim.c | 269 + histsim.h | 22 + histsim.tex | 50 + histsim.w | 30 + hkl.c | 1441 ++ hkl.h | 51 + hkl.i | 27 + hkl.test | 291 + hkl.tex | 215 + hkl.w | 173 + hklbuf.buf | Bin 0 -> 800 bytes hklscan.c | 434 + hklscan.h | 25 + hklscan.i | 17 + hklscan.tex | 111 + hklscan.w | 70 + ifile.c | 227 + ifile.h | 32 + inc.tcl | 22 + inherit.tcl | 297 + inidill.tcl | 4 + init8.c | 293 + initcl.c | 292 + intcli.c | 83 + integrate.c | 353 + integrate.h | 21 + integrate.tex | 52 + integrate.w | 44 + interface.c | 117 + interface.h | 123 + interface.tex | 497 + interface.w | 396 + interrupt.h | 49 + intserv.c | 119 + itc4.c | 283 + itc4.h | 43 + itc4.tcl | 7 + itc4.tex | 107 + itc4.w | 74 + itc4driv.c | 470 + keepalive | 9 + lld.c | 686 + lld.h | 137 + lld_blob.c | 131 + lld_blob.h | 53 + lld_str.h | 37 + log/sanslog00.log | 32 + ltc11.c | 828 + ltc11.h | 24 + macro.c | 825 + macro.h | 49 + maximize.c | 506 + maximize.h | 35 + mesure.c | 1390 ++ mesure.h | 39 + mesure.tex | 126 + mesure.w | 104 + modriv.h | 97 + motor.c | 1202 ++ motor.h | 57 + motor/Makefile | 21 + motor/el734_test.c | 3900 ++++ motor/makeprint.c | 203 + motor/test.dat | 45 + mumo.c | 811 + mumo.h | 36 + mumo.i | 9 + mumoconf.c | 373 + napi.c | 1373 ++ napi.h | 271 + napi.tex | 1850 ++ napif.f | 274 + napif.inc | 47 + nconman.tex | 389 + nconman.w | 356 + network.c | 705 + network.h | 91 + nextrics.c | 815 + nextrics.h | 37 + nread.c | 1028 + nread.h | 36 + nread.tex | 160 + nread.w | 139 + nserver.c | 458 + nserver.h | 51 + nserver.tex | 123 + nserver.w | 90 + nxamor.c | 499 + nxamor.h | 27 + nxamor.tex | 69 + nxamor.w | 48 + nxdata.c | 871 + nxdata.h | 30 + nxdata.tex | 192 + nxdata.w | 89 + nxdict.c | 1963 ++ nxdict.h | 88 + nxdict.tex | 3053 +++ nxdict.w | 2537 +++ nxdump.c | 133 + nxsans.c | 678 + nxsans.h | 17 + nxutil.c | 328 + nxutil.h | 34 + o2t.c | 306 + o2t.h | 22 + obdes.c | 135 + obdes.h | 55 + obpar.c | 198 + obpar.h | 69 + obtcl.tcl | 540 + ofac.c | 368 + ofac.h | 26 + old/scan.c | 2102 +++ old/scan.h | 51 + old/scan.i | 52 + old/scan.tex | 222 + old/scan.w | 185 + optfn.tcl | 37 + optimise.c | 811 + optimise.h | 44 + optimise.tex | 196 + optimise.w | 189 + optn.tcl | 22 + outcode.c | 22 + passwd.c | 164 + passwd.h | 22 + perfmon.c | 257 + perfmon.h | 36 + perfmon.i | 26 + perfmon.tex | 119 + perfmon.w | 78 + pimotor.c | 785 + pimotor.h | 24 + pimotor.tex | 67 + pimotor.w | 48 + pipiezo.c | 391 + psitest.tcl | 9 + rmlead.c | 26 + rmtrail.c | 31 + ruli.c | 335 + ruli.h | 39 + sans.tcl | 208 + sansdict.dic | 117 + sansreal.tcl | 168 + sanswave.c | 385 + sanswave.h | 27 + sanswave.tex | 100 + sanswave.w | 67 + scaldate.c | 55 + scaldate.h | 83 + scan.c | 2316 +++ scan.h | 62 + scan.i | 63 + scan.tex | 329 + scan.w | 291 + scontroller.c | 282 + script.c | 525 + script.h | 50 + sdynar.c | 198 + sdynar.h | 31 + sdynar.i | 20 + sel2.c | 528 + selector.c | 842 + selector.h | 60 + selvar.c | 640 + selvar.h | 38 + selvar.i | 12 + serial.c | 25 + serial.h | 15 + serial.tex | 37 + serial.w | 29 + serialsinq.h | 51 + serialsinq.tex | 168 + serialsinq.w | 135 + serialwait.c | 240 + serialwait.h | 19 + serialwait.tex | 64 + serialwait.w | 56 + servlog.c | 307 + servlog.h | 23 + servo.tcl | 77 + sics.h | 29 + sicscron.c | 140 + sicscron.h | 13 + sicsexit.c | 93 + sicsexit.h | 16 + sicsstat.tcl | 406 + sicsstatus.tcl | 368 + sicsvar.h | 74 + sicvar.c | 668 + simchop.c | 327 + simcter.c | 320 + simdriv.c | 331 + simev.c | 263 + simev.h | 12 + sinqhmdriv.c | 849 + sinqhmdriv.i | 37 + sinqhmdriv.tex | 107 + sinqhmdriv.w | 78 + sinqhmtcl.c | 575 + splitter.c | 417 + splitter.h | 72 + sps.c | 792 + sps.h | 27 + sps.i | 26 + sps.tex | 198 + sps.w | 144 + status.c | 343 + status.h | 45 + stest.log | 24 + stest.tcl | 7 + stptok.c | 55 + strdup.c | 29 + stringdict.c | 278 + stringdict.h | 39 + stringdict.tex | 91 + stringdict.w | 72 + strrepl.c | 75 + task.c | 348 + task.h | 121 + tcl/base.tcl | 791 + tcl/base8.tcl | 791 + tcl/bgerror.tcl | 8 + tcl/client.tcl | 151 + tcl/count.tcl | 45 + tcl/cscan.tcl | 126 + tcl/d.tcl | 3 + tcl/fit.tcl | 52 + tcl/g.tcl | 5 + tcl/inherit.tcl | 297 + tcl/inherit8.tcl | 297 + tcl/init.tcl | 616 + tcl/init8.c | 293 + tcl/init8.tcl | 617 + tcl/initcl.c | 292 + tcl/ldAout.tcl | 228 + tcl/log.tcl | 84 + tcl/obtcl.tcl | 540 + tcl/obtcl8.tcl | 540 + tcl/obtcl_mkindex | 9 + tcl/parray.tcl | 29 + tcl/reflist.tcl | 79 + tcl/scan.tcl | 74 + tcl/stdin.tcl | 23 + tcl/susca.tcl | 62 + tcl/tail.tcl | 12 + tcl/tcl8/base8.tcl | 791 + tcl/tcl8/inherit8.tcl | 297 + tcl/tcl8/init8.tcl | 617 + tcl/tcl8/obtcl8.tcl | 540 + tcl/tcl8/test.tst | 112 + tcl/tcl8/topsicom.tcl | 771 + tcl/tcl8/utils.tcl | 398 + tcl/tclIndex | 116 + tcl/topsicom.tcl | 394 + tcl/topsiold.tcl | 772 + tcl/utils.tcl | 398 + tcl/var.lis | 28 + tclev.c | 530 + tclev.h | 25 + tclev.i | 24 + tclev.tex | 169 + tclev.w | 126 + tclvarex.tcl | 57 + tdir.tcl | 5 + telnet.c | 275 + telnet.h | 27 + telnet.tex | 108 + telnet.w | 74 + test.db | 15 + test.dict | 20 + test.hdd | 10 + test.tcl | 375 + testj.tcl | 7 + token.c | 156 + token.h | 36 + token.tex | 82 + token.w | 74 + topsi.hdd | 18 + topsir.tcl | 127 + topsirr.tcl | 120 + transact.tcl | 20 + trics.dic | 105 + trics.tcl | 199 + tricsnex.tex | 100 + tricsnex.w | 79 + trim.c | 78 + tscan.tcl | 8 + ttest.tcl | 83 + udpquieck.c | 120 + udpquieck.h | 24 + udpquieck.tex | 94 + udpquieck.w | 74 + ufortify.h | 37 + utils.tcl | 398 + uubuffer.c | 166 + uubuffer.h | 27 + uusend.c | 146 + varlog.c | 506 + varlog.h | 33 + varlog.tex | 91 + varlog.w | 74 + velo.c | 1233 ++ velo.h | 68 + velo.i | 50 + velo.tex | 412 + velo.w | 316 + velodorn.c | 221 + velodorn.h | 55 + velodorn.tex | 113 + velodorn.w | 93 + velodornier.c | 683 + velodriv.h | 51 + velosim.c | 319 + viscom.tcl | 266 + volist.tcl | 35 + xy.tcl | 6 + xytable.c | 313 + xytable.h | 27 + xytable.i | 17 + xytable.tex | 129 + xytable.w | 89 + 846 files changed, 230218 insertions(+) create mode 100644 .log create mode 100644 .rfl create mode 100644 Components.txt create mode 100644 Dbg.c create mode 100644 Dbg.h create mode 100644 Dbg_cmd.c create mode 100644 HistDriv.i create mode 100644 HistMem.h create mode 100644 HistMem.i create mode 100644 Makefile create mode 100644 SCinter.c create mode 100644 SCinter.h create mode 100644 SICSmain.c create mode 100644 Scommon.h create mode 100644 access.c create mode 100644 alias.c create mode 100644 alias.h create mode 100644 amor.dic create mode 100644 amor2t.c create mode 100644 amor2t.h create mode 100644 amor2t.i create mode 100644 amor2t.tex create mode 100644 amor2t.w create mode 100644 amorpar.tcl create mode 100644 amorscan.c create mode 100644 amorscan.h create mode 100644 amorscan.tex create mode 100644 amorscan.w create mode 100644 amorstat.c create mode 100644 amorstat.h create mode 100644 amorstat.i create mode 100644 amorstat.tex create mode 100644 amorstat.w create mode 100644 amortest.tcl create mode 100644 ati.tcl create mode 100644 author.txt create mode 100644 autofile.tcl create mode 100644 backup.tcl create mode 100644 bare.tcl create mode 100644 base.tcl create mode 100644 beam.tcl create mode 100644 beamdt.tcl create mode 100644 bit.h create mode 100644 bruker.c create mode 100644 bruker.h create mode 100644 bruker.tex create mode 100644 bruker.w create mode 100644 buffer.c create mode 100644 buffer.h create mode 100644 callback.c create mode 100644 center.tex create mode 100644 center.w create mode 100644 chadapter.c create mode 100644 chadapter.h create mode 100644 choco.c create mode 100644 choco.h create mode 100644 choco.tex create mode 100644 choco.w create mode 100644 circular.c create mode 100644 circular.h create mode 100644 codri.h create mode 100644 coll.tcl create mode 100644 comentry.h create mode 100644 commandlog.c create mode 100644 commandlog.h create mode 100644 configfu.h create mode 100644 conman.c create mode 100644 conman.h create mode 100644 copyright.h create mode 100644 costa.c create mode 100644 costa.h create mode 100644 costa.i create mode 100644 costa.tex create mode 100644 costa.w create mode 100644 cotop.tcl create mode 100644 countdriv.c create mode 100644 countdriv.h create mode 100644 counter.c create mode 100644 counter.h create mode 100644 countf.tcl create mode 100644 cron.tex create mode 100644 cron.w create mode 100644 danu.c create mode 100644 danu.dat create mode 100644 danu.h create mode 100644 danu.tex create mode 100644 danu.w create mode 100644 defines.h create mode 100644 devexec.c create mode 100644 devexec.h create mode 100644 devexec.tex create mode 100644 devexec.w create mode 100644 dict.c create mode 100644 difrac.c create mode 100644 difrac.h create mode 100644 difrac/CAD4COMM create mode 100644 difrac/COMDIF create mode 100644 difrac/IATSIZ create mode 100644 difrac/Makefile create mode 100644 difrac/alfnum.f create mode 100644 difrac/align.f create mode 100644 difrac/ang180.f create mode 100644 difrac/ang360.f create mode 100644 difrac/angcal.f create mode 100644 difrac/angl.f create mode 100644 difrac/angrw.f create mode 100644 difrac/angval.f create mode 100644 difrac/basinp.f create mode 100644 difrac/begin.f create mode 100644 difrac/bigchi.f create mode 100644 difrac/blind.f create mode 100644 difrac/burger.f create mode 100644 difrac/cad4io.f create mode 100644 difrac/cad4l.f create mode 100644 difrac/cad4l.mak create mode 100644 difrac/cartc.f create mode 100644 difrac/cellls.f create mode 100644 difrac/cellsd.f create mode 100644 difrac/cent8.f create mode 100644 difrac/centre.f create mode 100644 difrac/cfind.f create mode 100644 difrac/cinput.f create mode 100644 difrac/cntref.f create mode 100644 difrac/comptn.f create mode 100644 difrac/creduc.f create mode 100644 difrac/demo1e.f create mode 100644 difrac/dhgen.f create mode 100644 difrac/dif.asc create mode 100644 difrac/dif.mak create mode 100644 difrac/dif.wpd create mode 100644 difrac/difini.f create mode 100644 difrac/difint.f create mode 100644 difrac/difrac.f create mode 100644 difrac/eulkap.f create mode 100644 difrac/fndsys.f create mode 100644 difrac/freefm.f create mode 100644 difrac/goloop.f create mode 100644 difrac/goniom.ini create mode 100644 difrac/grid.f create mode 100644 difrac/gwrite.f create mode 100644 difrac/ibmfil.f create mode 100644 difrac/iedevs.f create mode 100644 difrac/inchkl.f create mode 100644 difrac/indmes.f create mode 100644 difrac/keyget.f create mode 100644 difrac/latmod.f create mode 100644 difrac/linprf.f create mode 100644 difrac/list.dat create mode 100644 difrac/lister.f create mode 100644 difrac/lotem.f create mode 100644 difrac/lsormt.f create mode 100644 difrac/matrix.f create mode 100644 difrac/mesint.f create mode 100644 difrac/mod360.f create mode 100644 difrac/nexseg.f create mode 100644 difrac/orcel2.f create mode 100644 difrac/ormat3.f create mode 100644 difrac/oscil.f create mode 100644 difrac/params.f create mode 100644 difrac/pcdraw.f create mode 100644 difrac/pcount.f create mode 100644 difrac/peaksr.f create mode 100644 difrac/pfind.f create mode 100644 difrac/pltprf.f create mode 100644 difrac/prnbas.f create mode 100644 difrac/prnint.f create mode 100644 difrac/profil.f create mode 100644 difrac/prompt.f create mode 100644 difrac/prtang.f create mode 100644 difrac/pscan.f create mode 100644 difrac/qio.f create mode 100644 difrac/ralf.f create mode 100644 difrac/range.f create mode 100644 difrac/rcpcor.f create mode 100644 difrac/readme.dif create mode 100644 difrac/reindx.f create mode 100644 difrac/sammes.f create mode 100644 difrac/setiou.f create mode 100644 difrac/setop.f create mode 100644 difrac/setrow.f create mode 100644 difrac/sgerrs.f create mode 100644 difrac/sglatc.f create mode 100644 difrac/sglpak.f create mode 100644 difrac/sgmtml.f create mode 100644 difrac/sgprnh.f create mode 100644 difrac/sgrmat.f create mode 100644 difrac/sgroup.f create mode 100644 difrac/sgtrcf.f create mode 100644 difrac/sinmat.f create mode 100644 difrac/stdmes.f create mode 100644 difrac/swrite.f create mode 100644 difrac/sysang.f create mode 100644 difrac/tcentr.f create mode 100644 difrac/tfind.f create mode 100644 difrac/trics.f create mode 100644 difrac/wrbas.f create mode 100644 difrac/wxw2t.f create mode 100644 difrac/yesno.f create mode 100644 dilludriv.c create mode 100644 dilludriv.h create mode 100644 dilu.tem create mode 100644 dmc.c create mode 100644 dmc.h create mode 100644 dmc.tcl create mode 100644 dmc.tex create mode 100644 dmc.w create mode 100644 dmca.tcl create mode 100644 dmccom.tcl create mode 100644 dmcscan.tcl create mode 100755 dmcsim.tcl create mode 100644 doc/manager/alias.htm create mode 100644 doc/manager/client.htm create mode 100644 doc/manager/cliinst.htm create mode 100644 doc/manager/command.htm create mode 100644 doc/manager/cron.htm create mode 100644 doc/manager/hwini.htm create mode 100644 doc/manager/ini.htm create mode 100644 doc/manager/inifile.htm create mode 100644 doc/manager/iscan.htm create mode 100755 doc/manager/keepalive create mode 100644 doc/manager/macroman.htm create mode 100644 doc/manager/manager.htm create mode 100644 doc/manager/managerman create mode 100644 doc/manager/motor.tex create mode 100644 doc/manager/move.htm create mode 100644 doc/manager/mug create mode 100644 doc/manager/mug.tex create mode 100644 doc/manager/mug.txt create mode 100644 doc/manager/option.htm create mode 100644 doc/manager/serial.htm create mode 100644 doc/manager/setup.htm create mode 100755 doc/manager/sicsinstall create mode 100644 doc/manager/sicsnews.htm create mode 100644 doc/manager/sicsstat.tcl create mode 100644 doc/manager/special.htm create mode 100644 doc/manager/sps.htm create mode 100755 doc/manager/startsics create mode 100644 doc/manager/status.htm create mode 100644 doc/manager/template.htm create mode 100644 doc/manager/trouble.htm create mode 100644 doc/manager/var.htm create mode 100644 doc/programmer/...aux create mode 100644 doc/programmer/README create mode 100644 doc/programmer/SCinter.tex create mode 100644 doc/programmer/alias.tex create mode 100644 doc/programmer/amor2t.tex create mode 100644 doc/programmer/amorscan.tex create mode 100644 doc/programmer/amorstat.tex create mode 100644 doc/programmer/bruker.tex create mode 100644 doc/programmer/buffer.tex create mode 100644 doc/programmer/center.tex create mode 100644 doc/programmer/choco.tex create mode 100644 doc/programmer/costa.tex create mode 100644 doc/programmer/counter.tex create mode 100644 doc/programmer/cron.tex create mode 100644 doc/programmer/danu.tex create mode 100644 doc/programmer/devexec.tex create mode 100644 doc/programmer/difrac.tex create mode 100644 doc/programmer/dmc.tex create mode 100644 doc/programmer/dmccom.eps create mode 100644 doc/programmer/dmccom.gif create mode 100644 doc/programmer/drive.tex create mode 100644 doc/programmer/dynar.tex create mode 100644 doc/programmer/emonitor.tex create mode 100644 doc/programmer/evcontroller.tex create mode 100644 doc/programmer/evdrivers.tex create mode 100644 doc/programmer/event.tex create mode 100644 doc/programmer/faverage.tex create mode 100644 doc/programmer/fowrite.tex create mode 100644 doc/programmer/fupa.tex create mode 100644 doc/programmer/hart.eps create mode 100644 doc/programmer/hart.gif create mode 100644 doc/programmer/histogram.tex create mode 100644 doc/programmer/histsim.tex create mode 100644 doc/programmer/hkl.tex create mode 100644 doc/programmer/hklscan.tex create mode 100644 doc/programmer/ini.tex create mode 100644 doc/programmer/integrate.tex create mode 100644 doc/programmer/inter.tex create mode 100644 doc/programmer/interface.tex create mode 100644 doc/programmer/interrupt.tex create mode 100644 doc/programmer/itc4.tex create mode 100644 doc/programmer/kernelguide.tex create mode 100644 doc/programmer/macro.tex create mode 100644 doc/programmer/mesure.tex create mode 100644 doc/programmer/motor.tex create mode 100644 doc/programmer/mumo.tex create mode 100644 doc/programmer/napi.tex create mode 100644 doc/programmer/nconman.tex create mode 100644 doc/programmer/network.tex create mode 100644 doc/programmer/newsics.eps create mode 100644 doc/programmer/newsics.gif create mode 100644 doc/programmer/nread.tex create mode 100644 doc/programmer/nserver.tex create mode 100644 doc/programmer/nxamor.tex create mode 100644 doc/programmer/nxdata.tex create mode 100644 doc/programmer/nxdict.tex create mode 100644 doc/programmer/nxsans.tex create mode 100644 doc/programmer/o2t.tex create mode 100644 doc/programmer/obpar.tex create mode 100644 doc/programmer/ofac.tex create mode 100644 doc/programmer/oguide.tex create mode 100644 doc/programmer/optimise.tex create mode 100644 doc/programmer/overview.tex create mode 100644 doc/programmer/passwd.tex create mode 100644 doc/programmer/perfmon.tex create mode 100644 doc/programmer/pimotor.tex create mode 100644 doc/programmer/progold.data create mode 100644 doc/programmer/programmer.tex create mode 100644 doc/programmer/proto.tex create mode 100644 doc/programmer/pub.tex create mode 100644 doc/programmer/reference.tex create mode 100644 doc/programmer/ruli.tex create mode 100644 doc/programmer/sanswave.tex create mode 100644 doc/programmer/scan.tex create mode 100644 doc/programmer/selector.tex create mode 100644 doc/programmer/serial.tex create mode 100644 doc/programmer/serialsinq.tex create mode 100644 doc/programmer/serialwait.tex create mode 100644 doc/programmer/servlog.tex create mode 100644 doc/programmer/sicsexit.tex create mode 100644 doc/programmer/sinqhmdriv.tex create mode 100644 doc/programmer/splitter.tex create mode 100644 doc/programmer/sps.tex create mode 100644 doc/programmer/status.tex create mode 100644 doc/programmer/stringdict.tex create mode 100644 doc/programmer/task.tex create mode 100644 doc/programmer/tclev.tex create mode 100644 doc/programmer/telnet.tex create mode 100644 doc/programmer/template.tex create mode 100644 doc/programmer/token.tex create mode 100644 doc/programmer/tricsnex.tex create mode 100644 doc/programmer/udpquieck.tex create mode 100644 doc/programmer/varlog.tex create mode 100644 doc/programmer/velo.tex create mode 100644 doc/programmer/velodorn.tex create mode 100644 doc/programmer/xytable.tex create mode 100644 doc/user/Makefile create mode 100644 doc/user/README create mode 100644 doc/user/amor2t.htm create mode 100644 doc/user/basic.htm create mode 100644 doc/user/batch.htm create mode 100644 doc/user/buffer.htm create mode 100644 doc/user/chopper.htm create mode 100644 doc/user/cliinst.htm create mode 100644 doc/user/commandlog.htm create mode 100644 doc/user/config.htm create mode 100644 doc/user/count.htm create mode 100644 doc/user/counter.htm create mode 100644 doc/user/ctrl.htm create mode 100644 doc/user/dmc.htm create mode 100644 doc/user/dmcdev.htm create mode 100644 doc/user/dmchw.htm create mode 100644 doc/user/dmcinvoc.htm create mode 100644 doc/user/dmcman create mode 100644 doc/user/dmcman.tex create mode 100644 doc/user/dmco.htm create mode 100644 doc/user/drive.htm create mode 100644 doc/user/focus.htm create mode 100644 doc/user/focussps.htm create mode 100644 doc/user/foman create mode 100644 doc/user/foman.tex create mode 100644 doc/user/fomo.htm create mode 100644 doc/user/fowrite.htm create mode 100644 doc/user/general.htm create mode 100644 doc/user/histogram.htm create mode 100644 doc/user/hkl.htm create mode 100644 doc/user/hklscan.htm create mode 100644 doc/user/illprog.htm create mode 100644 doc/user/illprog.txt create mode 100644 doc/user/index.html create mode 100644 doc/user/logbook.htm create mode 100644 doc/user/logging.htm create mode 100644 doc/user/macro.htm create mode 100644 doc/user/mesure.htm create mode 100644 doc/user/motor.htm create mode 100644 doc/user/nextrics.htm create mode 100644 doc/user/nxpeek.htm create mode 100644 doc/user/optimise.htm create mode 100644 doc/user/powdtcl.htm create mode 100644 doc/user/psish.htm create mode 100644 doc/user/saco.htm create mode 100644 doc/user/samenv.htm create mode 100644 doc/user/sans.htm create mode 100644 doc/user/sanscom.htm create mode 100644 doc/user/sansdev.htm create mode 100644 doc/user/sanslist.htm create mode 100644 doc/user/sansman create mode 100644 doc/user/sansman.tex create mode 100644 doc/user/sharpend1.gif create mode 100644 doc/user/sharpend2.gif create mode 100644 doc/user/sharpend3.gif create mode 100644 doc/user/short.htm create mode 100644 doc/user/sicsinvoc.htm create mode 100644 doc/user/sicsinvoc.txt create mode 100644 doc/user/sicsnews.txt create mode 100644 doc/user/system.htm create mode 100644 doc/user/tchm.htm create mode 100644 doc/user/telnet.inc create mode 100644 doc/user/token.htm create mode 100644 doc/user/topco.htm create mode 100644 doc/user/topdev.htm create mode 100644 doc/user/topdev_n.htm create mode 100644 doc/user/tophw.htm create mode 100644 doc/user/topinvoc.htm create mode 100644 doc/user/topman create mode 100644 doc/user/topman.tex create mode 100644 doc/user/topscan.htm create mode 100644 doc/user/topsi.htm create mode 100644 doc/user/trics.htm create mode 100644 doc/user/tricsgen.htm create mode 100644 doc/user/tricsingle.htm create mode 100644 doc/user/tricsman create mode 100644 doc/user/tricsman.tex create mode 100644 doc/user/tricspsd.htm create mode 100644 doc/user/trimot.htm create mode 100644 doc/user/trouble.htm create mode 100644 doc/user/velocity.htm create mode 100644 doc/user/velolambda.htm create mode 100644 doc/user/xytable.htm create mode 100644 docho.c create mode 100644 drive.c create mode 100644 drive.h create mode 100644 dynar.tex create mode 100644 dynar.w create mode 100644 dynstring.c create mode 100644 dynstring.h create mode 100644 ecode.c create mode 100644 el734dc.c create mode 100644 el734driv.c create mode 100644 el755driv.c create mode 100644 el755driv.h create mode 100644 emergency.dat create mode 100644 emin.i create mode 100644 emon.c create mode 100644 emon.h create mode 100644 emon.i create mode 100644 emonitor.tex create mode 100644 emonitor.w create mode 100644 eurodriv.c create mode 100644 eurodriv.h create mode 100644 evcontroller.c create mode 100644 evcontroller.h create mode 100644 evcontroller.i create mode 100644 evcontroller.tex create mode 100644 evcontroller.w create mode 100644 evdriver.c create mode 100644 evdriver.i create mode 100644 event.c create mode 100644 event.h create mode 100644 event.tex create mode 100644 event.w create mode 100644 faverage.c create mode 100644 faverage.h create mode 100644 faverage.tex create mode 100644 faverage.w create mode 100644 fcircle.tcl create mode 100644 fetest.tcl create mode 100644 fitcenter.c create mode 100644 fitcenter.h create mode 100644 focus.dic create mode 100644 fortify.c create mode 100644 fortify.doc create mode 100644 fortify.h create mode 100644 fowrite.c create mode 100644 fowrite.h create mode 100644 ftest.tcl create mode 100644 fupa.c create mode 100644 fupa.h create mode 100644 hakle.tcl create mode 100644 hardsup/Makefile create mode 100644 hardsup/README create mode 100644 hardsup/asynsrv_def.h create mode 100644 hardsup/asynsrv_errcodes.h create mode 100644 hardsup/asynsrv_mark.c create mode 100644 hardsup/asynsrv_utility.c create mode 100644 hardsup/c_interfaces.c create mode 100644 hardsup/dillutil.c create mode 100644 hardsup/dillutil.h create mode 100644 hardsup/el734_def.h create mode 100644 hardsup/el734_errcodes.h create mode 100644 hardsup/el734_utility.c create mode 100644 hardsup/el734fix.h create mode 100644 hardsup/el734tcl.c create mode 100644 hardsup/el737_def.h create mode 100644 hardsup/el737_errcodes.h create mode 100644 hardsup/el737_utility.c create mode 100644 hardsup/el737fix.h create mode 100644 hardsup/el737tcl.c create mode 100644 hardsup/el755_def.h create mode 100644 hardsup/el755_errcodes.h create mode 100644 hardsup/el755_errorlog.c create mode 100644 hardsup/el755_utility.c create mode 100644 hardsup/err.c create mode 100644 hardsup/failinet.c create mode 100644 hardsup/geterrno.c create mode 100644 hardsup/itc4util.c create mode 100644 hardsup/itc4util.h create mode 100644 hardsup/makeprint.c create mode 100644 hardsup/rs232c_def.h create mode 100644 hardsup/serialsinq.c create mode 100644 hardsup/serialsinq.h create mode 100644 hardsup/sinq_defs.h create mode 100644 hardsup/sinq_prototypes.h create mode 100644 hardsup/sinqhm.c create mode 100644 hardsup/sinqhm.h create mode 100644 hardsup/sinqhm.i create mode 100644 hardsup/sinqhm.tex create mode 100644 hardsup/sinqhm.w create mode 100644 hardsup/sinqhm_client.c create mode 100644 hardsup/sinqhm_ctrl.c create mode 100644 hardsup/sinqhm_def.h create mode 100644 hardsup/stredit.c create mode 100644 hardsup/strjoin.c create mode 100644 hardsup/table.c create mode 100644 hardsup/table.h create mode 100644 hardsup/velsel_def.h create mode 100644 hardsup/velsel_utility.c create mode 100644 helium.tcl create mode 100644 histdriv.c create mode 100644 histmem.c create mode 100644 histogram.tex create mode 100644 histogram.w create mode 100644 histsim.c create mode 100644 histsim.h create mode 100644 histsim.tex create mode 100644 histsim.w create mode 100644 hkl.c create mode 100644 hkl.h create mode 100644 hkl.i create mode 100644 hkl.test create mode 100644 hkl.tex create mode 100644 hkl.w create mode 100644 hklbuf.buf create mode 100644 hklscan.c create mode 100644 hklscan.h create mode 100644 hklscan.i create mode 100644 hklscan.tex create mode 100644 hklscan.w create mode 100644 ifile.c create mode 100644 ifile.h create mode 100644 inc.tcl create mode 100644 inherit.tcl create mode 100644 inidill.tcl create mode 100644 init8.c create mode 100644 initcl.c create mode 100644 intcli.c create mode 100644 integrate.c create mode 100644 integrate.h create mode 100644 integrate.tex create mode 100644 integrate.w create mode 100644 interface.c create mode 100644 interface.h create mode 100644 interface.tex create mode 100644 interface.w create mode 100644 interrupt.h create mode 100644 intserv.c create mode 100644 itc4.c create mode 100644 itc4.h create mode 100644 itc4.tcl create mode 100644 itc4.tex create mode 100644 itc4.w create mode 100644 itc4driv.c create mode 100755 keepalive create mode 100644 lld.c create mode 100644 lld.h create mode 100644 lld_blob.c create mode 100644 lld_blob.h create mode 100644 lld_str.h create mode 100644 log/sanslog00.log create mode 100644 ltc11.c create mode 100644 ltc11.h create mode 100644 macro.c create mode 100644 macro.h create mode 100644 maximize.c create mode 100644 maximize.h create mode 100644 mesure.c create mode 100644 mesure.h create mode 100644 mesure.tex create mode 100644 mesure.w create mode 100644 modriv.h create mode 100644 motor.c create mode 100644 motor.h create mode 100644 motor/Makefile create mode 100644 motor/el734_test.c create mode 100644 motor/makeprint.c create mode 100644 motor/test.dat create mode 100644 mumo.c create mode 100644 mumo.h create mode 100644 mumo.i create mode 100644 mumoconf.c create mode 100644 napi.c create mode 100644 napi.h create mode 100644 napi.tex create mode 100644 napif.f create mode 100644 napif.inc create mode 100644 nconman.tex create mode 100644 nconman.w create mode 100644 network.c create mode 100644 network.h create mode 100644 nextrics.c create mode 100644 nextrics.h create mode 100644 nread.c create mode 100644 nread.h create mode 100644 nread.tex create mode 100644 nread.w create mode 100644 nserver.c create mode 100644 nserver.h create mode 100644 nserver.tex create mode 100644 nserver.w create mode 100644 nxamor.c create mode 100644 nxamor.h create mode 100644 nxamor.tex create mode 100644 nxamor.w create mode 100644 nxdata.c create mode 100644 nxdata.h create mode 100644 nxdata.tex create mode 100644 nxdata.w create mode 100644 nxdict.c create mode 100644 nxdict.h create mode 100644 nxdict.tex create mode 100644 nxdict.w create mode 100644 nxdump.c create mode 100644 nxsans.c create mode 100644 nxsans.h create mode 100644 nxutil.c create mode 100644 nxutil.h create mode 100644 o2t.c create mode 100644 o2t.h create mode 100644 obdes.c create mode 100644 obdes.h create mode 100644 obpar.c create mode 100644 obpar.h create mode 100644 obtcl.tcl create mode 100644 ofac.c create mode 100644 ofac.h create mode 100644 old/scan.c create mode 100644 old/scan.h create mode 100644 old/scan.i create mode 100644 old/scan.tex create mode 100644 old/scan.w create mode 100644 optfn.tcl create mode 100644 optimise.c create mode 100644 optimise.h create mode 100644 optimise.tex create mode 100644 optimise.w create mode 100644 optn.tcl create mode 100644 outcode.c create mode 100644 passwd.c create mode 100644 passwd.h create mode 100644 perfmon.c create mode 100644 perfmon.h create mode 100644 perfmon.i create mode 100644 perfmon.tex create mode 100644 perfmon.w create mode 100644 pimotor.c create mode 100644 pimotor.h create mode 100644 pimotor.tex create mode 100644 pimotor.w create mode 100644 pipiezo.c create mode 100644 psitest.tcl create mode 100644 rmlead.c create mode 100644 rmtrail.c create mode 100644 ruli.c create mode 100644 ruli.h create mode 100644 sans.tcl create mode 100644 sansdict.dic create mode 100644 sansreal.tcl create mode 100644 sanswave.c create mode 100644 sanswave.h create mode 100644 sanswave.tex create mode 100644 sanswave.w create mode 100644 scaldate.c create mode 100644 scaldate.h create mode 100644 scan.c create mode 100644 scan.h create mode 100644 scan.i create mode 100644 scan.tex create mode 100644 scan.w create mode 100644 scontroller.c create mode 100644 script.c create mode 100644 script.h create mode 100644 sdynar.c create mode 100644 sdynar.h create mode 100644 sdynar.i create mode 100644 sel2.c create mode 100644 selector.c create mode 100644 selector.h create mode 100644 selvar.c create mode 100644 selvar.h create mode 100644 selvar.i create mode 100644 serial.c create mode 100644 serial.h create mode 100644 serial.tex create mode 100644 serial.w create mode 100644 serialsinq.h create mode 100644 serialsinq.tex create mode 100644 serialsinq.w create mode 100644 serialwait.c create mode 100644 serialwait.h create mode 100644 serialwait.tex create mode 100644 serialwait.w create mode 100644 servlog.c create mode 100644 servlog.h create mode 100644 servo.tcl create mode 100644 sics.h create mode 100644 sicscron.c create mode 100644 sicscron.h create mode 100644 sicsexit.c create mode 100644 sicsexit.h create mode 100644 sicsstat.tcl create mode 100644 sicsstatus.tcl create mode 100644 sicsvar.h create mode 100644 sicvar.c create mode 100644 simchop.c create mode 100644 simcter.c create mode 100644 simdriv.c create mode 100644 simev.c create mode 100644 simev.h create mode 100644 sinqhmdriv.c create mode 100644 sinqhmdriv.i create mode 100644 sinqhmdriv.tex create mode 100644 sinqhmdriv.w create mode 100644 sinqhmtcl.c create mode 100644 splitter.c create mode 100644 splitter.h create mode 100644 sps.c create mode 100644 sps.h create mode 100644 sps.i create mode 100644 sps.tex create mode 100644 sps.w create mode 100644 status.c create mode 100644 status.h create mode 100644 stest.log create mode 100644 stest.tcl create mode 100644 stptok.c create mode 100644 strdup.c create mode 100644 stringdict.c create mode 100644 stringdict.h create mode 100644 stringdict.tex create mode 100644 stringdict.w create mode 100644 strrepl.c create mode 100644 task.c create mode 100644 task.h create mode 100644 tcl/base.tcl create mode 100644 tcl/base8.tcl create mode 100755 tcl/bgerror.tcl create mode 100755 tcl/client.tcl create mode 100644 tcl/count.tcl create mode 100644 tcl/cscan.tcl create mode 100644 tcl/d.tcl create mode 100644 tcl/fit.tcl create mode 100644 tcl/g.tcl create mode 100644 tcl/inherit.tcl create mode 100644 tcl/inherit8.tcl create mode 100644 tcl/init.tcl create mode 100644 tcl/init8.c create mode 100644 tcl/init8.tcl create mode 100644 tcl/initcl.c create mode 100644 tcl/ldAout.tcl create mode 100644 tcl/log.tcl create mode 100644 tcl/obtcl.tcl create mode 100644 tcl/obtcl8.tcl create mode 100755 tcl/obtcl_mkindex create mode 100644 tcl/parray.tcl create mode 100644 tcl/reflist.tcl create mode 100644 tcl/scan.tcl create mode 100644 tcl/stdin.tcl create mode 100644 tcl/susca.tcl create mode 100644 tcl/tail.tcl create mode 100644 tcl/tcl8/base8.tcl create mode 100644 tcl/tcl8/inherit8.tcl create mode 100644 tcl/tcl8/init8.tcl create mode 100644 tcl/tcl8/obtcl8.tcl create mode 100644 tcl/tcl8/test.tst create mode 100644 tcl/tcl8/topsicom.tcl create mode 100644 tcl/tcl8/utils.tcl create mode 100644 tcl/tclIndex create mode 100644 tcl/topsicom.tcl create mode 100644 tcl/topsiold.tcl create mode 100644 tcl/utils.tcl create mode 100644 tcl/var.lis create mode 100644 tclev.c create mode 100644 tclev.h create mode 100644 tclev.i create mode 100644 tclev.tex create mode 100644 tclev.w create mode 100644 tclvarex.tcl create mode 100644 tdir.tcl create mode 100644 telnet.c create mode 100644 telnet.h create mode 100644 telnet.tex create mode 100644 telnet.w create mode 100644 test.db create mode 100644 test.dict create mode 100644 test.hdd create mode 100644 test.tcl create mode 100644 testj.tcl create mode 100644 token.c create mode 100644 token.h create mode 100644 token.tex create mode 100644 token.w create mode 100644 topsi.hdd create mode 100644 topsir.tcl create mode 100644 topsirr.tcl create mode 100644 transact.tcl create mode 100644 trics.dic create mode 100644 trics.tcl create mode 100644 tricsnex.tex create mode 100644 tricsnex.w create mode 100644 trim.c create mode 100644 tscan.tcl create mode 100644 ttest.tcl create mode 100644 udpquieck.c create mode 100644 udpquieck.h create mode 100644 udpquieck.tex create mode 100644 udpquieck.w create mode 100644 ufortify.h create mode 100644 utils.tcl create mode 100644 uubuffer.c create mode 100644 uubuffer.h create mode 100644 uusend.c create mode 100644 varlog.c create mode 100644 varlog.h create mode 100644 varlog.tex create mode 100644 varlog.w create mode 100644 velo.c create mode 100644 velo.h create mode 100644 velo.i create mode 100644 velo.tex create mode 100644 velo.w create mode 100644 velodorn.c create mode 100644 velodorn.h create mode 100644 velodorn.tex create mode 100644 velodorn.w create mode 100644 velodornier.c create mode 100644 velodriv.h create mode 100644 velosim.c create mode 100755 viscom.tcl create mode 100644 volist.tcl create mode 100644 xy.tcl create mode 100644 xytable.c create mode 100644 xytable.h create mode 100644 xytable.i create mode 100644 xytable.tex create mode 100644 xytable.w diff --git a/.log b/.log new file mode 100644 index 00000000..099b9f4f --- /dev/null +++ b/.log @@ -0,0 +1,2722 @@ +OK +SICS>> mess measure test.hkl +Starting at list test.hkl at 1998-09-04 09:49:39 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 15.216 12203 20780 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 15.266 25714 29999 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 15.316 26461 11613 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 15.366 8519 15331 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 15.416 23872 21620 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 15.466 898 27255 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 15.516 16092 10172 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 15.566 1236 26260 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 15.616 20731 1291 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 15.666 23840 1218 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +10 15.716 11416 606 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +11 15.766 15528 21586 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +12 15.816 5976 27427 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +13 15.866 3757 238 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +14 15.916 29453 26437 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +15 15.966 21035 32629 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +16 16.016 21088 25093 +status = Driving +WARNING: dca off position by 1.000000 +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +17 15.066 12230 17529 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +18 16.116 15232 436 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +19 16.166 16549 1410 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +20 16.216 16859 23718 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +21 16.266 6657 31261 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +22 16.316 5054 16281 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +23 16.366 5253 22182 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +24 16.416 19688 24210 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Interrupting Current Hardware Operation +WARNING: Operation interrupted!! +status = Eager to execute commands +ERROR: Scan aborted +SICS>> mess np +mess.np = 50.000000 +SICS>> mess np 10 +OK +SICS>> mess measure test.hkl +Starting at list test.hkl at 1998-09-04 09:51:35 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 17.216 15235 15277 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 17.266 24814 11967 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 17.316 16351 30856 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 17.366 13400 26940 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 17.416 28383 20559 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 17.466 32486 27476 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 17.516 26030 11527 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 17.566 6421 23291 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 17.616 143 6821 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 17.666 17984 19099 +1 14.0 1.0 -3.0 34.93 17.4662365.2f -120.3757635.2f 57.86 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 60.437 15677 5312 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 60.487 6913 8517 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 60.537 21785 32184 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 60.587 28982 20980 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 60.637 24384 22193 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 60.687 23530 238 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 60.737 10458 27390 +status = Driving +ERROR: HW: HahahahahahahHahahHahaha-Mmmpfff + +ERROR: cannot read motor dca +ERROR: ERROR: HW: HahahahahahahHahahHahaha-Mmmpfff on dca +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 60.787 27960 254 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 60.837 5473 8624 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 60.887 16566 7534 +2 25.0 20.0 3.0 121.37 60.6874285.2f -161.7680215.2f 151.81 0.00 0.00 +status = Driving +status = Eager to execute commands +Driving to done +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 14.789 6560 6607 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 14.839 25249 18631 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 14.889 31253 14048 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 14.939 16538 21661 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 14.989 27925 22811 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 15.039 765 22247 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 15.089 7869 9058 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 15.139 11604 22468 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 15.189 22169 28837 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 15.239 26427 32302 +3 14.0 1.0 -1.0 30.08 15.0386245.2f -105.8243565.2f 57.33 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 12.967 24246 8915 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 13.017 14764 17951 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 13.067 5322 10514 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 13.117 18771 23942 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 13.167 29973 12847 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 13.217 16630 25875 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 13.267 26559 15669 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 13.317 6270 1419 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 13.367 29682 4929 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 13.417 13489 32431 +4 13.0 1.0 0.0 26.43 13.2171475.2f -97.0895085.2f 62.61 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 14.833 15614 5569 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 14.883 12518 31591 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +2 14.933 10083 10768 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 14.983 31345 23555 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 15.033 8907 6931 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 15.083 14491 834 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 15.133 10918 515 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 15.183 19640 20086 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 15.233 27496 14926 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 15.283 5236 7111 +5 13.0 1.0 -2.0 30.17 15.0827995.2f -114.8090905.2f 59.43 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 18.800 13161 2298 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 18.850 8523 10290 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 18.900 15502 19168 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 18.950 19314 9033 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 19.000 5262 24271 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 19.050 10232 5749 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 19.100 19798 18108 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 19.150 23814 18527 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 19.200 339 25099 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 19.250 25028 1208 +6 0.0 7.0 1.0 38.10 19.0499325.2f 168.9476015.2f 154.39 0.00 0.00 +status = Driving +status = Eager to execute commands +Driving to done +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 19.248 13927 13716 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 19.298 20120 19281 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 19.348 31989 24050 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 19.398 16064 7078 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 19.448 25174 31610 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 19.498 12784 20791 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 19.548 17449 22549 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 19.598 8828 31054 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 19.648 6099 21153 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 19.698 14516 32324 +7 -1.0 7.0 1.0 39.00 19.4981695.2f 166.0153055.2f 154.70 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 18.407 26651 22503 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 18.457 5613 9279 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 18.507 13524 17751 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 18.557 30823 16228 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 18.607 16043 11313 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 18.657 32415 8777 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 18.707 18301 11926 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 18.757 1779 451 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 18.807 17469 30747 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 18.857 20221 3523 +8 1.0 7.0 1.0 37.31 18.6574575.2f 172.0074465.2f 154.08 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 6.467 31117 32478 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 6.517 24930 15032 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 6.567 23969 5078 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 6.617 15498 16166 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 6.667 22679 31382 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 6.717 6975 11793 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 6.767 5930 7753 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 6.817 14665 20919 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 6.867 8115 21268 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 6.917 11186 28343 +9 1.0 2.0 2.0 13.43 6.7168745.2f 176.1939855.2f -170.37 0.00 0.00 +ERROR: 4.0, 0.0, 0.0 violates two theta limits +ERROR: NOT started +Finishing list test.hkl at 1998-09-04 09:57:37 +OK +SICS>> mess close +ERROR: parameter close not known +SICS>> mess start +OK +SICS>> mess measure test.hkl +Starting at list test.hkl at 1998-09-04 11:11:11 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 16.216 23284 31414 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 16.266 8139 11466 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 16.316 17151 10162 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 16.366 19971 16678 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 16.416 19200 5490 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 16.466 28360 12563 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 16.516 27559 17845 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 16.566 20834 12440 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 16.616 10919 24927 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 16.666 21331 32593 +WARNING: integration failed -->no peak found: 14.000000 1.000000 -3.000000 +OK +SICS>> mess np 10 +OK +SICS>> mess measure test.hkl +Starting at list test.hkl at 1998-09-04 11:21:08 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 17.216 4751 13337 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 17.266 18895 26634 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 17.316 17988 20942 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 17.366 3856 24327 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 17.416 27222 28512 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 17.466 23110 25948 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 17.516 30393 9540 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 17.566 15287 5641 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 17.616 22077 21073 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 17.666 20070 1583 +WARNING: integration failed -->no peak found: 14.000000 1.000000 -3.000000 +1 14.0 1.0 -3.0 34.93 17.4662365.2f -120.3757635.2f 57.86 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 60.437 19188 25817 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 60.487 22640 22708 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 60.537 32176 21305 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 60.587 22481 1473 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 60.637 1150 1463 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 60.687 15999 15330 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 60.737 27177 1204 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 60.787 17972 27943 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 60.837 173 16769 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 60.887 7596 22450 +WARNING: integration failed -->no peak found: 25.000000 20.000000 3.000000 +2 25.0 20.0 3.0 121.37 60.6874285.2f -161.7680215.2f 151.81 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 14.789 6290 17102 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 14.839 9514 8599 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 14.889 12552 5998 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 14.939 6103 18158 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 14.989 5285 13713 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 15.039 23519 1693 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 15.089 22868 16634 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 15.139 25031 19817 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 15.189 9538 2897 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 15.239 20378 3148 +WARNING: integration failed -->no peak found: 14.000000 1.000000 -1.000000 +3 14.0 1.0 -1.0 30.08 15.0386245.2f -105.8243565.2f 57.33 0.00 0.00 +status = Driving +status = Eager to execute commands +Driving to done +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 12.967 4703 15088 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 13.017 28097 8323 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 13.067 5072 2757 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 13.117 31466 20426 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 13.167 9758 29779 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 13.217 3202 9760 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 13.267 19918 6364 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 13.317 28781 24088 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 13.367 13264 23153 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 13.417 26095 1332 +WARNING: integration failed -->no peak found: 13.000000 1.000000 0.000000 +4 13.0 1.0 0.0 26.43 13.2171475.2f -97.0895085.2f 62.61 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 14.833 29844 13682 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 14.883 8113 16258 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 14.933 627 7629 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 14.983 427 2576 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 15.033 4132 32147 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 15.083 30728 12397 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 15.133 4686 4249 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 15.183 86 26783 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 15.233 21417 2539 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 15.283 25470 16152 +WARNING: integration failed -->no peak found: 13.000000 1.000000 -2.000000 +5 13.0 1.0 -2.0 30.17 15.0827995.2f -114.8090905.2f 59.43 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 18.800 19978 9089 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 18.850 29186 19589 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 18.900 23896 6277 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 18.950 28645 29856 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 19.000 16948 29501 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 19.050 1071 5416 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 19.100 19164 851 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 19.150 22013 26102 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 19.200 8001 13123 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 19.250 32556 21422 +WARNING: integration failed -->no peak found: 0.000000 7.000000 1.000000 +6 0.0 7.0 1.0 38.10 19.0499325.2f 168.9476015.2f 154.39 0.00 0.00 +status = Driving +status = Eager to execute commands +Driving to done +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 19.248 26954 32575 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 19.298 27927 20785 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +2 19.348 3437 3462 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 19.398 29953 4451 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 19.448 12193 9863 +status = Driving +ERROR: HW: HahahahahahahHahahHahaha-Mmmpfff + +ERROR: cannot read motor dca +ERROR: ERROR: HW: HahahahahahahHahahHahaha-Mmmpfff on dca +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 19.498 24099 7172 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 19.548 5895 10303 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 19.598 30103 6770 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 19.648 22228 3277 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 19.698 13831 7470 +WARNING: integration failed -->no peak found: -1.000000 7.000000 1.000000 +7 -1.0 7.0 1.0 39.00 19.4981695.2f 166.0153055.2f 154.70 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 18.407 7189 4329 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 18.457 2058 24208 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 18.507 20742 19466 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 18.557 17797 7562 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 18.607 17560 4578 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 18.657 21087 30994 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 18.707 10430 10029 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 18.757 19569 3897 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 18.807 23948 1245 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 18.857 12611 3256 +WARNING: integration failed -->no peak found: 1.000000 7.000000 1.000000 +8 1.0 7.0 1.0 37.31 18.6574575.2f 172.0074465.2f 154.08 0.00 0.00 +status = Driving +status = Eager to execute commands +Driving to done +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 6.467 9058 28454 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 6.517 8485 8230 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +2 6.567 17476 20637 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 6.617 1425 325 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 6.667 8370 29621 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 6.717 4531 10273 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 6.767 1287 23144 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 6.817 18941 12875 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 6.867 27536 18085 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 6.917 18065 25386 +WARNING: integration failed -->no peak found: 1.000000 2.000000 2.000000 +9 1.0 2.0 2.0 13.43 6.7168745.2f 176.1939855.2f -170.37 0.00 0.00 +ERROR: 4.0, 0.0, 0.0 violates two theta limits +ERROR: NOT started +Finishing list test.hkl at 1998-09-04 11:28:41 +OK +SICS>> mess start +OK +SICS>> mess measure test.hkl +Starting at list test.hkl at 1998-09-04 11:43:13 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 17.166 3587 3600 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +1 17.216 5103 13972 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +2 17.266 20683 2296 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 17.316 17290 20006 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 17.366 20571 22260 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 17.416 20592 19650 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 17.466 10975 2240 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 17.516 20291 6327 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 17.566 28655 24741 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 17.616 21437 13515 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +10 17.666 6470 11213 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +11 17.716 2605 11561 +WARNING: integration failed -->no peak found: 14.000000 1.000000 -3.000000 +1 14.0 1.0 -3.0 34.93 17.47 -120.38 57.86 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 60.387 28490 16206 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +1 60.437 10244 23144 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 60.487 13400 20316 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 60.537 4174 6032 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 60.587 1038 21848 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 60.637 5036 32653 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 60.687 23288 29615 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 60.737 21447 16076 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 60.787 7058 6596 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 60.837 10152 6137 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +10 60.887 29789 17 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +11 60.937 4742 453 +WARNING: integration failed -->no peak found: 25.000000 20.000000 3.000000 +2 25.0 20.0 3.0 121.37 60.69 -161.77 151.81 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 13.739 14623 9298 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +1 13.789 30628 1917 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 13.839 8245 25825 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 13.889 11582 11348 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 13.939 4783 13709 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 13.989 31715 25433 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 14.039 25335 4231 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 14.089 6678 32354 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 14.139 5604 31927 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 14.189 21045 6243 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +10 14.239 25430 2712 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +11 14.289 23196 27657 +WARNING: integration failed -->no peak found: 14.000000 1.000000 -1.000000 +3 14.0 1.0 -1.0 30.08 15.04 -105.82 57.33 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 12.917 31764 31059 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 12.967 9926 31559 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 13.017 83 15776 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 13.067 8150 8894 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 13.117 16382 16896 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 13.167 11422 30036 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 13.217 4287 22167 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 13.267 21133 398 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 13.317 20818 5169 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 13.367 11186 16649 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +10 13.417 22629 27140 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +11 13.467 23572 2787 +WARNING: integration failed -->no peak found: 13.000000 1.000000 0.000000 +4 13.0 1.0 0.0 26.43 13.22 -97.09 62.61 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 14.783 25086 20986 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 14.833 1225 11792 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +2 14.883 27510 19297 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 14.933 32680 27582 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 14.983 7929 29984 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 15.033 8785 24970 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 15.083 12376 30175 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 15.133 10492 32148 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 15.183 7688 30637 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 15.233 31237 32144 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +10 15.283 14105 20849 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +11 15.333 31252 29297 +WARNING: integration failed -->no peak found: 13.000000 1.000000 -2.000000 +5 13.0 1.0 -2.0 30.17 15.08 -114.81 59.43 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 18.750 3669 1905 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 18.800 7604 9106 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 18.850 31811 17033 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 18.900 27360 5405 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 18.950 8024 27766 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 19.000 5225 20278 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 19.050 31504 17758 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 19.100 7558 23104 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 19.150 4559 579 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 19.200 31187 27115 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +10 19.250 15893 5339 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +11 19.300 18528 6239 +WARNING: integration failed -->no peak found: 0.000000 7.000000 1.000000 +6 0.0 7.0 1.0 38.10 19.05 168.95 154.39 0.00 0.00 +status = Driving +status = Eager to execute commands +Driving to done +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 19.198 20985 17242 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +1 19.248 13887 4553 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 19.298 336 23036 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 19.348 6203 31495 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 19.398 20807 31166 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 19.448 29826 490 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 19.498 30455 6593 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 19.548 23701 26617 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 19.598 10767 11291 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +9 19.648 21518 2558 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +10 19.698 19680 97 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +11 19.748 2401 31305 +WARNING: integration failed -->no peak found: -1.000000 7.000000 1.000000 +7 -1.0 7.0 1.0 39.00 19.50 166.02 154.70 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 18.357 32222 25298 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +1 18.407 8129 13125 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +2 18.457 6155 23375 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 18.507 5125 10217 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 18.557 19714 31488 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 18.607 17032 3719 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 18.657 6699 7228 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 18.707 27982 29940 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 18.757 12717 28461 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 18.807 26557 10761 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +10 18.857 32034 31808 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +11 18.907 21584 16320 +WARNING: integration failed -->no peak found: 1.000000 7.000000 1.000000 +8 1.0 7.0 1.0 37.31 18.66 172.01 154.08 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +0 6.417 19373 1967 +status = Driving +status = Eager to execute commands +ERROR: Randomly simulated counter error +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 6.467 24755 19896 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +2 6.517 12896 23153 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +ERROR: HW: HahahahahahahHahahHahaha-Mmmpfff + +ERROR: cannot read motor dca +NP dca Counts Monitor +3 -999.990 25906 30382 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +4 6.617 32267 29584 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 6.667 20504 1301 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 6.717 8172 8033 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +7 6.767 470 18037 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 6.817 12137 26496 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 6.867 23880 16604 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +10 6.917 30399 19443 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +11 6.967 7671 21262 +WARNING: integration failed -->no peak found: 1.000000 2.000000 2.000000 +9 1.0 2.0 2.0 13.43 6.72 176.19 -170.37 0.00 0.00 +ERROR: 4.0, 0.0, 0.0 violates two theta limits +ERROR: NOT started +Finishing list test.hkl at 1998-09-04 11:48:37 +OK +SICS>> mess file +Currently writing to: /data/koenneck/src/sics/tmp/trics05781998 +SICS>> mess start +OK +SICS>> mess measure test.hkl +Starting at list test.hkl at 1998-09-04 11:57:24 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 17.116 22849 32144 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +1 17.166 14364 4844 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 17.216 22379 5640 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +3 17.266 4299 28193 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 17.316 17315 11212 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +5 17.366 6537 23969 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +6 17.416 14773 5091 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 17.466 15071 8547 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +8 17.516 13280 290 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 17.566 17374 22944 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +10 17.616 25086 7114 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +11 17.666 9273 27311 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +12 17.716 9288 28616 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +13 17.766 29641 27052 +WARNING: integration failed --> no left side to: 14.000000 1.000000 -3.000000 + 1 14.0 1.0 -3.0 34.93 17.47 -120.38 57.86 0.00 0.00 +status = Driving +status = Eager to execute commands +WARNING: driving to HKL finished with problems +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +0 60.337 7517 19415 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +1 60.387 22644 3952 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +2 60.437 17804 31775 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +3 60.487 4919 11826 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +4 60.537 26914 29469 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +5 60.587 28536 20888 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +6 60.637 25668 32120 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +7 60.687 22378 13053 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +8 60.737 12919 1977 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +9 60.787 5626 25484 +status = Driving +status = Eager to execute commands +status = Counting +ERROR: Randomly simulated counter error +status = Eager to execute commands +NP dca Counts Monitor +10 60.837 25651 6772 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +11 60.887 26752 22417 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +12 60.937 20124 14066 +status = Driving +status = Eager to execute commands +status = Counting +status = Eager to execute commands +NP dca Counts Monitor +13 60.987 15038 20714 +WARNING: integration failed --> no left side to: 25.000000 20.000000 3.000000 + 2 25.0 20.0 3.0 121.37 60.69 -161.77 151.81 0.00 0.00 diff --git a/.rfl b/.rfl new file mode 100644 index 00000000..fc3de31d --- /dev/null +++ b/.rfl @@ -0,0 +1,27 @@ +1 14.0 1.0 -3.0 34.93 17.4662365.2f -120.3757635.2f 57.86 0.00 0.00 +2 25.0 20.0 3.0 121.37 60.6874285.2f -161.7680215.2f 151.81 0.00 0.00 +3 14.0 1.0 -1.0 30.08 15.0386245.2f -105.8243565.2f 57.33 0.00 0.00 +4 13.0 1.0 0.0 26.43 13.2171475.2f -97.0895085.2f 62.61 0.00 0.00 +5 13.0 1.0 -2.0 30.17 15.0827995.2f -114.8090905.2f 59.43 0.00 0.00 +6 0.0 7.0 1.0 38.10 19.0499325.2f 168.9476015.2f 154.39 0.00 0.00 +7 -1.0 7.0 1.0 39.00 19.4981695.2f 166.0153055.2f 154.70 0.00 0.00 +8 1.0 7.0 1.0 37.31 18.6574575.2f 172.0074465.2f 154.08 0.00 0.00 +9 1.0 2.0 2.0 13.43 6.7168745.2f 176.1939855.2f -170.37 0.00 0.00 +1 14.0 1.0 -3.0 34.93 17.47 -120.38 57.86 0.00 0.00 +2 25.0 20.0 3.0 121.37 60.69 -161.77 151.81 0.00 0.00 +3 14.0 1.0 -1.0 30.08 15.04 -105.82 57.33 0.00 0.00 +4 13.0 1.0 0.0 26.43 13.22 -97.09 62.61 0.00 0.00 +5 13.0 1.0 -2.0 30.17 15.08 -114.81 59.43 0.00 0.00 +6 0.0 7.0 1.0 38.10 19.05 168.95 154.39 0.00 0.00 +7 -1.0 7.0 1.0 39.00 19.50 166.02 154.70 0.00 0.00 +8 1.0 7.0 1.0 37.31 18.66 172.01 154.08 0.00 0.00 +9 1.0 2.0 2.0 13.43 6.72 176.19 -170.37 0.00 0.00 +1 14.0 1.0 -3.0 34.93 17.47 -120.38 57.86 0.00 0.00 +2 25.0 20.0 3.0 121.37 60.69 -161.77 151.81 0.00 0.00 +3 14.0 1.0 -1.0 30.08 15.04 -105.82 57.33 0.00 0.00 +4 13.0 1.0 0.0 26.43 13.22 -97.09 62.61 0.00 0.00 +5 13.0 1.0 -2.0 30.17 15.08 -114.81 59.43 0.00 0.00 +6 0.0 7.0 1.0 38.10 19.05 168.95 154.39 0.00 0.00 +7 -1.0 7.0 1.0 39.00 19.50 166.02 154.70 0.00 0.00 +8 1.0 7.0 1.0 37.31 18.66 172.01 154.08 0.00 0.00 +9 1.0 2.0 2.0 13.43 6.72 176.19 -170.37 0.00 0.00 diff --git a/Components.txt b/Components.txt new file mode 100644 index 00000000..3e94898a --- /dev/null +++ b/Components.txt @@ -0,0 +1,161 @@ + + SICS components in this directory + + + 1.) SICS core + + - SCinter.* SICS-Interpreter + - Scommon.h common definitions + - conman.* Connection object and management + - devexec.* Device executor + - ifile.* options database + - interrupt.h Interrupt system + intserv.c + intcli.* + - macro.* link between Sics and Tcl + initcl.c + - network.* network protocoll handling + - obdes.* Object descriptor + - ofac.* Object factory, creates objects at startup + - passwd.* password database + - script.* some commands to access SICS internals from + Tcl-scripts. + - nserver.* server startup and closing, main loop + - servlog.* manages the server log + - nserver.c server main program + - interface.* object interface descriptions + - event.* SICS event description + - callback.* The callback system + - costa.* Command stack used for queing commands. + - ecode.* Text version of error codes. + - task.* Cooperative multitasker. + + + 2.) SICS core Objects + + - buffer.* LNS-RuenBueffer + - ruli.* RuenBueffer stack management + - configfu.h Prototype for some configuration commands + - status.* Status handling object + - sicsexit.* Exit command + - commandlog.* The commandlog + - danu.c The data file number management + - emon.* Environment control monitoring + - evcontroller.* General environment controller class. + - evdriver.* General environement controller driver. + - perfmon.* Performance measure. + - token.* The token system for access control. + - udpquieck.* send a UDP message when a data file changed. + + + + 3.) SICS Objects + + - counter.* Single counter object + - drive.* Drive command + - motor.* logical motor + - mumo.* multiple motor object (SANS) + comentry.* + mumoconf.* + - o2t.* Omega2Theta variable for TOPSI + - selector.* Handles a crystal monochromator with energy + selvar.* and lambda variables + - sicsvar.* primitive text, float or integer variables + - histmem.* histogram memory object + - nxdata.c some general NeXus data storage utilities + and the DMC storage routine + - nxutil.* NeXus utility routines. + - velo.* The velocity selector + - amor2t.* The AMOR Reflectometer two-theta movement + - choco.* A generalized controller with driveable + - chadapter.* parameters realized in chadapter. + - dmc.c special command initialization for DMC + - faverage.* Special command to average FOCUS-TOF data + online for status display. + - fitcenter.* Rough fitting and driving to center of + peaks. + - fowrite.* FOCUS TOF NeXus file writing. + - hkl.* Four circle angle calculation and driving. + - hklscan.* Scanning in reciprocal space for 4-circle. + - integrate.* Gabe integrtaion of scanned peaks. + - itc4.* Special things for ITC4, ITC-503 temperature + controllers. + - mesure.* Measuring reflection list on a 4-circle. + - nextrics.* Writing NeXus files for TRICS in rotation + camera mode. + - optimse.* General automatic peak optimisation using + center-of-gravity. + - pimotor.* Physik Instrument DC-804 step motor controller, + a child of motor. + - sanswave.* wavelength calculation for SANS using a + velocity selector. + - scan.* General purpose scanning utility. + - scontroller.* Access a serial port directly using SICS + - serial.* ways. + - sps.* Dealing with Siemens Siematic SPS controllers. + Probably SINQ specific. + - varlog.* log an environment controller + - xytable.* A general purpose table of x-y values. + - a2t. * AMOR two theta movement + - amorstat.* AMOR status display support + - nxamor.* AMOR data file writing + - amorscan.* AMOR specific scan functions. + + + 4.) SICS Hardware driver + + - countdriv.* EL737 counter driver + - modriv.* EL734 motor driver + el734driv.c + el734dc.c + - bruker.c Driver for the Bruker Magnet + - simcter.c Simulated counter + - simdriv.c Simulated motor + - histsim.c Simualted histogram memory + - histdriv.c histogram driver general + - sinqhmdriv.c SinQ histogram memory driver + - velosim.c Simulated velocity selector + - velodornier.c Dornier velocity selector + - dilludriv.* Driver for the old dillution cryostat + - docho.* Dornier chopper control system + - itc4driv.* Driver for ITC-4 - ITC-503 temperature + controllers. + - ltc11.* Driver for the Kyocera LTC-11 temperature + controller. + - pipiezo.* Driver for a Physik Instrument Piezo motor + controller. + - simchop.* simulated chopper. + - simev.* simulated environment controller. + - tclev.v necessary code for defining a environment + controller driver in Tcl. + + + 5.) Utility + + some of these are freeware files from the net + + - Dbg.* Don Libbes Tcl-Debugger + - bit.h Bit-Array handling macros + - defines.h, lld*.* Linked list package + - fortify.* memory debugging package + ufortify.* + - fupa.* helps interpreting object commands + - obpar.* manages array of object parameters + - splitter.* command analysis code + - strdup.*, string duplication + - strrepl.c string replacement + - stringdict.* a String Dictionary + - dynstring.* Dynamic Strings. + - sdynar.* Dynmaic array. + - uubuffer.* uuencode something into a buffer. + + 6.) Subdirectorys + + - hardsup additional HW handling code + - tcl SICS commands implemented in Tcl + - user user documentation + - user/general general SICS commands + - user/DMC DMC specific commands + - status status display clients + - fourcircle four circle diffraction related stuff + - ninx The ILL program INX modified for NeXus diff --git a/Dbg.c b/Dbg.c new file mode 100644 index 00000000..eb0f6105 --- /dev/null +++ b/Dbg.c @@ -0,0 +1,1206 @@ +/* Dbg.c - Tcl Debugger - See cmdHelp() for commands + +Written by: Don Libes, NIST, 3/23/93 + +Design and implementation of this program was paid for by U.S. tax +dollars. Therefore it is public domain. However, the author and NIST +would appreciate credit if this program or parts of it are used. + +*/ + +#include +#include "tclInt.h" +/*#include tclInt.h drags in varargs.h. Since Pyramid */ +/* objects to including varargs.h twice, just */ +/* omit this one. */ +#include "string.h" +#include "Dbg.h" + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif + +static int simple_interactor(); +static int zero(); + +/* most of the static variables in this file may be */ +/* moved into Tcl_Interp */ + +static Dbg_InterProc *interactor = simple_interactor; +static Dbg_IgnoreFuncsProc *ignoreproc = zero; +static Dbg_OutputProc *printproc = 0; + +static void print(...); + +static int debugger_active = FALSE; + +/* this is not externally documented anywhere as of yet */ +char *Dbg_VarName = "dbg"; + +#define DEFAULT_COMPRESS 0 +static int compress = DEFAULT_COMPRESS; +#define DEFAULT_WIDTH 75 /* leave a little space for printing */ + /* stack level */ +static int buf_width = DEFAULT_WIDTH; + +static int main_argc = 1; +static char *default_argv = "application"; +static char **main_argv = &default_argv; + +static Tcl_Trace debug_handle; +static int step_count = 1; /* count next/step */ + +#define FRAMENAMELEN 10 /* enough to hold strings like "#4" */ +static char viewFrameName[FRAMENAMELEN];/* destination frame name for up/down */ + +static CallFrame *goalFramePtr; /* destination for next/return */ +static int goalNumLevel; /* destination for Next */ + +static enum debug_cmd { + none, step, next, ret, cont, up, down, where, Next +} debug_cmd; + +/* this acts as a strobe (while testing breakpoints). It is set to true */ +/* every time a new debugger command is issued that is an action */ +static debug_new_action; + +#define NO_LINE -1 /* if break point is not set by line number */ + +struct breakpoint { + int id; + char *file; /* file where breakpoint is */ + int line; /* line where breakpoint is */ + char *pat; /* pattern defining where breakpoint can be */ + regexp *re; /* regular expression to trigger breakpoint */ + char *expr; /* expr to trigger breakpoint */ + char *cmd; /* cmd to eval at breakpoint */ + struct breakpoint *next, *previous; +}; + +static struct breakpoint *break_base = 0; +static int breakpoint_max_id = 0; + +static struct breakpoint * +breakpoint_new() +{ + struct breakpoint *b = (struct breakpoint *)ckalloc(sizeof(struct breakpoint)); + if (break_base) break_base->previous = b; + b->next = break_base; + b->previous = 0; + b->id = breakpoint_max_id++; + b->file = 0; + b->line = NO_LINE; + b->pat = 0; + b->re = 0; + b->expr = 0; + b->cmd = 0; + break_base = b; + return(b); +} + +static +void +breakpoint_print(interp,b) +Tcl_Interp *interp; +struct breakpoint *b; +{ + print(interp,"breakpoint %d: ",b->id); + + if (b->re) { + print(interp,"-re \"%s\" ",b->pat); + } else if (b->pat) { + print(interp,"-glob \"%s\" ",b->pat); + } else if (b->line != NO_LINE) { + if (b->file) { + print(interp,"%s:",b->file); + } + print(interp,"%d ",b->line); + } + + if (b->expr) + print(interp,"if {%s} ",b->expr); + + if (b->cmd) + print(interp,"then {%s}",b->cmd); + + putchar('\n'); +} + +static void +save_re_matches(interp,re) +Tcl_Interp *interp; +regexp *re; +{ + int i; + char name[20]; + char match_char;/* place to hold char temporarily */ + /* uprooted by a NULL */ + + for (i=0;istartp[i] == 0) break; + + sprintf(name,"%d",i); + /* temporarily null-terminate in middle */ + match_char = *re->endp[i]; + *re->endp[i] = 0; + Tcl_SetVar2(interp,Dbg_VarName,name,re->startp[i],0); + + /* undo temporary null-terminator */ + *re->endp[i] = match_char; + } +} + +/* return 1 to break, 0 to continue */ +static int +breakpoint_test(interp,cmd,bp) +Tcl_Interp *interp; +char *cmd; /* command about to be executed */ +struct breakpoint *bp; /* breakpoint to test */ +{ + if (bp->re) { +#if TCL_MAJOR_VERSION == 6 + if (0 == regexec(bp->re,cmd)) return 0; +#else + if (0 == TclRegExec(bp->re,cmd,cmd)) return 0; +#endif + save_re_matches(interp,bp->re); + } else if (bp->pat) { + if (0 == Tcl_StringMatch(cmd,bp->pat)) return 0; + } else if (bp->line != NO_LINE) { + /* not yet implemented - awaiting support from Tcl */ + return 0; + } + + if (bp->expr) { + int value; + + /* ignore errors, since they are likely due to */ + /* simply being out of scope a lot */ + if (TCL_OK != Tcl_ExprBoolean(interp,bp->expr,&value)) return 0; + } + + if (bp->cmd) { +#if TCL_MAJOR_VERSION == 6 + Tcl_Eval(interp,bp->cmd,0,(char **)0); +#else + Tcl_Eval(interp,bp->cmd); +#endif + } else { + breakpoint_print(interp,bp); + } + + return 1; +} + +static char *already_at_top_level = "already at top level"; + +/* similar to TclGetFrame but takes two frame ptrs and a direction. +If direction is up, search up stack from curFrame +If direction is down, simulate searching down stack by + seaching up stack from origFrame +*/ +static +int +TclGetFrame2(interp, origFramePtr, string, framePtrPtr, dir) + Tcl_Interp *interp; + CallFrame *origFramePtr; /* frame that is true top-of-stack */ + char *string; /* String describing frame. */ + CallFrame **framePtrPtr; /* Store pointer to frame here (or NULL + * if global frame indicated). */ + enum debug_cmd dir; /* look up or down the stack */ +{ + Interp *iPtr = (Interp *) interp; + int level, result; + CallFrame *framePtr; /* frame currently being searched */ + + CallFrame *curFramePtr = iPtr->varFramePtr; + + /* + * Parse string to figure out which level number to go to. + */ + + result = 1; + if (*string == '#') { + if (Tcl_GetInt(interp, string+1, &level) != TCL_OK) { + return TCL_ERROR; + } + if (level < 0) { + levelError: + Tcl_AppendResult(interp, "bad level \"", string, "\"", + (char *) NULL); + return TCL_ERROR; + } + framePtr = origFramePtr; /* start search here */ + + } else if (isdigit(*string)) { + if (Tcl_GetInt(interp, string, &level) != TCL_OK) { + return TCL_ERROR; + } + if (dir == up) { + if (curFramePtr == 0) { + Tcl_SetResult(interp,already_at_top_level,TCL_STATIC); + return TCL_ERROR; + } + level = curFramePtr->level - level; + framePtr = curFramePtr; /* start search here */ + } else { + if (curFramePtr != 0) { + level = curFramePtr->level + level; + } + framePtr = origFramePtr; /* start search here */ + } + } else { + level = curFramePtr->level - 1; + result = 0; + } + + /* + * Figure out which frame to use. + */ + + if (level == 0) { + framePtr = NULL; + } else { + for (;framePtr != NULL; framePtr = framePtr->callerVarPtr) { + if (framePtr->level == level) { + break; + } + } + if (framePtr == NULL) { + goto levelError; + } + } + *framePtrPtr = framePtr; + return result; +} + + +static char *printify(s) +char *s; +{ + static int destlen = 0; + char *d; /* ptr into dest */ + unsigned int need; + static char buf_basic[DEFAULT_WIDTH+1]; + static char *dest = buf_basic; + + if (s == 0) return(""); + + /* worst case is every character takes 4 to printify */ + need = strlen(s)*4; + if (need > destlen) { + if (dest && (dest != buf_basic)) free(dest); + dest = (char *)ckalloc(need+1); + destlen = need; + } + + for (d = dest;*s;s++) { + /* since we check at worst by every 4 bytes, play */ + /* conservative and subtract 4 from the limit */ + if (d-dest > destlen-4) break; + + if (*s == '\b') { + strcpy(d,"\\b"); d += 2; + } else if (*s == '\f') { + strcpy(d,"\\f"); d += 2; + } else if (*s == '\v') { + strcpy(d,"\\v"); d += 2; + } else if (*s == '\r') { + strcpy(d,"\\r"); d += 2; + } else if (*s == '\n') { + strcpy(d,"\\n"); d += 2; + } else if (*s == '\t') { + strcpy(d,"\\t"); d += 2; + } else if ((unsigned)*s < 0x20) { /* unsigned strips parity */ + sprintf(d,"\\%03o",*s); d += 4; + } else if (*s == 0177) { + strcpy(d,"\\177"); d += 4; + } else { + *d = *s; d += 1; + } + } + *d = '\0'; + return(dest); +} + +static +char * +print_argv(interp,argc,argv) +Tcl_Interp *interp; +int argc; +char *argv[]; +{ + static int buf_width_max = DEFAULT_WIDTH; + static char buf_basic[DEFAULT_WIDTH+1]; /* basic buffer */ + static char *buf = buf_basic; + int space; /* space remaining in buf */ + int len; + char *bufp; + int proc; /* if current command is "proc" */ + int arg_index; + + if (buf_width > buf_width_max) { + if (buf && (buf != buf_basic)) ckfree(buf); + buf = (char *)ckalloc(buf_width + 1); + buf_width_max = buf_width; + } + + proc = (0 == strcmp("proc",argv[0])); + sprintf(buf,"%.*s",buf_width,argv[0]); + len = strlen(buf); + space = buf_width - len; + bufp = buf + len; + argc--; argv++; + arg_index = 1; + + while (argc && (space > 0)) { + char *elementPtr; + char *nextPtr; + int wrap; + + /* braces/quotes have been stripped off arguments */ + /* so put them back. We wrap everything except lists */ + /* with one argument. One exception is to always wrap */ + /* proc's 2nd arg (the arg list), since people are */ + /* used to always seeing it this way. */ + + if (proc && (arg_index > 1)) wrap = TRUE; + else { + (void) TclFindElement(interp,*argv,&elementPtr, + &nextPtr,(int *)0,(int *)0); + if (*elementPtr == '\0') wrap = TRUE; + else if (*nextPtr == '\0') wrap = FALSE; + else wrap = TRUE; + } + + /* wrap lists (or null) in braces */ + if (wrap) { + sprintf(bufp," {%.*s}",space-3,*argv); + } else { + sprintf(bufp," %.*s",space-1,*argv); + } + len = strlen(buf); + space = buf_width - len; + bufp = buf + len; + argc--; argv++; + arg_index++; + } + + if (compress) { + /* this copies from our static buf to printify's static buf */ + /* and back to our static buf */ + strncpy(buf,printify(buf),buf_width); + } + + /* usually but not always right, but assume truncation if buffer is */ + /* full. this avoids tiny but odd-looking problem of appending "}" */ + /* to truncated lists during {}-wrapping earlier */ + if (strlen(buf) == buf_width) { + buf[buf_width-1] = buf[buf_width-2] = buf[buf_width-3] = '.'; + } + + return(buf); +} + +static +void +PrintStackBelow(interp,curf,viewf) +Tcl_Interp *interp; +CallFrame *curf; /* current FramePtr */ +CallFrame *viewf; /* view FramePtr */ +{ + char ptr; /* graphically indicate where we are in the stack */ + + /* indicate where we are in the stack */ + ptr = ((curf == viewf)?'*':' '); + + if (curf == 0) { + print(interp,"%c0: %s\n", + ptr,print_argv(interp,main_argc,main_argv)); + } else { + PrintStackBelow(interp,curf->callerVarPtr,viewf); + print(interp,"%c%d: %s\n",ptr,curf->level, + print_argv(interp,curf->argc,curf->argv)); + } +} + +static +void +PrintStack(interp,curf,viewf,argc,argv,level) +Tcl_Interp *interp; +CallFrame *curf; /* current FramePtr */ +CallFrame *viewf; /* view FramePtr */ +int argc; +char *argv[]; +char *level; +{ + PrintStackBelow(interp,curf,viewf); + + print(interp," %s: %s\n",level,print_argv(interp,argc,argv)); +} + +/* return 0 if goal matches current frame or goal can't be found */ +/* anywere in frame stack */ +/* else return 1 */ +/* This catches things like a proc called from a Tcl_Eval which in */ +/* turn was not called from a proc but some builtin such as source */ +/* or Tcl_Eval. These builtin calls to Tcl_Eval lose any knowledge */ +/* the FramePtr from the proc, so we have to search the entire */ +/* stack frame to see if it's still there. */ +static int +GoalFrame(goal,iptr) +CallFrame *goal; +Interp *iptr; +{ + CallFrame *cf = iptr->varFramePtr; + + /* if at current level, return success immediately */ + if (goal == cf) return 0; + + while (cf) { + cf = cf->callerVarPtr; + if (goal == cf) { + /* found, but since it's above us, fail */ + return 1; + } + } + return 0; +} + +/* debugger's trace handler */ +/*ARGSUSED*/ +static void +debugger_trap(clientData,interp,level,command,cmdProc,cmdClientData,argc,argv) +ClientData clientData; /* not used */ +Tcl_Interp *interp; +int level; /* positive number if called by Tcl, -1 if */ + /* called by Dbg_On in which case we don't */ + /* know the level */ +char *command; +int (*cmdProc)(); /* not used */ +ClientData cmdClientData; +int argc; +char *argv[]; +{ + char level_text[6]; /* textual representation of level */ + + int break_status; + Interp *iPtr = (Interp *)interp; + + CallFrame *trueFramePtr; /* where the pc is */ + CallFrame *viewFramePtr; /* where up/down are */ + + int print_command_first_time = TRUE; + static int debug_suspended = FALSE; + + struct breakpoint *b; + + /* skip commands that are invoked interactively */ + if (debug_suspended) return; + + /* skip debugger commands */ + if (argv[0][1] == '\0') { + switch (argv[0][0]) { + case 'n': + case 's': + case 'c': + case 'r': + case 'w': + case 'b': + case 'u': + case 'd': return; + } + } + + if ((*ignoreproc)(interp,argv[0])) return; + + /* if level is unknown, use "?" */ + sprintf(level_text,(level == -1)?"?":"%d",level); + + /* save so we can restore later */ + trueFramePtr = iPtr->varFramePtr; + + /* test all breakpoints to see if we should break */ + debug_suspended = TRUE; + + /* if any successful breakpoints, start interactor */ + debug_new_action = FALSE; /* reset strobe */ + break_status = FALSE; /* no successful breakpoints yet */ + for (b = break_base;b;b=b->next) { + break_status |= breakpoint_test(interp,command,b); + } + if (!debug_new_action && break_status) goto start_interp; + + /* if s or n triggered by breakpoint, make "s 1" (and so on) */ + /* refer to next command, not this one */ + if (debug_new_action) step_count++; + + switch (debug_cmd) { + case cont: + goto finish; + case step: + step_count--; + if (step_count > 0) goto finish; + goto start_interp; + case next: + /* check if we are back at the same level where the next */ + /* command was issued. Also test */ + /* against all FramePtrs and if no match, assume that */ + /* we've missed a return, and so we should break */ +/* if (goalFramePtr != iPtr->varFramePtr) goto finish;*/ + if (GoalFrame(goalFramePtr,iPtr)) goto finish; + step_count--; + if (step_count > 0) goto finish; + goto start_interp; + case Next: + /* check if we are back at the same level where the next */ + /* command was issued. */ + if (goalNumLevel < iPtr->numLevels) goto finish; + step_count--; + if (step_count > 0) goto finish; + goto start_interp; + case ret: + /* same comment as in "case next" */ + if (goalFramePtr != iPtr->varFramePtr) goto finish; + goto start_interp; + } + +start_interp: + if (print_command_first_time) { + print(interp,"%s: %s\n", + level_text,print_argv(interp,1,&command)); + print_command_first_time = FALSE; + } + /* since user is typing a command, don't interrupt it immediately */ + debug_cmd = cont; + debug_suspended = FALSE; + + /* interactor won't return until user gives a debugger cmd */ + (*interactor)(interp); + + /* save this so it can be restored after "w" command */ + viewFramePtr = iPtr->varFramePtr; + + if (debug_cmd == up || debug_cmd == down) { + /* calculate new frame */ + if (-1 == TclGetFrame2(interp,trueFramePtr,viewFrameName, + &iPtr->varFramePtr,debug_cmd)) { + print(interp,"%s\n",interp->result); + Tcl_ResetResult(interp); + } + goto start_interp; + } + + /* reset view back to normal */ + iPtr->varFramePtr = trueFramePtr; + + /* allow trapping */ + debug_suspended = FALSE; + + switch (debug_cmd) { + case cont: + case step: + goto finish; + case next: + goalFramePtr = iPtr->varFramePtr; + goto finish; + case Next: + goalNumLevel = iPtr->numLevels; + goto finish; + case ret: + goalFramePtr = iPtr->varFramePtr; + if (goalFramePtr == 0) { + print(interp,"nowhere to return to\n"); + break; + } + goalFramePtr = goalFramePtr->callerVarPtr; + goto finish; + case where: + PrintStack(interp,iPtr->varFramePtr,viewFramePtr,argc,argv,level_text); + break; + } + + /* restore view and restart interactor */ + iPtr->varFramePtr = viewFramePtr; + goto start_interp; + + finish: + debug_suspended = FALSE; +} + +/*ARGSUSED*/ +static +int +cmdNext(clientData, interp, argc, argv) +ClientData clientData; +Tcl_Interp *interp; +int argc; +char **argv; +{ + debug_cmd = *(enum debug_cmd *)clientData; + debug_new_action = TRUE; + + step_count = (argc == 1)?1:atoi(argv[1]); + return(TCL_RETURN); +} + +/*ARGSUSED*/ +static +int +cmdDir(clientData, interp, argc, argv) +ClientData clientData; +Tcl_Interp *interp; +int argc; +char **argv; +{ + debug_cmd = *(enum debug_cmd *)clientData; + + if (argc == 1) argv[1] = "1"; + strncpy(viewFrameName,argv[1],FRAMENAMELEN); + + return TCL_RETURN; +} + +/*ARGSUSED*/ +static +int +cmdSimple(clientData, interp, argc, argv) +ClientData clientData; +Tcl_Interp *interp; +int argc; +char **argv; +{ + debug_cmd = *(enum debug_cmd *)clientData; + debug_new_action = TRUE; + return TCL_RETURN; +} + +static +void +breakpoint_destroy(b) +struct breakpoint *b; +{ + if (b->file) ckfree(b->file); + if (b->pat) ckfree(b->pat); + if (b->re) ckfree((char *)b->re); + if (b->cmd) ckfree(b->cmd); + + /* unlink from chain */ + if ((b->previous == 0) && (b->next == 0)) { + break_base = 0; + } else if (b->previous == 0) { + break_base = b->next; + b->next->previous = 0; + } else if (b->next == 0) { + b->previous->next = 0; + } else { + b->previous->next = b->next; + b->next->previous = b->previous; + } + + ckfree((char *)b); +} + +static void +savestr(straddr,str) +char **straddr; +char *str; +{ + *straddr = ckalloc(strlen(str)+1); + strcpy(*straddr,str); +} + +/* return 1 if a string is substring of a flag */ +static int +flageq(flag,string,minlen) +char *flag; +char *string; +int minlen; /* at least this many chars must match */ +{ + for (;*flag;flag++,string++,minlen--) { + if (*string == '\0') break; + if (*string != *flag) return 0; + } + if (*string == '\0' && minlen <= 0) return 1; + return 0; +} + +/*ARGSUSED*/ +static +int +cmdWhere(clientData, interp, argc, argv) +ClientData clientData; +Tcl_Interp *interp; +int argc; +char **argv; +{ + if (argc == 1) { + debug_cmd = where; + return TCL_RETURN; + } + + argc--; argv++; + + while (argc) { + if (flageq("-width",*argv,2)) { + argc--; argv++; + if (*argv) { + buf_width = atoi(*argv); + argc--; argv++; + } else print(interp,"%d\n",buf_width); + } else if (flageq("-compress",*argv,2)) { + argc--; argv++; + if (*argv) { + compress = atoi(*argv); + argc--; argv++; + } else print(interp,"%d\n",compress); + } else { + print(interp,"usage: w [-width #] [-compress 0|1]\n"); + return TCL_ERROR; + } + } + return TCL_OK; +} + +#define breakpoint_fail(msg) {error_msg = msg; goto break_fail;} + +/*ARGSUSED*/ +static +int +cmdBreak(clientData, interp, argc, argv) +ClientData clientData; +Tcl_Interp *interp; +int argc; +char **argv; +{ + struct breakpoint *b; + char *error_msg; + + argc--; argv++; + + if (argc < 1) { + for (b = break_base;b;b=b->next) breakpoint_print(interp,b); + return(TCL_OK); + } + + if (argv[0][0] == '-') { + if (argv[0][1] == '\0') { + while (break_base) { + breakpoint_destroy(break_base); + } + breakpoint_max_id = 0; + return(TCL_OK); + } else if (isdigit(argv[0][1])) { + int id = atoi(argv[0]+1); + + for (b = break_base;b;b=b->next) { + if (b->id == id) { + breakpoint_destroy(b); + if (!break_base) breakpoint_max_id = 0; + return(TCL_OK); + } + } + Tcl_SetResult(interp,"no such breakpoint",TCL_STATIC); + return(TCL_ERROR); + } + } + + b = breakpoint_new(); + + if (flageq("-regexp",argv[0],2)) { + argc--; argv++; +#if TCL_MAJOR_VERSION == 6 + if ((argc > 0) && (b->re = regcomp(argv[0]))) { +#else + if ((argc > 0) && (b->re = TclRegComp(argv[0]))) { +#endif + savestr(&b->pat,argv[0]); + argc--; argv++; + } else { + breakpoint_fail("bad regular expression") + } + } else if (flageq("-glob",argv[0],2)) { + argc--; argv++; + if (argc > 0) { + savestr(&b->pat,argv[0]); + argc--; argv++; + } else { + breakpoint_fail("no pattern?"); + } + } else if ((!(flageq("if",*argv,1)) && (!(flageq("then",*argv,1))))) { + /* look for [file:]line */ + char *colon; + char *linep; /* pointer to beginning of line number */ + + colon = strchr(argv[0],':'); + if (colon) { + *colon = '\0'; + savestr(&b->file,argv[0]); + *colon = ':'; + linep = colon + 1; + } else { + linep = argv[0]; + /* get file from current scope */ + /* savestr(&b->file, ?); */ + } + + if (TCL_OK == Tcl_GetInt(interp,linep,&b->line)) { + argc--; argv++; + print(interp,"setting breakpoints by line number is currently unimplemented - use patterns or expressions\n"); + } else { + /* not an int? - unwind & assume it is an expression */ + + if (b->file) ckfree(b->file); + } + } + + if (argc > 0) { + int do_if = FALSE; + + if (flageq("if",argv[0],1)) { + argc--; argv++; + do_if = TRUE; + } else if (!flageq("then",argv[0],1)) { + do_if = TRUE; + } + + if (do_if) { + if (argc < 1) { + breakpoint_fail("if what"); + } + + savestr(&b->expr,argv[0]); + argc--; argv++; + } + } + + if (argc > 0) { + if (flageq("then",argv[0],1)) { + argc--; argv++; + } + + if (argc < 1) { + breakpoint_fail("then what?"); + } + + savestr(&b->cmd,argv[0]); + } + + sprintf(interp->result,"%d",b->id); + return(TCL_OK); + + break_fail: + breakpoint_destroy(b); + Tcl_SetResult(interp,error_msg,TCL_STATIC); + return(TCL_ERROR); +} + +static char *help[] = { +"s [#] step into procedure", +"n [#] step over procedure", +"N [#] step over procedures, commands, and arguments", +"c continue", +"r continue until return to caller", +"u [#] move scope up level", +"d [#] move scope down level", +" go to absolute frame if # is prefaced by \"#\"", +"w show stack (\"where\")", +"w -w [#] show/set width", +"w -c [0|1] show/set compress", +"b show breakpoints", +"b [-r regexp-pattern] [if expr] [then command]", +"b [-g glob-pattern] [if expr] [then command]", +"b [[file:]#] [if expr] [then command]", +" if pattern given, break if command resembles pattern", +" if # given, break on line #", +" if expr given, break if expr true", +" if command given, execute command at breakpoint", +"b -# delete breakpoint", +"b - delete all breakpoints", +0}; + +/*ARGSUSED*/ +static +int +cmdHelp(clientData, interp, argc, argv) +ClientData clientData; +Tcl_Interp *interp; +int argc; +char **argv; +{ + char **hp; + + for (hp=help;*hp;hp++) { + print(interp,"%s\n",*hp); + } + + return(TCL_OK); +} + +/* this may seem excessive, but this avoids the explicit test for non-zero */ +/* in the caller, and chances are that that test will always be pointless */ +/*ARGSUSED*/ +static int zero(interp,string) +Tcl_Interp *interp; +char *string; +{ + return 0; +} + +static int +simple_interactor(interp) +Tcl_Interp *interp; +{ + int rc; + char *ccmd; /* pointer to complete command */ + char line[BUFSIZ+1]; /* space for partial command */ + int newcmd = TRUE; + Interp *iPtr = (Interp *)interp; + +#if TCL_MAJOR_VERSION == 6 + Tcl_CmdBuf buffer; + + if (!(buffer = Tcl_CreateCmdBuf())) { + Tcl_AppendElement(interp,"no more space for cmd buffer",0); + return(TCL_ERROR); + } +#else + Tcl_DString dstring; + Tcl_DStringInit(&dstring); +#endif + + + newcmd = TRUE; + while (TRUE) { + if (newcmd) { + print(interp,"dbg%d.%d> ",iPtr->numLevels,iPtr->curEventNum+1); + } else { + print(interp,"dbg+> "); + } + fflush(stdout); + + if (0 >= (rc = read(0,line,BUFSIZ))) { + if (!newcmd) line[0] = 0; + else exit(0); + } else line[rc] = '\0'; + +#if TCL_MAJOR_VERSION == 6 + if (NULL == (ccmd = Tcl_AssembleCmd(buffer,line))) { +#else + ccmd = Tcl_DStringAppend(&dstring,line,rc); + if (!Tcl_CommandComplete(ccmd)) { +#endif + newcmd = FALSE; + continue; /* continue collecting command */ + } + newcmd = TRUE; + + rc = Tcl_RecordAndEval(interp,ccmd,0); +#if TCL_MAJOR_VERSION != 6 + Tcl_DStringFree(&dstring); +#endif + switch (rc) { + case TCL_OK: + if (*interp->result != 0) + print(interp,"%s\n",interp->result); + continue; + case TCL_ERROR: + print(interp,"%s\n",Tcl_GetVar(interp,"errorInfo",TCL_GLOBAL_ONLY)); + /* since user is typing by hand, we expect lots + of errors, and want to give another chance */ + continue; + case TCL_BREAK: + case TCL_CONTINUE: +#define finish(x) {rc = x; goto done;} + finish(rc); + case TCL_RETURN: + finish(TCL_OK); + default: + /* note that ccmd has trailing newline */ + print(interp,"error %d: %s\n",rc,ccmd); + continue; + } + } + /* cannot fall thru here, must jump to label */ + done: +#if TCL_MAJOR_VERSION == 6 + /* currently, code guarantees buffer is valid */ + Tcl_DeleteCmdBuf(buffer); +#else + Tcl_DStringFree(&dstring); +#endif + + return(rc); +} + +/* occasionally, we print things larger buf_max but not by much */ +/* see print statements in PrintStack routines for examples */ +#define PAD 80 + +static void +print(va_alist ) +va_dcl +{ + Tcl_Interp *interp; + char *fmt; + va_list args; + + va_start(args); + interp = va_arg(args,Tcl_Interp *); + fmt = va_arg(args,char *); + if (!printproc) vprintf(fmt,args); + else { + static int buf_width_max = DEFAULT_WIDTH+PAD; + static char buf_basic[DEFAULT_WIDTH+PAD+1]; + static char *buf = buf_basic; + + if (buf_width+PAD > buf_width_max) { + if (buf && (buf != buf_basic)) ckfree(buf); + buf = (char *)ckalloc(buf_width+PAD+1); + buf_width_max = buf_width+PAD; + } + + vsprintf(buf,fmt,args); + (*printproc)(interp,buf); + } + va_end(args); +} + +/*ARGSUSED*/ +Dbg_InterProc * +Dbg_Interactor(interp,inter_proc) +Tcl_Interp *interp; +Dbg_InterProc *inter_proc; +{ + Dbg_InterProc *tmp = interactor; + interactor = (inter_proc?inter_proc:simple_interactor); + return tmp; +} + +/*ARGSUSED*/ +Dbg_IgnoreFuncsProc * +Dbg_IgnoreFuncs(interp,proc) +Tcl_Interp *interp; +Dbg_IgnoreFuncsProc *proc; +{ + Dbg_IgnoreFuncsProc *tmp = ignoreproc; + ignoreproc = (proc?proc:zero); + return tmp; +} + +/*ARGSUSED*/ +Dbg_OutputProc * +Dbg_Output(interp,proc) +Tcl_Interp *interp; +Dbg_OutputProc *proc; +{ + Dbg_OutputProc *tmp = printproc; + printproc = (proc?proc:0); + return tmp; +} + + +/*ARGSUSED*/ +int +Dbg_Active(interp) +Tcl_Interp *interp; +{ + return debugger_active; +} + +char ** +Dbg_ArgcArgv(argc,argv,copy) +int argc; +char *argv[]; +int copy; +{ + char **alloc; + + if (!copy) { + main_argv = argv; + alloc = 0; + } else { + main_argv = alloc = (char **)ckalloc((argc+1)*sizeof(char *)); + while (argc-- >= 0) { + *main_argv++ = *argv++; + } + main_argv = alloc; + } + return alloc; +} + +static struct cmd_list { + char *cmdname; + Tcl_CmdProc *cmdproc; + enum debug_cmd cmdtype; +} cmd_list[] = {{"n", cmdNext, next}, + {"s", cmdNext, step}, + {"N", cmdNext, Next}, + {"c", cmdSimple, cont}, + {"r", cmdSimple, ret}, + {"w", cmdWhere, none}, + {"b", cmdBreak, none}, + {"u", cmdDir, up}, + {"d", cmdDir, down}, + {"h", cmdHelp, none}, + {0} +}; + +static void +init_debugger(interp) +Tcl_Interp *interp; +{ + struct cmd_list *c; + + for (c = cmd_list;c->cmdname;c++) { + Tcl_CreateCommand(interp,c->cmdname,c->cmdproc, + (ClientData)&c->cmdtype,(Tcl_CmdDeleteProc *)0); + } + + debug_handle = Tcl_CreateTrace(interp, + 10000,debugger_trap,(ClientData)0); + + debugger_active = TRUE; + Tcl_SetVar2(interp,Dbg_VarName,"active","1",0); +} + +/* allows any other part of the application to jump to the debugger */ +/*ARGSUSED*/ +void +Dbg_On(interp,immediate) +Tcl_Interp *interp; +int immediate; /* if true, stop immediately */ + /* should only be used in safe places */ + /* i.e., when Tcl_Eval can be called */ +{ + if (!debugger_active) init_debugger(interp); + + debug_cmd = step; + step_count = 1; + + if (immediate) { + static char *fake_cmd = "--interrupted-- (command_unknown)"; + + debugger_trap((ClientData)0,interp,-1,fake_cmd,(int (*)())0, + (ClientData)0,1,&fake_cmd); +/* (*interactor)(interp);*/ + } +} + +void +Dbg_Off(interp) +Tcl_Interp *interp; +{ + struct cmd_list *c; + + if (!debugger_active) return; + + for (c = cmd_list;c->cmdname;c++) { + Tcl_DeleteCommand(interp,c->cmdname); + } + + Tcl_DeleteTrace(interp,debug_handle); + debugger_active = FALSE; + Tcl_UnsetVar(interp,Dbg_VarName,TCL_GLOBAL_ONLY); +} diff --git a/Dbg.h b/Dbg.h new file mode 100644 index 00000000..29364f4d --- /dev/null +++ b/Dbg.h @@ -0,0 +1,46 @@ +/* Dbg.h - Tcl Debugger include file + +Written by: Don Libes, NIST, 3/23/93 + +Design and implementation of this program was paid for by U.S. tax +dollars. Therefore it is public domain. However, the author and NIST +would appreciate credit if this program or parts of it are used. + +*/ + +/* _DEBUG or _DBG is just too likely, use something more unique */ +#ifndef _NIST_DBG +#define _NIST_DBG + +#include "tcl.h" + +typedef int (Dbg_InterProc) _ANSI_ARGS_((Tcl_Interp *interp)); +typedef int (Dbg_IgnoreFuncsProc) _ANSI_ARGS_(( + Tcl_Interp *interp, + char *funcname)); +typedef void (Dbg_OutputProc) _ANSI_ARGS_(( + Tcl_Interp *interp, + char *output)); + +EXTERN char *Dbg_VarName; +EXTERN char *Dbg_DefaultCmdName; + +/* trivial interface, creates a "debug" command in your interp */ +EXTERN int Dbg_Init _ANSI_ARGS_((Tcl_Interp *)); + +EXTERN void Dbg_On _ANSI_ARGS_((Tcl_Interp *interp, + int immediate)); +EXTERN void Dbg_Off _ANSI_ARGS_((Tcl_Interp *interp)); +EXTERN char **Dbg_ArgcArgv _ANSI_ARGS_((int argc,char *argv[], + int copy)); +EXTERN int Dbg_Active _ANSI_ARGS_((Tcl_Interp *interp)); +EXTERN Dbg_InterProc *Dbg_Interactor _ANSI_ARGS_(( + Tcl_Interp *interp, + Dbg_InterProc *interactor)); +EXTERN Dbg_IgnoreFuncsProc *Dbg_IgnoreFuncs _ANSI_ARGS_(( + Tcl_Interp *interp, + Dbg_IgnoreFuncsProc *)); +EXTERN Dbg_OutputProc *Dbg_Output _ANSI_ARGS_(( + Tcl_Interp *interp, + Dbg_OutputProc *)); +#endif /* _NIST_DBG */ diff --git a/Dbg_cmd.c b/Dbg_cmd.c new file mode 100644 index 00000000..9ab2ceda --- /dev/null +++ b/Dbg_cmd.c @@ -0,0 +1,64 @@ +/* Dbg_cmd.c - Tcl Debugger default command, used if app writer wants a + quick and reasonable default. + +Written by: Don Libes, NIST, 3/23/93 + +Design and implementation of this program was paid for by U.S. tax +dollars. Therefore it is public domain. However, the author and NIST +would appreciate credit if this program or parts of it are used. + +*/ + +#include "tclInt.h" +#include "Dbg.h" + +char *Dbg_DefaultCmdName = "debug"; + +/*ARGSUSED*/ +static int +App_DebugCmd(clientData, interp, argc, argv) +ClientData clientData; +Tcl_Interp *interp; +int argc; +char **argv; +{ + int now = 0; /* soon if 0, now if 1 */ + + if (argc > 3) goto usage; + + argv++; + + while (*argv) { + if (0 == strcmp(*argv,"-now")) { + now = 1; + argv++; + } + else break; + } + + if (!*argv) { + if (now) { + Dbg_On(interp,1); + } else { + goto usage; + } + } else if (0 == strcmp(*argv,"0")) { + Dbg_Off(interp); + } else { + Dbg_On(interp,now); + } + return(TCL_OK); + usage: + interp->result = "usage: [[-now] 1|0]"; + return TCL_ERROR; +} + +int +Dbg_Init(interp) +Tcl_Interp *interp; +{ + Tcl_CreateCommand(interp,Dbg_DefaultCmdName,App_DebugCmd, + (ClientData)0,(void (*)())0); + return TCL_OK; +} + diff --git a/HistDriv.i b/HistDriv.i new file mode 100644 index 00000000..1c1c66e3 --- /dev/null +++ b/HistDriv.i @@ -0,0 +1,93 @@ + +#line 468 "histogram.w" + +/*--------------------------------------------------------------------------- + H I S T D R I V + internal header file which includes the definition of the Histogram memory + driver structure. + + Mark Koennecke, April 1997 +----------------------------------------------------------------------------*/ +#ifndef SICSHISTDRIV +#define SICSHISTDRIV +#define MAXCHAN 4096 + + +#line 81 "histogram.w" + + typedef struct __HistDriver { + /* configuration data */ + HistMode eHistMode; + OverFlowMode eFlow; + int iRank; + int iDims[MAXDIM]; + int nDim; + int iLength; + int iBinWidth; + float fTime[MAXCHAN]; + int iTimeChan; + /* counting operations data */ + CounterMode eCount; + float fCountPreset; + /* status flags */ + int iReconfig; + int iUpdate; + /* interface functions */ + int (*Configure)(pHistDriver self, + SConnection *pCon, + pStringDict pOpt, + SicsInterp *pSics); + int (*Start)(pHistDriver self, + SConnection *pCon); + int (*Halt)(pHistDriver self); + int (*GetCountStatus)(pHistDriver self, + SConnection *pCon); + int (*GetError)(pHistDriver self, + int *iCode, + char *perror, + int iErrlen); + int (*TryAndFixIt)(pHistDriver self, + int iCode); + int (*GetData)(pHistDriver self, + SConnection *pCon); + int (*GetHistogram)(pHistDriver self, + SConnection *pCon, + int i, + int iStart, int iEnd, + HistInt *pData); + + int (*SetHistogram)(pHistDriver self, + SConnection *pCon, + int i, + int iStart, int iEnd, + HistInt *pData); + long (*GetMonitor)(pHistDriver self, + int i, + SConnection *pCon); + float (*GetTime)(pHistDriver self, + SConnection *pCon); + int (*Preset)(pHistDriver self, + SConnection *pCon, + HistInt iVal); + int (*Pause)(pHistDriver self, + SConnection *pCon); + int (*Continue)(pHistDriver self, + SConnection *pCon); + int (*FreePrivate)(pHistDriver self); + void *pPriv; + } HistDriver; + +#line 480 "histogram.w" + + +#line 238 "histogram.w" + + pHistDriver CreateHistDriver(pStringDict pDict); + void DeleteHistDriver(pHistDriver self); + int HistDriverConfig(pHistDriver self, pStringDict pOpt, + SConnection *pCon); + +#line 481 "histogram.w" + + +#endif diff --git a/HistMem.h b/HistMem.h new file mode 100644 index 00000000..f9405f8a --- /dev/null +++ b/HistMem.h @@ -0,0 +1,94 @@ + +#line 441 "histogram.w" + +/*-------------------------------------------------------------------------- + H I S T M E M + + header for the histogram memory object for SICS. + + copyright: see implementation file. + Mark Koennecke, April 1997 +-----------------------------------------------------------------------------*/ +#ifndef SICSHISTMEM +#define SICSHISTMEM +#define MAXDIM 3 + + typedef struct __HistDriver *pHistDriver; + typedef struct __HistMem *pHistMem; +/*-------------------------------------------------------------------------*/ + typedef int HistInt; +/* + 32 bit integer on a DigitalUnix +*/ + +#line 9 "histogram.w" + + typedef enum { + eHTransparent, + eHNormal, + eHTOF, + eHStrobo, + eHRPT + } HistMode; + +#line 33 "histogram.w" + + typedef enum { + eOIgnore, + eOCeil, + eOCount, + eReflect + } OverFlowMode; + +#line 461 "histogram.w" + +/*--------------------------------------------------------------------------*/ + +#line 302 "histogram.w" + + pHistMem CreateHistMemory(char *drivername); + void DeleteHistMemory(void *self); + +#line 318 "histogram.w" + + int HistGetOption(pHistMem self, char *name, char *result, int iResultLen); + int HistSetOption(pHistMem self, char *name, char *value); + int HistConfigure(pHistMem self, SConnection *pCon, SicsInterp *pSics); + +#line 346 "histogram.w" + + float GetHistPreset(pHistMem self); + int SetHistPreset(pHistMem self, float fVal); + CounterMode GetHistCountMode(pHistMem self); + int SetHistCountMode(pHistMem self, CounterMode eNew); + long GetHistMonitor(pHistMem self, int i, SConnection *pCon); + const float *GetHistTimeBin(pHistMem self, int *iLength); + int GetHistLength(pHistMem self); + int GetHistDim(pHistMem self, int iDim[MAXDIM], int *nDim); + float GetHistCountTime(pHistMem self,SConnection *pCon); + int HistDoCount(pHistMem self, SConnection *pCon); + int HistBlockCount(pHistMem self, SConnection *pCon); + + +#line 375 "histogram.w" + + int SetHistogram(pHistMem self, SConnection *pCon, + int i,int iStart, int iEnd, HistInt *lData); + int GetHistogram(pHistMem self, SConnection *pCon, + int i,int iStart, int iEnd, HistInt *lData, int iDataLen); + HistInt *GetHistogramPointer(pHistMem self,SConnection *pCon); + int PresetHistogram(pHistMem self, SConnection *pCon, HistInt lVal); + +#line 410 "histogram.w" + + int MakeHistMemory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + + int HistAction(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + + +#line 463 "histogram.w" + + +#endif diff --git a/HistMem.i b/HistMem.i new file mode 100644 index 00000000..1a982f79 --- /dev/null +++ b/HistMem.i @@ -0,0 +1,35 @@ + +#line 486 "histogram.w" + +/*--------------------------------------------------------------------------- + H I S T M E M -- Internal + internal header file which includes the definition of the Histogram memory + data structure. + + Mark Koennecke, April 1997 +----------------------------------------------------------------------------*/ +#ifndef SICSHISTMEMINT +#define SICSHISTMEMINT + +#line 260 "histogram.w" + + typedef struct __HistMem { + pObjectDescriptor pDes; + int iAccess; + int iExponent; + pHistDriver pDriv; + int iInit; + pICountable pCountInt; + pICallBack pCall; + pStringDict pOption; + HistInt *iLocalData; + int iLocalLength; + int iLocalUpdate; + time_t tLocal; + int iUpdateIntervall; + } HistMem; + +#line 496 "histogram.w" + + +#endif diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f6e7de95 --- /dev/null +++ b/Makefile @@ -0,0 +1,78 @@ +#---------------------------------------------------------------------------- +# Makefile for SICS +# +# Mark Koennecke 1996-2000 +#--------------------------------------------------------------------------- +BINTARGET=$(HOME)/bin/sics + +#FORTIFYOBJ = fortify.o strdup.o +FORTIFYOBJ = +CC=cc +#CC=gcc +TCLOBJ=initcl.o +#TCLOBJ=init8.o + +#comment and uncomment according if a difrac version is required +#DIFOBJ= +#DIFIL= +DIFOBJ=difrac.o -Ldifrac -ldif -lfor +DIFIL= difrac.o + +COBJ = Sclient.o network.o ifile.o intcli.o $(FORTIFYOBJ) +SOBJ = network.o ifile.o conman.o SCinter.o splitter.o passwd.o \ + servlog.o sicvar.o nserver.o SICSmain.o \ + sicsexit.o costa.o task.o $(FORTIFYOBJ)\ + macro.o ofac.o obpar.o obdes.o drive.o status.o intserv.o \ + devexec.o mumo.o mumoconf.o selector.o selvar.o fupa.o lld.o \ + lld_blob.o buffer.o strrepl.o ruli.o $(TCLOBJ) \ + script.o o2t.o alias.o napi.o nxdata.o stringdict.o sdynar.o\ + histmem.o histdriv.o histsim.o sinqhmdriv.o interface.o callback.o \ + event.o emon.o evcontroller.o evdriver.o simev.o perfmon.o \ + danu.o itc4driv.o itc4.o nxdict.o nxsans.o varlog.o stptok.o nread.o \ + dilludriv.o scan.o fitcenter.o telnet.o token.o scontroller.o serial.o \ + tclev.o hkl.o integrate.o optimise.o dynstring.o nextrics.o nxutil.o \ + mesure.o uubuffer.o serialwait.o commandlog.o sps.o udpquieck.o \ + sanswave.o faverage.o bruker.o rmtrail.o fowrite.o ltc11.o \ + simchop.o choco.o chadapter.o docho.o trim.o eurodriv.o scaldate.o \ + hklscan.o xytable.o amor2t.o nxamor.o amorscan.o amorstat.o \ + circular.o el755driv.o maximize.o sicscron.o qcbo.o + +MOTOROBJ = motor.o el734driv.o simdriv.o el734dc.o pipiezo.o pimotor.o +COUNTEROBJ = countdriv.o simcter.o counter.o +DMCOBJ = dmc.o +VELOOBJ = velo.o velosim.o velodorn.o velodornier.o + +.SUFFIXES: +.SUFFIXES: .tcl .htm .c .o + + +CFLAGS = -I/data/koenneck/include -Ihardsup -std1 -g -warnprotos -c +#CFLAGS = -I/data/koenneck/include -DFORTIFY -Ihardsup -g -std1 -warnprotos -c +#CFLAGS = -I/data/koenneck/include -Ihardsup -std1 -warnprotos -c +LIBS = -L/data/koenneck/lib -Lhardsup -lhlib -ltcl7.6 -lmfhdf -ldf \ + /data/koenneck/lib/libjpeg.a -lz -lm -ll -lc + +# for cygnus +#CFLAGS = -I../HDF411/include -Ihardsup -DFORTIFY -DCYGNUS -g -c +#LIBS= -L../HDF411/lib -Lhardsup -lhlib -ltcl80 \ +# -lmfhdf -ldf -ljpeg -lz -lm + +.c.o: + $(CC) $(CFLAGS) $*.c + +all: server + +server: $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) $(DMCOBJ) $(VELOOBJ) $(DIFIL) + $(CC) -g -o SICServer $(SOBJ) $(MOTOROBJ) $(COUNTEROBJ) $(DMCOBJ) \ + $(VELOOBJ) $(DIFOBJ) $(LIBS) + cp SICServer $(BINTARGET) + +clean: + - rm *.o + - rm SICServer + +Dbg.o: Dbg.c + cc -g -I/data/koenneck/include -c Dbg.c +Dbg_cmd.o: Dbg_cmd.c + + diff --git a/SCinter.c b/SCinter.c new file mode 100644 index 00000000..e6d0738f --- /dev/null +++ b/SCinter.c @@ -0,0 +1,528 @@ +/*--------------------------------------------------------------------------- + + Implementation file for the SICS-interpreter. + + + + Mark Koennecke, November 1996 + + Copyright: + + Labor fuer Neutronenstreuung + Paul Scherrer Institut + CH-5423 Villigen-PSI + + + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY + FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY + DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE + IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE + NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + MODIFICATIONS. +---------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include +#include +#include "fortify.h" +#include "conman.h" +#include "splitter.h" +#include "Scommon.h" +#include "SCinter.h" +#include "obdes.h" +#include "devexec.h" +#include "servlog.h" +#include "macro.h" + +#define MAXLEN 256 +#define MAXPAR 100 + +/*--------------------------------------------------------------------------*/ + SicsInterp *InitInterp(void) + { + SicsInterp *pInter = NULL; + int i; + + pInter = (SicsInterp *)malloc(sizeof(SicsInterp)); + if(!pInter) + { + SICSLogWrite("Error allocating memory for Interpreter",eInternal); + return NULL; + } + pInter->pCList = NULL; + pInter->pTcl = (void *)MacroInit(pInter); + if(!pInter->pTcl) + { + free(pInter); + return NULL; + } + + pInter->argv = NULL; + pInter->argv = (char **)malloc(MAXPAR*sizeof(char *)); + if(pInter->argv == NULL) + { + free(pInter); + return NULL; + } + for(i = 0; i < MAXPAR; i++) + { + pInter->argv[i] = (char *)malloc(MAXLEN*sizeof(char)); + if(pInter->argv[i] == NULL) + { + free(pInter); + return NULL; + } + } + pInter->iDeleting = 0; + return pInter; + } +/*------------------------------------------------------------------------*/ + int AddCommand(SicsInterp *pInterp, char *pName, ObjectFunc pFunc, + KillFunc pKFunc, void *pData) + { + CommandList *pNew = NULL; + char pBueffel[512]; + + assert(pName); + assert(pFunc); + assert(pInterp); + + strcpy(pBueffel,pName); + strtolower(pBueffel); + if(FindCommand(pInterp,pBueffel) != NULL) + { + return 0; + } + + /* new memory */ + pNew = (CommandList *)malloc(sizeof(CommandList)); + if(!pNew) + { + sprintf(pBueffel, + "Out of memory creating command - %s -", pName); + SICSLogWrite(pBueffel,eInternal); + return 0; + } + + /* if no data given, initialise with Dummy struct */ + if(!pData) + { + pData = (void *)CreateDummy(pBueffel); + if(!pKFunc) + { + pKFunc = KillDummy; + } + } + + /* initialise datastructures */ + pNew->pName = strdup(pBueffel); + pNew->OFunc = pFunc; + pNew->KFunc = pKFunc; + pNew->pData = pData; + pNew->pNext = pInterp->pCList; + + + if(pInterp->pCList) + { + pInterp->pCList->pPrevious = pNew; + } + pNew->pPrevious = NULL; + + /* update headpointer */ + pInterp->pCList = pNew; + return 1; + } +/*------------------------------------------------------------------------*/ + int RemoveCommand(SicsInterp *pInterp, char *pName) + { + CommandList *pVictim = NULL; + char pBueffel[256]; + + assert(pInterp); + assert(pName); + + strcpy(pBueffel,pName); + strtolower(pBueffel); + + if(pInterp->iDeleting) + { + return 0; + } + + /* find our victim */ + pVictim = FindCommand(pInterp, pBueffel); + if(!pVictim) + return 0; + + /* found, remove it */ + /* kall KillFunction first */ + if(pVictim->KFunc) + { + pVictim->KFunc(pVictim->pData); + } + + /* delete and unlink data */ + if(pVictim->pName) + { + free(pVictim->pName); + } + if(pVictim->pPrevious) + { + pVictim->pPrevious->pNext = pVictim->pNext; + } + if(pVictim->pNext) + { + pVictim->pNext->pPrevious = pVictim->pPrevious; + } + /* adjust headpointer if necessary */ + if(pVictim == pInterp->pCList) + { + pInterp->pCList = pVictim->pNext; + } + free(pVictim); + return 1; + } + +#define MAXLEN 256 +#define MAXCOM 50 +extern char *stptok(char *s, char *tok, unsigned int toklen, char *brk); +extern char *SkipSpace(char *pPtr); +/*------------------------------------------------------------------------*/ + int InterpExecute(SicsInterp *self,SConnection *pCon, char *pText) + { + int iCount = 0; + int iRet; + int i; + char pBueffel[1024]; + CommandList *pCommand = NULL; + char pBrk[] = {" \r\n\0"}; + char *pPtr; + + assert(self); + assert(pCon); + + /* write info to Log */ + if(pCon->pSock) + { + sprintf(pBueffel,"Executing -> %s <- from socket %d",pText, + pCon->pSock->sockid); + SICSLogWrite(pBueffel,eCommand); + } + else + { + if(!pCon->iDummy) + { + printf("Executing -> %s <- from dummy socket\n", pText); + } + else + { + sprintf(pBueffel,"Executing -> %s <- from sicscron",pText); + SICSLogWrite(pBueffel,eCommand); + } + } + + /* convert to argc, argv */ + pPtr = SkipSpace(pText); + if(pPtr) + { + pPtr = stptok(pPtr,self->argv[0],255,pBrk); + } + while(pPtr != NULL) + { + iCount++; + pPtr = SkipSpace(pPtr); + if(!pPtr) + { + break; + } + pPtr = stptok(pPtr,self->argv[iCount],255,pBrk); + } + self->argv[iCount][0] = '\0'; + + /* the first one must be the target object. If not given an empty + command string was given which will be silently ignored */ + if(iCount < 1) + { + return 1; + } + + /* find it */ + pCommand = FindCommand(self,self->argv[0]); + if(!pCommand) + { + sprintf(pBueffel,"ERROR: Object -> %s <- NOT found", + self->argv[0]); + SCWrite(pCon,pBueffel,eError); + return -1; + + } + + + /* invoke the command */ + self->eOut = eStatus; + Tcl_ResetResult((Tcl_Interp *)self->pTcl); + MacroPush(pCon); + iRet = pCommand->OFunc(pCon, self, pCommand->pData, iCount, self->argv); + MacroPop(); + return iRet; + } +/*------------------------------------------------------------------------*/ + CommandList *FindCommand(SicsInterp *self, char *pName) + { + CommandList *pCurrent = NULL; + char pBueffel[256]; + + assert(self); + + if(self->iDeleting) + { + return NULL; + } + + strcpy(pBueffel,pName); + strtolower(pBueffel); + pCurrent = self->pCList; + while(pCurrent) + { + if(strcmp(pCurrent->pName, pBueffel) == 0 ) + { + return pCurrent; + } + pCurrent = pCurrent->pNext; + } + return NULL; + } +/*------------------------------------------------------------------------*/ + int WriteSicsStatus(SicsInterp *self, char *file) + { + CommandList *pCurrent = NULL; + FILE *fd = NULL; + Dummy *pDum = NULL; + + assert(self); + assert(file); + + /* open file */ + fd = fopen(file,"w"); + if(!fd) + { + return 0; + } + /* remove it, as I found garbage from previous runs in the + status file + */ + fclose(fd); + remove(file); + + fd = fopen(file,"w"); + if(!fd) + { + return 0; + } + + /* cycle through the list */ + pCurrent = self->pCList; + while(pCurrent) + { + pDum = (Dummy *)pCurrent->pData; + if(pDum) + { + pDum->pDescriptor->SaveStatus(pCurrent->pData,pCurrent->pName,fd); + } + pCurrent = pCurrent->pNext; + } + fclose(fd); + return 1; + } +/*------------------------------------------------------------------------*/ + void DeleteInterp(SicsInterp *self) + { + CommandList *pCurrent = NULL; + CommandList *pTemp; + Tcl_Interp *pTcl = NULL; + int i; + + assert(self); + self->iDeleting = 1; + + /* delete Commandlist */ + pCurrent = self->pCList; + while(pCurrent) + { + if(pCurrent->KFunc) + { + pCurrent->KFunc(pCurrent->pData); + } + if(pCurrent->pName) + { + free(pCurrent->pName); + } + pTemp = pCurrent->pNext; + free(pCurrent); + pCurrent = pTemp; + } + + /* clear Tcl_Interpreter. Must be AFTER deleting command list because + some devices may have Tcl drivers which need to be accessed for + proper closing of devices. + */ + pTcl = (Tcl_Interp *)self->pTcl; + if(pTcl) + { + Tcl_DeleteInterp(pTcl); + } + + for(i = 0; i < MAXPAR; i++) + { + free(self->argv[i]); + } + free(self->argv); + free(self); + } + +/*--------------------------------------------------------------------------*/ + int ListObjects(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]) + { + CommandList *pCurrent; + char pBueffel[256]; + int iNum = 0; + + assert(pSics); + assert(pCon); + + pCurrent = pSics->pCList; + while(pCurrent) + { + if(iNum == 0) + { + strcpy(pBueffel,pCurrent->pName); + iNum++; + } + else if(iNum < 4) + { + strcat(pBueffel," "); + strcat(pBueffel,pCurrent->pName); + iNum++; + } + else + { + strcat(pBueffel," "); + strcat(pBueffel,pCurrent->pName); + strcat(pBueffel,"\r\n"); + SCWrite(pCon,pBueffel,eStatus); + iNum = 0; + } + pCurrent = pCurrent->pNext; + } + + /* write final entries */ + if(strlen(pBueffel) > 2) + { + strcat(pBueffel,"\r\n"); + SCWrite(pCon,pBueffel,eStatus); + } + return 1; + } +/*---------------------------------------------------------------------------*/ + int InterpWrite(SicsInterp *pSics, char *buffer) + { + Tcl_Interp *pTcl = NULL; + + assert(pSics); + pTcl = (Tcl_Interp *)pSics->pTcl; + Tcl_SetResult(pTcl,buffer,TCL_VOLATILE); + return 1; + } +/*---------------------------------------------------------------------------*/ + Tcl_Interp *InterpGetTcl(SicsInterp *pSics) + { + Tcl_Interp *pTcl = NULL; + + pTcl = (Tcl_Interp *)pSics->pTcl; + return pTcl; + } +/*---------------------------------------------------------------------------*/ + void strtolower(char *pText) + { + assert(pText); + + while(*pText != '\0') + { + *pText = tolower(*pText); + pText++; + } + } +/*---------------------------------------------------------------------------*/ + void argtolower(int argc, char *argv[]) + { + int i; + + for(i = 0; i < argc; i++) + { + strtolower(argv[i]); + } + } + +/*------------------------------------------------------------------------*/ + char *FindAlias(SicsInterp *self, void *pData) + { + CommandList *pCurrent = NULL; + + assert(self); + + if(self->iDeleting) + { + return NULL; + } + + pCurrent = self->pCList; + while(pCurrent) + { + if(pCurrent->pData == pData) + { + return pCurrent->pName; + } + pCurrent = pCurrent->pNext; + } + return NULL; + } +/*---------------------------------------------------------------------------*/ + void *FindCommandData(SicsInterp *pSics, char *name, char *cclass) + { + CommandList *pCom; + pDummy pDum = NULL; + + pCom = FindCommand(pSics,name); + if(!pCom) + { + return NULL; + } + if(!pCom->pData) + return NULL; + + pDum = (pDummy)pCom->pData; + if(strcmp(pDum->pDescriptor->name,cclass) == 0) + { + return pCom->pData; + } + return NULL; + } diff --git a/SCinter.h b/SCinter.h new file mode 100644 index 00000000..2a1ee0bb --- /dev/null +++ b/SCinter.h @@ -0,0 +1,133 @@ +/*-------------------------------------------------------------------------- + + The SICS needs an interpreter. This is it. + + Mark Koennecke, November 1996 + + copyright: see implementation file + +---------------------------------------------------------------------------*/ +#ifndef SICSINTERPRETER +#define SICSINTERPRETER +#include "Scommon.h" + +typedef struct __SConnection *pSConnection; +typedef struct __SINTER *pSicsInterp; + + +typedef int (*ObjectFunc)(pSConnection pCon, pSicsInterp pInter, void + *pData, int argc, char *argv[]); + +typedef void (*KillFunc)(void *pData); + +typedef struct __Clist { + char *pName; + ObjectFunc OFunc; + KillFunc KFunc; + void *pData; + struct __Clist *pNext; + struct __Clist *pPrevious; + } CommandList; + +typedef struct __SINTER + { + CommandList *pCList; + OutCode eOut; + void *pTcl; + char **argv; + int iDeleting; + }SicsInterp; + +/*-------------------------------------------------------------------------*/ + SicsInterp *InitInterp(void); + /* makes a new interpreter. Returns him on success, else NULL + */ +/*------------------------------------------------------------------------*/ + int AddCommand(SicsInterp *pInterp, char *pName, ObjectFunc pFunc, + KillFunc pKFunc, void *pData); + /* adds a new command, Returns True or False, depending on success + Parameters: + pInterp : the interpreter to add the command to. + pName : the commands name + pFunc : the object function to call when this command is + invoked. Definition of type: see above + pKFunc : function to call in order to delete command data. + type definition: above + pData : pointer to the command's own datastructure. Will be + passed as pData with each call to Ofunc. + */ +/*-------------------------------------------------------------------------*/ + int RemoveCommand(SicsInterp *pInterp, char *pName); + /* kills the command name from the interpreter pInterp + */ +/*-------------------------------------------------------------------------*/ + int InterpExecute(SicsInterp *self,pSConnection pCon,char *pCommand); + + /* + executes a command in the interpreter self. Essentially converts + pCommand in an argc, argv[] pair, sets various status things and + invokes the object function. Takes care of status and error reporting + afterwards. + + Parameters: + self : interpreter to invoke command in. + The connection pCon will be used for I/O and status reporting. + The command to invoke is the string pCommand. + Returns -1 if the command can not be found. + If the command is found, 1 is returned on success, 0 on failure in + the command. +----------------------------------------------------------------------------*/ + + CommandList *FindCommand(SicsInterp *pInterp, char *name); + /* + Searches the Interpreters pInterp command list for a command + with name. Returns ist datastructure if found, NULL else + */ +/*-------------------------------------------------------------------------*/ + int WriteSicsStatus(SicsInterp *pSics,char *file); + /* + SICS needs a way to save the status of each object into a file. + This is done by invoking for each object the object descriptor + function SaveStatus. This function does just that. + + Parameters: + pSics : the interpreter to use. + file : the file to write the information to. + Returns: 1 on success, 0 on failure. +---------------------------------------------------------------------------*/ + int InterpWrite(SicsInterp *pSics, char *buffer); + /* + writes result to Tcl, used for Macro mechanism. + This is an internal function and should not be used. +----------------------------------------------------------------------------*/ + + void DeleteInterp(SicsInterp *self); + /* + deletes the interpreter self aand clears all asoociated datastructures. + self will no longer be valid after this. +--------------------------------------------------------------------------- */ + void strtolower(char *pText); + /* + strtolower converts a string to lowercase +--------------------------------------------------------------------------- */ + void argtolower(int argc, char *argv[]); + /* + converts an argc, argv[] pair to lowercase + */ + +/*-------------------------------------------------------------------------- + FindAlias tries to find an alias to the datastructure given as second + parameter. Returns the command name on success, else NULL. Be warned, this + is very special + */ + + char *FindAlias(SicsInterp *pSics, void *pData); + +/*------------------------------------------------------------------------- + FindCommandData finds a command with the name given. It tests the name in the + ObjectDescriptor to be of name class. If all this succeeds a pointer + to the commands data structure is retuned. Else NULL +*/ + void *FindCommandData(SicsInterp *pSics, char *name, char *comclass); +#endif + diff --git a/SICSmain.c b/SICSmain.c new file mode 100644 index 00000000..754e61af --- /dev/null +++ b/SICSmain.c @@ -0,0 +1,87 @@ +/*-------------------------------------------------------------------------- + + THE SICS SERVER + + + This file contains the main entry point into the world of SICS. + + + + Mark Koennecke, October 1996 + + Copyright: see copyright.h + + Labor fuer Neutronenstreuung + Paul Scherrer Institut + CH-5423 Villigen-PSI + + +----------------------------------------------------------------------------*/ +#include +#include +#include +#include "nserver.h" + +/***************************** Necessary Globals ****************************/ + + IPair *pSICSOptions = NULL; + pServer pServ = NULL; + +/* ========================= Less dreadful file statics =================== */ + +#define DEFAULTINIFILE "servo.tcl" + +/*--------------------------------------------------------------------------- + The Servers Main program. May take one argument: the name of an + initialisation file +*/ + + int main(int argc, char *argv[]) + { + int iRet; + + /* initialise, will die on you if problems */ + if(argc >= 2) + { + iRet = InitServer(argv[1],&pServ); + } + else + { + iRet = InitServer(NULL,&pServ); + } + if(!iRet) + { + printf("Unrecoverable error on server startup, exiting........."); + exit(1); + } + + + RunServer(pServ); + + StopServer(pServ); + pServ = NULL; + exit(0); + } +/*--------------------------------------------------------------------------*/ + SicsInterp *GetInterpreter(void) + { + return pServ->pSics; + } +/*--------------------------------------------------------------------------*/ + pExeList GetExecutor(void) + { + return pServ->pExecutor; + } +/*------------------------------------------------------------------------*/ + void StopExit(void) + { + if(pServ) + { + StopServer(pServ); + } + } +/*-------------------------------------------------------------------------*/ + pTaskMan GetTasker(void) + { + return pServ->pTasker; + } diff --git a/Scommon.h b/Scommon.h new file mode 100644 index 00000000..6217f979 --- /dev/null +++ b/Scommon.h @@ -0,0 +1,81 @@ +/*------------------------------------------------------------------------- + + Some common types and functions for SICS + + + Mark Koennecke, October 1996 + + Copyright: + + Labor fuer Neutronenstreuung + Paul Scherrer Institut + CH-5423 Villigen-PSI + + + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY + FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY + DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE + IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE + NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + MODIFICATIONS. +----------------------------------------------------------------------------*/ +#ifndef SICSCOMMON +#define SICSCOMMON + +/* this enum defines the output types in SICS */ +typedef enum { + eInternal, + eCommand, + eHWError, + eInError, + eStatus, + eValue, + eWarning, + eError + } OutCode; + +#include "interrupt.h" + +/* define some user rights codes */ +#define usInternal 0 +#define usMugger 1 +#define usUser 2 +#define usSpy 3 + +/* status and error codes */ +#define OKOK 1 +#define HWIdle 2 +#define HWBusy 3 +#define HWFault 4 +#define HWPosFault 5 +#define HWCrash 6 +#define NOMEMORY 7 +#define HWNoBeam 8 +#define HWPause 9 +#define HWWarn 10 + +/* + Sics uses some server options for some server configuration parameters. + These options are held in the global variable pSICSOptions. + */ +#include "ifile.h" +extern IPair *pSICSOptions; + +#endif + diff --git a/access.c b/access.c new file mode 100644 index 00000000..860c962a --- /dev/null +++ b/access.c @@ -0,0 +1,16 @@ +/* ------------------------------------------------------------------------ + The Accesscode names for SICS + + Mark Koennecke, November 1996 +----------------------------------------------------------------------------*/ +#ifndef PCODE +#define PCODE + + static char *aCode[] = { + "internal", + "mugger", + "user", + "spy", + NULL }; + static int iCodes = 4; +#endif diff --git a/alias.c b/alias.c new file mode 100644 index 00000000..62bf3840 --- /dev/null +++ b/alias.c @@ -0,0 +1,214 @@ +/*----------------------------------------------------------------------- + + A L I A S + Copyright: + + Labor fuer Neutronenstreuung + Paul Scherrer Institut + CH-5423 Villigen-PSI + + First Version: 1998, Mark Koennecke + updated: November 1999, Mark Koennecke + + + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY + FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY + DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE + IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE + NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + MODIFICATIONS. +----------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include "fortify.h" +#include "sics.h" +#include "splitter.h" +#include "alias.h" + +/* + Usage: SicsAlias object newname +*/ + + int SicsAlias(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]) + { + CommandList *pCom = NULL; + char pBueffel[256]; + int iRet; + + if(!SCMatchRights(pCon,usMugger)) + { + SCWrite(pCon,"ERROR: aliasing only allowed to Managers", + eError); + return 0; + } + + if(argc < 3) + { + SCWrite(pCon,"ERROR: insufficient number of arguments to SicsAlias", + eError); + return 0; + } + + argtolower(argc,argv); + /* first parameter should be an registered SICS object */ + pCom = FindCommand(pSics,argv[1]); + if(!pCom) + { + sprintf(pBueffel,"ERROR: cannot find %s, no alias created",argv[1]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + + /* alright: create the alias */ + iRet = AddCommand(pSics,argv[2],pCom->OFunc,NULL,pCom->pData); + if(!iRet) + { + sprintf(pBueffel,"ERROR: duplicate command %s not created",argv[2]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + return 1; + } +/*-------------------------------------------------------------------- + Make Alias: a command which installs a general alias into SICS. +*/ + + typedef struct { + pObjectDescriptor pDes; + char *pCommand; + }Alias, *pAlias; +/*----------------------------------------------------------------------*/ + static void FreeAlias(void *pData) + { + pAlias self = (pAlias)pData; + if(!self) + return; + + if(self->pDes) + DeleteDescriptor(self->pDes); + + if(self->pCommand) + free(self->pCommand); + + free(self); + } +/*---------------------------------------------------------------------- + In order to make alias most general alias tries to find the interfaces + defined by the object corresponding to the first word in the command. + Note: does not work, the object pointer with which a interface function + will be called refers to the alias and not the proper thing: core dump! + Therefore disabled! +*/ + static void *AliasInterface(void *pData, int iID) + { + CommandList *pCom = NULL; + pDummy pDum = NULL; + char *pPtr = NULL; + pAlias self = (pAlias)pData; + + assert(self); + pPtr = strtok(self->pCommand," \t\n"); + pCom = FindCommand(pServ->pSics,pPtr); + if(!pCom) + return NULL; + + pDum = (pDummy)pCom->pData; + if(!pDum) + return NULL; + + return pDum->pDescriptor->GetInterface(pDum,iID); + } +/*-----------------------------------------------------------------------*/ + static int AliasAction(SConnection *pCon, SicsInterp *pSics, + void *pData, int argc, char *argv[]) + { + pAlias self = NULL; + int status; + char pLine[512]; + char *pPtr; + Tcl_DString command; + + self = (pAlias)pData; + assert(self); + + /* + build command by appending the alias command and any possible + arguments given. + */ + Tcl_DStringInit(&command); + Tcl_DStringAppend(&command, self->pCommand,-1); + Tcl_DStringAppend(&command," ",-1); + Arg2Text(argc-1,&argv[1],pLine,511); + Tcl_DStringAppend(&command,pLine,-1); + + /* execute the command on the current connection */ + status = SCInvoke(pCon,pSics,Tcl_DStringValue(&command)); + + /* finish */ + Tcl_DStringFree(&command); + return status; + } +/*-----------------------------------------------------------------------*/ + int MakeAlias(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]) + { + char pBueffel[512]; + int iRet; + pAlias pNew = NULL; + + if(argc < 3) + { + SCWrite(pCon,"ERROR: insufficient number of arguments to alias", + eError); + return 0; + } + + Arg2Text(argc-2,&argv[2],pBueffel,511); + + /* create data structure */ + pNew = (pAlias)malloc(sizeof(Alias)); + if(!pNew) + { + SCWrite(pCon,"ERROR: out of memory while creating alias",eError); + return 0; + } + pNew->pDes = CreateDescriptor("Alias"); + pNew->pCommand = strdup(pBueffel); + if( !pNew->pDes || !pNew->pCommand) + { + SCWrite(pCon,"ERROR: out of memory while creating alias",eError); + return 0; + } + + iRet = AddCommand(pSics, + argv[1], + AliasAction, + FreeAlias, + pNew); + if(!iRet) + { + FreeAlias(pNew); + SCWrite(pCon,"ERROR: duplicate object name NOT created",eError); + return 0; + } + return 1; + } diff --git a/alias.h b/alias.h new file mode 100644 index 00000000..88b327e4 --- /dev/null +++ b/alias.h @@ -0,0 +1,20 @@ +/*------------------------------------------------------------------------ + A L I A S + + Implementation of the alias command. This is a configuration command + which allows additional names "aliases" for an existing object. + + Mark Koennecke, March 1997 + + copyright: see implementation file + +-------------------------------------------------------------------------*/ +#ifndef SICSALIAS +#define SICSALIAS + + int SicsAlias(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + int MakeAlias(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); +#endif + diff --git a/amor.dic b/amor.dic new file mode 100644 index 00000000..bec39713 --- /dev/null +++ b/amor.dic @@ -0,0 +1,210 @@ +##NXDICT-1.0 +#---------------------------------------------------------------------------- +# NeXus dictionary file for the SINQ instrument AMOR +# +# DO NOT EDIT WHEN YOU DO NOT KNOW WHAT YOU ARE DOING! +# This file determines the placement of data items in the AMOR NeXus +# data file. Your data may not be readable if this file is messed up. +# +# Mark Koennecke, September 1999 +#---------------------------------------------------------------------------- +# AMOR may have variable time binning. In order +# to cope with that, we use NXDICT's text replacement feature and define +# these things +timebin = 512 +detsize = 255 +scanlength = 10 +#---------- NXentry level +etitle=/entry1,NXentry/SDS title -type DFNT_CHAR -rank 1 -dim {132} +estart=/entry1,NXentry/SDS start_time -type DFNT_CHAR -rank 1 -dim {132} +eend=/entry1,NXentry/SDS end_time -type DFNT_CHAR -rank 1 -dim {132} +#----------------- NXinstrument +iname=/entry1,NXentry/reflectometer,NXinstrument/SDS name -type DFNT_CHAR \ + -rank 1 -dim {132} +#----------------- NXsource +sname=/entry1,NXentry/reflectometer,NXinstrument/SINQ,NXsource/SDS name \ + -type DFNT_CHAR -rank 1 -dim {132} +stype=/entry1,NXentry/reflectometer,NXinstrument/SINQ,NXsource/SDS type \ + -type DFNT_CHAR -rank 1 -dim {132} +#----------------- Chopper +cname=/entry1,NXentry/reflectometer,NXinstrument/chopper,NXchopper/SDS name \ + -type DFNT_CHAR -rank 1 -dim {132} +crot=/entry1,NXentry/reflectometer,NXinstrument/chopper,NXchopper/SDS \ + rotation_speed -attr {units,rpm} +#---------------- frame overlap mirror +fomname=/entry1,NXentry/reflectometer,NXinstrument/frame_overlap_mirror,NXfilter/SDS name \ + -type DFNT_CHAR -rank 1 -dim {132} +fomh=/entry1,NXentry/reflectometer,NXinstrument/frame_overlap_mirror,NXfilter/SDS \ + omega_height -attr {units,mm} +fomom=/entry1,NXentry/reflectometer,NXinstrument/frame_overlap_mirror,NXfilter/SDS \ + omega -attr {units,degree} +fodist=/entry1,NXentry/reflectometer,NXinstrument/frame_overlap_mirror,NXfilter/SDS \ + distance -attr {units,mm} +#-------------- first slit +d1l=/entry1,NXentry/reflectometer,NXinstrument/diaphragm1,NXfilter/SDS left \ + -attr {units,mm} +d1r=/entry1,NXentry/reflectometer,NXinstrument/diaphragm1,NXfilter/SDS right \ + -attr {units,mm} +d1t=/entry1,NXentry/reflectometer,NXinstrument/diaphragm1,NXfilter/SDS top \ + -attr {units,mm} +d1b=/entry1,NXentry/reflectometer,NXinstrument/diaphragm1,NXfilter/SDS bottom \ + -attr {units,mm} +d1dist=/entry1,NXentry/reflectometer,NXinstrument/diaphragm1,NXfilter/SDS distance \ + -attr {units,mm} +#---------- polarizing mirror +polname=/entry1,NXentry/reflectometer,NXinstrument/polarizer,NXfilter/SDS name \ + -type DFNT_CHAR -rank 1 -dim {132} +polz=/entry1,NXentry/reflectometer,NXinstrument/polarizer,NXfilter/SDS height \ + -attr {units,mm} +polzom=/entry1,NXentry/reflectometer,NXinstrument/polarizer,NXfilter/SDS omega_height \ + -attr {units,mm} +polom=/entry1,NXentry/reflectometer,NXinstrument/polarizer,NXfilter/SDS omega \ + -attr {units,degree} +poly=/entry1,NXentry/reflectometer,NXinstrument/polarizer,NXfilter/SDS y_position \ + -attr {units,mm} +poldist=/entry1,NXentry/reflectometer,NXinstrument/polarizer,NXfilter/SDS distance \ + -attr {units,mm} +#-------------- second slit +d2l=/entry1,NXentry/reflectometer,NXinstrument/diaphragm2,NXfilter/SDS left \ + -attr {units,mm} +d2r=/entry1,NXentry/reflectometer,NXinstrument/diaphragm2,NXfilter/SDS right \ + -attr {units,mm} +d2t=/entry1,NXentry/reflectometer,NXinstrument/diaphragm2,NXfilter/SDS top \ + -attr {units,mm} +d2b=/entry1,NXentry/reflectometer,NXinstrument/diaphragm2,NXfilter/SDS bottom \ + -attr {units,mm} +d2dist=/entry1,NXentry/reflectometer,NXinstrument/diaphragm2,NXfilter/SDS distance \ + -attr {units,mm} +#-------------- third slit +d3l=/entry1,NXentry/reflectometer,NXinstrument/diaphragm3,NXfilter/SDS left \ + -attr {units,mm} +d3r=/entry1,NXentry/reflectometer,NXinstrument/diaphragm3,NXfilter/SDS right \ + -attr {units,mm} +d3t=/entry1,NXentry/reflectometer,NXinstrument/diaphragm3,NXfilter/SDS top \ + -attr {units,mm} +d3b=/entry1,NXentry/reflectometer,NXinstrument/diaphragm3,NXfilter/SDS bottom \ + -attr {units,mm} +d3dist=/entry1,NXentry/reflectometer,NXinstrument/diaphragm3,NXfilter/SDS distance \ + -attr {units,mm} +#---------------- sample table +saname=/entry1,NXentry/sample,NXsample/SDS name \ + -type DFNT_CHAR -rank 1 -dim {132} +somheight=/entry1,NXentry/sample,NXsample/SDS omega_height \ + -attr {units,mm} +schi=/entry1,NXentry/sample,NXsample/SDS chi \ + -attr {units,degree} +somega=/entry1,NXentry/sample,NXsample/SDS omega \ + -attr {units,degree} +stheight=/entry1,NXentry/sample,NXsample/SDS table_height \ + -attr {units,mm} +stdist=/entry1,NXentry/sample,NXsample/SDS distance \ + -attr {units,mm} +#------------ fourth slit +d4l=/entry1,NXentry/reflectometer,NXinstrument/diaphragm4,NXfilter/SDS left \ + -attr {units,mm} +d4r=/entry1,NXentry/reflectometer,NXinstrument/diaphragm4,NXfilter/SDS right \ + -attr {units,mm} +d4t=/entry1,NXentry/reflectometer,NXinstrument/diaphragm4,NXfilter/SDS top \ + -attr {units,mm} +d4b=/entry1,NXentry/reflectometer,NXinstrument/diaphragm4,NXfilter/SDS bottom \ + -attr {units,mm} +d4dist=/entry1,NXentry/reflectometer,NXinstrument/diaphragm4,NXfilter/SDS distance \ + -attr {units,mm} +#------------ analyzer +anname=/entry1,NXentry/reflectometer,NXinstrument/polarizer,NXfilter/SDS name \ + -type DFNT_CHAR -rank 1 -dim {132} +anoz=/entry1,NXentry/reflectometer,NXinstrument/analyzer,NXfilter/SDS omega_height \ + -attr {units,mm} +anom=/entry1,NXentry/reflectometer,NXinstrument/analyzer,NXfilter/SDS omega \ + -attr {units,degree} +antz=/entry1,NXentry/reflectometer,NXinstrument/analyzer,NXfilter/SDS height \ + -attr {units,mm} +andist=/entry1,NXentry/reflectometer,NXinstrument/analyzer,NXfilter/SDS distance \ + -attr {units,mm} +#--------------- fifth slit!! +d5l=/entry1,NXentry/reflectometer,NXinstrument/diaphragm5,NXfilter/SDS left \ + -attr {units,mm} +d5r=/entry1,NXentry/reflectometer,NXinstrument/diaphragm5,NXfilter/SDS right \ + -attr {units,mm} +d5t=/entry1,NXentry/reflectometer,NXinstrument/diaphragm5,NXfilter/SDS top \ + -attr {units,mm} +d5b=/entry1,NXentry/reflectometer,NXinstrument/diaphragm5,NXfilter/SDS bottom \ + -attr {units,mm} +d5dist=/entry1,NXentry/reflectometer,NXinstrument/diaphragm5,NXfilter/SDS distance \ + -attr {units,mm} +#---------- count control +cnmode=/entry1,NXentry/reflectometer,NXinstrument/counter,NXmonitor/SDS count_mode \ + -type DFNT_CHAR -rank 1 -dim {30} +cnpreset=/entry1,NXentry/reflectometer,NXinstrument/counter,NXmonitor/SDS preset \ + -attr {units,countsOrseconds} +cntime=/entry1,NXentry/reflectometer,NXinstrument/counter,NXmonitor/SDS time \ + -attr {units,seconds} +cnmon1=/entry1,NXentry/reflectometer,NXinstrument/counter,NXmonitor/SDS monitor1 \ + -type DFNT_INT32 -attr {units,counts} +cnmon2=/entry1,NXentry/reflectometer,NXinstrument/counter,NXmonitor/SDS monitor2 \ + -type DFNT_INT32 -attr {units,counts} +#-------------- detector-TOF mode +dettype=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS type \ + -type DFNT_CHAR -rank 1 -dim {132} +dety=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS y_detector \ + -type DFNT_FLOAT32 -rank 1 -dim {$(detsize)} -attr {axis,1} \ + -attr {units,mm} +detxx=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS x_detector \ + -type DFNT_FLOAT32 -rank 1 -dim {$(detsize)} -attr {axis,2} \ + -attr {units,mm} +detz=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS z \ + -type DFNT_FLOAT32 -rank 1 -dim {$(detsize)} -attr {axis,2} \ + -attr {units,mm} +detx=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS x \ + -type DFNT_FLOAT32 -attr {units,mm} +detom=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS omega \ + -type DFNT_FLOAT32 -attr {units,degree} +detheight=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS height \ + -type DFNT_FLOAT32 -attr {units,mm} +detdist=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS distance \ + -type DFNT_FLOAT32 -attr {units,mm} +dettime=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS time_binning \ + -type DFNT_FLOAT32 -rank 1 -dim {$(timebin)} -attr {axis,3} \ + -attr {units,ms} +spinup=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS spinup \ + -type DFNT_INT32 -rank 3 -dim {$(detsize),$(detsize),$(timebin)} \ + -attr {signal,1} +spindown=/entry1,NXentry/reflectometer,NXinstrument/TOF,NXdetector/SDS spindown \ + -type DFNT_INT32 -rank 3 -dim {$(detsize),$(detsize),$(timebin)} \ + -attr {signal,1} +#------------ detector: scan mode +scanroot=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS +sdetx=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS x \ + -type DFNT_FLOAT32 -attr {units,mm} +sdetom=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS omega \ + -type DFNT_FLOAT32 -attr {units,degree} +sdetheight=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS height \ + -type DFNT_FLOAT32 -attr {units,mm} +spinupup=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS spinup_upper \ + -type DFNT_INT32 -rank 1 -dim {$(scanlength)} -attr {signal,1} +spindownup=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS \ + spindown_upper \ + -type DFNT_INT32 -rank 1 -dim {$(scanlength)} -attr {signal,2} +spinuplo=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS spinup_lower \ + -type DFNT_INT32 -rank 1 -dim {$(scanlength)} -attr {signal,3} +spindownlo=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS \ + spindown_lower \ + -type DFNT_INT32 -rank 1 -dim {$(scanlength)} -attr {signal,4} +somega=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS \ + omega -attr {units,degree} \ + -type DFNT_FLOAT32 -rank 1 -dim {$(scanlength)} -attr {axis,1} +smonitor1=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS \ + monitor1 \ + -type DFNT_INT32 -rank 1 -dim {$(scanlength)} +smonitor2=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS \ + monitor2 \ + -type DFNT_INT32 -rank 1 -dim {$(scanlength)} +stime=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS \ + time \ + -type DFNT_FLOAT32 -rank 1 -dim {$(scanlength)} -attr {units,s} +sdetdist=/entry1,NXentry/reflectometer,NXinstrument/scan,NXdetector/SDS distance \ + -type DFNT_FLOAT32 -attr {units,mm} +#------------------- data vGroup +dana=/entry1,NXentry/TOF,NXdata/NXVGROUP +sdana=/entry1,NXentry/scan,NXdata/NXVGROUP + diff --git a/amor2t.c b/amor2t.c new file mode 100644 index 00000000..6213e4f2 --- /dev/null +++ b/amor2t.c @@ -0,0 +1,634 @@ +/*--------------------------------------------------------------------------- + A M O R 2 T + + A class for controlling the two theta movement of the reflectometer + AMOR at SINQ. It is not clear if this class may be useful for other + reflectometers, too. At AMOR the two theta movement of the detector is + realized by translating the detector along x and z. Also it can be + tilted in omega. Furthermore the height of two diaphragms has to be + adjusted when moving two theta as well. In polarizing mode the analyzer + mirror has to be moved as well. + + copyright: see copyright.h + + Mark Koennecke, September 1999 +---------------------------------------------------------------------------*/ +#include +#include +#include +#include "fortify.h" +#include +#include "sics.h" +#include "motor.h" +#include "obpar.h" + +#define DEBUG 1 + +#define MAXMOT 9 +#define MAXPAR 8 + +#include "amor2t.i" +#include "amor2t.h" + +/* + Defines for accessing various motors and variables. Definition of motor: see + annotated AMOR drawing. +*/ + +/* monochromator omega */ +#define MOTMOM 0 +/* sample omega */ +#define MOTSOM 1 +/* detector height movement */ +#define MOTCOZ 2 +/* detector movement along main axis */ +#define MOTCOX 3 +/* sample holder height movement */ +#define MOTSTZ 4 +/* whole sample table height movement */ +#define MOTSOZ 5 +/* lift for diaphragm 4*/ +#define MOTD4B 6 +/* lift for diaphragm 5 */ +#define MOTD5B 7 +/* detector omega movement */ +#define MOTCOM 8 + +/* distance detector sample */ +#define PARDS 0 +/* constant height of sample: height = PARDH + MOTSOZ + MOTSTZ */ +#define PARDH 1 +/* distance diaphragm 4 - sample */ +#define PARDD4 2 +/* distance to diaphragm 5 */ +#define PARDD5 3 +/* interrupt to issue when a motor fails on this */ +#define PARINT 4 +/* base height of counter station */ +#define PARDDH 5 +/* height of D4 */ +#define PARD4H 6 +/* height of D5 */ +#define PARD5H 7 + +/*====================================================================== + The core of it all: The calculation of the settings for the various + motors. +========================================================================*/ + + static int CalculateAMORE(pAmor2T self, SConnection *pCon, float fNew) + { + float fMOM, fSOM, fSTZ, fSOZ; + double fAngle, fX, fZ, fBase, fPIR; + float fCOZ, fCOX, fCOM; + int iRet; +#ifdef DEBUG + char pBueffel[132]; +#endif + + /* get the necessary angles first */ + iRet = MotorGetSoftPosition(self->aEngine[MOTMOM],pCon,&fMOM); + if(iRet != 1) + { + return iRet; + } + iRet = MotorGetSoftPosition(self->aEngine[MOTSOM],pCon,&fSOM); + if(iRet != 1) + { + return iRet; + } + iRet = MotorGetSoftPosition(self->aEngine[MOTSTZ],pCon,&fSTZ); + if(iRet != 1) + { + return iRet; + } + iRet = MotorGetSoftPosition(self->aEngine[MOTSOZ],pCon,&fSOZ); + if(iRet != 1) + { + return iRet; + } + + /* calculate base height of sample table */ + fBase = fSTZ + fSOZ + ObVal(self->aParameter,PARDH); + fPIR = 180. / 3.1415926; + + /* calculation for detector */ + fAngle = fNew - 2*fMOM; + if(fAngle < 0) + { + fAngle = fAngle + 360.; + } + fAngle /= fPIR; + fX = ObVal(self->aParameter,PARDS)*cos(fAngle); + fZ = ObVal(self->aParameter,PARDS)*sin(fAngle); + self->toStart[0].pMot = self->aEngine[MOTCOX]; + strcpy(self->toStart[0].pName,self->aEngine[MOTCOX]->name); + self->toStart[0].fTarget = fX - ObVal(self->aParameter,PARDS); + self->toStart[1].pMot = self->aEngine[MOTCOZ]; + strcpy(self->toStart[1].pName,self->aEngine[MOTCOZ]->name); + self->toStart[1].fTarget = fZ + fBase - + ObVal(self->aParameter,PARDDH); + self->toStart[2].pMot = self->aEngine[MOTCOM]; + strcpy(self->toStart[2].pName,self->aEngine[MOTCOM]->name); + self->toStart[2].fTarget = fNew - 2*fMOM; + self->iStart = 3; + + /* calculation for diaphragm 4 */ + fZ = ObVal(self->aParameter,PARDD4) * sin(fAngle); + self->toStart[3].pMot = self->aEngine[MOTD4B]; + strcpy(self->toStart[3].pName,self->aEngine[MOTD4B]->name); + self->toStart[3].fTarget = fBase + fZ - + ObVal(self->aParameter,PARD4H); + self->iStart = 4; + + /* calculation for diaphragm 5 */ + fZ = ObVal(self->aParameter,PARDD5) * sin(fAngle); + self->toStart[4].pMot = self->aEngine[MOTD5B]; + strcpy(self->toStart[4].pName,self->aEngine[MOTD5B]->name); + self->toStart[4].fTarget = fBase + fZ - + ObVal(self->aParameter,PARD5H); + self->iStart = 5; +#ifdef DEBUG + sprintf(pBueffel,"2T COZ COX COM D4B D5B "); + SCWrite(pCon,pBueffel,eValue); + sprintf(pBueffel,"%6.2f %6.2f %6.2f %6.2f %6.2f %6.2f", + fNew, self->toStart[1].fTarget, self->toStart[0].fTarget, + self->toStart[2].fTarget, self->toStart[3].fTarget, + self->toStart[4].fTarget); + SCWrite(pCon,pBueffel,eValue); +#endif + + return 1; + } +/*======================================================================== + Definition of interface functions. +=========================================================================*/ + static long A2TSetValue(void *pData, SConnection *pCon, float fNew) + { + int i, iRet; + pIDrivable pDriv = NULL; + pAmor2T self = (pAmor2T) pData; + + assert(self); + + /* calculation */ + iRet = CalculateAMORE(self,pCon,fNew); + if(iRet != 1) + { + return iRet; + } + + /* start them all */ + for(i = 0; i < self->iStart; i++) + { + pDriv = self->toStart[i].pMot->pDescriptor->GetInterface( + self->toStart[i].pMot,DRIVEID); + if(pDriv != NULL) + { + iRet = pDriv->SetValue(self->toStart[i].pMot,pCon, + self->toStart[i].fTarget); + if(iRet != OKOK) + { + return iRet; + } + } + } + return OKOK; + } +/*-------------------------------------------------------------------------*/ + static int A2THalt(void *pData) + { + int i, iRet; + pIDrivable pDriv = NULL; + pAmor2T self = (pAmor2T) pData; + + assert(self); + + /* stop them all */ + for(i = 0; i < self->iStart; i++) + { + pDriv = self->toStart[i].pMot->pDescriptor->GetInterface( + self->toStart[i].pMot,DRIVEID); + if(pDriv != NULL) + { + iRet = pDriv->Halt(self->toStart[i].pMot); + } + } + return OKOK; + } +/*-----------------------------------------------------------------------*/ + static int A2TCheck(void *pData, float fNew, char *error, int iErrLen) + { + int i, iRet; + pIDrivable pDriv = NULL; + pAmor2T self = (pAmor2T) pData; + SConnection *pDumCon = NULL; + + + assert(self); + pDumCon = SCCreateDummyConnection(pServ->pSics); + assert(pDumCon); + + /* calculation */ + iRet = CalculateAMORE(self,pDumCon,fNew); + SCDeleteConnection(pDumCon); + if(iRet != 1) + { + return iRet; + } + + /* check them all */ + for(i = 0; i < self->iStart; i++) + { + pDriv = self->toStart[i].pMot->pDescriptor->GetInterface( + self->toStart[i].pMot,DRIVEID); + if(pDriv != NULL) + { + iRet = pDriv->CheckLimits(self->toStart[i].pMot, + self->toStart[i].fTarget, + error,iErrLen); + if(iRet != 1) + { + return iRet; + } + } + } + return 1; + } +/*------------------------------------------------------------------------*/ + static int A2TStatus(void *pData, SConnection *pCon) + { + int i, iRet; + pIDrivable pDriv = NULL; + pAmor2T self = (pAmor2T) pData; + + assert(self); + + /* check them all */ + for(i = 0; i < self->iStart; i++) + { + pDriv = self->toStart[i].pMot->pDescriptor->GetInterface( + self->toStart[i].pMot,DRIVEID); + if(pDriv != NULL) + { + iRet = pDriv->CheckStatus(self->toStart[i].pMot,pCon); + if( (iRet != OKOK) && (iRet != HWIdle) ) + { + return iRet; + } + } + } + return iRet; + } +/*------------------------------------------------------------------------*/ + static float A2TGetValue(void *pData, SConnection *pCon) + { + float fVal, fMOM, fResult; + int iRet; + pIDrivable pDriv = NULL; + pAmor2T self = (pAmor2T) pData; + + assert(self); + + /* get COM */ + pDriv = self->aEngine[MOTCOM]->pDescriptor->GetInterface( + self->aEngine[MOTCOM],DRIVEID); + if(pDriv) + { + fVal = pDriv->GetValue(self->aEngine[MOTCOM],pCon); + if(fVal < -9000) + { + return fVal; + } + } + /* get MOM */ + pDriv = self->aEngine[MOTCOM]->pDescriptor->GetInterface( + self->aEngine[MOTMOM],DRIVEID); + if(pDriv) + { + fMOM = pDriv->GetValue(self->aEngine[MOTMOM],pCon); + if(fMOM < -9000) + { + return fMOM; + } + } + + /* retrocalculate 2 theta */ + fResult = fVal + 2*fMOM; + return fResult; + } +/*-----------------------------------------------------------------------*/ + static void *A2TGetInterface(void *pData, int iID) + { + pAmor2T self = (pAmor2T) pData; + + assert(self); + if(iID == DRIVEID) + { + return self->pDriv; + } + return NULL; + } +/*------------------------------------------------------------------------*/ + static int A2TSave(void *pData, char *name, FILE *fd) + { + int i; + pAmor2T self = (pAmor2T) pData; + + assert(self); + + fprintf(fd,"%s detectord %f \n", name, ObVal(self->aParameter,PARDS)); + fprintf(fd,"%s sampleh %f \n", name, ObVal(self->aParameter,PARDH)); + fprintf(fd,"%s d4d %f \n", name, ObVal(self->aParameter,PARDD4)); + fprintf(fd,"%s d5d %f \n", name, ObVal(self->aParameter,PARDD5)); + fprintf(fd,"%s interrupt %f \n", name, ObVal(self->aParameter,PARINT)); + fprintf(fd,"%s detectorh %f \n", name, ObVal(self->aParameter,PARDDH)); + fprintf(fd,"%s d4h %f \n", name, ObVal(self->aParameter,PARD4H)); + fprintf(fd,"%s d5h %f \n", name, ObVal(self->aParameter,PARD5H)); + + return 1; + } +/*------------------------------------------------------------------------*/ + static void A2TKill(void *pData) + { + pAmor2T self = (pAmor2T) pData; + + if(self == NULL) + return; + + if(self->pDes) + DeleteDescriptor(self->pDes); + + if(self->pDriv) + free(self->pDriv); + + if(self->aParameter) + ObParDelete(self->aParameter); + + free(self); + } +/*-------------------------------------------------------------------------- + Initialization: All is done from the Factory function. This takes an Tcl + array as parameter which is supposed to hold the names of all motors. + This must fail if one of the motors cannot be accessed. +--------------------------------------------------------------------------*/ + int Amor2TFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]) + { + pAmor2T pNew = NULL; + int i, iRet; + char pBueffel[512]; + char *pMot = NULL; + + if(argc < 3) + { + SCWrite(pCon, + "ERROR: Insufficient number of arguments to Amor2tFactory", + eError); + return 0; + } + + /* allocate space ..............*/ + pNew = (pAmor2T)malloc(sizeof(Amor2T)); + if(!pNew) + { + SCWrite(pCon,"ERROR: out of memory in Amor2TFactory",eError); + return 0; + } + memset(pNew,0,sizeof(Amor2T)); + pNew->pDes = CreateDescriptor("Amor2T"); + pNew->aParameter = ObParCreate(MAXPAR); + pNew->pDriv = CreateDrivableInterface(); + if( (!pNew->pDes) || (!pNew->aParameter) || (!pNew->pDriv) ) + { + SCWrite(pCon,"ERROR: out of memory in Amor2TFactory",eError); + A2TKill(pNew); + return 0; + } + + /* find the motors*/ + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"mom",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for mom motr found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTMOM] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTMOM]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"som",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for som motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTSOM] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTSOM]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"coz",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for coz motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTCOZ] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTCOZ]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"cox",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for cox motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTCOX] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTCOX]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"stz",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for stz motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTSTZ] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTSTZ]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"soz",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for soz motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTSOZ] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTSOZ]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"d4b",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for d4b motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTD4B] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTD4B]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"d5b",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for d5b motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTD5B] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTD5B]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + pMot = Tcl_GetVar2(pSics->pTcl,argv[2],"com",TCL_GLOBAL_ONLY); + if(!pMot) + { + SCWrite(pCon,"ERROR: no value for com motor found",eError); + A2TKill(pNew); + return 0; + } + pNew->aEngine[MOTCOM] = FindMotor(pSics,pMot); + if(!pNew->aEngine[MOTCOM]) + { + sprintf(pBueffel,"ERROR: motor %s NOT found!", pMot); + A2TKill(pNew); + return 0; + } + + /* initialize parameters */ + ObParInit(pNew->aParameter,PARDS,"detectord",400.,usMugger); + ObParInit(pNew->aParameter,PARDH,"sampleh",50.,usMugger); + ObParInit(pNew->aParameter,PARDD4,"d4d",100.,usMugger); + ObParInit(pNew->aParameter,PARDD5,"d5d",200.,usMugger); + ObParInit(pNew->aParameter,PARINT,"interrupt",0.,usMugger); + ObParInit(pNew->aParameter,PARDDH,"detectorh",40.,usMugger); + ObParInit(pNew->aParameter,PARD4H,"d4h",40.,usMugger); + ObParInit(pNew->aParameter,PARD5H,"d5h",400.,usMugger); + + /* initialize interfaces */ + pNew->pDes->GetInterface = A2TGetInterface; + pNew->pDes->SaveStatus = A2TSave; + pNew->pDriv->Halt = A2THalt; + pNew->pDriv->CheckLimits = A2TCheck; + pNew->pDriv->SetValue = A2TSetValue; + pNew->pDriv->CheckStatus = A2TStatus; + pNew->pDriv->GetValue = A2TGetValue; + + /* install command */ + iRet = AddCommand(pSics,argv[1], + Amor2TAction,A2TKill,pNew); + if(!iRet) + { + sprintf(pBueffel,"ERROR: duplicate command %s NOT created", + argv[1]); + SCWrite(pCon,pBueffel,eError); + A2TKill(pNew); + return 0; + } + return 1; + } +/*----------------------------------------------------------------------*/ + int Amor2TAction(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]) + { + pAmor2T self = (pAmor2T)pData; + char pBueffel[256]; + float fVal; + double dVal; + ObPar *pPar = NULL; + int iRet; + + assert(self); + + if(argc > 1) + { + strtolower(argv[1]); + if(argc >= 3) + { + iRet = Tcl_GetDouble(pSics->pTcl,argv[2],&dVal); + if(iRet != TCL_OK) + { + sprintf(pBueffel,"ERROR: failed to convert %s to number", + argv[2]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + iRet = ObParSet(self->aParameter,argv[0],argv[1],(float)dVal,pCon); + if(iRet) + { + SCSendOK(pCon); + } + return iRet; + } + else + { + pPar = ObParFind(self->aParameter,argv[1]); + if(!pPar) + { + sprintf(pBueffel,"ERROR: parameter %s NOT found",argv[1]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + sprintf(pBueffel,"%s.%s = %f",argv[0],pPar->name, pPar->fVal); + SCWrite(pCon,pBueffel,eValue); + return 1; + } + } + else + { + fVal = self->pDriv->GetValue(self,pCon); + sprintf(pBueffel," %s = %f", argv[0], fVal); + SCWrite(pCon,pBueffel,eValue); + return 1; + } + } + + + diff --git a/amor2t.h b/amor2t.h new file mode 100644 index 00000000..6e243cb0 --- /dev/null +++ b/amor2t.h @@ -0,0 +1,22 @@ + +/*------------------------------------------------------------------------- + A m o r 2 T + A class for controlling the two theta movement of a reflectometer. + Especially the AMOR reflectometer at SINQ. For details see the file + amor2t.tex. DO NOT TOUCH! This file is automatically created from amor2t.w + with nuweb. + + Mark Koennecke, September 1999 +---------------------------------------------------------------------------*/ +#ifndef AMOR2T +#define AMOR2T + + typedef struct __AMOR2T *pAmor2T; + + int Amor2TFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + int Amor2TAction(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + void Amor2TKill(void *pData); + +#endif diff --git a/amor2t.i b/amor2t.i new file mode 100644 index 00000000..caf1bcf2 --- /dev/null +++ b/amor2t.i @@ -0,0 +1,27 @@ + +/*-------------------------------------------------------------------------- + A m o r 2 T . i + Internal data structure definitions for Amor2T. For details see amor2t.tex. + DO NOT TOUCH! This file is automatically created from amor2t.w. + + Mark Koennecke, September 1999 +----------------------------------------------------------------------------*/ + + typedef struct { + pMotor pMot; + char pName[80]; + float fTarget; + }MotEntry, *pMotEntry; + + + + typedef struct __AMOR2T { + pObjectDescriptor pDes; + pIDrivable pDriv; + pMotor aEngine[MAXMOT]; + MotEntry toStart[MAXMOT]; + int iStart; + ObPar *aParameter; + }Amor2T; + + diff --git a/amor2t.tex b/amor2t.tex new file mode 100644 index 00000000..6badd4b2 --- /dev/null +++ b/amor2t.tex @@ -0,0 +1,176 @@ +\subsection{AMOR Two Theta} +AMOR is SINQ's new reflectometer. It has the peculiar feature that the +two theta movement of the detector is expressed in translations along +the reflectometer base axis and the detector height. Additionally the +detector is tilted. The height of two diaphragms has to be adjusted as +well. And, in polarizing mode, the analyzer has to be operated as +well. Quite a complicated movement. I fear this module may only be +useful for AMOR, but may be, other reflectometers may profit as well. +This object implements this complex movement as a virtual motor. + +The following formulas are used for the necessary calculations: +\begin{eqnarray} +delta height & = & h_{s} - R \sin \alpha \\ +delta x & = & |x_{c} - x_{s}| - R \cos \alpha \\ +omega & = & -2 MOM + 2 SOM \\ +\end{eqnarray} +with +\begin{eqnarray} +h_{s} & = & \tan(2MOM)|x_{c} - x_{s}| \\ +R & = & \sqrt{hs^{2} - |x_{c} - x_{s}|^{2}} \\ +\alpha & = & 180 -90 - \beta - 2SOM \\ +\beta & = & 180 - 90 - 2MOM \\ +MOM & = & polarizer \omega \\ +SOM & = & sample \omega \\ +x_{c} & = & counter position \\ +x_{s} & = & sample position\\ +\end{eqnarray} +The same equations hold true for the calculations of the diaphragm +heights, just replace the distances. The equations for the analyzer +are not yet known. + +Due to this complicated movement this module needs to know about a lot +of motors and a lot of parameters. The distances of the various +components need to be modified at run time in order to allow for +configuration changes. These are not motorized but must be entered +manually. + +\subsubsection{Data Structures} +Consequently data structures are complex. The first data structure +used is an entry in an array of motors to start: +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap1} +$\langle$putput {\footnotesize ?}$\rangle\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@ typedef struct {@\\ +\mbox{}\verb@ pMotor pMot;@\\ +\mbox{}\verb@ char pName[80];@\\ +\mbox{}\verb@ float fTarget;@\\ +\mbox{}\verb@ }MotEntry, *pMotEntry;@\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-1ex} +\footnotesize\addtolength{\baselineskip}{-1ex} +\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}} +\item Macro referenced in scrap ?. +\end{list} +\end{minipage}\\[4ex] +\end{flushleft} +\begin{description} +\item[pMot] is a pointer to the motors data structure. +\item[pName] is the name of the motor to start. +\item[fTarget] is the target value for the motor. +\end{description} + +The next data structure is the class data structure for amor2t: +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap2} +$\langle$amoredata {\footnotesize ?}$\rangle\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@ typedef struct __AMOR2T {@\\ +\mbox{}\verb@ pObjectDescriptor pDes;@\\ +\mbox{}\verb@ pIDrivable pDriv;@\\ +\mbox{}\verb@ pMotor aEngine[MAXMOT];@\\ +\mbox{}\verb@ MotEntry toStart[MAXMOT];@\\ +\mbox{}\verb@ int iStart;@\\ +\mbox{}\verb@ ObPar *aParameter;@\\ +\mbox{}\verb@ }Amor2T;@\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-1ex} +\footnotesize\addtolength{\baselineskip}{-1ex} +\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}} +\item Macro referenced in scrap ?. +\end{list} +\end{minipage}\\[4ex] +\end{flushleft} +\begin{description} +\item[pDes] The standard SICS object descriptor. +\item[pDriv] The drivable interface. The functions defined for the +drivable interface implement most of the work of this class. +\item[aEngine] An array of pointers to the motor data structures this +class has to deal with. The proper initialization of this is taken +care of during the initialization of the object. +\item[toStart] An array of motors to start when all calculations have +been performed. +\item[iStart] The number of valid entries in toStart. +\item[aParameter] An array of parameters for this object. +\end{description} + +\subsubsection{The Interface} +The interface to this module is quite primitive. Most of the +functionality is hidden in the drivable interface. So there are only +functions for interacting with the interpreter. + +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap3} +$\langle$amorinterface {\footnotesize ?}$\rangle\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@ typedef struct __AMOR2T *pAmor2T;@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ int Amor2TFactory(SConnection *pCon, SicsInterp *pSics, void *pData,@\\ +\mbox{}\verb@ int argc, char *argv[]);@\\ +\mbox{}\verb@ int Amor2TAction(SConnection *pCon, SicsInterp *pSics, void *pData,@\\ +\mbox{}\verb@ int argc, char *argv[]);@\\ +\mbox{}\verb@ void Amor2TKill(void *pData); @\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-1ex} +\footnotesize\addtolength{\baselineskip}{-1ex} +\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}} +\item Macro referenced in scrap ?. +\end{list} +\end{minipage}\\[4ex] +\end{flushleft} +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap4} +\verb@"amor2t.i"@ {\footnotesize ? }$\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@/*--------------------------------------------------------------------------@\\ +\mbox{}\verb@ A m o r 2 T . i@\\ +\mbox{}\verb@ Internal data structure definitions for Amor2T. For details see amor2t.tex.@\\ +\mbox{}\verb@ DO NOT TOUCH! This file is automatically created from amor2t.w.@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ Mark Koennecke, September 1999@\\ +\mbox{}\verb@----------------------------------------------------------------------------*/@\\ +\mbox{}\verb@@$\langle$putput {\footnotesize ?}$\rangle$\verb@@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@@$\langle$amoredata {\footnotesize ?}$\rangle$\verb@@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-2ex} +\end{minipage}\\[4ex] +\end{flushleft} +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap5} +\verb@"amor2t.h"@ {\footnotesize ? }$\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@/*-------------------------------------------------------------------------@\\ +\mbox{}\verb@ A m o r 2 T@\\ +\mbox{}\verb@ A class for controlling the two theta movement of a reflectometer. @\\ +\mbox{}\verb@ Especially the AMOR reflectometer at SINQ. For details see the file @\\ +\mbox{}\verb@ amor2t.tex. DO NOT TOUCH! This file is automatically created from amor2t.w@\\ +\mbox{}\verb@ with nuweb.@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ Mark Koennecke, September 1999@\\ +\mbox{}\verb@---------------------------------------------------------------------------*/@\\ +\mbox{}\verb@#ifndef AMOR2T@\\ +\mbox{}\verb@#define AMOR2T@\\ +\mbox{}\verb@@$\langle$amorinterface {\footnotesize ?}$\rangle$\verb@@\\ +\mbox{}\verb@#endif @\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-2ex} +\end{minipage}\\[4ex] +\end{flushleft} diff --git a/amor2t.w b/amor2t.w new file mode 100644 index 00000000..04705ca7 --- /dev/null +++ b/amor2t.w @@ -0,0 +1,122 @@ +\subsection{AMOR Two Theta} +AMOR is SINQ's new reflectometer. It has the peculiar feature that the +two theta movement of the detector is expressed in translations along +the reflectometer base axis and the detector height. Additionally the +detector is tilted. The height of two diaphragms has to be adjusted as +well. And, in polarizing mode, the analyzer has to be operated as +well. Quite a complicated movement. I fear this module may only be +useful for AMOR, but may be, other reflectometers may profit as well. +This object implements this complex movement as a virtual motor. + +The following formulas are used for the necessary calculations: +\begin{eqnarray} +delta height & = & h_{s} - R \sin \alpha \\ +delta x & = & |x_{c} - x_{s}| - R \cos \alpha \\ +omega & = & -2 MOM + 2 SOM \\ +\end{eqnarray} +with +\begin{eqnarray} +h_{s} & = & \tan(2MOM)|x_{c} - x_{s}| \\ +R & = & \sqrt{hs^{2} - |x_{c} - x_{s}|^{2}} \\ +\alpha & = & 180 -90 - \beta - 2SOM \\ +\beta & = & 180 - 90 - 2MOM \\ +MOM & = & polarizer \omega \\ +SOM & = & sample \omega \\ +x_{c} & = & counter position \\ +x_{s} & = & sample position\\ +\end{eqnarray} +The same equations hold true for the calculations of the diaphragm +heights, just replace the distances. The equations for the analyzer +are not yet known. + +Due to this complicated movement this module needs to know about a lot +of motors and a lot of parameters. The distances of the various +components need to be modified at run time in order to allow for +configuration changes. These are not motorized but must be entered +manually. + +\subsubsection{Data Structures} +Consequently data structures are complex. The first data structure +used is an entry in an array of motors to start: +@d putput @{ + typedef struct { + pMotor pMot; + char pName[80]; + float fTarget; + }MotEntry, *pMotEntry; +@} +\begin{description} +\item[pMot] is a pointer to the motors data structure. +\item[pName] is the name of the motor to start. +\item[fTarget] is the target value for the motor. +\end{description} + +The next data structure is the class data structure for amor2t: +@d amoredata @{ + typedef struct __AMOR2T { + pObjectDescriptor pDes; + pIDrivable pDriv; + pMotor aEngine[MAXMOT]; + MotEntry toStart[MAXMOT]; + int iStart; + ObPar *aParameter; + }Amor2T; +@} +\begin{description} +\item[pDes] The standard SICS object descriptor. +\item[pDriv] The drivable interface. The functions defined for the +drivable interface implement most of the work of this class. +\item[aEngine] An array of pointers to the motor data structures this +class has to deal with. The proper initialization of this is taken +care of during the initialization of the object. +\item[toStart] An array of motors to start when all calculations have +been performed. +\item[iStart] The number of valid entries in toStart. +\item[aParameter] An array of parameters for this object. +\end{description} + +\subsubsection{The Interface} +The interface to this module is quite primitive. Most of the +functionality is hidden in the drivable interface. So there are only +functions for interacting with the interpreter. + +@d amorinterface @{ + typedef struct __AMOR2T *pAmor2T; + + int Amor2TFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + int Amor2TAction(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + void Amor2TKill(void *pData); +@} + +@o amor2t.i @{ +/*-------------------------------------------------------------------------- + A m o r 2 T . i + Internal data structure definitions for Amor2T. For details see amor2t.tex. + DO NOT TOUCH! This file is automatically created from amor2t.w. + + Mark Koennecke, September 1999 +----------------------------------------------------------------------------*/ +@ + +@ + +@} + +@o amor2t.h @{ +/*------------------------------------------------------------------------- + A m o r 2 T + A class for controlling the two theta movement of a reflectometer. + Especially the AMOR reflectometer at SINQ. For details see the file + amor2t.tex. DO NOT TOUCH! This file is automatically created from amor2t.w + with nuweb. + + Mark Koennecke, September 1999 +---------------------------------------------------------------------------*/ +#ifndef AMOR2T +#define AMOR2T +@ +#endif +@} + diff --git a/amorpar.tcl b/amorpar.tcl new file mode 100644 index 00000000..bdd5af1e --- /dev/null +++ b/amorpar.tcl @@ -0,0 +1,23 @@ +#-------------------------------------------------------------------------- +# A SICS-tcl-macro script for formatting the parameters for the +# reflectometer AMOR's status display. +# +# Mark Koennecke, October 1999 +#------------------------------------------------------------------------- +proc amorpar {} { + lappend list "amorpar == " + lappend list [lastscancommand] ";" + catch {scan getvars} msg + lappend list $msg ";" + lappend list [xxxscan getfile] ";" + lappend list [sicstime] ";" + set ret [catch {temperature} msg] + if {$ret == 0} { + lappend list $msg + } + set ret [catch {magnet} msg] + if {$ret == 0} { + lappend list $msg + } + return [join $list] +} \ No newline at end of file diff --git a/amorscan.c b/amorscan.c new file mode 100644 index 00000000..7f556e46 --- /dev/null +++ b/amorscan.c @@ -0,0 +1,140 @@ +/*------------------------------------------------------------------------- + A M O R S C A N + + An adaption of the general scan routine to deal with special issues at + the reflectometer AMOR at SINQ. + + copyright: see copyright.h + + Mark Koennecke, September 1999 +--------------------------------------------------------------------------*/ +#include +#include +#include "fortify.h" +#include "sics.h" +#include "scan.h" +#include "scan.i" +#include "HistMem.h" +#include "nxamor.h" +#include "amorscan.h" + +/*--------------------------------------------------------------------*/ + static int AmorHeader(pScanData self) + { + return WriteAmorHeader(self->pFile, self->pCon); + } +/*--------------------------------------------------------------------*/ + static int AmorPoints(pScanData self, int iP) + { + /* write only at last scan point */ + if((iP+1) >= self->iNP) + { + return WriteAmorScan(self->pFile,self->pCon,self); + } + } +/*--------------------------------------------------------------------*/ + static int AmorCollect(pScanData self, int iP) + { + pVarEntry pVar = NULL; + void *pDings; + int i, iRet, status; + float fVal; + char pStatus[512], pItem[20]; + char pHead[512]; + CountEntry sCount; + + assert(self); + assert(self->pCon); + + /* prepare output header */ + sprintf(pHead,"%-5.5s","NP"); + sprintf(pStatus,"%-5d",iP); + + /* loop over all scan variables */ + status = 1; + for(i = 0; i < self->iScanVar; i++) + { + DynarGet(self->pScanVar,i,&pDings); + pVar = (pVarEntry)pDings; + if(pVar) + { + fVal = pVar->pInter->GetValue(pVar->pObject,self->pCon); + pVar->fData[iP] = fVal; + sprintf(pItem,"%-10.10s",pVar->Name); + strcat(pHead,pItem); + sprintf(pItem,"%-10.3f",fVal); + strcat(pStatus,pItem); + } + } + + /* store counter data */ + /* monitors */ + for(i = 1; i < 10; i++) + { + sCount.Monitors[i-1] = GetMonitor((pCounter)self->pCounterData,i, + self->pCon); + } + if( self->iChannel != 0 && self->iChannel != -10 ) + { + sCount.Monitors[self->iChannel - 1] = + GetCounts((pCounter)self->pCounterData, + self->pCon); + } + /* counter1 */ + strcat(pHead,"Counter1 "); + sCount.lCount = GetCounts((pCounter)self->pCounterData,self->pCon); + sprintf(pItem,"%-15d",sCount.lCount); + strcat(pStatus,pItem); + + /* + WARNING + Assignements have to be checked when the Schlumpfes are + ready putting the counter box together. + */ + + /* counter2 */ + strcat(pHead,"Counter2 "); + sCount.Monitors[0] = GetMonitor((pCounter)self->pCounterData, + 1,self->pCon); + sprintf(pItem,"%-15d",sCount.Monitors[0]); + strcat(pStatus,pItem); + + /* monitors */ + sCount.Monitors[3] = GetMonitor((pCounter)self->pCounterData, + 2,self->pCon); + sCount.Monitors[4] = GetMonitor((pCounter)self->pCounterData, + 3,self->pCon); + + /* get time */ + sCount.fTime = GetCountTime((pCounter)self->pCounterData, + self->pCon); + strcat(pHead,"Monitor1 "); + sprintf(pItem,"%-12d",sCount.Monitors[3]); + strcat(pStatus,pItem); + strcat(pHead,"Monitor2 "); + sprintf(pItem,"%-12d",sCount.Monitors[4]); + strcat(pStatus,pItem); + strcat(pHead,"Time "); + sprintf(pItem,"%-6.1f",sCount.fTime); + strcat(pStatus,pItem); + + /* write progress */ + strcat(pHead,"\n"); + strcat(pStatus,"\n"); + SCWrite(self->pCon,pHead,eWarning); + SCWrite(self->pCon,pStatus,eWarning); + + /* stow away */ + DynarReplace(self->pCounts,self->iCounts,&sCount,sizeof(CountEntry)); + self->iCounts++; + return 1; + } +/*-----------------------------------------------------------------------*/ + int ConfigureAmor(pScanData self) + { + self->WriteHeader = AmorHeader; + self->WriteScanPoints = AmorPoints; + self->CollectScanData = AmorCollect; + strcpy(self->ext,".hdf"); + return 1; + } diff --git a/amorscan.h b/amorscan.h new file mode 100644 index 00000000..d97195f4 --- /dev/null +++ b/amorscan.h @@ -0,0 +1,15 @@ + +/*----------------------------------------------------------------------- + A M O R S C A N + Adaption of the scan command to do things specific to the + reflectometer AMOR at SINQ. + + Mark Koennecke, September 1999 +-----------------------------------------------------------------------*/ +#ifndef AMORSCAN +#define AMORSCAN + + int ConfigureAmor(pScanData pScan); + +#endif + diff --git a/amorscan.tex b/amorscan.tex new file mode 100644 index 00000000..6e25f20f --- /dev/null +++ b/amorscan.tex @@ -0,0 +1,71 @@ +\subsection{Amor Scan} +This is a special adaption of the general scan routines for the +reflectometer AMOR at SINQ. It works by replacing the configurable +routines in the general scan command with special ones, suited to the +reflectometers purpose. There are several adaptions to the standard +scan command: +\begin{itemize} +\item Data is written to NeXus files instead of ASCII files. +\item There are two counters to keep track of. +\item Furthermore stubs are provided for dealing with spin flippers. +\end{itemize} + +In order to keep track of counters and monitors the following +convention has been devised: +\begin{itemize} +\item GetCounts gets the main detector. +\item GetMonitor 0 the second detector +\item GetMonitor 1 the first detector other spin +\item GetMonitor 2 the second detector other spin +\item GetMonitor 3 the first monitor +\item GetMonitor 4 the second monitor +\end{itemize} +Thus the monitor channels are used to keep the additional counter +information. + +This module provides only one external function: +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap1} +$\langle$amorscan {\footnotesize ?}$\rangle\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@ int ConfigureAmor(pScanData pScan);@\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-1ex} +\footnotesize\addtolength{\baselineskip}{-1ex} +\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}} +\item Macro referenced in scrap ?. +\end{list} +\end{minipage}\\[4ex] +\end{flushleft} +which configures the variable fields and function pointers in pScan to +functions defined in this module. These then do the right thing. This +module is also an example of how the scan command can be configured to do +tricks based on the syntax and hooks defined in scan.*. + + +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap2} +\verb@"amorscan.h"@ {\footnotesize ? }$\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@/*-----------------------------------------------------------------------@\\ +\mbox{}\verb@ A M O R S C A N@\\ +\mbox{}\verb@ Adaption of the scan command to do things specific to the@\\ +\mbox{}\verb@ reflectometer AMOR at SINQ.@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ Mark Koennecke, September 1999@\\ +\mbox{}\verb@-----------------------------------------------------------------------*/@\\ +\mbox{}\verb@#ifndef AMORSCAN@\\ +\mbox{}\verb@#define AMORSCAN@\\ +\mbox{}\verb@@$\langle$amorscan {\footnotesize ?}$\rangle$\verb@@\\ +\mbox{}\verb@#endif@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-2ex} +\end{minipage}\\[4ex] +\end{flushleft} diff --git a/amorscan.w b/amorscan.w new file mode 100644 index 00000000..b52be00d --- /dev/null +++ b/amorscan.w @@ -0,0 +1,57 @@ +\subsection{Amor Scan} +This is a special adaption of the general scan routines for the +reflectometer AMOR at SINQ. It works by replacing the configurable +routines in the general scan command with special ones, suited to the +reflectometers purpose. There are several adaptions to the standard +scan command: +\begin{itemize} +\item Data is written to NeXus files instead of ASCII files. +\item There are two counters to keep track of. +\item Furthermore stubs are provided for dealing with spin flippers. +\end{itemize} + +In order to keep track of counters and monitors the following +convention has been devised: +\begin{itemize} +\item GetCounts gets the main detector. +\item GetMonitor 0 the second detector +\item GetMonitor 1 the first detector other spin +\item GetMonitor 2 the second detector other spin +\item GetMonitor 3 the first monitor +\item GetMonitor 4 the second monitor +\end{itemize} +Thus the monitor channels are used to keep the additional counter +information. + +This module provides only one external function: +@d amorscan @{ + int ConfigureAmor(pScanData pScan); +@} +which configures the variable fields and function pointers in pScan to +functions defined in this module. These then do the right thing. This +module is also an example of how the scan command can be configured to do +tricks based on the syntax and hooks defined in scan.*. + + +@o amorscan.h @{ +/*----------------------------------------------------------------------- + A M O R S C A N + Adaption of the scan command to do things specific to the + reflectometer AMOR at SINQ. + + Mark Koennecke, September 1999 +-----------------------------------------------------------------------*/ +#ifndef AMORSCAN +#define AMORSCAN +@ +#endif + +@} + + + + + + + + diff --git a/amorstat.c b/amorstat.c new file mode 100644 index 00000000..b72c6374 --- /dev/null +++ b/amorstat.c @@ -0,0 +1,772 @@ +/*-------------------------------------------------------------------------- + A M O R S T A T U S + + The implementation file for the amor status display facilitator module. The + reflectometer AMOR needs some advanced feautures for its status display. + These needs are taken care of here. + + copyright: see copyright.h + + Mark Koennecke, September 1999 + --------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include "fortify.h" +#include "sics.h" +#include "counter.h" +#include "HistMem.h" +#include "scan.h" +#include "lld.h" +#include "amorstat.i" +#include "amorstat.h" +/*------------------------------------------------------------------------- + A static which determines if we are in TOF or scan mode. +*/ + static int iTOF = 0; + static pHistMem pHMHM = NULL; +/*-------------------------------------------------------------------------*/ + static int HMCountStartCallback(int iEvent, void *pEvent, void *pUser) + { + SConnection *pCon = (SConnection *)pUser; + const float *fTime = NULL; + int *iTime = NULL; + int iLength, iRet, i; + + assert(pCon); + + if(iEvent == COUNTSTART) + { + /* send current time binning */ + iTOF = 1; + fTime = GetHistTimeBin(pHMHM,&iLength); + iTime = (int *)malloc((iLength+1)*sizeof(int)); + if( (!fTime) || (!iTime)) + { + return 0; + } + iTime[0] = htonl(iLength); + for(i = 0 ; i < iLength; i++) + { + iTime[i+1] = htonl((int)(fTime[i]*65536.)); + } + /* send new time binning to all clients */ + SCWrite(pCon,"TOFClear",eError); + SCWriteUUencoded(pCon,"arrowaxis_time",iTime, + (iLength+1)*sizeof(int)); + free(iTime); + } + return 1; + } +/*-------------------------------------------------------------------------*/ + static int ScanStartCallback(int iEvent, void *pEvent, void *pUser) + { + float *fAxis = NULL; + int *iAxis = NULL; + int iLength, iRet, i; + char pBueffel[80], pName[40]; + SConnection *pCon = (SConnection *)pUser; + pScanData pScan = (pScanData)pEvent; + + assert(pCon); + assert(pScan); + + + if(iEvent == SCANSTART) + { + iTOF = 0; + /* send current axis */ + iLength = GetScanNP(pScan); + fAxis = (float *)malloc((iLength+1)*sizeof(float)); + iAxis = (int *)malloc((iLength+1)*sizeof(int)); + if( (!fAxis) || (!iAxis)) + { + return 0; + } + iAxis[0] = htonl(iLength); + GetScanVar(pScan,0,fAxis,iLength); + GetScanVarName(pScan,0,pName,39); + sprintf(pBueffel,"arrowaxis_%s",pName); + for(i = 0 ; i < iLength; i++) + { + iAxis[i+1] = htonl((int)(fAxis[i]*65536.)); + } + /* send new axis to client */ + SCWrite(pCon,"SCANClear",eError); + SCWriteUUencoded(pCon,pBueffel,iAxis, + (iLength+1)*sizeof(int)); + free(iAxis); + free(fAxis); + } + return 1; + } +/*------------------------------------------------------------------------*/ + static int ScanPointCallback(int iEvent, void *pEvent, void *pUser) + { + long *lData = NULL; + int *iData = NULL; + int iLength, iRet, i; + SConnection *pCon = (SConnection *)pUser; + pScanData pScan = (pScanData)pEvent; + + assert(pCon); + assert(pScan); + + + if( (iEvent == SCANPOINT) || (iEvent == SCANEND) ) + { + /* send current data */ + iTOF = 0; + iLength = GetScanNP(pScan); + lData = (long *)malloc((iLength+1)*sizeof(long)); + iData = (int *)malloc((iLength+1)*sizeof(int)); + if( (!lData) || (!iData)) + { + return 0; + } + iData[0] = htonl(iLength); + GetScanCounts(pScan,lData,iLength); + for(i = 0 ; i < iLength; i++) + { + iData[i+1] = htonl((int)(lData[i])); + } + /* send counts to client */ + SCWriteUUencoded(pCon,"arrow_spinupup",iData, + (iLength+1)*sizeof(int)); + /* send counts for other detector */ + GetScanMonitor(pScan,0,lData,iLength); + for(i = 0 ; i < iLength; i++) + { + iData[i+1] = htonl((int)(lData[i])); + } + SCWriteUUencoded(pCon,"arrow_spinuplo",iData, + (iLength+1)*sizeof(int)); + /* to do: check for polarization and send spinlo */ + free(iData); + free(lData); + } + return 1; + } +/*------------------------------------------------------------------------*/ + static int SendLoadedData(pAmorStat self, SConnection *pCon) + { + int i, iRet, *iData = NULL; + char pBueffel[80]; + UserData ud; + + SCWrite(pCon,"loaded_CLEAR",eValue); + iRet = LLDnodePtr2First(self->iUserList); + while(iRet != 0) + { + LLDnodeDataTo(self->iUserList,&ud); + iData = (int *)malloc((ud.iNP*2 + 1)*sizeof(int)); + if(!iData) + { + return 0; + } + iData[0] = htonl(ud.iNP); + for(i = 0; i < ud.iNP; i++) + { + iData[i+1] = htonl((int)(ud.fX[i]*65536)); + iData[i+1+ud.iNP] = htonl((int)(ud.fY[i]*65536)); + } + sprintf(pBueffel,"loaded_%s",ud.name); + SCWriteUUencoded(pCon,pBueffel,iData,(ud.iNP*2+1)*sizeof(int)); + iRet = LLDnodePtr2Next(self->iUserList); + } + } +/*------------------------------------------------------------------------*/ + static int LoadCallback(int iEvent, void *pEvent, void *pUser) + { + pAmorStat pAS = NULL; + SConnection *pCon = NULL; + + if(iEvent == FILELOADED) + { + pAS = (pAmorStat)pEvent; + pCon = (SConnection *)pUser; + assert(pAS); + assert(pCon); + SendLoadedData(pAS,pCon); + } + return 1; + } +/*-------------------------------------------------------------------------*/ + static void ClearUserData(pAmorStat self) + { + int iRet; + UserData ud; + + iRet = LLDnodePtr2First(self->iUserList); + while(iRet != NULL) + { + LLDnodeDataTo(self->iUserList,&ud); + if(ud.fX != NULL) + free(ud.fX); + if(ud.fY != NULL) + free(ud.fY); + if(ud.name != NULL) + free(ud.name); + iRet = LLDnodePtr2Next(self->iUserList); + } + LLDdelete(self->iUserList); + self->iUserList = LLDcreate(sizeof(UserData)); + } +/*----------------------------------------------------------------------*/ + void KillAmorStatus(void *pData) + { + pAmorStat self = (pAmorStat)pData; + + if(!self) + return; + + if(self->iUserList >= 0) + { + ClearUserData(self); + LLDdelete(self->iUserList); + } + if(self->pDes) + DeleteDescriptor(self->pDes); + if(self->pCall) + DeleteCallBackInterface(self->pCall); + free(self); + } +/*------------------------------------------------------------------*/ + int AmorStatusFactory(SConnection *pCon, SicsInterp *pSics, + void *pData, int argc, char *argv[]) + { + pAmorStat pNew = NULL; + CommandList *pCom = NULL; + char pBueffel[256]; + int iRet; + + /* check number of arguments */ + if(argc < 4) + { + sprintf(pBueffel,"ERROR: insufficient number of arguments to %s", + argv[0]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + + /* allocate a new data structure */ + pNew = (pAmorStat)malloc(sizeof(AmorStat)); + if(!pNew) + { + sprintf(pBueffel,"ERROR: out of memory in %s",argv[0]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + memset(pNew,0,sizeof(AmorStat)); + pNew->pDes = CreateDescriptor("AmorStatus"); + pNew->iUserList = LLDcreate(sizeof(UserData)); + pNew->pCall = CreateCallBackInterface(); + if( (!pNew->pDes) || (pNew->iUserList < 0) || (!pNew->pCall) ) + { + sprintf(pBueffel,"ERROR: out of memory in %s",argv[0]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + + /* to locate the HM and the scan object */ + pCom = FindCommand(pSics,argv[2]); + if(pCom) + { + if(pCom->pData) + { + if(!iHasType(pCom->pData,"ScanObject")) + { + sprintf(pBueffel,"ERROR: %s is NO scan object",argv[2]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + } + else + { + sprintf(pBueffel,"ERROR: %s is NO scan object",argv[2]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + } + else + { + sprintf(pBueffel,"ERROR: %s NOT found",argv[2]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + pNew->pScan = (pScanData)pCom->pData; + pCom = FindCommand(pSics,argv[3]); + if(pCom) + { + if(pCom->pData) + { + if(!iHasType(pCom->pData,"HistMem")) + { + sprintf(pBueffel,"ERROR: %s is NO histogram memory object", + argv[3]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + } + else + { + sprintf(pBueffel,"ERROR: %s is NO histogram memory object", + argv[3]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + } + else + { + sprintf(pBueffel,"ERROR: %s NOT found",argv[3]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + pNew->pHM = (pHistMem)pCom->pData; + pHMHM = (pHistMem)pCom->pData; + + /* install command */ + iRet = AddCommand(pSics,argv[1], + AmorStatusAction,KillAmorStatus,pNew); + if(!iRet) + { + sprintf(pBueffel,"ERROR: duplicate command %s NOT created", + argv[1]); + SCWrite(pCon,pBueffel,eError); + KillAmorStatus(pNew); + return 0; + } + + + return 1; + } +/*------------------------------------------------------------------*/ + static int RegisterInterest(pAmorStat self, SConnection *pCon) + { + long lID; + pDummy pDum = NULL; + pICallBack pCall = NULL; + + assert(self); + assert(pCon); + + /* Register all the callbacks. Dependent on the state of + iTOF invoke the apropriate callbacks in order to force + an initial update. + */ + /* file load callback */ + lID = RegisterCallback(self->pCall, FILELOADED, LoadCallback, + pCon, NULL); + SCRegister(pCon,pServ->pSics, self->pCall,lID); + SendLoadedData(self,pCon); + + /* scan object */ + pDum = (pDummy)self->pScan; + pCall = pDum->pDescriptor->GetInterface(pDum,CALLBACKINTERFACE); + if(pCall) + { + lID = RegisterCallback(pCall,SCANSTART,ScanStartCallback, + pCon, NULL); + SCRegister(pCon,pServ->pSics,pCall,lID); + lID = RegisterCallback(pCall,SCANPOINT,ScanPointCallback, + pCon, NULL); + SCRegister(pCon,pServ->pSics,pCall,lID); + lID = RegisterCallback(pCall,SCANEND,ScanPointCallback, + pCon, NULL); + SCRegister(pCon,pServ->pSics,pCall,lID); + if(iTOF == 0) + { + ScanStartCallback(SCANSTART,pDum,pCon); + ScanPointCallback(SCANPOINT,pDum,pCon); + } + } + pDum = (pDummy)self->pHM; + pCall = pDum->pDescriptor->GetInterface(pDum,CALLBACKINTERFACE); + if(pCall) + { + lID = RegisterCallback(pCall,COUNTSTART,HMCountStartCallback, + pCon, NULL); + SCRegister(pCon,pServ->pSics,pCall,lID); + if(iTOF == 1) + { + HMCountStartCallback(COUNTSTART,pDum,pCon); + } + } + return 1; + } +/*-----------------------------------------------------------------*/ + static int FileLoad(pAmorStat self, SConnection *pCon, + char *name, double dScale) + { + char pBueffel[256], pDummy[50]; + FILE *fd = NULL; + UserData ud; + int iNP, i; + float fDummy; + + /* open the file */ + fd = fopen(name,"r"); + if(!fd) + { + sprintf(pBueffel,"ERROR: cannot open %s for reading",name); + SCWrite(pCon,pBueffel,eError); + return 0; + } + + /* skip first line */ + if(fgets(pBueffel,255,fd) == NULL) + { + SCWrite(pCon,"ERROR: premature end of file",eError); + fclose(fd); + return 0; + } + + /* read number of points in second line */ + if(fgets(pBueffel,255,fd) == NULL) + { + SCWrite(pCon,"ERROR: premature end of file",eError); + fclose(fd); + return 0; + } + sscanf(pBueffel,"%s %d",pDummy, &iNP); + /* allocate data */ + ud.iNP = iNP; + ud.fX = (float *)malloc(iNP*sizeof(float)); + ud.fY = (float *)malloc(iNP*sizeof(float)); + ud.name = strdup(name); + + /* skip two lines */ + if(fgets(pBueffel,255,fd) == NULL) + { + SCWrite(pCon,"ERROR: premature end of file",eError); + fclose(fd); + return 0; + } + if(fgets(pBueffel,255,fd) == NULL) + { + SCWrite(pCon,"ERROR: premature end of file",eError); + fclose(fd); + return 0; + } + + /* loop reading data */ + for(i = 0; i < iNP; i++) + { + if(fgets(pBueffel,255,fd) == NULL) + { + SCWrite(pCon,"WARNING: premature end of file",eError); + break; + } + sscanf(pBueffel," %f %f %f",&ud.fX[i],&fDummy, &ud.fY[i]); + ud.fY[i] *= dScale; + } + fclose(fd); + + /* enter ud into list */ + LLDnodeInsertFrom(self->iUserList,&ud); + + return 1; + } +/*----------------------------------------------------------------- + Collapse creates a 2D image from the detector by summing all time + channels together in any given detector. +*/ + + static int Collapse(pAmorStat self, SConnection *pCon) + { + HistInt *lData = NULL; + int i, i2, i3, iDim[MAXDIM], iIdx, iSum; + int *iImage = NULL, *iPtr; + + /* get size of our problem */ + GetHistDim(self->pHM,iDim,&i3); + assert(i3 == 3); + + /* get data */ + lData = GetHistogramPointer(self->pHM,pCon); + if(!lData) + { + return 0; + } + + /* allocate some data */ + iImage = (int *)malloc((2 + iDim[0]*iDim[1])*sizeof(int)); + if(iImage == NULL) + { + SCWrite(pCon,"ERROR: failed to allocate memory in Collapse",eError); + return 0; + } + memset(iImage,0,(2 + iDim[0]*iDim[1])*sizeof(int)); + + /* first two numbers are the dimension of the image */ + iImage[0] = htonl(iDim[0]); + iImage[1] = htonl(iDim[1]); + + /* loop the loop */ + for(i = 0; i < iDim[0]; i++) + { + for(i2 = 0; i2 < iDim[1]; i2++) + { + iPtr = lData + i*iDim[1]*iDim[2] + + i2*iDim[2]; + iIdx = i*iDim[1] + i2; + for(i3 = 0, iSum = 0; i3 < iDim[2]; i3++) + { + iSum += iPtr[i3]; + } + iImage[iIdx+2] = htonl(iSum); + } + } + + /* send image */ + SCWriteUUencoded(pCon,"arrow_image",iImage, + (iDim[0]*iDim[1]+2)*sizeof(int)); + free(iImage); + return 1; + } +/*------------------------------------------------------------------- + SubSample sums histogram data in the area defined by the rectangle + x1,y1 x2, y2. Summing is along the time axis. +*/ + static int SubSample(pAmorStat self, SConnection *pCon, + char *name, int x1, int x2, int y1, int y2) + { + int iDim[MAXDIM], i, i2, i3, *iSum = NULL, iLang, *iPtr; + HistInt *lData = NULL; + int iLimit; + char pBueffel[132]; + + /* get histogram data */ + GetHistDim(self->pHM,iDim,&i3); + assert(i3 == 3); + lData = GetHistogramPointer(self->pHM,pCon); + if(!lData) + { + return 0; + } + + /* check limits */ + if(x2 < x1) + x2 = x1 + 1; + if(y2 < y1) + y2 = y1 + 1; + + iLimit = 0; + if( x1 > iDim[0]) + { + iLimit = 1; + x1 = iDim[0] - 1; + } + if(x1 < 0) + { + iLimit = 1; + x1 = 0; + } + if( x2 > iDim[0]) + { + iLimit = 2; + x2 = iDim[0] - 1; + } + if(x2 < 0) + { + iLimit = 2; + x2 = 0; + } + if( y1 > iDim[1]) + { + iLimit = 3; + y1 = iDim[1] - 1; + } + if(y1 < 0) + { + iLimit = 3; + y1 = 0; + } + if( y2 > iDim[1]) + { + iLimit = 4; + y2 = iDim[1] - 1; + } + if(y2 < 0) + { + iLimit = 4; + y2 = 0; + } + if(iLimit != 0) + { + switch(iLimit) + { + case 1: + strcpy(pBueffel,"WARNING: limit violation on x1"); + break; + case 2: + strcpy(pBueffel,"WARNING: limit violation on x2"); + break; + case 3: + strcpy(pBueffel,"WARNING: limit violation on y1"); + break; + case 4: + strcpy(pBueffel,"WARNING: limit violation on y2"); + break; + } + SCWrite(pCon,pBueffel,eWarning); + } + + /* allocate space for result */ + iSum = (int *)malloc((iDim[2]+1)*sizeof(int)); + if(!iSum) + { + SCWrite(pCon,"ERROR: out of memory in SubSample",eError); + return 0; + } + memset(iSum,0,(iDim[2]+1)*sizeof(int)); + + /* do it! */ + iSum[0] = iDim[2]; + for(i = x1; i < x2; i++) + { + for(i2 = x1; i2 < y2; i2++) + { + iPtr = lData + i*iDim[1]*iDim[2] + + i2*iDim[2]; + for(i3 = 0; i3 < iDim[2]; i3++) + { + iSum[i3+1] += iPtr[i3]; + } + } + } + + /* network byte order */ + for(i = 0; i < iDim[2]+1; i++) + { + iSum[i] = htonl(iSum[i]); + } + + /* send */ + sprintf(pBueffel,"arrowsum_%s",name); + SCWriteUUencoded(pCon,pBueffel,iSum,(iDim[2]+1)*sizeof(int)); + + free(iSum); + return 1; + } +/*------------------------------------------------------------------*/ + int AmorStatusAction(SConnection *pCon, SicsInterp *pSics, + void *pData, int argc, char *argv[]) + { + pAmorStat self = (pAmorStat)pData; + char pBueffel[512]; + double dScale; + int iRet; + int x1, x2, y1, y2; + + assert(self); + + if(argc < 2) + { + sprintf(pBueffel,"ERROR: need argument to %s",argv[0]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + + strtolower(argv[1]); + if(strcmp(argv[1],"interest") == 0) + { + RegisterInterest(self,pCon); + SCSendOK(pCon); + return 1; + } + else if(strcmp(argv[1],"load") == 0) + { + if(argc < 4) + { + sprintf(pBueffel, + "ERROR: need filename and scale argument to %s load", + argv[0]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + iRet = Tcl_GetDouble(pSics->pTcl,argv[3],&dScale); + if(iRet != TCL_OK) + { + sprintf(pBueffel,"ERROR: cannot convert %s to scale factor", + argv[3]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + FileLoad(self,pCon,argv[2],dScale); + InvokeCallBack(self->pCall, FILELOADED,self); + SCSendOK(pCon); + } + else if(strcmp(argv[1],"collapse") == 0) + { + iRet = Collapse(self,pCon); + if(iRet) + { + SCSendOK(pCon); + } + return iRet; + } + else if(strcmp(argv[1],"sample") == 0) + { + if(argc < 7) + { + SCWrite(pCon,"ERROR: insufficent number of arguments to sample", + eError); + return 0; + } + iRet = Tcl_GetInt(pSics->pTcl,argv[3],&x1); + if(iRet != TCL_OK) + { + sprintf(pBueffel,"ERROR: cannot convert %s to int", argv[3]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + iRet = Tcl_GetInt(pSics->pTcl,argv[6],&y2); + if(iRet != TCL_OK) + { + sprintf(pBueffel,"ERROR: cannot convert %s to int", argv[6]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + iRet = Tcl_GetInt(pSics->pTcl,argv[4],&x2); + if(iRet != TCL_OK) + { + sprintf(pBueffel,"ERROR: cannot convert %s to int", argv[4]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + iRet = Tcl_GetInt(pSics->pTcl,argv[5],&y1); + if(iRet != TCL_OK) + { + sprintf(pBueffel,"ERROR: cannot convert %s to int", argv[5]); + SCWrite(pCon,pBueffel,eError); + return 0; + } + iRet = SubSample(self,pCon,argv[2],x1,x2,y1,y2); + if(iRet) + SCSendOK(pCon); + return iRet; + } + else if(strcmp(argv[1],"sendloaded") == 0) + { + SendLoadedData(self,pCon); + return 1; + } + else if(strcmp(argv[1],"clear") == 0) + { + ClearUserData(self); + InvokeCallBack(self->pCall, FILELOADED,self); + SCSendOK(pCon); + } + return 1; + } + + diff --git a/amorstat.h b/amorstat.h new file mode 100644 index 00000000..6665cec2 --- /dev/null +++ b/amorstat.h @@ -0,0 +1,21 @@ + +/*------------------------------------------------------------------------ + A M O R S T A T U S + + Public definitions for the AMOR status display + facilitator object. DO NOT CHANGE. This file is automatically + created from amorstat.w. + + Mark Koennecke, September 1999 +---------------------------------------------------------------------*/ +#ifndef AMORSTATUS +#define AMORSTATUS + + int AmorStatusFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + int AmorStatusAction(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + void KillAmorStatus(void *pData); + +#endif + diff --git a/amorstat.i b/amorstat.i new file mode 100644 index 00000000..5a24a644 --- /dev/null +++ b/amorstat.i @@ -0,0 +1,29 @@ + +/*------------------------------------------------------------------------ + A M O R S T A T U S + + Internal data structure definitions for the AMOR status display + facilitator object. DO NOT CHANGE. This file is automatically + created from amorstat.w. + + Mark Koennecke, September 1999 +---------------------------------------------------------------------*/ + +/*---------------------------------------------------------------------*/ + typedef struct { + float *fX, *fY; + int iNP; + char *name; + }UserData, *pUserData; +/*---------------------------------------------------------------------*/ + typedef struct __AMORSTAT { + pObjectDescriptor pDes; + pICallBack pCall; + int iUserList; + pScanData pScan; + pHistMem pHM; + int iTOF; + }AmorStat, *pAmorStat; + + + diff --git a/amorstat.tex b/amorstat.tex new file mode 100644 index 00000000..8d295337 --- /dev/null +++ b/amorstat.tex @@ -0,0 +1,138 @@ +\subsection{Amor Status Display Support} +The reflectometer AMOR has a few unique status display requirements: +\begin{itemize} +\item In scan mode up to four detector counts curves must be shown for +the two counters in spin-up or spin-down mode. This needs to be +updated after each scan point. +\item Additionally user defined curves may need to be displayed. +\item The usual helper information muste be displayed. +\item In TOF mode it must be possible to define a region on the +detector whose summed counts are displayed versus the time +binning. This must be sent on request. +\end{itemize} +In order to cover all this a special object within SICS is required +which deals with all this and packages information in a status display +compliant way. + +In order to do this the amorstatus object registers callbacks both +with the histogram memory and the scan object. These callback +functions are then responsible for updating the status displays. In +order for amorstatus to be able to do this, the client must register +itself with a special command. + +In order to achieve all this some data structures are needed: +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap1} +$\langle$asdata {\footnotesize ?}$\rangle\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@/*---------------------------------------------------------------------*/@\\ +\mbox{}\verb@ typedef struct {@\\ +\mbox{}\verb@ float *fX, *fY;@\\ +\mbox{}\verb@ int iNP;@\\ +\mbox{}\verb@ char *name;@\\ +\mbox{}\verb@ }UserData, *pUserData; @\\ +\mbox{}\verb@/*---------------------------------------------------------------------*/@\\ +\mbox{}\verb@ typedef struct __AMORSTAT {@\\ +\mbox{}\verb@ pObjectDescriptor pDes;@\\ +\mbox{}\verb@ pICallBack pCall;@\\ +\mbox{}\verb@ int iUserList;@\\ +\mbox{}\verb@ pScanData pScan;@\\ +\mbox{}\verb@ pHistMem pHM;@\\ +\mbox{}\verb@ int iTOF;@\\ +\mbox{}\verb@ }AmorStat, *pAmorStat;@\\ +\mbox{}\verb@ @\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-1ex} +\footnotesize\addtolength{\baselineskip}{-1ex} +\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}} +\item Macro referenced in scrap ?. +\end{list} +\end{minipage}\\[4ex] +\end{flushleft} +The fourth data structure is the amor status object data structure. It +has the following fields: +\begin{description} +\item[pDes] The standard SICS object descriptor. +\item[pCall] The callback interface. +\item[iUserList] A list of user data loaded data. +\item[pScan] A pointer to the scan object. +\item[pHM] A pointer to the histogram memory. +\item[iTOF] A flag which is true if we are taking measurements in TOF +mode. +\end{description} + +In terms of a function interface this object has not much to +offer. Its main purpose is really as an interface to the status +display clients and thus it is configured through the interpreter +interface function. No need for other SICS objects to access it. + +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap2} +$\langle$asinter {\footnotesize ?}$\rangle\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@ int AmorStatusFactory(SConnection *pCon, SicsInterp *pSics, void *pData,@\\ +\mbox{}\verb@ int argc, char *argv[]);@\\ +\mbox{}\verb@ int AmorStatusAction(SConnection *pCon, SicsInterp *pSics, void *pData,@\\ +\mbox{}\verb@ int argc, char *argv[]);@\\ +\mbox{}\verb@ void KillAmorStatus(void *pData);@\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-1ex} +\footnotesize\addtolength{\baselineskip}{-1ex} +\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}} +\item Macro referenced in scrap ?. +\end{list} +\end{minipage}\\[4ex] +\end{flushleft} +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap3} +\verb@"amorstat.i"@ {\footnotesize ? }$\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@/*------------------------------------------------------------------------@\\ +\mbox{}\verb@ A M O R S T A T U S@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ Internal data structure definitions for the AMOR status display @\\ +\mbox{}\verb@ facilitator object. DO NOT CHANGE. This file is automatically@\\ +\mbox{}\verb@ created from amorstat.w.@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ Mark Koennecke, September 1999@\\ +\mbox{}\verb@---------------------------------------------------------------------*/@\\ +\mbox{}\verb@@$\langle$asdata {\footnotesize ?}$\rangle$\verb@@\\ +\mbox{}\verb@ @\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-2ex} +\end{minipage}\\[4ex] +\end{flushleft} +\begin{flushleft} \small +\begin{minipage}{\linewidth} \label{scrap4} +\verb@"amorstat.h"@ {\footnotesize ? }$\equiv$ +\vspace{-1ex} +\begin{list}{}{} \item +\mbox{}\verb@@\\ +\mbox{}\verb@/*------------------------------------------------------------------------@\\ +\mbox{}\verb@ A M O R S T A T U S@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ Public definitions for the AMOR status display @\\ +\mbox{}\verb@ facilitator object. DO NOT CHANGE. This file is automatically@\\ +\mbox{}\verb@ created from amorstat.w.@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@ Mark Koennecke, September 1999@\\ +\mbox{}\verb@---------------------------------------------------------------------*/@\\ +\mbox{}\verb@#ifndef AMORSTATUS@\\ +\mbox{}\verb@#define AMORSTATUS@\\ +\mbox{}\verb@@$\langle$asinter {\footnotesize ?}$\rangle$\verb@@\\ +\mbox{}\verb@#endif@\\ +\mbox{}\verb@@\\ +\mbox{}\verb@@$\diamond$ +\end{list} +\vspace{-2ex} +\end{minipage}\\[4ex] +\end{flushleft} diff --git a/amorstat.w b/amorstat.w new file mode 100644 index 00000000..a8653d7b --- /dev/null +++ b/amorstat.w @@ -0,0 +1,102 @@ +\subsection{Amor Status Display Support} +The reflectometer AMOR has a few unique status display requirements: +\begin{itemize} +\item In scan mode up to four detector counts curves must be shown for +the two counters in spin-up or spin-down mode. This needs to be +updated after each scan point. +\item Additionally user defined curves may need to be displayed. +\item The usual helper information muste be displayed. +\item In TOF mode it must be possible to define a region on the +detector whose summed counts are displayed versus the time +binning. This must be sent on request. +\end{itemize} +In order to cover all this a special object within SICS is required +which deals with all this and packages information in a status display +compliant way. + +In order to do this the amorstatus object registers callbacks both +with the histogram memory and the scan object. These callback +functions are then responsible for updating the status displays. In +order for amorstatus to be able to do this, the client must register +itself with a special command. + +In order to achieve all this some data structures are needed: +@d asdata @{ +/*---------------------------------------------------------------------*/ + typedef struct { + float *fX, *fY; + int iNP; + char *name; + }UserData, *pUserData; +/*---------------------------------------------------------------------*/ + typedef struct __AMORSTAT { + pObjectDescriptor pDes; + pICallBack pCall; + int iUserList; + pScanData pScan; + pHistMem pHM; + int iTOF; + }AmorStat, *pAmorStat; + +@} + + +The fourth data structure is the amor status object data structure. It +has the following fields: +\begin{description} +\item[pDes] The standard SICS object descriptor. +\item[pCall] The callback interface. +\item[iUserList] A list of user data loaded data. +\item[pScan] A pointer to the scan object. +\item[pHM] A pointer to the histogram memory. +\item[iTOF] A flag which is true if we are taking measurements in TOF +mode. +\end{description} + +In terms of a function interface this object has not much to +offer. Its main purpose is really as an interface to the status +display clients and thus it is configured through the interpreter +interface function. No need for other SICS objects to access it. + +@d asinter @{ + int AmorStatusFactory(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + int AmorStatusAction(SConnection *pCon, SicsInterp *pSics, void *pData, + int argc, char *argv[]); + void KillAmorStatus(void *pData); +@} + + +@o amorstat.i @{ +/*------------------------------------------------------------------------ + A M O R S T A T U S + + Internal data structure definitions for the AMOR status display + facilitator object. DO NOT CHANGE. This file is automatically + created from amorstat.w. + + Mark Koennecke, September 1999 +---------------------------------------------------------------------*/ +@ + +@} + +@o amorstat.h @{ +/*------------------------------------------------------------------------ + A M O R S T A T U S + + Public definitions for the AMOR status display + facilitator object. DO NOT CHANGE. This file is automatically + created from amorstat.w. + + Mark Koennecke, September 1999 +---------------------------------------------------------------------*/ +#ifndef AMORSTATUS +#define AMORSTATUS +@ +#endif + +@} + + + diff --git a/amortest.tcl b/amortest.tcl new file mode 100644 index 00000000..b4db41b9 --- /dev/null +++ b/amortest.tcl @@ -0,0 +1,268 @@ +# -------------------------------------------------------------------------- +# Initialization script for a simulated AMOR instrument +# +# +# Dr. Mark Koennecke September,1999 - ??, ???? +#--------------------------------------------------------------------------- + +#------------ our home +set home /data/koenneck/src/sics + +#----------- first all the server options are set + +ServerOption ReadTimeOut 100 +# timeout when checking for commands. In the main loop SICS checks for +# pending commands on each connection with the above timeout, has +# PERFORMANCE impact! + +ServerOption AcceptTimeOut 100 +# timeout when checking for connection req. +# Similar to above, but for connections + +ServerOption ReadUserPasswdTimeout 7000 +# time to wiat for a user/passwd to be sent from a client. Increase this +# if there is a problem connecting to a server due to network overload\ + +ServerOption LogFileDir $home/tmp +#LogFileDir is the directory where the command log is going + +ServerOption LogFileBaseName $home/tmp/server +# the path and base name of the internal server logfile to which all +# activity will be logged. + +ServerOption statusfile $home/tmp/sicsstatus.tcl + +ServerOption ServerPort 2911 +# the port number the server is going to listen at. The client MUST know +# this number in order to connect. It is in client.ini + +ServerOption InterruptPort 2914 +# The UDP port where the server will wait for Interrupts from clients. +# Obviously, clients wishing to interrupt need to know this number. + +# Telnet options +ServerOption TelnetPort 1301 +ServerOption TelWord sicslogin + +ServerOption DefaultTclDirectory $home/tcl +ServerOption DefaultCommandFile topsicom.tcl + +#------ a port for broadcasting UDP messages +ServerOption QuieckPort 2108 + +#--------------------------------------------------------------------------- +# U S E R S + +# than the SICS users are specified +# Syntax: SicsUser name password userRightsCode +SicsUser Mugger Diethelm 1 +SicsUser User Rosy 2 +SicsUser Spy 007 1 + +#-------------------------------------------------------------------------- +# G E N E R A L V A R I A B L E S +# now a few general variables are created +# Syntax: VarMake name type access +# type can be one of: Text, Int, Float +#access can be one of: Internal, Mugger, user, Spy + +VarMake Instrument Text Internal +Instrument AMOR +Instrument lock + + + +VarMake Title Text User +VarMake sample Text User +sample "DanielSulfid" +Title "Amore mio in SINQ" +VarMake User Text User +User The reflective looser + +VarMake lastscancommand Text User + +VarMake Adress Text User +VarMake phone Text User +VarMake fax Text User +VarMake email Text User +VarMake sample_mur Float User + +#-------------------------------------------------------------------------- +# B u i l d i n g B l o c k s +#-------------------------------------------------------------------------- +# +#=================== Chopper +VarMake chopperrotation Float User +chopperrotation 10000. + +ClientPut "Starting motor initialization ....." +#=================== frame overlap mirror +VarMake fomname Text Mugger +fomname Super Duper Mirror +fomname lock +VarMake fomdist Float Mugger +fomdist 120 +Motor FTZ SIM 0. 120. .1 2. # fom height +Motor FOM SIM -30. 30. .1 2. # fom omega + +#================== first diaphragm +VarMake d1dist Float Mugger +d1dist 200. +Motor D1L SIM 0. 120. .1 2. # left +Motor D1R SIM 0. 120. .1 2. # right +Motor D1T SIM 0. 120. .1 2. # top +Motor D1B SIM 0. 1000. .1 2. # bottom + +#================== polarizer +VarMake polname Text Mugger +polname Daniels Special Edition Polarizer +polname lock +VarMake poldist Float Mugger +fomdist 200 +Motor MOZ SIM 0. 1000. .1 2. # pol table height +Motor MTY SIM -60. 60. .1 2. # pol y movement +Motor MOM SIM -30. 30. .1 2. # pol omega +Motor MTZ SIM -30. 30. .1 2. # pol omega height + +#=================== diaphragm 2 +VarMake d2dist Float Mugger +d2dist 200. +Motor D2L SIM 0. 120. .1 2. # left +Motor D2R SIM 0. 120. .1 2. # right +Motor D2T SIM 0. 120. .1 2. # top +Motor D2B SIM 0. 1000. .1 2. # bottom + +#==================== diaphragm 3 +VarMake d3dist Float Mugger +d3dist 200. +Motor D3L SIM 0. 120. .1 2. # left +Motor D3R SIM 0. 120. .1 2. # right +Motor D3T SIM 0. 120. .1 2. # top +Motor D3B SIM 0. 1000. .1 2. # bottom + +#===================== sample table +VarMake sampledist Float Mugger +sampledist 200 +Motor STZ SIM -50. 50. .1 2. # sample height +Motor SOM SIM -30. 30. .1 2. # sample omega +Motor SCH SIM -30. 30. .1 2. # sample chi +Motor SOZ SIM 0. 1000. .1 2. # table height + +#====================== diaphragm 4 +VarMake d4dist Float Mugger +d4dist 200. +Motor D4L SIM 0. 120. .1 2. # left +Motor D4R SIM 0. 120. .1 2. # right +Motor D4T SIM 0. 120. .1 2. # top +Motor D4B SIM 0. 1000. .1 2. # bottom + +#======================= analyzer +VarMake ananame Text Mugger +ananame Daniels Special Edition Analyzer +ananame lock +VarMake anadist Float Mugger +anadist 200 +Motor AOZ SIM 0. 1000. .1 2. # analyzer table height +Motor AOM SIM -30. 30. .1 2. # analyzer omega +Motor ATZ SIM -30. 30. .1 2. # analyzer omega height + +#======================== diaphragm 5 +VarMake d5dist Float Mugger +d5dist 200. +Motor D5L SIM 0. 120. .1 2. # left +Motor D5R SIM 0. 120. .1 2. # right +Motor D5T SIM 0. 120. .1 2. # top +Motor D5B SIM 0. 1000. .1 2. # bottom + +#======================== counter +VarMake detectordist Float Mugger +detectordist 200. +MakeCounter counter SIM +Motor COZ SIM 0. 1000. .1 2. # counter table height +Motor C3Z SIM 0. 300. .1 2. # counter height +Motor COM SIM -30. 30. .1 2. # counter omega +Motor COX SIM -100. 100. .1 2. # counter x +ClientPut "Motors initialized" + +#======================== histogram memory +MakeHM hm SIM +hm configure HistMode TOF +hm configure OverFlowMode Ceil +hm configure Rank 1 +hm configure dim0 128 +hm configure dim1 128 +hm configure Length 16384 +hm configure BinWidth 4 +hm preset 100. +hm CountMode Timer +hm configure Counter counter +hm configure init 0 +hm genbin 0. 35. 100 +hm init + +ClientPut "Histogram Memory Initialized" +#-------------------------------------------------------------------------- +# D a t a S t o r a g e +#------------------------------------------------------------------------ +VarMake SicsDataPath Text Mugger +SicsDataPath $home/ +SicsDataPath lock +VarMake SicsDataPrefix Text Mugger +SicsDataPrefix amortest +SicsDataPrefix lock +VarMake SicsDataPostFix Text Mugger +SicsDataPostFix ".hdf" +SicsDataPostFix lock + +MakeDataNumber SicsDataNumber $home/danu.dat + +MakeStoreAmor hm + +#-------------------------------------------------------------------------- +# C o m m a n d I n i t i a l i z a t i o n +#------------------------------------------------------------------------- +#======= logbook +source tcl/log.tcl +Publish LogBook Spy +#======== Drive +MakeDrive +#======== scan +source $home/tcl/topsicom.tcl +source $home/tcl/cscan.tcl +Publish cscan User +Publish sscan User +Publish sftime Spy +Publish scan Spy +Publish ScanCounts Spy +Publish TextStatus Spy +Publish otUnknown Spy +MakeScanCommand xxxscan counter topsi.hdd recover.bin +xxxscan configure amor +#========== peak & center +MakePeakCenter xxxscan +source /data/koenneck/src/sics/countf.tcl +#========== serial port general purpose +SerialInit +Publish serialport User +Publish p1 User +#=========== the optimiser +MakeOptimise opti counter + +#=========== Amor2T +set a2t(mom) mom +set a2t(som) som +set a2t(coz) coz +set a2t(cox) cox +set a2t(stz) stz +set a2t(soz) soz +set a2t(d4b) d4b +set a2t(d5b) d5b +set a2t(com) com +MakeAmor2T a2t a2t + +#=========== Status Display Support +MakeAmorStatus amorstatus xxxscan hm +source amorpar.tcl +Publish amorpar Spy +ClientPut "Done Initializing" + diff --git a/ati.tcl b/ati.tcl new file mode 100644 index 00000000..e274d886 --- /dev/null +++ b/ati.tcl @@ -0,0 +1,7 @@ +drive mom 3. +scan var a2t 0. .2 +scan var som 0. .1 +scan preset 1 +scan mode timer +scan np 20 +scan run diff --git a/author.txt b/author.txt new file mode 100644 index 00000000..d579a3c4 --- /dev/null +++ b/author.txt @@ -0,0 +1,46 @@ + Copyright: + + Labor fuer Neutronenstreuung + Paul Scherrer Institut + CH-5423 Villigen-PSI + + + The authors hereby grant permission to use, copy, modify, distribute, + and license this software and its documentation for any purpose, provided + that existing copyright notices are retained in all copies and that this + notice is included verbatim in any distributions. No written agreement, + license, or royalty fee is required for any of the authorized uses. + Modifications to this software may be copyrighted by their authors + and need not follow the licensing terms described here, provided that + the new terms are clearly indicated on the first page of each file where + they apply. + + IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY + FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY + DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE + IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE + NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + MODIFICATIONS. +----------------------------------------------------------------------------*/ +#include +#include +#include +#include +#include +#include "fortify.h" +#include "lld.h" +#include "lld_blob.h" +#include "lld_str.h" +#include "conman.h" +#include "obdes.h" +#include "fupa.h" +#include "motor.h" +#include "datadmc.h" +#include "countdriv.h" +#include "counter.h" diff --git a/autofile.tcl b/autofile.tcl new file mode 100644 index 00000000..608adaa6 --- /dev/null +++ b/autofile.tcl @@ -0,0 +1,211 @@ +#---------------------------------------------------------------------------- +# This is part of the WWW-interface to SICS. This interface allows to +# create batch files to be run automatically by SICS. These files are +# stored in a special directory as files with the ending .sip by the +# CGI-scripts or servlets creating them. Now, a system is needed which +# checks this directory regularly for new files and executes them in SICS. +# This is the purpose of the SICS-Tcl macros defined in this file. +# +# First edition: Mark Koennecke, December 1999 +#---------------------------------------------------------------------------- + +#----------- !!!! the path where the automatic files reside +set autofpath "/data/koenneck/tmp/auto" + +#------- a variable which defines if we should operate and the current file. +set __autofile_run 0 +set __auto_exe_file "" + +#!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# There is a name command between the Tcl internal scan command and the +# SICS scan command. The Tcl internal has to be renamed. The following +# variable defines the name of the Tcl scan command +set tclscan stscan + +#---------- do initializing things when called first time +set ret [catch [catch {autofile} msg] +if {$ret != 0} { + VarMake autofilepath Text Mugger + autofilepath $autofpath + autofilepath lock + Publish autofileexecute User + Publish autofile Mugger + Publish autostart User + Publish autoadd User + Publish autoend User +#------- for automatic file name creation + catch {MakeDataNumber autonumber $autofpath/autonumber.dat} +#------- check any 30 seconds + sicscron 30 autofileexecute +} + +#-------------------------------------------------------------------------- +proc autofile { {action null} } { + upvar #0 __autofile_run ar + + if { [string compare $action start] == 0} { + set ar 1 + return OK + } elseif { [string compare $action stop] == 0 } { + set ar 0 + return OK + } else { + if {$ar == 1} { + return on + } else { + return off + } + } +} + +#-------------------------------------------------------------------------- +proc autofileexecute { } { + upvar #0 __autofile_run ar + upvar #0 __auto_exe_file aef + upvar #0 tclscan filescan +#--------- no operation if not activated + if {$ar != 1} { + return + } +#--------- aquire a list of candidate batch files + set tmp [autofilepath] + set ltmp [split $tmp =] + set tmp [lindex $ltmp 1] + set tmp2 [string trim $tmp]/*.inp + set ret [catch {set filelist [glob $tmp2]} msg] + if {$ret != 0} { + return "Nothing to do" + } + if { [llength $filelist] < 1 } { + return "Nothing to do" + } +#--------- now, in each file the second line contains the order number, +# find the lowest one which is the next one to execute + set minnum 999999 + set file2exe null + foreach fil $filelist { + set f [open $fil r] + gets $f + set numline [gets $f] + set ret [catch {$filescan $numline "# %d" numi} msg] + close $f + if { $ret == 0 } { + if { $numi < $minnum } { + set minnum $numi + set file2exe $fil + } + } else { + ClientPut $msg + } + } +#------------ having found an input file, execute it + if { [string compare $file2exe null] != 0 } { + set aef $file2exe + set ret [catch {interneval $file2exe} msg] +#------ after execution rename it with a different extension + set fil2 [file rootname $file2exe].old + file rename -force $file2exe $fil2 + if {$ret != 0 } { + error $msg + } else { + return $msg + } + } + return "Invalid autobatch files" +} + +#========================================================================= +# File management functions +# +# autostart creates a fresh file. The data is stored in a SICS runbuffer. +# autoadd adds a line to the runbuffer +# autoend writes the file to disk then. +#========================================================================= + +proc autostart {} { + catch {buf del autobuffer} + Buf new autobuffer +} + +proc autoadd args { + autobuffer append $args +} + +proc autoend {} { + upvar #0 autofpath ap + autonumber incr + set txt [autonumber] + set l [split $txt =] + set txt [string trim [lindex $l 1]] + set fil [format "$ap/auto%7.7d.inp" $txt] + set filnum [format "# %d" $txt] + autobuffer ins 1 $filnum + autobuffer save $fil + Buf del autobuffer +} + +#============================================================================ +# file list management +#============================================================================ + +proc buildsortedlist {filar} { + upvar #0 autofpath ap + upvar $filar list + set i 0 +#----------- build arrays of all relevant files + set ret [catch {set l1 [glob $ap/*.inp]}] + if { $ret == 0 } { + foreach fil $l1 { + set list($i) + incr i + set f [open $fil r] + set $fil(title) [gets $f] + set txt [gets $f] + close $f + set ret [catch {$filescan $txt "# %d" numi} msg] + if { $ret == 0} { + set fil(no) $numi + }else { + set fil(no) -10 + } + } + } + set ret [catch {set l1 [glob $ap/*.old]}] + if { $ret == 0 } { + foreach fil $l1 { + set list($i) + incr i + set f [open $fil r] + set $fil(title) [gets $f] + set txt [gets $f] + close $f + set ret [catch {$filescan $txt "# %d" numi} msg] + if { $ret == 0} { + set fil(no) $numi + }else { + set fil(no) -10 + } + } + } + set nfil i +#--------- now selection sort this list + for {set i 0} { i < $nfil} {incr i} { + set min $i + set ff $list($min) + for {set j [expr $i + 1]} {$j < $nfil} {incr j} { + set ff $list($j) + set fff $list($min) + if { $ff(no) < $fff(no)} { + set min $j + } + } + set t $list($min) + set list($min) $list($min) + set list($i) $t + } +} + +proc autolist {} { + +} + diff --git a/backup.tcl b/backup.tcl new file mode 100644 index 00000000..b5dc3e50 --- /dev/null +++ b/backup.tcl @@ -0,0 +1,137 @@ +# RuenBuffer Renate +Buf new Renate +Renate append Alle Fische sind schon da + +Renate append Alle Nixen auch + +Renate append Nur die dummen Neutronen kommen nicht + +Renate append Und die Schluempfe kriegen es auch nicht gebacken + +# RuenBuffer Kunigunde +Buf new Kunigunde +Kunigunde append Alle Fische sind schon da + +Kunigunde append Alle Nixen auch + +Kunigunde append Nur die dummen Neutronen kommen nicht + +Kunigunde append Und die Schluempfe kriegen es auch nicht gebacken + +# RuenBuffer Walter +Buf new Walter +Walter append Alle Fische sind schon da + +Walter append Alle Nixen auch + +Walter append Nur die dummen Neutronen kommen nicht + +Walter append Und die Schluempfe kriegen es auch nicht gebacken + +# RuenBuffer Willi +Buf new Willi +Willi append Alle Nixen auch +Willi append Und die Schluempfe kriegen es auch nicht gebacken +# RuenBuffer Heinz +Buf new Heinz +Heinz append GGG Fische sind schon da +Heinz append GGG Nixen auch +Heinz append Nur die dummen Neutronen kommen schon +Heinz append Und die Schluempfe kriegen es auch schon gebacken + +Curve SoftLowerLim 0.000000 +Curve SoftUpperLim 1000.000000 +Curve SoftZero 0.000000 +Curve Fixed -1.000000 +Curve InterruptMode 0.000000 +Curve AccessCode 2.000000 +TwoTheta SoftLowerLim -140.000000 +TwoTheta SoftUpperLim 140.000000 +TwoTheta SoftZero 0.000000 +TwoTheta Fixed -1.000000 +TwoTheta InterruptMode 0.000000 +TwoTheta AccessCode 2.000000 +Theta SoftLowerLim -70.000000 +Theta SoftUpperLim 70.000000 +Theta SoftZero 0.000000 +Theta Fixed -1.000000 +Theta InterruptMode 0.000000 +Theta AccessCode 2.000000 +bsy SoftLowerLim -50.000000 +bsy SoftUpperLim 50.000000 +bsy SoftZero 0.000000 +bsy Fixed -1.000000 +bsy InterruptMode 0.000000 +bsy AccessCode 2.000000 +bsx SoftLowerLim -50.000000 +bsx SoftUpperLim 50.000000 +bsx SoftZero 0.000000 +bsx Fixed -1.000000 +bsx InterruptMode 0.000000 +bsx AccessCode 2.000000 +dphi SoftLowerLim 0.000000 +dphi SoftUpperLim 360.000000 +dphi SoftZero 0.000000 +dphi Fixed -1.000000 +dphi InterruptMode 0.000000 +dphi AccessCode 2.000000 +dsy SoftLowerLim -50.000000 +dsy SoftUpperLim 50.000000 +dsy SoftZero 0.000000 +dsy Fixed -1.000000 +dsy InterruptMode 0.000000 +dsy AccessCode 2.000000 +dsd SoftLowerLim 0.000000 +dsd SoftUpperLim 18000.000000 +dsd SoftZero 0.000000 +dsd Fixed -1.000000 +dsd InterruptMode 0.000000 +dsd AccessCode 2.000000 +saz SoftLowerLim 0.000000 +saz SoftUpperLim 30.000000 +saz SoftZero 0.000000 +saz Fixed -1.000000 +saz InterruptMode 0.000000 +saz AccessCode 2.000000 +say SoftLowerLim -22.000000 +say SoftUpperLim 22.000000 +say SoftZero 0.000000 +say Fixed -1.000000 +say InterruptMode 0.000000 +say AccessCode 2.000000 +sax SoftLowerLim -30.000000 +sax SoftUpperLim 30.000000 +sax SoftZero 0.000000 +sax Fixed -1.000000 +sax InterruptMode 0.000000 +sax AccessCode 2.000000 +som SoftLowerLim -180.000000 +som SoftUpperLim 360.000000 +som SoftZero 0.000000 +som Fixed -1.000000 +som InterruptMode 0.000000 +som AccessCode 2.000000 +sphi SoftLowerLim -22.000000 +sphi SoftUpperLim 22.000000 +sphi SoftZero 0.000000 +sphi Fixed -1.000000 +sphi InterruptMode 0.000000 +sphi AccessCode 2.000000 +schi SoftLowerLim -22.000000 +schi SoftUpperLim 22.000000 +schi SoftZero 0.000000 +schi Fixed -1.000000 +schi InterruptMode 0.000000 +schi AccessCode 2.000000 +comment (null) +comment setAccess 2 +environment (null) +environment setAccess 2 +SubTitle (null) +SubTitle setAccess 2 +User set +User setAccess 2 +Title Alle meine Entchen sind schon da +Title setAccess 2 +Instrument set +Instrument setAccess 0 diff --git a/bare.tcl b/bare.tcl new file mode 100644 index 00000000..7c4fe26c --- /dev/null +++ b/bare.tcl @@ -0,0 +1,47 @@ +# -------------------------------------------------------------------------- +# Initialization script for a simulated TOPSI instrument +# +# +# Dr. Mark Koennecke February, 1996 +#--------------------------------------------------------------------------- +# O P T I O N S + +# --------------- Initialize Tcl internals -------------------------------- + +# first all the server options are set + +ServerOption ReadTimeOut 10 +# timeout when checking for commands. In the main loop SICS checks for +# pending commands on each connection with the above timeout, has +# PERFORMANCE impact! + +ServerOption AcceptTimeOut 10 +# timeout when checking for connection req. +# Similar to above, but for connections + +ServerOption ReadUserPasswdTimeout 500000 +# time to wiat for a user/passwd to be sent from a client. Increase this +# if there is a problem connecting to a server due to network overload\ + +ServerOption LogFileBaseName /data/koenneck/src/sics/tmp/server +# the path and base name of the internal server logfile to which all +# activity will be logged. + +ServerOption ServerPort 2910 +# the port number the server is going to listen at. The client MUST know +# this number in order to connect. It is in client.ini + +ServerOption InterruptPort 2913 +# The UDP port where the server will wait for Interrupts from clients. +# Obviously, clients wishing to interrupt need to know this number. + + +#--------------------------------------------------------------------------- +# U S E R S + +# than the SICS users are specified +# Syntax: SicsUser name password userRightsCode +SicsUser Mugger Diethelm 1 +SicsUser User Rosy 2 +SicsUser Spy 007 3 + diff --git a/base.tcl b/base.tcl new file mode 100644 index 00000000..2f39a1e7 --- /dev/null +++ b/base.tcl @@ -0,0 +1,791 @@ +crunch_skip begin +DOC "class Base" { + NAME + Base - The basic class inherited by all obTcl objects + + SYNOPSIS + Base new + - Creates an object of the simplest possible class. + + DESCRIPTION + All classes inherits the Base class automatically. The Base class + provides methods that are essential for manipulating obTcl-objects, + such as `info' and `destroy'. + + METHODS + Base provides the following generic methods to all objects: + + new - EXPERIMENTAL! Arranges to create a new object of + the class of the invoking object. + + instance - EXPERIMENTAL! Arranges to create a new object of + the class of the invoking object. This method + differs from `new' by NOT automatically invoking + the `init' method of the new object. + One possible usage: Create a replacement for the + normal class object -a replacement which has no + hard-coded methods (this will need careful design + though). + + init - Does nothing. The init method is automatically + invoked whenever an object is created with `new'. + + destroy - Frees all instance variables of the object, and + the object itself. + + class - Returns the class of the object. + + set name ?value? + - Sets the instance variable `name' to value. + If no value is specified, the current value is + returned. Mainly used for debugging purposes. + + info - Returns information about the object. See INFO + below. + + eval