SICS-771 Add frequency for each chopper disk.
This commit is contained in:
@ -13,6 +13,7 @@ driver astrium_chopper = {
|
||||
var aspeed = { type = float; mutable = true; }
|
||||
var rphase = { type = float; }
|
||||
var aphase = { type = float; mutable = true; }
|
||||
var frequency = { type = float; mutable = true; }
|
||||
}
|
||||
|
||||
group disk_2 = {
|
||||
@ -26,6 +27,7 @@ driver astrium_chopper = {
|
||||
var aspeed = { type = float; mutable = true; }
|
||||
var rphase = { type = float; }
|
||||
var aphase = { type = float; mutable = true; }
|
||||
var frequency = { type = float; mutable = true; }
|
||||
}
|
||||
|
||||
group disk_3 = {
|
||||
@ -39,6 +41,7 @@ driver astrium_chopper = {
|
||||
var aspeed = { type = float; mutable = true; }
|
||||
var rphase = { type = float; }
|
||||
var aphase = { type = float; mutable = true; }
|
||||
var frequency = { type = float; mutable = true; }
|
||||
}
|
||||
|
||||
group disk_4 = {
|
||||
@ -52,6 +55,7 @@ driver astrium_chopper = {
|
||||
var aspeed = { type = float; mutable = true; }
|
||||
var rphase = { type = float; }
|
||||
var aphase = { type = float; mutable = true; }
|
||||
var frequency = { type = float; mutable = true; }
|
||||
}
|
||||
|
||||
code fetch_function fetchState = {%%
|
||||
@ -87,8 +91,16 @@ driver astrium_chopper = {
|
||||
set rhs "[string trim [lindex ${lst} 1]]"
|
||||
sct "attr_${lhs}" "${rhs}"
|
||||
set base [pathname [sct]]
|
||||
foreach node [list ASPEED RSPEED APHASE RPHASE MASTER] {
|
||||
if { [string equal -nocase "${lhs}" "${node}"] } {
|
||||
switch [string toupper [string trim ${node}]] {
|
||||
"ASPEED" {
|
||||
if [string is double "${rhs}"] {
|
||||
set freq [expr "${rhs}" / 60.0]
|
||||
if { "[hval ${base}/frequency]" != "${freq}" } {
|
||||
hset ${base}/frequency ${freq}
|
||||
}
|
||||
}
|
||||
}
|
||||
"RSPEED" "APHASE" "RPHASE" "MASTER" {
|
||||
if { "[hval ${base}/${node}]" != "${rhs}" } {
|
||||
hset ${base}/${node} "${rhs}"
|
||||
}
|
||||
|
@ -174,8 +174,16 @@ proc ::scobj::astrium_chopper::readState {tc_root} {
|
||||
set rhs "[string trim [lindex ${lst} 1]]"
|
||||
sct "attr_${lhs}" "${rhs}"
|
||||
set base [pathname [sct]]
|
||||
foreach node [list ASPEED RSPEED APHASE RPHASE MASTER] {
|
||||
if { [string equal -nocase "${lhs}" "${node}"] } {
|
||||
switch [string toupper [string trim ${node}]] {
|
||||
"ASPEED" {
|
||||
if [string is double "${rhs}"] {
|
||||
set freq [expr "${rhs}" / 60.0]
|
||||
if { "[hval ${base}/frequency]" != "${freq}" } {
|
||||
hset ${base}/frequency ${freq}
|
||||
}
|
||||
}
|
||||
}
|
||||
"RSPEED" "APHASE" "RPHASE" "MASTER" {
|
||||
if { "[hval ${base}/${node}]" != "${rhs}" } {
|
||||
hset ${base}/${node} "${rhs}"
|
||||
}
|
||||
@ -269,6 +277,17 @@ proc ::scobj::astrium_chopper::mkDriver { sct_controller name ip_address tcp_por
|
||||
hsetprop ${scobj_hpath}/disk_1/aspeed type "part"
|
||||
hsetprop ${scobj_hpath}/disk_1/aspeed nxalias "${name}_disk_1_aspeed"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_1/frequency plain user float
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency control true
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency data true
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency mutable true
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency nxsave true
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency oldval 0.0
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency klass "parameter"
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency type "part"
|
||||
hsetprop ${scobj_hpath}/disk_1/frequency nxalias "${name}_disk_1_frequency"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_1/master plain user text
|
||||
hsetprop ${scobj_hpath}/disk_1/master control true
|
||||
hsetprop ${scobj_hpath}/disk_1/master data true
|
||||
@ -349,6 +368,17 @@ proc ::scobj::astrium_chopper::mkDriver { sct_controller name ip_address tcp_por
|
||||
hsetprop ${scobj_hpath}/disk_2/aspeed type "part"
|
||||
hsetprop ${scobj_hpath}/disk_2/aspeed nxalias "${name}_disk_2_aspeed"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_2/frequency plain user float
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency control true
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency data true
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency mutable true
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency nxsave true
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency oldval 0.0
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency klass "parameter"
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency type "part"
|
||||
hsetprop ${scobj_hpath}/disk_2/frequency nxalias "${name}_disk_2_frequency"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_2/master plain user text
|
||||
hsetprop ${scobj_hpath}/disk_2/master control true
|
||||
hsetprop ${scobj_hpath}/disk_2/master data true
|
||||
@ -429,6 +459,17 @@ proc ::scobj::astrium_chopper::mkDriver { sct_controller name ip_address tcp_por
|
||||
hsetprop ${scobj_hpath}/disk_3/aspeed type "part"
|
||||
hsetprop ${scobj_hpath}/disk_3/aspeed nxalias "${name}_disk_3_aspeed"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_3/frequency plain user float
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency control true
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency data true
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency mutable true
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency nxsave true
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency oldval 0.0
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency klass "parameter"
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency type "part"
|
||||
hsetprop ${scobj_hpath}/disk_3/frequency nxalias "${name}_disk_3_frequency"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_3/master plain user text
|
||||
hsetprop ${scobj_hpath}/disk_3/master control true
|
||||
hsetprop ${scobj_hpath}/disk_3/master data true
|
||||
@ -509,6 +550,17 @@ proc ::scobj::astrium_chopper::mkDriver { sct_controller name ip_address tcp_por
|
||||
hsetprop ${scobj_hpath}/disk_4/aspeed type "part"
|
||||
hsetprop ${scobj_hpath}/disk_4/aspeed nxalias "${name}_disk_4_aspeed"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_4/frequency plain user float
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency control true
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency data true
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency mutable true
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency nxsave true
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency oldval 0.0
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency klass "parameter"
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency sdsinfo "::nexus::scobj::sdsinfo"
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency type "part"
|
||||
hsetprop ${scobj_hpath}/disk_4/frequency nxalias "${name}_disk_4_frequency"
|
||||
|
||||
hfactory ${scobj_hpath}/disk_4/master plain user text
|
||||
hsetprop ${scobj_hpath}/disk_4/master control true
|
||||
hsetprop ${scobj_hpath}/disk_4/master data true
|
||||
|
Reference in New Issue
Block a user