change init files to be more generic

tcl/seainit.tcl and tcvl/graphinit.tcl are kept for a short time
new files: sea_init.tcl. graph_init.tcl
This commit is contained in:
2026-02-18 16:15:42 +01:00
parent 97a6629abb
commit ae53f2e519
4 changed files with 212 additions and 0 deletions

53
tcl/graph_init.tcl Normal file
View File

@@ -0,0 +1,53 @@
#---------------------------------------------------------------------------
# graph server initialization script
#---------------------------------------------------------------------------
set home $::env(HOME)
if {[catch {set instrument $::env(Instrument)}]} {
set instrument [file tail $home]
}
if {[catch {set serverport $::env(SEA_GRAPH_PORT)}]} {
set serverport 8741
}
if {"$home" == "/home/$instrument"} {
set logbase $home/sea/
} else {
set logbase $home/sea/$instrument/
}
set connect_sea_to_sics 0
cd /sq_sw/linse/ins/$instrument/sea/tcl
ServerOption LogFileDir $logbase/log2
#LogFileDir is the directory where the command log is going
ServerOption LoggerDir $logbase/logger
#where the logger files should be written
ServerOption LogReaderPath :$logbase/logger:$env(HOME)/sicslogger
#where the logger files chould be read from
set statusfile $logbase/status/graphstatus.tcl
ServerOption statusfile $statusfile
ServerOption ServerPort $serverport
# the port number the server is going to listen at. The client MUST know
# this number in order to connect.
#interrupt port not needed for SEA, but required for SICS, add 100
incr serverport 100
ServerOption InterruptPort $serverport
SicsUser lnsmanager lnsSICSlns 1
SicsUser seamanager seager 1
SicsUser seauser seaser 2
SicsUser Spy 007 3
VarMake Instrument Text Internal
Instrument $instrument
commandlog auto
commandlog compact 1
restore $statusfile

View File

@@ -1,5 +1,6 @@
#---------------------------------------------------------------------------
# graph server initialization script
# OLD VERSION before /sq_sw
#---------------------------------------------------------------------------
if {[info exists serverport]} {

157
tcl/sea_init.tcl Normal file
View File

@@ -0,0 +1,157 @@
#---------------------------------------------------------------------------
# sea initialization script
#---------------------------------------------------------------------------
set home $::env(HOME)
if {[catch {set instrument $::env(Instrument)}]} {
set instrument [file tail $home]
}
if {[catch {set serverport $::env(SEA_SEA_PORT)}]} {
set serverport 8641
}
if {"$home" == "/home/$instrument"} {
set logbase $home/sea/
} else {
set logbase $home/sea/$instrument/
}
if {"$instrument" == "hrpt"} {
set connect_sea_to_sics 2911
} else {
set connect_sea_to_sics 0
}
set sea_root $::env(SEA_ROOT)
if {"$searoot" ne ""} {
cd $searoot
}
if {[sicsdescriptor loglisten] eq "loglisten"} {
loglisten commandlog 1000
loglisten timestamps m
}
logconfig logtemplate $logbase/log/log
#mongoconfig open mongodb://logwriter:sinqsics@mpc1965:27017/?authSource=admin sea_$instrument
#parhistconfig sea_$instrument
ServerOption LogFileBaseName $logbase/stdlog
ServerOption LogFileDir $logbase/log
#LogFileDir is the directory where the command log is going
ServerOption LoggerDir $logbase/logger
#where the logger files should be written
#ServerOption HistoryDir $logbase/history
#where the FRAPPY-like history files should be written
ServerOption LogReaderPath $logbase/logger:$env(HOME)/sicslogger
#where the logger files chould be read from
set statusfile $logbase/status/seastatus.tcl
ServerOption statusfile $statusfile
ServerOption ServerPort $serverport
# the port number the server is going to listen at. The client MUST know
# this number in order to connect.
#interrupt port not needed for SEA, but required for SICS, subtract 100
ServerOption InterruptPort [expr $serverport - 100]
# Telnet options, subtract 200
ServerOption TelnetPort [expr $serverport - 200]
ServerOption TelWord sealogin
# allow to call the unix script safeplugin
allowexec [pwd]/plugin/safeplugin
allowexec ping
allowexec dig
allowexec frappy
definealias tem temperature
ServerOption overwriteOwner 1
# allows to run or drive when another client is already running,
# taking over ownership of the executor
SicsUser lnsmanager lnsSICSlns 1
SicsUser seamanager seager 1
SicsUser seauser seaser 2
SicsUser Spy 007 3
VarMake Instrument Text Internal
Instrument $instrument
MakeDrive
MakeTclInt save_env_object
#SerialInit
#Publish serialport user
#Publish p1 user
#Publish p2 user
#Publish p3 user
#commandlog auto
#commandlog compact 60
makeobject obj_list array
makeobject cfg_env array
makeobject desc_env array
makeobject device_layout array
makeobject graph_shown array
makeobject graph_label array
makeobject graph_units array
makeobject graph_color array
makeobject graph_order array
makeobject device array logged
makeobject seaclient_list array
makeobject vars string
makeobject addon_list array
makeobject obj_dependencies array
makeobject ignore_msg array
makeobject instconfig array
catch {
source instconfig/${instrument}.tcl
}
# the following items could be moved to the array "device"
makeobject deviceDesc string
makeobject stickDesc string
if {$instrument eq "seaman"} {
makeobject busy_list array
makeobject request_list array
makeobject device_list array
makeobject hostport_list array
makeobject rack_list array
makeobject instr_list array
makeobject samenv_list array
makeobject web_ports array
source seacom.tcl
source seamancom.tcl
# only for test
source remob.tcl
} else {
makeobject ts_busy array
makeobject device_on array
source stdsct.tcl
source seacom.tcl
source remob.tcl
stdConfig::make -name seaman -driver seaclient -port linse-c:3001 -permanent 1
startAutodeviceCron
if {[silent 0 result instconfig stickrot] == 1} {
# enable stickrot:
# in sea/tcl/instconfig/<instrument>.tcl add the following line:
# instconfig makeitem stickrot 1
source stickrot.tcl
}
}
restore $statusfile
backup
array_init device name unknown changetime 0 stick_menu {} stick_name {} newdevice {} olddevice {} rack {} confirmed {}
array_init device frappy_u_config 0 frappy_u_stick 0 frappy_u_addon 0 frappy_main {} frappy_stick {} frappy_addons {}
array_init device name_label NONE stick_label {}
connect_sics

View File

@@ -1,5 +1,6 @@
#---------------------------------------------------------------------------
# sea initialization script
# OLD VERSION before /sq_sw
#---------------------------------------------------------------------------
if {[info exists serverport]} {