Mid.CBF Pre-AA2-MVP Design Work In Progress

Startup Sequence

@startuml startup
!include mid-cbf-puml-definitions.txt

title MCS Startup Sequence\nAll Units have hardware\nAll FHS connected and on Network
participant "CSP_Mid\n.LMC" as lmc #Thistle
box "\nMCS\n"
  participant "Mid.CBF\nController" as controller
  collections "Subarray" as subarray
  collections "VCC\nUnit" as vcc_unit
  collections "FSP\nUnit" as fsp_unit
  collections "FSP" as mcs_fsp
  participant "FHS\nHardware\nStatus" as hw_status
  collections "Network\nSwitch" as network
end box
box "\nHardware\n"
  participant "Open\nStack" as open_stack #LightGreen
  participant "Network\nAPI" as network_api #LightGreen
end box
box "\nFHS\n"
  collections "FHS\nController" as fhs_ctrl
  collections "VCC\nAll Bands\nController" as vcc_ctrl
  collections "FSP\nControl" as fsp_ctrl
end box

hw_status -> hw_status        : init
activate hw_status
loop #LightCyan Continuous
  hw_status -> open_stack     : get HW status
  alt HW Status returned
    hw_status <- open_stack     : HW Status
    / rnote over hw_status      : HealthState: OK
  else Unable to contact OpenStack
    hw_status <- open_stack     : Error
    / rnote over hw_status      : HealthState: FAILED
  end
end
deactivate hw_status

network  -> network           : init
activate network
loop #LightCyan Continuous, further details TBD
  network   -> network_api    : get Network status
  network   <- network_api    : Network Status
end
deactivate network

rnote over controller         : AdminMode: OFFLINE\nOpState: DISABLE
/ rnote over subarray         : AdminMode: OFFLINE\nOpState: DISABLE
/ rnote over vcc_unit         : AdminMode: OFFLINE\nOpState: DISABLE
/ rnote over fsp_unit         : AdminMode: OFFLINE\nOpState: DISABLE
/ rnote over mcs_fsp          : AdminMode: OFFLINE\nOpState: DISABLE
/ rnote over hw_status        : AdminMode: N/A\nOpState: ON (or N/A)
lmc -> controller             : AdminMode: ONLINE


controller -> vcc_unit        : AdminMode: ONLINE
group #LightCyan Connect to VCC Units
  alt VCC Unit has hardware
    loop poll until communicating
      vcc_unit -> network          : start communicating
      activate network
      vcc_unit <- network          : communicating success

      vcc_unit -> fhs_ctrl         : start communicating
      activate fhs_ctrl           
      vcc_unit <- fhs_ctrl         : communicating success
 
      vcc_unit -> vcc_ctrl         : start communicating
      activate vcc_ctrl 
      vcc_unit <- vcc_ctrl         : communicating success   
      
    end
    vcc_unit  ->> network        : Subscribe Health State
    vcc_unit  ->> fhs_ctrl       : Subscribe Health State
    vcc_unit  ->> vcc_ctrl       : Subscribe Health State
    vcc_unit  <<-- network        : Health State
    deactivate network
    vcc_unit  <<-- fhs_ctrl       : Health State
    deactivate fhs_ctrl
    vcc_unit  <<-- vcc_ctrl       : Health State
    deactivate vcc_ctrl
    vcc_unit -->> controller     : Health State
    rnote over vcc_unit          : AdminMode: ONLINE\nOpState: ON\nHealthState: OK, \nDEGRADED or FAILED    
  else VCC Unit has no hardware, do nothing
    rnote over vcc_unit          : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN
  end
end
controller -> fsp_unit        : AdminMode: ONLINE
group #LightCyan Connect to FSP Units
  alt FSP Unit has hardware
    loop poll until communicating
      fsp_unit  ->> network      : start communicating
      activate network
      fsp_unit <- network        : communicating success

      fsp_unit  ->> fhs_ctrl      : start communicating
      activate fhs_ctrl      
      fsp_unit <- fhs_ctrl        : communicating success

      fsp_unit  ->> mcs_fsp      : start communicating
      activate mcs_fsp 
      mcs_fsp  ->> fsp_ctrl      : start communicating
      activate fsp_ctrl
      mcs_fsp <- fsp_ctrl        : communicating success
      fsp_unit <- mcs_fsp        : communicating success
   
    end
    fsp_unit  ->> network        : Subscribe Health State
    fsp_unit  ->> fhs_ctrl       : Subscribe Health State
    fsp_unit  ->> fsp_ctrl       : Subscribe Health State

    fsp_unit  <<-- network        : Health State
    deactivate network
    fsp_unit  <<-- fhs_ctrl       : Health State
    deactivate fhs_ctrl
    mcs_fsp  <<-- fsp_ctrl       : Health State
    deactivate fsp_ctrl
    fsp_unit  <<-- mcs_fsp       : Health State
    deactivate mcs_fsp
    fsp_unit -->> controller      : Health State
    rnote over fsp_unit         : AdminMode: ONLINE\nOpState: ON\nHealthState: OK, \nDEGRADED or FAILED    
  else FSP Unit has no hardware, do nothing
    rnote over fsp_unit         : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN  
  end
