大家早上好,
我已经在这个问题上工作了几天,但我无法找到解决办法。我已经研究和谷歌搜索无济于事。任何帮助/见解将不胜感激。我正在尝试创建一个按钮,单击该按钮时将自动通过日期过滤器(例如从 1/1/15 开始)并通过 1/2 -1/5 使用新过滤的标记层更新地图,因为它逐步通过功能。我已经让过滤器逐步通过 1/1-1/5;但是,它不会在地图可视化过程中更新,所以用户看到的只是从 1/1 到 1/5 的跳跃,中间有一个暂停(我在每个步骤中都有一个睡眠计时器)。我已经包含了下面的代码,我只是在学习 IronPython,我不确定我需要调用什么来刷新可视化。Visualization.Refresh() 不起作用。非常感谢!
import Spotfire.Dxp.Application.Filters as filters
import Spotfire.Dxp.Application.Filters.ItemFilter
import time
from Spotfire.Dxp.Application.Filters import FilterTypeIdentifiers
from Spotfire.Dxp.Data import DataProperty, DataType, DataPropertyAttributes, DataPropertyClass
from Spotfire.Dxp.Application.Visuals import MarkerLayer
myPanel = Document.ActivePageReference.FilterPanel
myFilter= myPanel.TableGroups[2].GetFilter("Date (Daily)")
myFilter.FilterReference.TypeId = FilterTypeIdentifiers.ItemFilter
itemFilter = myFilter.FilterReference.As[filters.ItemFilter]()
whichCol = itemFilter.DataColumnReference
count = 0
while count < 5:
count = count +1
if (whichCol.Properties.PropertyExists("CurrentStep") == False):
myProp = DataProperty.CreateCustomPrototype("CurrentStep",0,DataType.Integer,DataPropertyAttributes.IsVisible|DataPropertyAttributes.IsEditable)
Document.Data.Properties.AddProperty(DataPropertyClass.Column, myProp)
whichCol.Properties.SetProperty("CurrentStep",0)
Document.Properties["DateTest"] = "1/1/15"
time.sleep(1)
else:
time.sleep(1)
whichVal = whichCol.Properties.GetProperty("CurrentStep")
#print whichVal
#print itemFilter.Values.Count
if (whichVal == itemFilter.Values.Count):
whichCol.Properties.SetProperty("CurrentStep",0)
Document.Properties["DateTest"] = "1/1/15"
else:
itemFilter.Value = itemFilter.Values.Item[whichVal]
whichCol.Properties.SetProperty("CurrentStep",whichVal+1)
Document.Properties["DateTest"] = itemFilter.Value