From ac5fb5e87659e9abe8b60a209139de708582253c Mon Sep 17 00:00:00 2001 From: kamuru Date: Wed, 11 Dec 2013 12:09:19 +0900 Subject: [PATCH] [Title] Modified device chart renderer [Desc.] Modified device chart renderer to draw line right position [Issue] --- .../ui/timeline/chart/DeviceChart.java | 52 +++++++++++----------- .../ui/timeline/chart/DeviceChartRenderer.java | 10 ++--- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChart.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChart.java index e74d536..997ffa5 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChart.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChart.java @@ -41,14 +41,14 @@ public class DeviceChart extends TimelineChart { private DAChartSeries dnetSeries; private DAChartSeries cameraSeries; - private final String[] wifiStates = new String[] { OFF, UNCONNECTED, + public static final String[] WIFI_STATES = new String[] { OFF, UNCONNECTED, CONNECTED, TRANSFER }; - private final String[] bluetoothStates = new String[] { OFF, ON, VISIBLE, + public static final String[] BLUETOOTH_STATES = new String[] { OFF, ON, VISIBLE, EMPTY, TRANSFER }; - private final String[] gpsStates = new String[] { OFF, SEARCHING, CONNECTED }; - private final String[] dnetStates = new String[] { OFF, NORMAL_CONNECTED, + public static final String[] GPS_STATES = new String[] { OFF, SEARCHING, CONNECTED }; + public static final String[] DNET_STATES = new String[] { OFF, NORMAL_CONNECTED, SECURE_CONNECTED, TRANSFER }; - private final String[] cameraStates = new String[] { OFF, OPEN, PREVIEW, + public static final String[] CAMERA_STATES = new String[] { OFF, OPEN, PREVIEW, RECORDING, RECORDING_PAUSE }; public static DeviceChart getInstance() { @@ -114,26 +114,26 @@ public class DeviceChart extends TimelineChart { } private void parseLog(SystemData logData) { -// try { -// double time = logData.getTime() / TimelineConstants.MEGA_DOUBLE; -// int wifi = logData.getWifi(); -// int bluetooth = logData.getBtStatus(); -// int gps = logData.getGpsStatus(); -// int dnet = logData.getDnet(); -// int camera = logData.getCamera(); -// -// wifiSeries.addSeriesItem(new DAChartSeriesItem(time, wifi, -// wifiStates[wifi])); -// bluetoothSeries.addSeriesItem(new DAChartSeriesItem(time, -// bluetooth, bluetoothStates[bluetooth])); -// gpsSeries.addSeriesItem(new DAChartSeriesItem(time, gps, -// gpsStates[gps])); -// dnetSeries.addSeriesItem(new DAChartSeriesItem(time, dnet, -// dnetStates[dnet])); -// cameraSeries.addSeriesItem(new DAChartSeriesItem(time, camera, -// cameraStates[camera])); -// } catch (NumberFormatException ne) { -// ne.printStackTrace(); -// } + try { + double time = logData.getTime() / TimelineConstants.MEGA_DOUBLE; + int wifi = logData.getWifi(); + int bluetooth = logData.getBtStatus(); + int gps = logData.getGpsStatus(); + int dnet = logData.getDnet(); + int camera = logData.getCamera(); + + wifiSeries.addSeriesItem(new DAChartSeriesItem(time, wifi, + WIFI_STATES[wifi])); + bluetoothSeries.addSeriesItem(new DAChartSeriesItem(time, + bluetooth, BLUETOOTH_STATES[bluetooth])); + gpsSeries.addSeriesItem(new DAChartSeriesItem(time, gps, + GPS_STATES[gps])); + dnetSeries.addSeriesItem(new DAChartSeriesItem(time, dnet, + DNET_STATES[dnet])); + cameraSeries.addSeriesItem(new DAChartSeriesItem(time, camera, + CAMERA_STATES[camera])); + } catch (NumberFormatException ne) { + ne.printStackTrace(); + } } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChartRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChartRenderer.java index 8809c13..9026691 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChartRenderer.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/DeviceChartRenderer.java @@ -12,11 +12,11 @@ import org.tizen.dynamicanalyzer.widgets.chart.DAChartSeriesItem; import org.tizen.dynamicanalyzer.widgets.helper.ColorResources; public class DeviceChartRenderer extends DAChartRenderer { - private static final int WIFI_STATE = 4; - private static final int BLUETOOTH_STATE = 4; - private static final int GPS_STATE = 3; - private static final int DNET_STATE = 4; - private static final int CAMERA_STATE = 8; + private static final int WIFI_STATE = DeviceChart.WIFI_STATES.length; + private static final int BLUETOOTH_STATE = DeviceChart.BLUETOOTH_STATES.length; + private static final int GPS_STATE = DeviceChart.GPS_STATES.length; + private static final int DNET_STATE = DeviceChart.DNET_STATES.length; + private static final int CAMERA_STATE = DeviceChart.CAMERA_STATES.length; private static final int[] states = new int[] { WIFI_STATE, BLUETOOTH_STATE, GPS_STATE, DNET_STATE, CAMERA_STATE }; -- 2.7.4