Search in sources :

Example 1 with DynamicDebugWidgetTask

use of kutch.biff.marvin.task.DynamicDebugWidgetTask in project Board-Instrumentation-Framework by intel.

the class DataManager method ChangeValue.

public void ChangeValue(String ID, String Namespace, String Value) {
    boolean OnDemandItemFound = false;
    boolean OnDemandTabFound = false;
    synchronized (this) {
        for (Pair<DynamicItemInfoContainer, OnDemandWidgetBuilder> entry : _OnDemandQueue) {
            if (entry.getKey().Matches(Namespace, ID, Value)) {
                LateCreateTask objTask = new LateCreateTask(entry.getValue(), Namespace, ID, Value, entry.getKey().getLastMatchedSortStr());
                TaskManager.getTaskManager().AddDeferredTaskObject(objTask);
                OnDemandItemFound = true;
                if (entry.getValue() instanceof OnDemandTabBuilder) {
                    OnDemandTabFound = true;
                }
            }
        }
        if (OnDemandItemFound) {
            Configuration.getConfig().setCursorToWait();
        }
        // go and handle any GenerateDatapoint stuff
        for (GenerateDatapointInfo info : __GenerateDatapointList) {
            if (info.Matches(Namespace, ID)) {
                info.BuildDatapoint(Namespace, ID);
            }
        }
    }
    synchronized (this) {
        String Key = Utility.generateKey(Namespace, ID);
        _UpdateCount++;
        boolean inWildcard = HandleWildcardChangeValue(ID, Namespace, Value);
        if (false == _DataMap.containsKey(Key)) {
            _DataMap.put(Key, new DataSet());
            if (false == inWildcard) {
                _UnassignedDataPoints++;
                // nifty stuff to dynamically add a tab to show 'unregistered' data points.
                if (kutch.biff.marvin.widget.DynamicTabWidget.isEnabled()) {
                    DynamicDebugWidgetTask objTask = new DynamicDebugWidgetTask(Namespace, ID, Value);
                    TaskManager.getTaskManager().AddPostponedTask(objTask, 0);
                }
            }
        }
        if (// if didn't exist, is created above
        _DataMap.containsKey(Key)) {
            _DataMap.get(Key).setLatestValue(Value);
        }
    }
    if (true == OnDemandTabFound) {
    // ApplyOnDemandTabStyle objTask = new ApplyOnDemandTabStyle();
    // TaskManager.getTaskManager().AddPostponedTask(objTask, 1000);
    }
}
Also used : DynamicItemInfoContainer(kutch.biff.marvin.utility.DynamicItemInfoContainer) OnDemandWidgetBuilder(kutch.biff.marvin.widget.widgetbuilder.OnDemandWidgetBuilder) GenerateDatapointInfo(kutch.biff.marvin.utility.GenerateDatapointInfo) LateCreateTask(kutch.biff.marvin.task.LateCreateTask) OnDemandTabBuilder(kutch.biff.marvin.widget.widgetbuilder.OnDemandTabBuilder) DynamicDebugWidgetTask(kutch.biff.marvin.task.DynamicDebugWidgetTask)

Aggregations

DynamicDebugWidgetTask (kutch.biff.marvin.task.DynamicDebugWidgetTask)1 LateCreateTask (kutch.biff.marvin.task.LateCreateTask)1 DynamicItemInfoContainer (kutch.biff.marvin.utility.DynamicItemInfoContainer)1 GenerateDatapointInfo (kutch.biff.marvin.utility.GenerateDatapointInfo)1 OnDemandTabBuilder (kutch.biff.marvin.widget.widgetbuilder.OnDemandTabBuilder)1 OnDemandWidgetBuilder (kutch.biff.marvin.widget.widgetbuilder.OnDemandWidgetBuilder)1