Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - alexrhyshurn

#1
Hello,

Thanks for all the feedback.

My problem was (of course) entirely my mistake.

I did not understand the difference between integer and Floating Point data type. An integer is just that, a whole number and so cannot get decimal places.

So trying to use %.2f format string with integer cant work. I Changed my DCIs to Floating point, and now %.2f for 2 decimal places is working fine.

Apologies to all.

Alex
#2
Hi,

I am sorry I was not clear.

The returned value for %s is, for example, 109.794250 plain and simple.

In the format string I have put %s kW so giving the result of 109.794250 kW

If I create a new DCI COntainer and leave the format string blank it returns: 109.794250
If I create a new DCI COntainer and put %s in the format string it returns: 109.794250

I can use any text around the %s such as Total Grid Power: %s kW which returns: Total Grid Power: 109.794250 kW

What I want to do is take the result from %s and reduce it to two decimal places.

So I don't think that its a string.

Best regards,

Alex

#3
Hi,

Thanks for the response.

The DCI is a simple query an SNMP value (no transformations or anything) from a Schneider Powerlogic ION Power Meter, and the Map is a DCI Container, I have shown the raw value as well as some others with format string. I am aiming to get 2 deminal places precision.

I should add, that the DCI containers shown with data are using %s

Thanks,

Alex
#4
General Support / [SOLVED] Re: Networks Maps broke
December 27, 2018, 02:49:47 PM
Hi Victor,

Thanks. That works.

Alex
#5
I think I have found the cause.

When adding descriptions to the format string, I have some data that is a percentage, so I added:

Total UPS Power: %s %

Hoping to see:

Total UPS Power: 47 %

The second percentage mark causes the whole map to break, and I have to delete it and make a new one.

Can anybody guide me on how to include a second % sign?

Thanks,

Alex
#6
General Support / [SOLVED] Networks Maps broke
December 26, 2018, 08:13:39 PM
Hi All,

I was happily working on my network map, and then I added a new DCI COntainer with two DCIs and it worked fine. I went back to add some text to the Format String, and now the Map is broken with the error below.

What happened?

QuoteCould not create the view: 34

Quotejava.lang.ArrayIndexOutOfBoundsException: 34
   at org.netxms.client.datacollection.DataFormatter.format(DataFormatter.java:80)
   at org.netxms.client.datacollection.DciValue.format(DciValue.java:110)
   at org.netxms.ui.eclipse.networkmaps.views.helpers.LinkDciValueProvider.getDciDataAsString(LinkDciValueProvider.java:268)
   at org.netxms.ui.eclipse.networkmaps.views.helpers.DCIContainerFigure.<init>(DCIContainerFigure.java:56)
   at org.netxms.ui.eclipse.networkmaps.views.helpers.MapLabelProvider.getFigure(MapLabelProvider.java:292)
   at org.netxms.ui.eclipse.networkmaps.views.helpers.ExtendedGraphViewer.inputChanged(ExtendedGraphViewer.java:280)
   at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:280)
   at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1690)
   at org.netxms.ui.eclipse.networkmaps.views.AbstractNetworkMapView.refreshMap(AbstractNetworkMapView.java:419)
   at org.netxms.ui.eclipse.networkmaps.views.AbstractNetworkMapView.createPartControl(AbstractNetworkMapView.java:390)
   at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:386)
   at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:240)
   at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
   at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2245)
   at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1154)
   at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.java:3934)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
   at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3931)
   at org.netxms.ui.eclipse.networkmaps.NetworkMapOpenHandler.openObject(NetworkMapOpenHandler.java:33)
   at org.netxms.ui.eclipse.objectbrowser.api.ObjectOpenHandlerRegistry.callOpenObjectHandler(ObjectOpenHandlerRegistry.java:58)
   at org.netxms.ui.eclipse.objectbrowser.views.ObjectBrowser$1.openObject(ObjectBrowser.java:229)
   at org.netxms.ui.eclipse.objectbrowser.widgets.ObjectTree.openObject(ObjectTree.java:700)
   at org.netxms.ui.eclipse.objectbrowser.widgets.ObjectTree.access$4(ObjectTree.java:697)
   at org.netxms.ui.eclipse.objectbrowser.widgets.ObjectTree$4.doubleClick(ObjectTree.java:168)
   at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:845)
   at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
   at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
   at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
   at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:843)
   at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1477)
   at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1246)
   at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249)
   at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:246)
   at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:307)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3562)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3186)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
   at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.netxms.ui.eclipse.console.Application.start(Application.java:37)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
   at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
   at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
#7
Hello,

This is my first post, so I hope I am clear.

I having problems with formatting the DCI Containers on a network map. Running NetXMS 2.2.10 on Ubuntu.

I am reading these:
It seems that most common formatters would include:
    %s - insert a string
    %d - insert a signed integer (decimal)
    %f - insert a real number, standard notation

And we can see from the documentation:

QuoteFor each Data Source can be configured: Data collection item, name, format string(like "Text: %.4f"), in case of table DCI also column and instance

So, my problem is that if I select a DCI, the Map displays the integer with 6 decimal places, and I want to reduce that to two. However ANY format string items do not work.

E.g. putting the suggested %.4f returns an <INVALID FORMAT> (%.4f), using %d returns the same. Switching the DCI itself between string and integer makes no difference.

Please can somebody help me understand what I an doing wrong?

Many thanks.

Alex