#!/bin/sh # # mysql_tc330_insert.sh table tv_sec cchn schn cdat sdat setpt range tune p i d # # Insert a new reccord into $table # $table - the table to use, ie tc330a or tc330b # $tv_sec - time in unix seconds. # $cchn - control channel: A or B # $schn - sample channel: A or B # $cdat - temperature of the control channel, kelvin. # $sdat - temperature of the sample channel, kelvin. # $setpt - setpoint temperature, kelvin. # $range - 0, 1, 2, 3 is off, low, med, high. # $tune - auto tine status: 0=manual 1=P 2=PI 3=PID # $p - P in PID. # $i - I in PID. # $d - D in PID. # # examples: # mysql_tc330_insert.sh tc330a 1241126275 A B 30.0 72.0 30.0 25.0 2 0 500 200 100 # # csh> mysql_tc330_insert.sh tc330a `date +%s` A B 30.0 72.0 30.0 25.0 2 0 500 200 100 if [ $# -ne 13 ] then echo " usage: $0 table tv_sec cchn schn cdat sdat setpt heater range tune p i d" exit 1 fi # narg=$# dbname=spex table=$1 tv_sec=$2 cchn=$3 schn=$4 cdat=$5 sdat=$6 setpt=$7 heater=$8 range=$9 tune=${10} p=${11} i=${12} d=${13} echo "USE $dbname;" echo "INSERT INTO $table VALUES( $tv_sec, '$cchn', '$schn', $cdat, $sdat, $setpt, $heater, $range, $tune, $p, $i, $d);" #exit # mysql --host=irtfweb.ifa.hawaii.edu --user=spex --password='XXXXX' -t <