【问题标题】:How to explicitly tell user to wait until script finishes in Spotfire如何明确告诉用户等到脚本在 Spotfire 中完成
【发布时间】:2018-06-28 07:46:48
【问题描述】:


我需要一些建议来完成此线程标题上的操作;让我详细说明一下,我有一个 Spotfire 分析,其中要使用的数据由一组级联的下拉菜单控制,每个下拉菜单都链接到一个文档属性。 它的工作方式是用户在第一个下拉菜单中选择一个值,然后在后台运行一个脚本,该脚本会自动限制以下下拉菜单的可用选项。此行为在第二个和第三个下拉选择器中重复。

这按预期工作。但是,我的问题是,当这些文档属性发生变化时,后台会发生大量操作,例如重新计算几个相当大的表合并,在分析过程中重新计算其他几个表上的许多列等等。
所有这些都需要很长时间才能执行,问题是用户在执行这些操作时最终会看到一个无响应的屏幕。

我需要的是一种方法来指示用户分析没有挂起,他们只需要等到后台操作完成,然后再继续在下一个下拉菜单上进行选择。

我尝试了一些简单的方法,例如创建一个文档属性,一旦单击下拉脚本,该属性就会被分配一个值,然后在脚本末尾重置相同的属性,使用属性值来指示脚本已经完成或尚未完成,但这种方法不起作用。

# Copyright © 2017. TIBCO Software Inc.  Licensed under TIBCO BSD-style license.

#
# Updates a dependent control, setting the value of the 
# dependent property according to the first valid value 
# for that property.
#
# This script should be configured to run when the independent
# control is changed
#
# Andrew Berridge, TIBCO Spotfire, July 2014, Revised September 2016

from Spotfire.Dxp.Data import *

#Updates one or more dependent property based on the selection made in another drop-down control
independentPropertyValue = Document.Properties[independentPropertyName]
Document.Properties["readyToDisplay"] = "No"

i = 0
for dependentPropertyName in dependentPropertyNames.Split(","):
    dependentPropertyName = dependentPropertyName.Trim()
    dependentValuesDataTableName = dependentValuesDataTableNames.Split(",")[i].Trim()
    dependentValuesDataTable = Document.Data.Tables[dependentValuesDataTableName]
    dependentPropertyName = dependentPropertyNames.Split(",")[i].Trim()
    dependentPropertyValue = Document.Properties[dependentPropertyName]
    dependentValuesColumnName = dependentValuesColumnNames.Split(",")[i].Trim()
    dependentValuesColumnCursor = DataValueCursor.CreateFormatted(dependentValuesDataTable.Columns[dependentValuesColumnName])
    independentValuesCursor = DataValueCursor.CreateFormatted(dependentValuesDataTable.Columns[independentValuesColumnName])
    firstValidValue = ""
    for row in dependentValuesDataTable.GetRows(dependentValuesColumnCursor, independentValuesCursor):
        independentValue = independentValuesCursor.CurrentValue
        val = dependentValuesColumnCursor.CurrentValue
        if independentValue == independentPropertyValue and val != "(Empty)" :
            if firstValidValue == "" : 
                firstValidValue = val
                break

    print "Setting value of dependent property " + dependentPropertyName + " to: " + firstValidValue
    Document.Properties[dependentPropertyName] = firstValidValue
    i += 1

Document.Properties["readyToDisplay"] = "Yes"
#print "readyToDisplay is " + Document.Properties["readyToDisplay"]

关于如何解决这个问题的任何想法?

简单来说,我只需要一种方法来向用户指示在任何下拉菜单选择器中进行选择后正在后台发生“事情”,并在系统准备好时通知他们进行以下选择等等。

谢谢

马里奥·雷耶斯

【问题讨论】:

    标签: ironpython spotfire


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-10-10
    • 2020-09-10
    • 2015-03-01
    • 2022-11-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多