Search in sources :

Example 11 with SingleDciConfig

use of org.netxms.client.maps.configs.SingleDciConfig in project netxms by netxms.

the class NetworkMapWidget method addDciToRequestList.

/**
 * Goes thought all links and trys to add to request list required DCIs.
 */
protected void addDciToRequestList() {
    Collection<NetworkMapLink> linkList = mapPage.getLinks();
    for (NetworkMapLink item : linkList) {
        if (item.hasDciData()) {
            for (SingleDciConfig value : item.getDciAsList()) {
                if (value.type == SingleDciConfig.ITEM) {
                    dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
                } else {
                    dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
                }
            }
        }
    }
    Collection<NetworkMapElement> mapElements = mapPage.getElements();
    for (NetworkMapElement element : mapElements) {
        if (element instanceof NetworkMapDCIContainer) {
            NetworkMapDCIContainer item = (NetworkMapDCIContainer) element;
            if (item.hasDciData()) {
                for (SingleDciConfig value : item.getObjectDCIArray()) {
                    if (value.type == SingleDciConfig.ITEM) {
                        dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
                    } else {
                        dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
                    }
                }
            }
        }
        if (element instanceof NetworkMapDCIImage) {
            NetworkMapDCIImage item = (NetworkMapDCIImage) element;
            DCIImageConfiguration config = item.getImageOptions();
            SingleDciConfig value = config.getDci();
            if (value.type == SingleDciConfig.ITEM) {
                dciValueProvider.addDci(value.getNodeId(), value.dciId, mapPage);
            } else {
                dciValueProvider.addDci(value.getNodeId(), value.dciId, value.column, value.instance, mapPage);
            }
        }
    }
}
Also used : NetworkMapDCIImage(org.netxms.client.maps.elements.NetworkMapDCIImage) NetworkMapElement(org.netxms.client.maps.elements.NetworkMapElement) DCIImageConfiguration(org.netxms.client.maps.configs.DCIImageConfiguration) NetworkMapDCIContainer(org.netxms.client.maps.elements.NetworkMapDCIContainer) NetworkMapLink(org.netxms.client.maps.NetworkMapLink) SingleDciConfig(org.netxms.client.maps.configs.SingleDciConfig)

Aggregations

SingleDciConfig (org.netxms.client.maps.configs.SingleDciConfig)11 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 ArrayList (java.util.ArrayList)3 DciValue (org.netxms.client.datacollection.DciValue)3 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)2 NXCPMessage (org.netxms.base.NXCPMessage)2 NetworkMapLink (org.netxms.client.maps.NetworkMapLink)2 DCIImageConfiguration (org.netxms.client.maps.configs.DCIImageConfiguration)2 NetworkMapDCIContainer (org.netxms.client.maps.elements.NetworkMapDCIContainer)2 NetworkMapDCIImage (org.netxms.client.maps.elements.NetworkMapDCIImage)2 NetworkMapElement (org.netxms.client.maps.elements.NetworkMapElement)2 SelectDciDialog (org.netxms.ui.eclipse.datacollection.dialogs.SelectDciDialog)2 DataSourceEditDlg (org.netxms.ui.eclipse.networkmaps.dialogs.DataSourceEditDlg)2 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 Threshold (org.netxms.client.datacollection.Threshold)1 AccessPoint (org.netxms.client.objects.AccessPoint)1 ConnectionPoint (org.netxms.client.topology.ConnectionPoint)1 DciSelector (org.netxms.ui.eclipse.datacollection.widgets.DciSelector)1