#!/usr/bin/perl
#
# M Krasberg, April 2004, U of Wisconsin
#
# this is a simple help utility
#

$user=getpwuid($>);

$command = $ARGV[0];


if ($command eq  "domhubapp") {

print <<EOF;

'domhubapp' will launch both rmiregistry and domhubapp

If you run 'domhubapp' from a workspace directory 
	(such as /home/$user/icecube/work) 
 then the jar files found in that workspace tree will be used.

If you run 'domhubapp' from another directory then the jar files found in 
 the standard software repository (/home/icecube/work) will be used.

'domhubapp' requires jar files from the following packages:
  'domhub', 'domhub-common'

EOF
;

}
elsif ($command eq  "domhub-maintenance") {

print <<EOF;

 To update the domhub software using the master installation script you
   should (as 'root') execute /root/icecube_software_install.pl

 User accounts should be added using (as 'root') /root/add_icecube_users.pl

 The preferred way to update software on the standard software repository
  is to (as 'root) 'su - icecube', and then to execute the script 
  'update_all_icecube_software.pl /home/icecube/work'.


EOF
;



}

else {

print <<EOF;

    For help on a particular topic type 'icehelp <topic>'

    Sadly, this script needs quite a bit of work...
      only 'domhubapp' and 'domhub-maintenance' currently provide help

    Topics include:

    domhubapp
    stf
    testdaq-control
    dtsx
    xymodem
    update_all_icecube_software.pl
    domhub-maintenance


old commands:
 source /home/krasberg/bin/set_classpath
 rmiregistry
 java icecube.daq.domhub.DOMHub /usr/local/etc/dh.properties
 java icecube.testdaq.control.TestDAQControl

coincidence code:
 java -Xmx1024m icecube.testdaq.coincidence.Coincidence zipfile 1000 4

independent data collector:
 java icecube.testdaq.datacollector.DataCollectorFactoryImpl

to run ezplot: java icecube.testdaq.ezplot.Plotter

to run RapCalTest:  java icecube.testdaq.datacollector.RapCalTest <tcalibFile>

to run data quality test: java icecube.testdaq.test.DataQualityTest <ZIPfile>

to run domtest:
java icecube.testdaq.domtest.DomtestMain SteeringFile

for domcal: 
off all, on all, gotoiceboot, dtsxall, then: the following will do first 64 doms on card 0:
java icecube.daq.domcal.DOMCal localhost 5000 64 /home/testdaq/domcal/ calibrate dom calibrate hv

to install latest release and domcal on a dom:
 to upload a build to ALL DOMs:
  off all
  insall.sh /home/testdaq/release239/release.hex
  after loading the software you must do this:
   echo "0" > /proc/driver/domhub/blocking
 for domcal:
  xymodem -v5 -z /dev/dhc0w0dA domcal.something.gz domcal


for TCALs:
tcaltest /proc/driver/domhub/card0/pair0/domA/tcalib 5

STF: (dtsx should NOT be running)
  off all
  source setclasspath /home/testdaq/work-stf/
  java icecube.daq.stf.STF
 or, to run stf non-interactively:
  off all
  stf.sh /home/testdaq/work-stf temperature

to copy fat database DOM Ids to domprodtest database:
 must run from "/home/testdaq/work" workspace because recent version of this
   program is in the HEAD of the daq-db-common project
 java icecube.daq.db.app.AddHardware
 

after a reboot the following needs to be done:
 as 'root': "nohup domhub-services &"
 execute command: "resetdsb"
 then use toothpick to reset the DSB

to generate steering files:
 from the domhub: 
  on all
  gotoiceboot
 EITHER on the domhub:  autogen-steering -H databasemachine
 OR on the databasemachine: autogen-steering domhubmachine


to add a user account:
 please use /root/add_icecube_users.pl


EOF
;
 
}

exit(1);

