Changeset 16441


Ignore:
Timestamp:
05/29/13 18:20:14 (11 years ago)
Author:
tbretz
Message:
Some updates to the output; added a timeout when waiting for the voltage to be ramped correctly.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/scripts/Main.js

    r16077 r16441  
    195195        return;
    196196
    197     this.voltageStep = null;
    198197    if (!evt.data)
    199198        return;
     
    216215    this.previous = avg;
    217216
    218     console.out("  DeltaV="+this.voltageStep);
     217    console.out("  DeltaV=%.3f".$(this.voltageStep));
    219218}
    220219
     
    253252
    254253        // Switch voltage off
    255         console.out("  Voltage on: switch off");
     254        console.out("  "+new Date().toUTCString()+": Voltage off: switch off");
    256255        dim.send("BIAS_CONTROL/SET_ZERO_VOLTAGE");
    257256
     
    303302    if (isOff)
    304303    {
    305         console.out("  Voltage on: switch on");
     304        console.out("  "+new Date().toUTCString()+": Voltage on: switch on");
    306305        //console.out(JSON.stringify(dim.state("BIAS_CONTROL")));
    307306
     
    347346    console.out("  Feedback wait: start");
    348347
    349     function func(service)
    350     {
    351         if ((service.cnt!=undefined && service.get().counter>service.cnt+10) ||
    352             (service.voltageStep && service.voltageStep<0.02))
     348    function func()
     349    {
     350        if ((this.cnt!=undefined && this.get().counter>this.cnt+10) ||
     351            (this.voltageStep && this.voltageStep<0.02))
    353352            return true;
    354353    }
    355354
    356355    var now = new Date();
    357     //v8.timeout(5*60000, func, this);
    358     while ((this.cnt==undefined || this.get().counter<=this.cnt+10) && (!this.voltageStep || this.voltageStep>0.02))
    359         v8.sleep(100);
     356
     357    v8.timeout(4*60000, func, this);
    360358
    361359    console.out("  Feedback wait: end [dV=%.3f, cnt=%d, %.2fs]".$(this.voltageStep, this.get().counter, (new Date()-now)/1000));
Note: See TracChangeset for help on using the changeset viewer.