Progress bar in Extender scripts

You can now add a Meter to display progress of a process run in an Extender script.

See Meter.html in the VIXXA>Doc folder.

Copy

Create a progress bar in the UI

class MyUI(UI):
    def doMeter(self):
        # gets the UI to create a progress bar
        self.createMeter(self.onMeterCreated) 
    
def onMeterCreated(self, e):
    self.meter = Meter()
    bShowCancel = True
    bShowGauge = True
    self.meter.create("Title", bShowCancel, bShowGauge)

    self.meter.setTotal(100) # set how manys steps - ie how many times we will call tick()
    i = 0
    while i < 100:
        i = i + 1
        self.meter.setLabel("Progress label " + str(i))
        self.meter.tick() # each tick progresses the meter

    # you can also call:
    percent = 25
    self.meter.setPercent(percent)

    # or:
    cur = 50
    total = 200
    self.meter.setPercent2(cur, total) # this would set it to 25%

    self.meter.destroy()
    self.destroyMeter() # tells the UI to hide the progress bar