The functions interface

import HasyUtils, Spectra
import random

def main():
    if not HasyUtils.isSardanaMonitorAlive():
        print "SardanaMonitor is not alive"
        return
    smNode = 'haso107d1'
    print "date:   ", HasyUtils.toSardanaMonitor( { 'gra_decode_text': "date()"}, node = smNode)
    print "2*3:    ", HasyUtils.toSardanaMonitor( { 'gra_decode_int': "2*3"}, node = smNode)
    print "sqrt(2):", HasyUtils.toSardanaMonitor( { 'gra_decode_double': "sqrt(2.)"}, node = smNode)
    #print HasyUtils.toSardanaMonitor( { 'gra_command': "cls;wait 1;display 1"}, node = smNode)
    
main()

--- output
date:    {u'result': u'12-Dec-2018'}
2*3:     {u'result': u'6'}
sqrt(2): {u'result': u'1.41421'}



2020-07-03