Skip to content

repl: Use text_block for umv, scan progress, user status

Valentin Valls requested to merge use-textblock-for-user-status into master

Close #4234 (closed)

This PR use the text_block helper inside different display, in order to use them together.

For example a countdown can be used inside a text_block.

  • Rework countdown with text_block
  • Rework scan progress with text_block
  • Rework user status with text_block
  • Rework umove with text_block
  • Plus a tuning of the scan and step scan progress
    • display the scan state
    • use timedisplay for formatting

Test of a dscan with motor restoration

dscan(robx,-1,1,10,.01,beamviewer)

dscan

Test with a user status interleaved with logs

import gevent

def log_stuffs():
    while True:
        print("aaaaaa")
        gevent.sleep(0.2)

g = gevent.spawn(log_stuffs)

from bliss.common.user_status_info import status_message
import gevent
with status_message() as update:
    update("Pif")
    gevent.sleep(1)
    update("Paf")
    gevent.sleep(1)
    update("Bouf")
    gevent.sleep(1)
    update("Toc")
    gevent.sleep(1)
    update("He fall down")
    gevent.sleep(1)
g.kill()

Test of a text_block containing countdown

with text_block() as tb:
    tb.set_text("Step 1")
    countdown(5, "Stabilization")
    tb.set_text("Step 2")
    countdown(5, "Stabilization")
    tb.set_text("Done")
Edited by Valentin Valls

Merge request reports