Developing an custom DashboardPart

Post Reply
flp
Posts: 51
Joined: Tue Sep 02, 2014 12:54 am

Developing an custom DashboardPart

Post by flp » Fri Nov 14, 2014 10:03 pm

I also need to develop a custom dashboard.
It's actually nearly done, but I have some problems to receive data.

If the input data is like the following (I just need the first 3 values),
everything is fine. Which means if all the values are integers, there is no problem:

Code: Select all

10,10,-25732,red 1/1 1.half,24,1
But my data is like the following, Odysseus encounters problems:

Code: Select all

10.0,10,-25732,red 1/1 1.half,24,1

Code: Select all

176725 WARN  TupleDataHandler  - Error parsing 10.0 with class de.uniol.inf.is.odysseus.core.datahandler.IntegerHandler For input string: "10.0" - de.uniol.inf.is.odysseus.core.datahandler.TupleDataHandler.readData(TupleDataHandler.java:121) 
My parsing code is the following:

Code: Select all

		if (element != null && element instanceof Tuple<?>) {
			Tuple<?> tuple = (Tuple<?>) element;

			final int x = (int) tuple.getAttribute(1);
			final int y = (int) tuple.getAttribute(2);
			double time = (double) tuple.getAttribute(0);

			PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
				@Override
				public void run() {
					synchronized (lockObject) {
						if (!sidesChanged && time > 30.0) {
							halftimeChange();
							sidesChanged = true;
						}
						if (y >= 0) {
							handleRightHalf(x, y);
						} else {
							handleLeftHalf(x, y);
						}
					}
				}
			});
		}
	}

User avatar
Marco Grawunder
Posts: 272
Joined: Tue Jul 29, 2014 10:29 am
Location: Oldenburg, Germany
Contact:

Re: Developing an custom DashboardPart

Post by Marco Grawunder » Mon Nov 17, 2014 10:31 am

The error is because the schema and the values do not fit. It is an integer value expected but a double delivered.

flp
Posts: 51
Joined: Tue Sep 02, 2014 12:54 am

Re: Developing an custom DashboardPart

Post by flp » Mon Nov 17, 2014 4:41 pm

Can you explain how I set the schema? I didn't find anything in the other code which seemed to be useful

User avatar
ckuka
Posts: 35
Joined: Tue Jul 29, 2014 10:55 am
Location: Shanghai, P.R. China/中国上海
Contact:

Re: Developing an custom DashboardPart

Post by ckuka » Tue Nov 18, 2014 11:50 am

The simplest way is the MAP operator. Just place one near the sink and convert the attribute values using the datatype functions [1]
(Changing the schema in the sink is not a good idea.)

[1] http://odysseus.offis.uni-oldenburg.de: ... +Functions
kind regards / 祝好
Christian Kuka

flp
Posts: 51
Joined: Tue Sep 02, 2014 12:54 am

Re: Developing an custom DashboardPart

Post by flp » Tue Nov 18, 2014 3:28 pm

Ah, I expected java code for that. The problem was the following issue and should be fixed now:

viewtopic.php?f=10&t=81

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest