Fixed class cast exception on particular dashboards. Fixed Android client protocol...
authorEriks Jenkevics <eriks@netxms.org>
Wed, 12 Apr 2017 11:41:33 +0000 (14:41 +0300)
committerEriks Jenkevics <eriks@netxms.org>
Wed, 12 Apr 2017 15:09:01 +0000 (18:09 +0300)
android/src/console/app/src/main/java/org/netxms/ui/android/main/activities/DrawPieChart.java
android/src/console/app/src/main/java/org/netxms/ui/android/main/dashboards/elements/BarChartElement.java
android/src/console/app/src/main/java/org/netxms/ui/android/main/dashboards/elements/PieChartElement.java
android/src/console/app/src/main/java/org/netxms/ui/android/main/dashboards/elements/TablePieChartElement.java
android/src/console/app/src/main/java/org/netxms/ui/android/service/tasks/ConnectTask.java

index 4df31a4..de25e77 100644 (file)
@@ -7,7 +7,7 @@ import org.achartengine.ChartFactory;
 import org.achartengine.GraphicalView;
 import org.achartengine.model.CategorySeries;
 import org.achartengine.renderer.DefaultRenderer;
-import org.achartengine.renderer.SimpleSeriesRenderer;
+import org.achartengine.renderer.XYSeriesRenderer;
 
 
 /**
@@ -38,7 +38,7 @@ public class DrawPieChart extends AbstractComparisonChart
                renderer.setZoomEnabled(false);
                for(int color : colorList)
                {
-                       SimpleSeriesRenderer r = new SimpleSeriesRenderer();
+                       XYSeriesRenderer r = new XYSeriesRenderer();
                        r.setColor(color | 0xFF000000);
                        renderer.addSeriesRenderer(r);
                }
index 36f61ea..af27a67 100644 (file)
@@ -10,8 +10,8 @@ import org.achartengine.chart.BarChart;
 import org.achartengine.chart.BarChart.Type;
 import org.achartengine.model.XYMultipleSeriesDataset;
 import org.achartengine.model.XYSeries;
-import org.achartengine.renderer.SimpleSeriesRenderer;
 import org.achartengine.renderer.XYMultipleSeriesRenderer;
+import org.achartengine.renderer.XYSeriesRenderer;
 import org.netxms.client.datacollection.DciData;
 import org.netxms.ui.android.helpers.Colors;
 import org.netxms.ui.android.main.activities.helpers.ChartDciConfig;
@@ -117,7 +117,7 @@ public class BarChartElement extends AbstractDashboardElement
                ChartDciConfig[] items = config.getDciList();
                for (int i = 0; i < items.length && i < Colors.DEFAULT_ITEM_COLORS.length; i++)
                {
-                       SimpleSeriesRenderer r = new SimpleSeriesRenderer();
+                       XYSeriesRenderer r = new XYSeriesRenderer();
                        int color = items[i].getColorAsInt();
                        if (color == -1)
                                color = Colors.DEFAULT_ITEM_COLORS[i];
index c24372d..d477ac1 100644 (file)
@@ -9,7 +9,7 @@ import org.achartengine.ChartFactory;
 import org.achartengine.GraphicalView;
 import org.achartengine.model.CategorySeries;
 import org.achartengine.renderer.DefaultRenderer;
-import org.achartengine.renderer.SimpleSeriesRenderer;
+import org.achartengine.renderer.XYSeriesRenderer;
 import org.netxms.client.datacollection.DciData;
 import org.netxms.ui.android.helpers.Colors;
 import org.netxms.ui.android.main.activities.helpers.ChartDciConfig;
@@ -100,7 +100,7 @@ public class PieChartElement extends AbstractDashboardElement
                ChartDciConfig[] items = config.getDciList();
                for (int i = 0; i < items.length && i < Colors.DEFAULT_ITEM_COLORS.length; i++)
                {
-                       SimpleSeriesRenderer r = new SimpleSeriesRenderer();
+                       XYSeriesRenderer r = new XYSeriesRenderer();
                        int color = items[i].getColorAsInt();
                        if (color == -1)
                                color = Colors.DEFAULT_ITEM_COLORS[i];
index f9353d7..6015c8d 100644 (file)
@@ -10,7 +10,7 @@ import java.util.concurrent.ScheduledExecutorService;
 import org.achartengine.ChartFactory;
 import org.achartengine.model.CategorySeries;
 import org.achartengine.renderer.DefaultRenderer;
-import org.achartengine.renderer.SimpleSeriesRenderer;
+import org.achartengine.renderer.XYSeriesRenderer;
 import org.netxms.client.Table;
 import org.netxms.ui.android.helpers.Colors;
 import org.netxms.ui.android.main.dashboards.configs.TablePieChartConfig;
@@ -92,7 +92,7 @@ public class TablePieChartElement extends AbstractDashboardElement
 
                for (int i = 0; i < count && i < Colors.DEFAULT_ITEM_COLORS.length; i++)
                {
-                       SimpleSeriesRenderer r = new SimpleSeriesRenderer();
+                       XYSeriesRenderer r = new XYSeriesRenderer();
                        r.setColor(Colors.DEFAULT_ITEM_COLORS[i] | 0xFF000000);
                        renderer.addSeriesRenderer(r);
                }
index ab11c85..c5468eb 100644 (file)
@@ -5,6 +5,7 @@ package org.netxms.ui.android.service.tasks;
 
 import org.netxms.base.NXCommon;
 import org.netxms.client.NXCSession;
+import org.netxms.client.ProtocolVersion;
 import org.netxms.ui.android.R;
 import org.netxms.ui.android.service.ClientConnectorService;
 import org.netxms.ui.android.service.ClientConnectorService.ConnectionStatus;
@@ -106,7 +107,7 @@ public class ConnectTask extends Thread
                                        try
                                        {
                                                Log.d(TAG, "calling session.connect()");
-                                               session.connect();
+                                               session.connect(new int[] { ProtocolVersion.INDEX_FULL });
                                                Log.d(TAG, "calling session.login()");
                                                session.login(login, password);
                                                Log.d(TAG, "calling session.subscribe()");