Python command: Dashboard

Use the dashboard. commands in a Python Script Designer dashboard control to refresh or close the current dashboard or to open a dashboard or desktop.

Note: The Python debugger will generate an error when it tries to evaluate the dashboard. commands. This is known behavior.

See Python commands for other commands you can use with GainSeeker.

 

Contents  [Hide]

 

Commands

Syntax

Example

Description/Remarks

New or changed in GainSeeker version

dashboard.close()

dashboard.close()

Closes the current dashboard and immediately stops execution of the script.

Note: Running the debugger on this command will generate an error.

8.7

dashboard.opendashboard(name, showEdit=False, clearAll=False)

dashboard.opendashboard("Production", True, True)

Closes all existing chart windows, then opens the dashboard named "Production" in Edit/Open mode.

Opens the dashboard with the name you provide.

If showEdit is True , this is equivalent to manually opening a dashboard with the Edit/Open button.

If clearAll is True , this will close all existing chart windows - including the current dashboard window - and immediately stop execution of the script.

If showEdit and clearAll are both True, all chart windows are closed before the Edit Dashboard Settings window is displayed for the specified dashboard.

Note: Running the debugger on this command will generate an error.

8.7

dashboard.opendesktop(name, showEdit=False, clearAll=False)

dashboard.opendesktop("Shift Charts", True, True)

Opens the desktop named "Shift Charts" in Edit/Open mode.
When the user selects Edit/Open options and clicks OK, all existing chart windows are closed and the desktop is opened with any specified changes.

Opens the desktop with the name you provide.

If showEdit is True , this is equivalent to manually opening a desktop with the Edit/Open button.

If clearAll is True , this will close all existing chart windows - including the current dashboard window - and immediately stop execution of the script.

If showEdit and clearAll are both True, the Edit Desktop Settings window is displayed for the specified desktop. After the user specifies any changes and clicks OK, all chart windows are closed and the desktop is opened with any specified changes.

Note: Running the debugger on this command will generate an error.

8.7

dashboard.refresh()

misc.run("DESPC.exe", True, '-n:"Data Entry Operator" -T:"Shift Checks template"')

dashboard.refresh()

Run the SPC Data Entry module (DESPC.exe) with command line parameters to automatically log in and launch a particular data entry template. As soon as the SPC Data Entry module is closed, refresh the current dashboard.

Refreshes the current dashboard and immediately stops execution of the script.

Note: Running the debugger on this command will generate an error.

8.7

Example script

dashboardname = "Process Defects"

 

#Display Form 1

disp.reset()

 

msg_opendash = disp.newdisplaytext("Open dashboard " + dashboardname)

msg_opendash.row = 0

disp.addcntrl(msg_opendash)

 

ckbx_showedit = disp.newcheckbox()

ckbx_showedit.row = 1

ckbx_showedit.text = "Show 'Edit/Open' dialog"

disp.addcntrl(ckbx_showedit)

 

ckbx_clearall = disp.newcheckbox()

ckbx_clearall.row = 2

ckbx_clearall.text = "Clear open windows"

disp.addcntrl(ckbx_clearall)

 

disp.addbtn(0, "Open New")

disp.addbtn(1, "Refresh this")

disp.addbtn(2, "Close this")

 

disp.show()

 

if disp.getresult() == 0 :

dashboard.opendashboard(dashboardname, ckbx_showedit.value, ckbx_clearall.value)

elif disp.getresult() == 1 :

dashboard.refresh()

elif disp.getresult() == 2 :

dashboard.close()

 

 

#Display Form 2

disp.reset()

 

container1 = disp.newbrowser()

container1.url = """www.google.com"""

container1.column = 0

container1.row = 0

container1.width = 1

container1.height = 1

disp.addcntrl(container1)

 

disp.addbtn(1, "Refresh this")

disp.addbtn(2, "Close this")

disp.show()

 

if disp.getresult() == 1 :

dashboard.refresh()

elif disp.getresult() == 2 :

dashboard.close()