end
note right of vcc_unit           : VCC Units and FSP Units without\nhardware\ndo not participate in remaining sequence
loop #LightCyan For each Subarray
  controller   ->> subarray    : Subscribe Health State
  controller   <<- subarray    : Health State
end
rnote over controller         : AdminMode: ONLINE\nOpState: OFF\nHealthState: OK, \nDEGRADED or FAILED
group #LightCyan Initialize System Parameters
  lmc        -> controller      : InitSysParam(json_str)
  loop #LightCyan For each Subarray
    controller -> subarray        : Write sysParam
    controller <-- subarray       : Success
  end
  lmc       <-- controller      : Success
end

rnote over controller         : AdminMode: ONLINE\nOpState: OFF\nHealthState: OK or\nDEGRADED or FAILED
/ rnote over vcc_unit         : AdminMode: ONLINE\nOpState: ON\nHealthState: OK, \nDEGRADED or FAILED
/ rnote over fsp_unit         : AdminMode: ONLINE\nOpState: ON\nHealthState: OK, \nDEGRADED or FAILED

lmc <- controller             : Get Health State before issuing On() command
lmc -> controller  ++         : On()
controller -> subarray        : AdminMode: ONLINE
rnote over subarray           : AdminMode: ONLINE\nOpState: ON\nHealthState: OK
lmc         <--  controller   : Success
rnote over controller         : AdminMode: ONLINE\nOpState: ON

@enduml

Shutdown Sequence

@startuml shutdown
!include mid-cbf-puml-definitions.txt

title Shutdown Sequence\n
participant "CSP_Mid\n.LMC" as lmc #Thistle
box "\nMCS\n"
  participant "Mid.CBF\nController" as controller
  collections "Subarray" as subarray
  collections "VCC\nUnit" as vcc_unit
  collections "FSP\nUnit" as fsp_unit
  participant "FHS\nHardware\nStatus" as hw_status
  collections "Network\nSwitch" as network
end box
box "\nHardware\n"
  participant "Open\nStack" as open_stack #LightGreen
  participant "Network\nAPI" as network_api #LightGreen
end box
box "\nFHS\n"
  collections "FHS\nController" as fhs_ctrl
  collections "All Bands\nController" as ab_ctrl
end box

rnote over controller         : AdminMode: ONLINE\nOpState: ON\nHealthState: OK or\nDEGRADED
/ rnote over vcc_unit         : AdminMode: ONLINE\nOpState: ON\nHealthState: OK, \nDEGRADED or FAILED
/ rnote over fsp_unit         : AdminMode: ONLINE\nOpState: ON\nHealthState: OK, \nDEGRADED or FAILED

lmc -> controller  ++         : Off()
controller -> subarray        : issue commands to return all\nsubarrays to ObsState.EMPTY
rnote over subarray           : AdminMode: ONLINE\nOpState: ON\nHealthState: OK, FAILED\nDEGRADED
controller -> subarray        : OFFLINE
rnote over subarray           : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: OK
lmc         <--  controller   : Success
rnote over controller         : AdminMode: ONLINE\nOpState: OFF\nHealthState: OK, FAILED\nDEGRADED

lmc -> controller             : AdminMode: OFFLINE

loop #LightCyan each VCC Unit
  controller   ->  vcc_unit++   : OFFLINE
  note over vcc_unit            : Stop communicating with subordinates  
  rnote over vcc_unit           : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN
  controller   <-- vcc_unit--   : Success
end loop
loop #LightCyan each FSP Unit
  controller   ->  fsp_unit++   : OFFLINE
  note over fsp_unit            : Stop communicating with subordinates  
  rnote over fsp_unit           : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN
  controller   <-- fsp_unit--   : Success
end loop

rnote over controller         : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN

rnote over controller         : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN
/ rnote over subarray         : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: OK
/ rnote over vcc_unit         : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN
/ rnote over fsp_unit         : AdminMode: OFFLINE\nOpState: DISABLE\nHealthState: UNKNOWN

@enduml