(block *waveobj.Block)
| 238 | } |
| 239 | |
| 240 | func generateToolsForTsunamiBlock(block *waveobj.Block) []uctypes.ToolDefinition { |
| 241 | var tools []uctypes.ToolDefinition |
| 242 | |
| 243 | status := blockcontroller.GetBlockControllerRuntimeStatus(block.OID) |
| 244 | if status == nil || status.ShellProcStatus != blockcontroller.Status_Running || status.TsunamiPort <= 0 { |
| 245 | return nil |
| 246 | } |
| 247 | |
| 248 | blockORef := waveobj.MakeORef(waveobj.OType_Block, block.OID) |
| 249 | rtInfo := wstore.GetRTInfo(blockORef) |
| 250 | |
| 251 | if tool := GetTsunamiGetDataToolDefinition(block, rtInfo, status); tool != nil { |
| 252 | tools = append(tools, *tool) |
| 253 | } |
| 254 | if tool := GetTsunamiGetConfigToolDefinition(block, rtInfo, status); tool != nil { |
| 255 | tools = append(tools, *tool) |
| 256 | } |
| 257 | if tool := GetTsunamiSetConfigToolDefinition(block, rtInfo, status); tool != nil { |
| 258 | tools = append(tools, *tool) |
| 259 | } |
| 260 | |
| 261 | return tools |
| 262 | } |
| 263 | |
| 264 | // Used for internal testing of tool loops |
| 265 | func GetAdderToolDefinition() uctypes.ToolDefinition { |
no test coverage detected