diff options
author | Minkee Lee <minkee.lee@samsung.com> | 2016-03-08 14:11:26 +0900 |
---|---|---|
committer | Minkee Lee <minkee.lee@samsung.com> | 2016-03-08 14:11:36 +0900 |
commit | 15e039033c9592698a9d37960b14e76f3a29b7be (patch) | |
tree | dc8532c62fbe58c6ce188418406352776af121d0 | |
parent | b39db9f5e8405c0130723c71c759a11b9309c686 (diff) | |
parent | c031e7d6ebbbce8c77f6e88b90f67495c4ea84fe (diff) | |
download | emulator-manager-resources-15e039033c9592698a9d37960b14e76f3a29b7be.tar.gz emulator-manager-resources-15e039033c9592698a9d37960b14e76f3a29b7be.tar.bz2 emulator-manager-resources-15e039033c9592698a9d37960b14e76f3a29b7be.zip |
Merge branch 'tizen_3.0_develop' into tizen_3.0
Conflicts:
package/changelog
package/pkginfo.manifest
plugins/wearable/template/3.0-wearable-circle-i386.xml
plugins/wearable/template/x86-standard-template.xml
Change-Id: I766456996dc0b30734c6cfa6cb16ffac48b3dc5b
Signed-off-by: Minkee Lee <minkee.lee@samsung.com>
54 files changed, 575 insertions, 4515 deletions
@@ -1,8 +1,17 @@ #!/bin/sh -platform_version=3.0 common_libpath=`pwd -P`/lib +if [ -z "$platform_version" ] +then + platform_version=3.0 +fi + +if [ -z "$package_version" ] +then + package_version="" +fi + for d in plugins/*/ ; do - ant -buildfile "$d/build.xml" $1 -Dplatform.version=$platform_version -Dcommon.libpath="$common_libpath" + ant -buildfile "$d/build.xml" $* -Dplatform.version=$platform_version -Dcommon.libpath="$common_libpath" -Dpackage.version=${package_version} done diff --git a/package/build.linux b/package/build.linux index 0b94014..800d140 100755 --- a/package/build.linux +++ b/package/build.linux @@ -1,8 +1,5 @@ #!/bin/sh -xe # clean - -TIZEN_VER=3.0 - clean() { echo "$SRCDIR" @@ -14,16 +11,22 @@ clean() # build build() { + TIZEN_VER=3.0 + cd "$SRCDIR" mkdir "$SRCDIR/lib" - cp "$ROOTDIR/swt_4.4/swt.jar" "$SRCDIR/lib" cp "$ROOTDIR/tools/emulator/bin/emulator-manager.jar" "$SRCDIR/lib" - ./build.sh + + PKG_INFO=$SRCDIR/package/pkginfo.manifest + BINARY_VERSION=`awk -F: '$1 == "Version" {name=$2; print name}' $PKG_INFO` + BINARY_VERSION=`echo ${BINARY_VERSION} | tr -d ' '` + platform_version=${TIZEN_VER} package_version=${BINARY_VERSION} ./build.sh } # install install() { + TIZEN_VER=3.0 PROFILES="mobile wearable tv" for P in $PROFILES; do RESOURCES_DIR=$SRCDIR/package/${P}-${TIZEN_VER}-emulator-manager-resources.package.$TARGET_OS/data/platforms/tizen-${TIZEN_VER}/${P}/emulator-resources @@ -35,9 +38,3 @@ install() mv "$PROFILE_SRCDIR/em-plugin-${P}.jar" "$RESOURCES_DIR/plugins/" done } - -[ "$1" = "clean" ] && clean -[ "$1" = "build" ] && build -[ "$1" = "install" ] && install - -echo "success" diff --git a/package/changelog b/package/changelog index 2512d62..9dd71ed 100644 --- a/package/changelog +++ b/package/changelog @@ -1,16 +1,33 @@ -* 2.4.132 -- add rotary device option. -- rename template file for wearable circle. -== minkee Lee<minkee.lee@samsung.com> 2016-02-19 +* 2.4.133 +- remove legacy UI soruce. +- add rotary option +== minkee Lee<minkee.lee@samsung.com> 2016-03-08 -* 2.4.131 -- copy all template files for wearable. -== minkee Lee<minkee.lee@samsung.com> 2016-02-15 +* 2.4.132 +- add 'force_pat' kernel option. +- add default network option. (x86-standard.xml) +== minkee Lee<minkee.lee@samsung.com> 2016-02-18 * 2.4.130 - add template for wearable profile. == minkee Lee<minkee.lee@samsung.com> 2016-01-27 +* 2.4.131 +- prepare wearable 3.0 (both old and new UI) +== minkee Lee<minkee.lee@samsung.com> 2016-01-28 + +* 2.4.128 +- copy new template file. +== minkee Lee<minkee.lee@samsung.com> 2015-11-30 + +* 2.4.127 +- add and re-arrange some template item for new UI. +== minkee Lee<minkee.lee@samsung.com> 2015-11-27 + +* 2.4.126 +- add template for new UI. +== minkee Lee<minkee.lee@samsung.com> 2015-11-10 + * 2.4.125 - remove net "vhost=on" option. == minkee Lee<minkee.lee@samsung.com> 2015-10-30 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 6f21292..18170ad 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,22 +1,22 @@ Source: emulator-manager-resources -Version: 2.4.132 +Version: 2.4.133 Maintainer: MinKee Lee <minkee.lee@samsung.com>, Jihye Kim <jihye424.kim@samsung.com> Package: mobile-3.0-emulator-manager-resources OS: ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64 Build-host-os: ubuntu-32 -Build-dependency: emulator-common-lib-dev, emulator-manager +Build-dependency: emulator-manager Description: Emulator Manager Platform Resources Package: wearable-3.0-emulator-manager-resources OS: ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64 Build-host-os: ubuntu-32 -Build-dependency: emulator-common-lib-dev, emulator-manager +Build-dependency: emulator-manager Description: Emulator Manager Platform Resources Package: tv-3.0-emulator-manager-resources OS: ubuntu-32, ubuntu-64, windows-32, windows-64, macos-64 Build-host-os: ubuntu-32 -Build-dependency: emulator-common-lib-dev, emulator-manager +Build-dependency: emulator-manager Description: Emulator Manager Platform Resources diff --git a/plugins/mobile/.classpath b/plugins/mobile/.classpath index 3b8e13c..1e4c2b3 100644 --- a/plugins/mobile/.classpath +++ b/plugins/mobile/.classpath @@ -3,6 +3,5 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/EmulatorManager"/> - <classpathentry kind="lib" path="/EmulatorManager/lib/swt.jar" sourcepath="/EmulatorManager/lib/src.zip"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/plugins/mobile/build.xml b/plugins/mobile/build.xml index 569a490..52acad8 100644 --- a/plugins/mobile/build.xml +++ b/plugins/mobile/build.xml @@ -7,13 +7,11 @@ <property name="profile" value="mobile"/> <property name="plugin.file" value="em-plugin-${profile}.jar" /> - <property name="item.factory" value="org.tizen.emulator.manager.${profile}.ui.detail.ItemListFactory" /> <property name="vm.worker" value="org.tizen.emulator.manager.${profile}.vms.VMWorker" /> - <property name="vmbutton.painter" value="org.tizen.emulator.manager.${profile}.ui.widget.VMButtonPainter" /> - <property name="option.factory" value="org.tizen.emulator.manager.${profile}.vms.option.OptionFactory" /> + <property name="option.factory.v2" value="org.tizen.emulator.manager.${profile}.vms.option.OptionFactoryV2" /> <path id="plugin-classpath"> - <fileset dir="${common.libpath}" includes="swt.jar,emulator-manager.jar" /> + <fileset dir="${common.libpath}" includes="emulator-manager.jar" /> </path> <target name="clean"> @@ -43,11 +41,10 @@ <jar jarfile="${plugin.file}" basedir="${build.dir}" duplicate="add"> <manifest> <attribute name="Platform-Version" value="${platform.version}"/> - <attribute name="Platform-Profile" value="${profile}"/> - <attribute name="Item-Factory" value="${item.factory}"/> + <attribute name="Platform-Profile" value="${profile}"/> <attribute name="VM-Worker" value="${vm.worker}" /> - <attribute name="VMButton-Painter" value="${vmbutton.painter}" /> - <attribute name="Option-Factory" value="${option.factory}" /> + <attribute name="Option-Factory-v2" value="${option.factory.v2}" /> + <attribute name="Package-Version" value="${package.version}" /> </manifest> </jar> </target> diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java deleted file mode 100644 index 7d64cc5..0000000 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/detail/ItemListFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JiHye Kim <jihye1128.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.mobile.ui.detail; - -import java.util.List; - -import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory; -import org.tizen.emulator.manager.ui.detail.item.IViewItem; -import org.tizen.emulator.manager.vms.xml.template.ItemList; - -public class ItemListFactory extends CommonItemListFactory { - @Override - public void makeItemList(List<? extends IViewItem> itemList, ItemList template) { - makePropertyItemList(itemList, template.getPropertyList()); - makeDeviceItemList(itemList, template.getDeviceList()); - } -} diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/detail/MItemName.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/detail/MItemName.java deleted file mode 100644 index 736e99b..0000000 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/detail/MItemName.java +++ /dev/null @@ -1,55 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - - -package org.tizen.emulator.manager.mobile.ui.detail; - -import org.tizen.emulator.manager.ui.detail.item.ItemName; - -public class MItemName extends ItemName { - // Jack - public static final String EARJACK = "earjack"; //$NON-NLS-1$ - public static final String USB = "usb"; //$NON-NLS-1$ - public static final String CHARGER = "charger"; //$NON-NLS-1$ - - // Sensor - public static final String ACCEL = "accel"; //$NON-NLS-1$ - public static final String GYRO = "gyro"; //$NON-NLS-1$ - public static final String GEO = "geo"; //$NON-NLS-1$ - public static final String LIGHT = "light"; //$NON-NLS-1$ - public static final String PROXI = "proxi"; //$NON-NLS-1$ - public static final String HAPTIC = "haptic"; //$NON-NLS-1$ - public static final String PRESS = "press"; // pressure //$NON-NLS-1$ - public static final String UV = "uv"; // ultra violet //$NON-NLS-1$ - public static final String HRM = "hrm"; // heartbeat rate meter //$NON-NLS-1$ - - // Device - public static final String NFC = "nfc"; //$NON-NLS-1$ - public static final String BATTERY = "battery"; //$NON-NLS-1$ - public static final String CAMERA = "camera"; //$NON-NLS-1$ -} diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/widget/VMButtonPainter.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/widget/VMButtonPainter.java deleted file mode 100644 index f879c58..0000000 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/ui/widget/VMButtonPainter.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JiHye Kim <jihye1128.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.mobile.ui.widget; - -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Rectangle; -import org.tizen.emulator.manager.resources.FontResources; -import org.tizen.emulator.manager.ui.widgets.CommonVMButtonPainter; -import org.tizen.emulator.manager.ui.widgets.VMButton; -import org.tizen.emulator.manager.ui.widgets.WSTATE; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.VMPropertyValue; - -public class VMButtonPainter extends CommonVMButtonPainter { - - public VMButtonPainter() { - TEXT_X_POINT = 40 + BUTTON_X_OFFSET; - TEXT_Y_POINT = 27 + BUTTON_Y_OFFSET; - TEXT_Y_GAP = 23; - TEXT_RE_X_POINT = 16 + BUTTON_X_OFFSET; - - TITLE_X_OFFSET = 9; - TITLE_Y_OFFSET = 8; - - LAUNCH_BUTTON_LEFT_OFFSET = 13; - LAUNCH_BUTTON_BOTTOM_OFFSET = 13; - } - - @Override - public void drawButtonText(GC gc, Rectangle rect, VMButton button) { - VMProperty property = button.getProperty(); - if (property == null) { - return; - } - - // drawing Title - gc.setForeground(button.getFontColor(button.currentState())); - gc.setFont(FontResources.VM_BUTTON_TITLE_FONT.getFont()); - - gc.setBackground(button.getBackgroundColor(button.currentState())); - gc.drawString(button.getTitle(), button.getTitle_x(), TITLE_Y_OFFSET, true); - - // reset font color - gc.setForeground(button.getFontColor(WSTATE.NORMAL)); - - VMPropertyValue value = property.getPropertyValue(); - String version = value.baseImage.isStandard() ? - property.getImageVersion() : "custom"; - - gc.drawString(version, TEXT_X_POINT, TEXT_Y_POINT + 2, true); - gc.drawString(property.getArch().name(), TEXT_X_POINT, TEXT_Y_POINT + TEXT_Y_GAP + 1, true); - gc.drawString(Integer.toString(value.ramSize), TEXT_X_POINT, TEXT_Y_POINT + TEXT_Y_GAP * 2, true); - gc.drawString(value.resolution.getStrValue(), TEXT_RE_X_POINT, TEXT_Y_POINT + TEXT_Y_GAP * 3, true); - } -} diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/Launcher.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/Launcher.java deleted file mode 100644 index 941e44f..0000000 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/Launcher.java +++ /dev/null @@ -1,856 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * MunKyu Im <munkyu.im@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * JiHye Kim <jihye1128.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.mobile.vms; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.manager.EmulatorManager; -import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; -import org.tizen.emulator.manager.console.RemoteManager; -import org.tizen.emulator.manager.job.CheckGPU; -import org.tizen.emulator.manager.job.CheckVT; -import org.tizen.emulator.manager.logging.EMLogger; -import org.tizen.emulator.manager.mobile.ui.detail.ItemListFactory; -import org.tizen.emulator.manager.resources.FilePathResources; -import org.tizen.emulator.manager.resources.StringResources; -import org.tizen.emulator.manager.tool.PortHelper; -import org.tizen.emulator.manager.tool.SettingInfoFile; -import org.tizen.emulator.manager.tool.TapUtil; -import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory; -import org.tizen.emulator.manager.ui.detail.item.property.NetIPInfoViewItem; -import org.tizen.emulator.manager.ui.detail.item.property.NetProxyViewItem; -import org.tizen.emulator.manager.ui.dialog.IPAddressInputDialog; -import org.tizen.emulator.manager.ui.dialog.MessageDialog; -import org.tizen.emulator.manager.vms.EmulatorVMList; -import org.tizen.emulator.manager.vms.ILauncher; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator; -import org.tizen.emulator.manager.vms.helper.HelperClass; -import org.tizen.emulator.manager.vms.helper.MonitoringEmulator; -import org.tizen.emulator.manager.vms.helper.ProcessResult; -import org.tizen.emulator.manager.vms.helper.VMLauncherException; -import org.tizen.emulator.manager.vms.xml.CpuType; -import org.tizen.emulator.manager.vms.helper.VMWorkerException; -import org.tizen.emulator.manager.vms.xml.OptionType; -import org.tizen.emulator.manager.vms.xml.TouchType; - -public class Launcher implements ILauncher { - private boolean isConsole = false; - private String binPath = null; - private String emulatorPath; - private static Launcher launcher; - - public static final String IFUP_SCRIPT = "emulator-ifup.sh"; //$NON-NLS-1$ - // Option names in vm_config.xml - // Add if need. - public static final String OPT_DEVICE = "device"; //$NON-NLS-1$ - public static final String OPT_NFC = "nfc"; //$NON-NLS-1$ - public static final String OPT_BATTERY = "battery"; //$NON-NLS-1$ - public static final String OPT_CAMERA = "camera"; //$NON-NLS-1$ - public static final String OPT_HWKEY = "hwkey"; //$NON-NLS-1$ - public static final String OPT_SWAP = "swap"; //$NON-NLS-1$ - public static final String OPT_CODEC = "codec"; //$NON-NLS-1$ - - public static final String OPT_JACK = "jack"; //$NON-NLS-1$ - public static final String OPT_EARJACK = "earjack"; //$NON-NLS-1$ - public static final String OPT_USB = "usb"; //$NON-NLS-1$ - public static final String OPT_CHARGER = "charger"; //$NON-NLS-1$ - - public static final String OPT_SENSOR = "sensor"; //$NON-NLS-1$ - public static final String OPT_ACCEL = "accel"; //$NON-NLS-1$ - public static final String OPT_GYRO = "gyro"; //$NON-NLS-1$ - public static final String OPT_GEO = "geo"; //$NON-NLS-1$ - public static final String OPT_LIGHT = "light"; //$NON-NLS-1$ - public static final String OPT_PROXI = "proxi"; //$NON-NLS-1$ - public static final String OPT_HAPTIC = "haptic"; //$NON-NLS-1$ - public static final String OPT_PRESS = "press"; // pressure //$NON-NLS-1$ - public static final String OPT_UV = "uv"; // ultra violet //$NON-NLS-1$ - public static final String OPT_HRM = "hrm"; // heartbeat rate meter //$NON-NLS-1$ - - public static final String OPT_EXPERIMENTAL = ItemListFactory.ITEM_EXPERIMENTAL; - public static final String OPT_QT_ENABLE = "qtEnable"; //$NON-NLS-1$ - - - // Network option. - public static final String OPT_NET_CONNECT_TYPE = CommonItemListFactory.ITEM_NET_CONNECT_TYPE; - public static final String OPT_NET_TAP_DEVICE = CommonItemListFactory.ITEM_NET_TAP_DEVICE; - public static final String OPT_NET_IP_INFO = CommonItemListFactory.ITEM_NET_IP_INFO; - public static final String OPT_NET_IPADDR = NetIPInfoViewItem.ITEM_IP; - public static final String OPT_NET_SUBNET = NetIPInfoViewItem.ITEM_SUBNET; - public static final String OPT_NET_GATEWAY = NetIPInfoViewItem.ITEM_GATEWAY; - public static final String OPT_NET_DNS = CommonItemListFactory.ITEM_NET_DNS; - public static final String OPT_NET_MAC = CommonItemListFactory.ITEM_NET_MAC; - public static final String OPT_NET_PROXY = CommonItemListFactory.ITEM_NET_PROXY; - public static final String OPT_NET_DHCP = NetIPInfoViewItem.ITEM_USE_DHCP; - - public static Launcher getInstance() { - if (launcher == null) { - launcher = new Launcher(); - } - return launcher; - } - - private Launcher() { - isConsole = EmulatorManager.isConsoleMode(); - } - - @Override - public List<String> getLaunchCommand(VMProperty property, String path) throws VMLauncherException { - String binary; - String hwVirtualization = null; - int portNo; - boolean useBridgeNet = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_CONNECT_TYPE).equals("Bridge") && //$NON-NLS-1$ - (EmulatorManager.isLinux() || EmulatorManager.isWin() || EmulatorManager.isMac()); - String tapName = null; - if (useBridgeNet) { - if (EmulatorManager.isWin()) { - tapName = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_TAP_DEVICE); - if (TapUtil.nameNotExist(tapName)) - throw new VMLauncherException((new StringBuilder()) - .append("Tap device is not exist : ").append(tapName) //$NON-NLS-1$ - .append("\nCheck VM's tap configuration.").toString()); //$NON-NLS-1$ - if (isTapUsing(tapName)) - throw new VMLauncherException( - (new StringBuilder()) - .append("Tap device(") //$NON-NLS-1$ - .append(tapName) - .append(") is being used by other VM.") //$NON-NLS-1$ - .append("\nPlease select another tap device for current VM.") //$NON-NLS-1$ - .toString()); - String ipAddr = property.getPropertyValue() - .getAdvancedOptionSubValue(OPT_NET_IP_INFO, "ipAddr"); //$NON-NLS-1$ - if (isIpAddrUsing(ipAddr)) - throw new VMLauncherException((new StringBuilder()) - .append("VM's ip address(").append(ipAddr) //$NON-NLS-1$ - .append(") is being used by other VM.") //$NON-NLS-1$ - .append("\nPlease modify current VM's ip address.") //$NON-NLS-1$ - .toString()); - } - if (EmulatorManager.isWin()) { - try { - if (!TapUtil.isTapInBridge(tapName)) { - MessageDialog dialog = new MessageDialog(); - int res = dialog - .openWarningAndSelectionDialog("\nTap device is not connected with Bridge." //$NON-NLS-1$ - + "\nGuest network would work as NAT." //$NON-NLS-1$ - + "\nKeep launching ?"); //$NON-NLS-1$ - if (res != SWT.OK) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - } - useBridgeNet = false; - } - - } catch (VMWorkerException e) { - throw new VMLauncherException(e.getMessage()); - } - } - } - /* check available port number */ - portNo = new PortHelper().getPortNo(); - if(portNo == -1) { - String error = "Can not execute emulator." //$NON-NLS-1$ - + StringResources.NEW_LINE - + "All available ports are in use."; //$NON-NLS-1$ - throw new VMLauncherException(error); - } - - if (property.getArch().toString().equals("x86")) { //$NON-NLS-1$ - if (EmulatorManager.isWin()) { - binary = "emulator-x86.exe"; //$NON-NLS-1$ - } else { - binary = "emulator-x86"; //$NON-NLS-1$ - } - } else { - if (EmulatorManager.isWin()) { - binary = "emulator-arm.exe"; //$NON-NLS-1$ - } else { - binary = "emulator-arm"; //$NON-NLS-1$ - } - } - - // check disk image - File child = new File(property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()); - File base = new File(property.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue()); - if (!child.exists()) { - throw new VMLauncherException("Child disk image does not exist." //$NON-NLS-1$ - + StringResources.NEW_LINE + child.getAbsolutePath() - , true); - } - if (!base.exists()) { - throw new VMLauncherException("Base disk image does not exist." //$NON-NLS-1$ - + StringResources.NEW_LINE + base.getAbsolutePath() - , true); - } - - if (property.getConfiguration().getUsability().isHwVirtualization() && CheckVT.isVTSupported()) { - hwVirtualization = CheckVT.getVTEnablingCommand(); - } - - List<String> cmd = new ArrayList<String>(); - int width = property.getConfiguration().getDevice().getDisplay().getResolution().getWidth(); - int height = property.getConfiguration().getDevice().getDisplay().getResolution().getHeight(); - String skinPath = null; - if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) { - skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath(); - if (skinPath != null && skinPath.isEmpty()) { - skinPath = null; - } - } - String fileshare = property.getConfiguration().getUsability().getFileSharing().getPath(); - //String osVersion = System.getProperty("os.version"); - boolean isFileshare = true; - if (fileshare == null) { - isFileshare = false; - } - - /* get MAC address of host set as guest MAC address */ - String macAddr = useBridgeNet ? property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_MAC) : SettingInfoFile - .getMACaddr(); - - if(macAddr.isEmpty()) { - macAddr = "52:54:00:12:34:56"; //$NON-NLS-1$ - EMLogger.getLogger().log(Level.INFO, String.format("MAC set as default = %s", macAddr)); //$NON-NLS-1$ - } - - emulatorPath = property.getPropertyValue().baseImage.getPlatform().getEmulatorPath(); - if (path == null || path.isEmpty()) { - cmd.add(FilePathResources.getEmulatorBinPath(emulatorPath) + File.separator + binary); - } else { - this.binPath = path; - cmd.add(binPath + File.separator + binary); - } - - cmd.add("--skin-args"); //$NON-NLS-1$ - cmd.add("width=" + width); //$NON-NLS-1$ - cmd.add("height=" + height); //$NON-NLS-1$ - if (skinPath != null) { - cmd.add("skin.path=" + skinPath); //$NON-NLS-1$ - } - - if (RemoteManager.getSpiceMode()) { - cmd.add("hb.ignore=true"); //$NON-NLS-1$ - } - - cmd.add("--qemu-args"); //$NON-NLS-1$ - - // x86 part of cmd - if (property.getArch().toString().equals("x86")) { //$NON-NLS-1$ - cmd.add("-drive"); //$NON-NLS-1$ - cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()+ ",if=virtio,index=1"); //$NON-NLS-1$ //$NON-NLS-2$ - cmd.add( "-boot"); //$NON-NLS-1$ - cmd.add("c"); //$NON-NLS-1$ - cmd.add("-append"); //$NON-NLS-1$ - String kernelOption = "console=ttyS0 video=LVDS-1:" //$NON-NLS-1$ - + width - + "x" //$NON-NLS-1$ - + height - + "-32@60" //$NON-NLS-1$ - + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 //$NON-NLS-1$ - + getIP(useBridgeNet, property) - + " vm_name=" + property.getConfiguration().getBaseInformation().getName(); //$NON-NLS-1$ - String hostIp = "10.0.2.2"; //$NON-NLS-1$ - if (useBridgeNet) { - String bridgeIp = TapUtil.getBridgeIpAddr(property - .getPropertyValue().getAdvancedOptionValue( - OPT_NET_TAP_DEVICE)); - if (bridgeIp == null) { - MessageDialog dialog = new MessageDialog(); - int res = dialog.openInfoDialog( - "\nCannot find host(bridge) IP address." //$NON-NLS-1$ - + "\nTo use bridge network, host IP is required." //$NON-NLS-1$ - + "\nPlease input manually."); //$NON-NLS-1$ - if (res != SWT.OK) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - } - - // Input host IP address. - String ip = IPAddressInputDialog.open("Input host's IP address"); //$NON-NLS-1$ - if (ip == null) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - - } else { - hostIp = ip; - } - - } else { - hostIp = bridgeIp; - } - } - kernelOption += " host_ip=" + hostIp; //$NON-NLS-1$ - - // Set proxy. - String proxyConfig = null; - String proxyMode = property.getPropertyValue(). - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_PROXY_MODE); - if (proxyMode.equals(NetProxyViewItem.MODE_AUTO)) { - proxyConfig = getHostProxy(); - - } else if (proxyMode.equals(NetProxyViewItem.MODE_MANUAL)) { - proxyConfig = "http_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_HTTP_PROXY) - + " https_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_HTTPS_PROXY) - + " ftp_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_FTP_PROXY) - + " socks_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_SOCKS_PROXY); - } - - if (proxyConfig != null) { - kernelOption += (" " + proxyConfig); //$NON-NLS-1$ - } - - /* set virtio-9p string in case of using directory share [kernel option] */ - if(isFileshare) { - kernelOption += " virtio-9p"; //$NON-NLS-1$ - } - - /* - if(property.getPropertyValue().skin != null && property.getPropertyValue().skin.getButtonType() == SKIN_BUTTON_TYPE.THREE_BUTTON_TYPE) { - kernelOption += " platform_feature=3btn"; - } else { - kernelOption += " platform_feature=1btn"; - } - */ - - cmd.add(kernelOption); - - /* use fileshare [non-kernel option] */ - if(isFileshare) { - cmd.add("-virtfs"); //$NON-NLS-1$ - cmd.add("local,path=" + property.getConfiguration().getUsability().getFileSharing().getPath() +",security_model=none,mount_tag=fileshare"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - cmd.add("-serial"); //$NON-NLS-1$ - cmd.add("file:" + FilePathResources.getTizenVmsPath() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CpuType cpuOption = property.getConfiguration().getDevice().getCPU(); - if (cpuOption != null) { - cmd.add("-smp"); //$NON-NLS-1$ - cmd.add(String.valueOf(cpuOption.getValue().getValue())); - } - cmd.add("-m"); //$NON-NLS-1$ - cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue())); - cmd.add("-M"); //$NON-NLS-1$ - cmd.add("maru-x86-machine"); //$NON-NLS-1$ - cmd.add("-net"); //$NON-NLS-1$ - cmd.add("nic,model=virtio,macaddr=" + macAddr); //$NON-NLS-1$ - cmd.add("-soundhw"); //$NON-NLS-1$ - cmd.add("all"); //$NON-NLS-1$ - cmd.add("-usb"); //$NON-NLS-1$ - cmd.add("-vga"); //$NON-NLS-1$ - cmd.add("none"); //$NON-NLS-1$ - cmd.add("-enable-vigs"); //$NON-NLS-1$ - cmd.add("-L"); //$NON-NLS-1$ - cmd.add(FilePathResources.getEmulatorBiosPath(emulatorPath)); - cmd.add("-kernel"); //$NON-NLS-1$ - cmd.add(FilePathResources.getEmulatorKernelPath(emulatorPath) + File.separator+ "bzImage." + property.getArch().toString()); //$NON-NLS-1$ - cmd.add("-net"); //$NON-NLS-1$ - if (useBridgeNet) { - if (EmulatorManager.isWin()) { - tapName = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_TAP_DEVICE); - if (TapUtil.nameNotExist(tapName)) { - throw new VMLauncherException("Tap device is not exist : " //$NON-NLS-1$ - + tapName + "\nCheck VM's tap configuration."); //$NON-NLS-1$ - } - cmd.add("tap,ifname=" + tapName + ",script=no,downscript=no"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - cmd.add("tap,script=/etc/" + IFUP_SCRIPT +",downscript=no"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } else { - cmd.add("user,dhcpstart=10.0.2.16"); //$NON-NLS-1$ - } - - cmd.add("-rtc"); //$NON-NLS-1$ - cmd.add("base=utc"); //$NON-NLS-1$ - if (property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage() != null - && checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_SWAP))) { - cmd.add("-drive"); //$NON-NLS-1$ - cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage().getValue() + ",if=virtio,index=2"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /* append HW virtualization option if supports */ - if (hwVirtualization != null) { - cmd.add(hwVirtualization); - } - - // add hw gl acceleration - if (property.getConfiguration().getUsability().isHwGLAcceleration() - && CheckGPU.isGPUSupported()) { -// cmd.add(CheckVirtualization.getInstance().getGPU_enable_command()); - cmd.add("-vigs-backend"); //$NON-NLS-1$ - cmd.add("gl"); //$NON-NLS-1$ - cmd.add("-enable-yagl"); //$NON-NLS-1$ - cmd.add("-yagl-backend"); //$NON-NLS-1$ - cmd.add("vigs"); //$NON-NLS-1$ - } else { - cmd.add("-vigs-backend"); //$NON-NLS-1$ - cmd.add("sw"); //$NON-NLS-1$ - } - - // for suspend - if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE - && property.getConfiguration().getUsability().isSupportSuspend()) { - cmd.add("-enable-suspend"); //$NON-NLS-1$ - } - - // for bootup status - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-esm-pci"); //$NON-NLS-1$ - - // for host keyboard - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-keyboard-pci"); //$NON-NLS-1$ - - // for ecp - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-evdi-pci,profile=" + property.getPropertyValue().baseImage.getProfile()); //$NON-NLS-1$ - - // for brightness - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("maru-brightness"); //$NON-NLS-1$ - - // for vmodem - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-vmodem-pci"); //$NON-NLS-1$ - - // for hardware key - if (checkOnOff(property.getPropertyValue().getAdvancedOptionValue(OPT_HWKEY))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-hwkey-pci"); //$NON-NLS-1$ - } - - // for codec - if (checkOnOff(property.getPropertyValue().getAdvancedOptionValue(OPT_CODEC))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("codec-pci"); //$NON-NLS-1$ - } - - // for nfc - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_NFC))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-nfc-pci"); //$NON-NLS-1$ - } - - // for battery - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-power-pci"); //$NON-NLS-1$ - /*if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_BATTERY))) { - cmd.add("-device"); - cmd.add("virtio-power-pci"); - }*/ - - // for camera - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_CAMERA))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("maru-camera"); //$NON-NLS-1$ - } - - cmd.add("-device"); //$NON-NLS-1$ - TouchType touchType = property.getConfiguration().getDevice().getTouch(); - if (touchType != null) { - cmd.add("virtio-touchscreen-pci,max_point=" + touchType.getMaxTouchPoint()); //$NON-NLS-1$ - } else { - cmd.add("virtio-touchscreen-pci"); //$NON-NLS-1$ - } - - // for sensor (accel, geo, gyro, light, proxi, haptic, pressure, ultra violet, heart rate meter) - OptionType sensor = property.getPropertyValue().getAdvancedOption(OPT_SENSOR); - if (sensor != null) { - cmd.add("-device"); //$NON-NLS-1$ - - StringBuilder sb = new StringBuilder(); - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_ACCEL))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("accel"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_GEO))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("geo"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_GYRO))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("gyro"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_LIGHT))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("light"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_PROXI))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("proxi"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_HAPTIC))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("haptic"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_PRESS))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("press"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_UV))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("uv"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_HRM))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("hrm"); //$NON-NLS-1$ - } - - if (sb.toString().isEmpty()) { - cmd.add("virtio-sensor-pci"); //$NON-NLS-1$ - } else { - sb.insert(0, "virtio-sensor-pci,sensors="); //$NON-NLS-1$ - cmd.add(sb.toString()); - } - } - - // for jacks (enabled charger, earjack and usb) - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-jack-pci,jacks=earjack&charger&usb"); //$NON-NLS-1$ - /* OptionType jacks = property.getPropertyValue().getAdvancedOption(OPT_JACK); - if (jacks != null) { - cmd.add("-device"); - - StringBuilder sb = new StringBuilder(); - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_EARJACK))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("earjack"); - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_CHARGER))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("charger"); - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_USB))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("usb"); - } - - if (sb.toString().isEmpty()) { - cmd.add("virtio-jack-pci"); - } else { - sb.insert(0, "virtio-jack-pci,jacks="); - cmd.add(sb.toString()); - } - } */ - } - - /* append user added options if exists */ - String advancedOptions = property.getConfiguration().getUsability().getAdvancedOptions(); - if (advancedOptions != null) { - String[] arrOptions = advancedOptions.split(" "); //$NON-NLS-1$ - for (String option : arrOptions) { - cmd.add(option); - } - } - - /* spice options */ - if (RemoteManager.getSpiceMode() - || CheckingRunningEmulator.isRemote(property)) { - cmd.add("-spice"); //$NON-NLS-1$ - cmd.add("disable-ticketing"); //$NON-NLS-1$ - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0"); //$NON-NLS-1$ - cmd.add("-chardev"); //$NON-NLS-1$ - cmd.add("spicevmc,id=vdagent,name=vdagent"); //$NON-NLS-1$ - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0"); //$NON-NLS-1$ - } - - //for qt enable - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( - OPT_EXPERIMENTAL, OPT_QT_ENABLE))) { - if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE) { - cmd.add("-display"); //$NON-NLS-1$ - if (EmulatorManager.isMac()) { - cmd.add("maru_qt,rendering=offscreen"); //$NON-NLS-1$ - } else { - cmd.add("maru_qt,rendering=onscreen"); //$NON-NLS-1$ - } - } - } - - EMLogger.getLogger().log(Level.INFO, "Starting Emulator Command : "); //$NON-NLS-1$ - String temp = cmd.get(0) + " "; //$NON-NLS-1$ - for (String s : cmd.subList(1, cmd.size())) { - temp += ("\"" + s + "\" "); //$NON-NLS-1$ //$NON-NLS-2$ - } - EMLogger.getLogger().log(Level.INFO, temp); - System.out.println("cmd : " + cmd); //$NON-NLS-1$ - return cmd; - } - - @Override - public boolean launch(VMProperty property) throws VMLauncherException { - return launch(property, false); - } - - @Override - public boolean launch(VMProperty property, boolean wait) throws VMLauncherException { - List<String> cmd; - - cmd = getLaunchCommand(property, null); - - if (cmd == null) { - return false; - } - - CheckingRunningEmulator.addEmulator(property); - MonitoringEmulator monitor = new MonitoringEmulator(property); - Process process = launch(cmd); - if (process != null) { - monitor.setProcess(process); - monitor.start(); - if (wait) { - try { - monitor.join(); - } catch (InterruptedException e) { - EMLogger.getLogger().warning(e.getMessage()); - } - if (monitor.isSuccess()) { - return true; - } else { - return false; - } - } - return true; - } else { - CheckingRunningEmulator.removeEmulator(property, false); - monitor.interrupt(); - return false; - } - } - - @Override - public Process launch(List<String> cmd) { - ProcessBuilder pb = new ProcessBuilder(cmd); - Map<String, String> env = pb.environment(); - if (EmulatorManager.isLinux()) { - String value = env.get("LD_LIBRARY_PATH"); //$NON-NLS-1$ - env.put("LD_LIBRARY_PATH", ((value == null) ? "" : value + ":") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + FilePathResources.getEmulatorBinPath(emulatorPath) + ":" + FilePathResources.getEmulatorCheckToolPath() + File.separator + "lib:"); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "LD_LIBRARY_PATH=" + env.get("LD_LIBRARY_PATH")); //$NON-NLS-1$ //$NON-NLS-2$ - } - env.put("GL_VERSION", "2"); //$NON-NLS-1$ //$NON-NLS-2$ - env.put("VIGS_SYNC_READ_PIXELS", "1"); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "GL_VERSION: " + env.get("GL_VERSION")); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "VIGS_SYNC_READ_PIXELS: " + env.get("VIGS_SYNC_READ_PIXELS")); //$NON-NLS-1$ //$NON-NLS-2$ - - if (this.binPath == null || this.binPath.isEmpty()) { - pb.directory(new File(FilePathResources.getEmulatorBinPath(emulatorPath))); - } else { - pb.directory(new File(this.binPath)); - } - - Process process = null; - try { - process = pb.start(); - } catch (IOException e) { - if (!isConsole) { - MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); - msg.openWarningDialog("Failed to launch" + StringResources.NEW_LINE + e.getMessage()); //$NON-NLS-1$ - } - EMLogger.getLogger().log(Level.WARNING, "Failed to launch." + StringResources.NEW_LINE + e.getMessage()); //$NON-NLS-1$ - } - - return process; - } - - - private boolean checkOnOff(String value) { - if (value.toLowerCase().equals("on")) { //$NON-NLS-1$ - return true; - } else if (value.toLowerCase().equals("off")) { //$NON-NLS-1$ - return false; - } else if (value.isEmpty()){ - return true; - } else { - return false; - } - } - - private boolean checkOn(String value) { - if (value.toLowerCase().equals("on")) { //$NON-NLS-1$ - return true; - } - return false; - } - - - @Override - public void sendRemoteLog(String msg) { - EMLogger.getLogger().info("Launcher log : " + msg); //$NON-NLS-1$ - } - - private static boolean isTapUsing(String tapName) { - boolean isUsing = false; -// VMProperty arr[] = (VMProperty[]) EmulatorVMList.getInstance() -// .getProperties(); -// int len$ = arr$.length; -// for (int i$ = 0; i$ < len$; i$++) { - for (VMProperty prop : EmulatorVMList.getInstance().getProperties()) { - if (!prop.isRunning()) { - continue; - } - String name = prop.getPropertyValue().getAdvancedOptionValue( - OPT_NET_TAP_DEVICE); - if (tapName.equals(name)) { - isUsing = true; - break; - } - } - - return isUsing; - } - - private static boolean isIpAddrUsing(String ipAddr) { - boolean isUsing = false; - - for (VMProperty prop : EmulatorVMList.getInstance().getProperties()) { - if (!prop.isRunning()) { - continue; - } - String ip = prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, "ipAddr"); //$NON-NLS-1$ - if (!ipAddr.equals(ip)) { - continue; - } - isUsing = true; - break; - } - - return isUsing; - } - - private String getIP(boolean useBridgeNet, VMProperty prop) { - StringBuilder sb = new StringBuilder(); - sb.append(" ip="); //$NON-NLS-1$ - if (useBridgeNet) { - String useDHCP = prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_DHCP); - if (checkOn(useDHCP)) { - return ""; //$NON-NLS-1$ - } - - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_IPADDR)); - sb.append("::"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_GATEWAY)); - sb.append(":"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_SUBNET)); - sb.append("::eth0:none:"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionValue( - OPT_NET_DNS)); - - } else { // NAT (default) - //sb.append("10.0.2.16::10.0.2.2:255.255.255.0::eth0:none:10.0.2.3"); - return ""; //$NON-NLS-1$ - } - return sb.toString(); - } - - private String getHostProxy() throws VMLauncherException{ - String result = null; - String proxyCommand = "check-net"; //$NON-NLS-1$ - if (EmulatorManager.isWin()) { - proxyCommand = "check-net.exe"; //$NON-NLS-1$ - } - - List<String> cmd = Arrays.asList(FilePathResources.getEmulatorCheckToolPath() + File.separator + proxyCommand, "--proxy"); //$NON-NLS-1$ - ProcessResult res = HelperClass.runProcess(cmd); - boolean isCommandSuccess = false; - if (res.isSuccess()) { - for (String str : res.getStdOutMsg()) { - if (str.startsWith("MODE:")) { //$NON-NLS-1$ - isCommandSuccess = true; - } - if (str.startsWith("http_proxy")) { //$NON-NLS-1$ - result = str; - } - } - - } else if (!res.isSuccess() || !isCommandSuccess) { - EMLogger.getLogger().warning(res.getResultMessage()); - int dialogRes = new MessageDialog().openWarningAndSelectionDialog - ("Failed to get host proxy setting." //$NON-NLS-1$ - + "\n" + res.getResultMessage() //$NON-NLS-1$ - + "\nContinue launching anyway ?"); //$NON-NLS-1$ - if (dialogRes != SWT.OK) { - throw new VMLauncherException("User canceled launching VM."); //$NON-NLS-1$ - } - } - - if (result == null) { - EMLogger.getLogger().warning("Can't find host proxy setting."); //$NON-NLS-1$ - EMLogger.getLogger().warning("check-net result : " + res.getResultMessage()); //$NON-NLS-1$ - } - - return result; - } -} diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/VMWorker.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/VMWorker.java index eb22261..9a02d06 100644 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/VMWorker.java +++ b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/VMWorker.java @@ -39,9 +39,4 @@ public class VMWorker extends VMWorkerCommon { EMLogger.getLogger().info("Launcher log : " + msg); //$NON-NLS-1$ } - @Override - public void initLauncher() { - setLauncher(Launcher.getInstance()); - } - } diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MDefaultOption.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MDefaultOption.java index 4be79dd..b4dfb98 100644 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MDefaultOption.java +++ b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MDefaultOption.java @@ -29,7 +29,6 @@ package org.tizen.emulator.manager.mobile.vms.option; import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.helper.VMLauncherException; import org.tizen.emulator.manager.vms.option.LaunchConfig; import org.tizen.emulator.manager.vms.option.OPTION_KEY; import org.tizen.emulator.manager.vms.option.Option; @@ -37,8 +36,7 @@ import org.tizen.emulator.manager.vms.option.Option; public class MDefaultOption extends Option { @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) - throws VMLauncherException { + public void getLaunchArgument(LaunchConfig config, VMProperty property) { config.addQemuOption("-device AC97"); //$NON-NLS-1$ config.addQemuOption("-device virtio-maru-esm-pci"); //$NON-NLS-1$ diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MDeviceOption.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MDeviceOption.java deleted file mode 100644 index 73f4fc0..0000000 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MDeviceOption.java +++ /dev/null @@ -1,59 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.mobile.vms.option; - -import org.tizen.emulator.manager.mobile.ui.detail.MItemName; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.Option; - -public class MDeviceOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - // for nfc - if (checkOn(property.getPropertyValue().getAdvancedOptionSubValue( - MItemName.DEVICE, MItemName.NFC))) { - config.addQemuOption("-device", "virtio-maru-nfc-pci"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // for battery -// if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( -// MItemName.DEVICE, MItemName.BATTERY))) { -// config.addQemuOption("-device", "virtio-power-pci"); -// } - - // for camera -// if (checkOn(property.getPropertyValue().getAdvancedOptionSubValue( -// MItemName.DEVICE, MItemName.CAMERA))) { -// config.addQemuOption("-device", "maru-camera"); -// } - } - -} diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MJackOption.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MJackOption.java deleted file mode 100644 index 9406697..0000000 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MJackOption.java +++ /dev/null @@ -1,77 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.mobile.vms.option; - -import org.tizen.emulator.manager.mobile.ui.detail.MItemName; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.OPTION_KEY; -import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.OptionType; - -public class MJackOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - OptionType jacks = property.getPropertyValue().getAdvancedOption( - MItemName.JACK); - StringBuilder sb = new StringBuilder(); - if (jacks != null) { - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.JACK, - MItemName.EARJACK))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("earjack"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.JACK, - MItemName.CHARGER))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("charger"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.JACK, MItemName.USB))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("usb"); //$NON-NLS-1$ - } - } - - // TODO duplicated in MDefaultOption.java - config.addVariable(OPTION_KEY.VAR_JACKS, sb.toString()); - config.addQemuOption("-device", "virtio-jack-pci,jacks=" //$NON-NLS-1$ //$NON-NLS-2$ - + varForm(OPTION_KEY.VAR_JACKS)); - } - -} diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MSensorOption.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MSensorOption.java deleted file mode 100644 index 7e780bc..0000000 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MSensorOption.java +++ /dev/null @@ -1,119 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.mobile.vms.option; - -import org.tizen.emulator.manager.mobile.ui.detail.MItemName; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.OPTION_KEY; -import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.OptionType; - -public class MSensorOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - OptionType sensor = property.getPropertyValue().getAdvancedOption( - MItemName.SENSOR); - StringBuilder sb = new StringBuilder(); - if (sensor != null) { - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.ACCEL))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("accel"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.GEO))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("geo"); //$NON-NLS-1$ - } - if (checkOnOff(property - .getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.GYRO))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("gyro"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.LIGHT))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("light"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.PROXI))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("proxi"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.HAPTIC))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("haptic"); //$NON-NLS-1$ - } - if (checkOnOff(property - .getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.UV))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("uv"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.PRESS))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("press"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(MItemName.SENSOR, MItemName.HRM))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("hrm"); //$NON-NLS-1$ - } - } - - config.addVariable(OPTION_KEY.VAR_SENSORS, sb.toString()); - config.addQemuOption("-device", "virtio-maru-sensor-pci,sensors=" //$NON-NLS-1$ //$NON-NLS-2$ - + varForm(OPTION_KEY.VAR_SENSORS)); - - } - -} diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MTouchPointOption.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MTouchPointOption.java index 3a3ffac..def0ab8 100644 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MTouchPointOption.java +++ b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/MTouchPointOption.java @@ -33,17 +33,14 @@ import org.tizen.emulator.manager.vms.VMProperty; import org.tizen.emulator.manager.vms.option.LaunchConfig; import org.tizen.emulator.manager.vms.option.OPTION_KEY; import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.TouchType; public class MTouchPointOption extends Option { @Override public void getLaunchArgument(LaunchConfig config, VMProperty property) { - TouchType touchType = property.getConfiguration().getDevice() - .getTouch(); - if (touchType != null && touchType.getMaxTouchPoint() > 0) { + if (property.getPropertyValue().maxTouchCount > 0) { config.addVariable(OPTION_KEY.VAR_MAX_POINT, - String.valueOf(touchType.getMaxTouchPoint())); + String.valueOf(property.getPropertyValue().maxTouchCount)); config.addQemuOption("-device", "virtio-maru-touchscreen-pci,max_point=" //$NON-NLS-1$ //$NON-NLS-2$ + varForm(OPTION_KEY.VAR_MAX_POINT)); } else { diff --git a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/OptionFactory.java b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/OptionFactoryV2.java index 8ffab58..7064519 100644 --- a/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/OptionFactory.java +++ b/plugins/mobile/src/org/tizen/emulator/manager/mobile/vms/option/OptionFactoryV2.java @@ -1,11 +1,13 @@ -/* Emulator Manager +/* + * Emulator Manager * * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: * Minkee Lee <minkee.lee@samsung.com> + * JiHye Kim <jihye424.kim@samsung.com> * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> + * Sangho Park <sangho.p@samsung.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -31,23 +33,22 @@ package org.tizen.emulator.manager.mobile.vms.option; import java.util.ArrayList; import java.util.List; -import org.tizen.emulator.manager.ui.detail.item.ItemName; +import org.tizen.emulator.manager.template.renewal.VMItem; +import org.tizen.emulator.manager.ui.renewal.item.CommonOptionFactory; import org.tizen.emulator.manager.vms.option.CommonOption; -import org.tizen.emulator.manager.vms.option.CommonOptionFactroy; import org.tizen.emulator.manager.vms.option.DisplayModeOption; +import org.tizen.emulator.manager.vms.option.ForcePatOption; import org.tizen.emulator.manager.vms.option.IOption; import org.tizen.emulator.manager.vms.option.Option; import org.tizen.emulator.manager.vms.option.RemoteOption; -import org.tizen.emulator.manager.vms.xml.template.Item; -import org.tizen.emulator.manager.vms.xml.template.ItemList; -public class OptionFactory extends CommonOptionFactroy { +public class OptionFactoryV2 extends CommonOptionFactory { @Override - public List<IOption> makeOptionList(ItemList itemTemplate) { + public List<IOption> makeOptionList(List<VMItem> itemList) { List<IOption> optionList = new ArrayList<IOption>(); - makeCommonOptionList(optionList, itemTemplate); + makeCommonOptionList(optionList, itemList); // Add other options optionList.add(Option.getInstance(CommonOption.class)); @@ -55,27 +56,14 @@ public class OptionFactory extends CommonOptionFactroy { optionList.add(Option.getInstance(RemoteOption.class)); optionList.add(Option.getInstance(MDefaultOption.class)); optionList.add(Option.getInstance(DisplayModeOption.class)); - + optionList.add(Option.getInstance(ForcePatOption.class)); return optionList; } - @Override - public void addDeviceOption(Item item, List<IOption> optionList) { - String name = item.getName(); - if (name.equals(ItemName.SENSOR)) { - optionList.add(Option.getInstance(MSensorOption.class)); - - } else if (name.equals(ItemName.DEVICE)) { - optionList.add(Option.getInstance(MDeviceOption.class)); - - } else if (name.equals(ItemName.JACK)) { - optionList.add(Option.getInstance(MJackOption.class)); - } else if (name.equals(ItemName.DISPLAY_MODE)) { - return; - - } else { - super.addDeviceOption(item, optionList); - } + @Override + public void addOption(List<IOption> optionList, VMItem item) { + super.addOption(optionList, item); } + } diff --git a/plugins/mobile/template/x86-standard-template-v2.xml b/plugins/mobile/template/x86-standard-template-v2.xml new file mode 100644 index 0000000..73ddfa4 --- /dev/null +++ b/plugins/mobile/template/x86-standard-template-v2.xml @@ -0,0 +1,115 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> + +<!-- This file describes component of VM property UI in Emulator manager. + (VM property UI descriptor) + Each element in this file is matched with an item of vm property UI. --> + +<ItemList xmlns="http://www.tizen.org/em/template" version="2.0"> + <information profile="mobile" version="3.0" image="x86-standard"/> + + <itemGroup name="default"> + <item name="name" title="VM Name" type="textInput"/> + <item name="profile" title="Profile"/> + <item name="baseImage" title="Base Image"/> + <item name="deviceTemplate" title="Device" type="treeRoot"> + <item type="label" name="display" title="Display"> + <item name="resolution" title="Resolution" type="combo" > + <!-- name, width, height, dpi --> + <option name="320" attr="experimental"> ,320,320,316 </option> + <option name="hvga" attr="experimental"> HVGA,320,480,160 </option> + <option name="wvga"> WVGA,480,800,233 </option> + <option name="WSVGA" attr="experimental"> WSVGA,600,1024,207 </option> + <option name="qhd"> qHD,540,960,220 </option> + <option name="hd"> HD,720,1280,306 </option> + <option name="WXGA" attr="experimental"> WXGA,1280,800,300 </option> + <option name="WQXGA" attr="experimental"> WQXGA,2560,1600,301 </option> + <option name="FULLHD" attr="experimental"> FULLHD,1080,1920,314 </option> + </item> + <item name="size" title="Size" type="textInput" /> + <item name="skin" title="Skin" type="combo" /> + </item> + <item name="processors" title="Processors" type="combo" /> + <item name="ramSize" title="Ram" type="combo" > + <option name="useConfig">false</option> + <option name="list">512,768,1024</option> + </item> + <item name="sensor" title="Sensor" type="checkLabel" > + <item name="accel" title="Accelerometer" type="checkbox" /> + <item name="gyro" title="Gyroscope" type="checkbox" /> + <item name="geo" title="Geo-magnetic" type="checkbox" /> + <item name="proxi" title="Proximity" type="checkbox"/> + <item name="light" title="Light" type="checkbox"/> + <item name="haptic" title="Haptic" type="checkbox"/> + <item name="press" title="Pressure" type="checkbox"/> + <item name="uv" title="Ultraviolet" type="checkbox"/> + <item name="hrm" title="Heartbeat Rate" type="checkbox"/> + <option name="numColumn">2</option> + </item> + <item name="connectivity" title="Connectivity" type="checkLabel"> + <item name="nfc" title="NFC" type="checkbox" /> + <option name="numColumn">2</option> + </item> + + </item> + </itemGroup> + + + <itemGroup name="advanced"> + <item name="suspendSupport" title="Suspend" type="toggle" > + <option name="experimental">true</option> + </item> + <item name="fileShare" title="File Sharing" type="file"> + <option name="dialogType">directory</option> + </item> + <item name="camera" title="Camera" type="label" > +<!-- <item type="combo" name="frontType" title="Front"/> --> +<!-- <item type="file" name="frontImage" title="(image)"/> --> + <item type="combo" name="rearType" title="Rear"/> + <item type="file" name="rearImage" title="(image)"/> + </item> + <item name="hwSupport" title="HW Support" type="label" > + <item name="cpu" title="CPU VT" type="toggle" /> + <item name="gpu" title="GPU" type="toggle" /> + </item> + <item name="glVersion" title="OpenGL ES Ver" type="combo"> + <option name="v2.0_v3.0">v2.0 & v3.0</option> + <option name="v1.1_v2.0">v1.1 & v2.0</option> + <option name="supportOS">mac</option> + </item> +<!-- <item type="combo" name="maxTouch" title="Max Touch Point"/> --> + <item name="network" title="Network" type="label"> + <item name="proxy" title="Proxy" type="combo" > + <option name="none">No proxy</option> + <option name="auto">Use host proxy</option> + <option name="manual">Use manual proxy</option> + <option name="defaultValue">auto</option> + </item> + <item name="netConnectType" title="Connect Type" type="combo" > + <option name="list">NAT, Bridge</option> + </item> + <item name="netTapDevice" title="Base Network" type="combo"> + <option name="supportOS">mac,linux</option> + </item> + <item name="netTapDevice" title="Tap Device" type="combo"> + <option name="supportOS">win</option> + </item> + <item name="netIpInfo" title="VM IP info" type="subLabel"> + <item name="useDHCP" title="Use DHCP" type="checkbox" > + <option name="defaultValue">on</option> + </item> + <item name="ipAddr" title="IP Address" type="text" /> + <item name="subnet" title="Subnet" type="text"/> + <item name="gateway" title="Gateway" type="text"/> + </item> + <item name="netDns" type="text" title="DNS" /> + <item name="netMac" type="text" title="MAC" /> + </item> + <item name="viewer" title="Viewer" type="combo" > + <option name="list">Native, Web</option> + <option name="experimental">true</option> + <option name="defaultValue">Native</option> + </item> + </itemGroup> + +</ItemList> + diff --git a/plugins/mobile/template/x86-standard-template.xml b/plugins/mobile/template/x86-standard-template.xml deleted file mode 100644 index e845034..0000000 --- a/plugins/mobile/template/x86-standard-template.xml +++ /dev/null @@ -1,141 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> - -<!-- This file describes component of VM property UI in Emulator manager. - (VM property UI descriptor) - Each element in this file is matched with an item of vm property UI. --> - -<ItemList xmlns="http://www.tizen.org/em/template" profile="mobile" image="x86-standard"> - - <propertyList> - <item type="text" name="vmName" title="Name"/> - <item type="file" name="baseImage" title="Base Image"> - <option name="dialogType">file</option> - </item> - <item type="label" name="display" title="Display"> - <item type="combo" name="resolution" title="Resolution"> - <!-- name, width, height, dpi --> - <option name="experimental"> ,320,320,316 </option> - <option name="experimental"> HVGA,320,480,160 </option> - <option name="wvga"> WVGA,480,800,233 </option> -<!-- <option name="wsvga"> WSVGA,600,1024,207 </option> --> - <option name="experimental"> WSVGA,600,1024,207 </option> - <option name="qhd"> qHD,540,960,220 </option> - <option name="hd"> HD,720,1280,294 </option> - <option name="experimental"> WXGA,1280,800,300 </option> - <option name="experimental"> WQXGA,2560,1600,301 </option> - <option name="experimental"> FULLHD,1080,1920,314 </option> - </item> - <item type="spinner" name="dpi" title="Density"/> - <item type="combo" name="skin" title="Skin"/> - </item> - <item type="combo" name="processors" title="Processors" /> - <item type="combo" name="ramSize" title="RAM Size"> - <option name="list">512,768,1024</option> - </item> - <item type="toggle" name="suspendSupport" title="Suspend"> - <option name="experimental">true</option> - </item> -<!-- <item type="combo" name="maxTouch" title="Max Touch Point"/> --> - <item type="label" name="fileShare" title="File Sharing"> - <item type="toggle" name="share" title="Sharing"/> - <item type="file" name="directory" title="Directory"> - <option name="dialogType">directory</option> - </item> - </item> - <item type="label" name="hwSupport" title="HW Support"> - <item type="toggle" name="cpu" title="CPU VT"/> - <item type="toggle" name="gpu" title="GPU"/> - </item> - <item type="combo" name="glVersion" title="OpenGL ES Ver"> - <option name="v2.0_v3.0">v2.0 & v3.0</option> - <option name="v1.1_v2.0">v1.1 & v2.0</option> - <option name="supportOS">mac</option> - </item> - </propertyList> - -<!-- Followings are drawn as check box in Emulator Manager vm property UI.--> - <deviceList> - <item type="lineLabel" name="advancedOption" title="Advanced Option"/> - <item type="label" name="camera" title="Camera"> -<!-- <item type="combo" name="frontType" title="Front"/> --> -<!-- <item type="file" name="frontImage" title="(image)"/> --> - <item type="combo" name="rearType" title="Rear"/> - <item type="file" name="rearImage" title="(image)"/> - </item> - <item type="checkLabel" name="sensor" title="Sensor"> - <item type="checkbox" name="accel" title="Accelerometer"/> - <item type="checkbox" name="gyro" title="Gyroscope"/> - <item type="checkbox" name="geo" title="Geo-magnetic"/> - <item type="checkbox" name="proxi" title="Proximity"/> - <item type="checkbox" name="light" title="Light"/> - <item type="checkbox" name="haptic" title="Haptic"/> - <item type="checkbox" name="press" title="Pressure"/> - <item type="checkbox" name="uv" title="Ultraviolet"/> - <item type="checkbox" name="hrm" title="Heartbeat Rate"/> - </item> - <item type="checkLabel" name="device" title="Device"> - <item type="checkbox" name="nfc" title="NFC"/> -<!-- <item type="checkbox" name="camera" title="Camera"/> --> -<!-- <item type="checkbox" name="battery" title="Battery"/> --> -<!-- <item type="checkbox" name="swap" title="Swap Image"> --> -<!-- <option name="defaultOnCreate">on</option> --> -<!-- </item> --> -<!-- <item type="checkbox" name="hwkey" title="HW Key"/> --> - </item> -<!-- <item type="checkLabel" name="jack" title="Jack"> --> -<!-- <item type="checkbox" name="earjack" title="Ear Jack"/> --> -<!-- <item type="checkbox" name="charger" title="Charger"/> --> -<!-- <item type="checkbox" name="usb" title="USB"/> --> -<!-- </item> --> - - - <!-- Network configuration --> - <item name="netConfig" type="lineLabel" title="Network Configuration"> - <option name="spreadOnStart">false</option> - </item> - <item name="proxy" type="combo" title="Proxy"> - <option name="none">No proxy</option> - <option name="auto">Use host proxy</option> - <option name="manual">Use manual proxy</option> - <option name="defaultOnCreate">auto</option> - </item> - <item name="netConnectType" type="combo" title="Connect Type"> - <option name="list">NAT, Bridge</option> - </item> - <item name="netTapDevice" type="combo" title="Base Network"> - <option name="supportOS">mac,linux</option> - </item> - <item name="netTapDevice" type="combo" title="Tap Device"> - <option name="supportOS">win</option> - </item> - <item name="netIpInfo" type="label" title="VM IP info"> - <item name="useDHCP" type="checkbox" title="Use DHCP"> - <option name="defaultOnCreate">off</option> - </item> - <item name="ipAddr" type="text" title="IP Address" /> - <item name="subnet" type="text" title="Subnet" /> - <item name="gateway" type="text" title="Gateway" /> - </item> - <item name="netDns" type="text" title="DNS" /> - <item name="netMac" type="text" title="MAC" /> - - - <item type="lineLabel" name="experimental" title="Experimental Options"/> - <item type="label" name="viewer" title="Viewer"> - <item type="combo" name="type" title="Type"> - <option name="list">Native, Web</option> - <option name="defaultOnCreate">Native</option> - </item> - </item> - <item type="checkLabel" name="displayMode" title="Display Mode"> -<!-- <option name="hideLabel">on</option> --> - <item type="checkbox" name="qtEnable" title="Direct Rendering"> - <option name="defaultIfEmpty">on</option> - <option name="defaultOnCreate">on</option> - </item> - </item> - - </deviceList> - -</ItemList> - diff --git a/plugins/mobile/template/x86-standard.xml b/plugins/mobile/template/x86-standard.xml index 116d1b4..3847fd5 100644 --- a/plugins/mobile/template/x86-standard.xml +++ b/plugins/mobile/template/x86-standard.xml @@ -47,5 +47,29 @@ <subOption name="uv" value="on"/> <subOption name="hrm" value="on"/> </option> + <option name="netIpInfo"> + <subOption name="useDHCP" value="off"/> + <subOption name="ipAddr" value=""/> + <subOption name="subnet" value=""/> + <subOption name="gateway" value=""/> + </option> + <option name="connectivity"> + <subOption name="nfc" value="on"/> + </option> + <option name="camera"> + <subOption name="rearType" value="(none)"/> + <subOption name="rearImage" value=""/> + </option> + <option name="proxy"> + <subOption name="proxyMode" value="auto"/> + <subOption name="httpProxy" value=""/> + <subOption name="httpsProxy" value=""/> + <subOption name="ftpProxy" value=""/> + <subOption name="socksProxy" value=""/> + </option> + <option name="netConnectType" value="NAT"/> + <option name="netTapDevice" value=""/> + <option name="netDns" value=""/> + <option name="netMac" value=""/> </advancedOption> </EmulatorConfiguration> diff --git a/plugins/tv/.classpath b/plugins/tv/.classpath index 3b8e13c..1e4c2b3 100644 --- a/plugins/tv/.classpath +++ b/plugins/tv/.classpath @@ -3,6 +3,5 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/EmulatorManager"/> - <classpathentry kind="lib" path="/EmulatorManager/lib/swt.jar" sourcepath="/EmulatorManager/lib/src.zip"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/plugins/tv/build.xml b/plugins/tv/build.xml index 4dfc933..c19a745 100644 --- a/plugins/tv/build.xml +++ b/plugins/tv/build.xml @@ -7,13 +7,11 @@ <property name="profile" value="tv"/> <property name="plugin.file" value="em-plugin-${profile}.jar" /> - <property name="item.factory" value="org.tizen.emulator.manager.${profile}.ui.detail.ItemListFactory" /> <property name="vm.worker" value="org.tizen.emulator.manager.${profile}.vms.VMWorker" /> - <property name="vmbutton.painter" value="org.tizen.emulator.manager.${profile}.ui.widget.VMButtonPainter" /> - <property name="option.factory" value="org.tizen.emulator.manager.${profile}.vms.option.OptionFactory" /> + <property name="option.factory.v2" value="org.tizen.emulator.manager.${profile}.vms.option.OptionFactoryV2" /> <path id="plugin-classpath"> - <fileset dir="${common.libpath}" includes="swt.jar,emulator-manager.jar" /> + <fileset dir="${common.libpath}" includes="emulator-manager.jar" /> </path> <target name="clean"> @@ -43,11 +41,10 @@ <jar jarfile="${plugin.file}" basedir="${build.dir}" duplicate="add"> <manifest> <attribute name="Platform-Version" value="${platform.version}"/> - <attribute name="Platform-Profile" value="${profile}"/> - <attribute name="Item-Factory" value="${item.factory}"/> + <attribute name="Platform-Profile" value="${profile}"/> <attribute name="VM-Worker" value="${vm.worker}" /> - <attribute name="VMButton-Painter" value="${vmbutton.painter}" /> - <attribute name="Option-Factory" value="${option.factory}" /> + <attribute name="Option-Factory-v2" value="${option.factory.v2}" /> + <attribute name="Package-Version" value="${package.version}" /> </manifest> </jar> </target> diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/ui/detail/ItemListFactory.java b/plugins/tv/src/org/tizen/emulator/manager/tv/ui/detail/ItemListFactory.java deleted file mode 100644 index 13d95bc..0000000 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/ui/detail/ItemListFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JiHye Kim <jihye1128.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.tv.ui.detail; - -import java.util.List; - -import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory; -import org.tizen.emulator.manager.ui.detail.item.IViewItem; -import org.tizen.emulator.manager.vms.xml.template.ItemList; - -public class ItemListFactory extends CommonItemListFactory { - @Override - public void makeItemList(List<? extends IViewItem> itemList, ItemList template) { - makePropertyItemList(itemList, template.getPropertyList()); - makeDeviceItemList(itemList, template.getDeviceList()); - } -} diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/ui/detail/TItemName.java b/plugins/tv/src/org/tizen/emulator/manager/tv/ui/detail/TItemName.java deleted file mode 100644 index 7649dbf..0000000 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/ui/detail/TItemName.java +++ /dev/null @@ -1,55 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - - -package org.tizen.emulator.manager.tv.ui.detail; - -import org.tizen.emulator.manager.ui.detail.item.ItemName; - -public class TItemName extends ItemName { - // Jack - public static final String EARJACK = "earjack"; //$NON-NLS-1$ - public static final String USB = "usb"; //$NON-NLS-1$ - public static final String CHARGER = "charger"; //$NON-NLS-1$ - - // Sensor - public static final String ACCEL = "accel"; //$NON-NLS-1$ - public static final String GYRO = "gyro"; //$NON-NLS-1$ - public static final String GEO = "geo"; //$NON-NLS-1$ - public static final String LIGHT = "light"; //$NON-NLS-1$ - public static final String PROXI = "proxi"; //$NON-NLS-1$ - public static final String HAPTIC = "haptic"; //$NON-NLS-1$ - public static final String PRESS = "press"; // pressure //$NON-NLS-1$ - public static final String UV = "uv"; // ultra violet //$NON-NLS-1$ - public static final String HRM = "hrm"; // heartbeat rate meter //$NON-NLS-1$ - - // Device - public static final String NFC = "nfc"; //$NON-NLS-1$ - public static final String BATTERY = "battery"; //$NON-NLS-1$ - public static final String CAMERA = "camera"; //$NON-NLS-1$ -} diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/ui/widget/VMButtonPainter.java b/plugins/tv/src/org/tizen/emulator/manager/tv/ui/widget/VMButtonPainter.java deleted file mode 100644 index 0f8f43e..0000000 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/ui/widget/VMButtonPainter.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JiHye Kim <jihye1128.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.tv.ui.widget; - -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Rectangle; -import org.tizen.emulator.manager.resources.FontResources; -import org.tizen.emulator.manager.ui.widgets.CommonVMButtonPainter; -import org.tizen.emulator.manager.ui.widgets.VMButton; -import org.tizen.emulator.manager.ui.widgets.WSTATE; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.VMPropertyValue; - -public class VMButtonPainter extends CommonVMButtonPainter { - - public VMButtonPainter() { - TEXT_X_POINT = 40 + BUTTON_X_OFFSET + 23; - TEXT_Y_POINT = 27 + BUTTON_Y_OFFSET + 25; - TEXT_Y_GAP = 22; - - TITLE_X_OFFSET = 9; - TITLE_Y_OFFSET = 7; - - LAUNCH_BUTTON_LEFT_OFFSET = 13; - LAUNCH_BUTTON_BOTTOM_OFFSET = 13; - } - - @Override - public void drawButtonText(GC gc, Rectangle rect, VMButton button) { - VMProperty property = button.getProperty(); - if (property == null) { - return; - } - - // drawing Title - gc.setForeground(button.getFontColor(button.currentState())); - gc.setFont(FontResources.VM_BUTTON_TITLE_FONT.getFont()); - - gc.setBackground(button.getBackgroundColor(button.currentState())); - gc.drawString(button.getTitle(), button.getTitle_x(), TITLE_Y_OFFSET, true); - - // reset font color - gc.setForeground(button.getFontColor(WSTATE.NORMAL)); - - VMPropertyValue value = property.getPropertyValue(); - String version = value.baseImage.isStandard() ? - property.getImageVersion() : "custom"; - - gc.drawString(version, TEXT_X_POINT, TEXT_Y_POINT, true); - gc.drawString(property.getArch().name(), TEXT_X_POINT + 72, TEXT_Y_POINT, true); - gc.drawString(Integer.toString(value.ramSize), TEXT_X_POINT, TEXT_Y_POINT + TEXT_Y_GAP, true); - gc.drawString(value.resolution.getStrValue(), TEXT_X_POINT + 52, TEXT_Y_POINT + TEXT_Y_GAP, true); - } -} diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/Launcher.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/Launcher.java deleted file mode 100644 index 2859633..0000000 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/Launcher.java +++ /dev/null @@ -1,856 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * MunKyu Im <munkyu.im@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * JiHye Kim <jihye1128.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.tv.vms; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.manager.EmulatorManager; -import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; -import org.tizen.emulator.manager.console.RemoteManager; -import org.tizen.emulator.manager.job.CheckGPU; -import org.tizen.emulator.manager.job.CheckVT; -import org.tizen.emulator.manager.logging.EMLogger; -import org.tizen.emulator.manager.tv.ui.detail.ItemListFactory; -import org.tizen.emulator.manager.resources.FilePathResources; -import org.tizen.emulator.manager.resources.StringResources; -import org.tizen.emulator.manager.tool.PortHelper; -import org.tizen.emulator.manager.tool.SettingInfoFile; -import org.tizen.emulator.manager.tool.TapUtil; -import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory; -import org.tizen.emulator.manager.ui.detail.item.property.NetIPInfoViewItem; -import org.tizen.emulator.manager.ui.detail.item.property.NetProxyViewItem; -import org.tizen.emulator.manager.ui.dialog.IPAddressInputDialog; -import org.tizen.emulator.manager.ui.dialog.MessageDialog; -import org.tizen.emulator.manager.vms.EmulatorVMList; -import org.tizen.emulator.manager.vms.ILauncher; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator; -import org.tizen.emulator.manager.vms.helper.HelperClass; -import org.tizen.emulator.manager.vms.helper.MonitoringEmulator; -import org.tizen.emulator.manager.vms.helper.ProcessResult; -import org.tizen.emulator.manager.vms.helper.VMLauncherException; -import org.tizen.emulator.manager.vms.xml.CpuType; -import org.tizen.emulator.manager.vms.helper.VMWorkerException; -import org.tizen.emulator.manager.vms.xml.OptionType; -import org.tizen.emulator.manager.vms.xml.TouchType; - -public class Launcher implements ILauncher { - private boolean isConsole = false; - private String binPath = null; - private String emulatorPath; - private static Launcher launcher; - - public static final String IFUP_SCRIPT = "emulator-ifup.sh"; //$NON-NLS-1$ - // Option names in vm_config.xml - // Add if need. - public static final String OPT_DEVICE = "device"; //$NON-NLS-1$ - public static final String OPT_NFC = "nfc"; //$NON-NLS-1$ - public static final String OPT_BATTERY = "battery"; //$NON-NLS-1$ - public static final String OPT_CAMERA = "camera"; //$NON-NLS-1$ - public static final String OPT_HWKEY = "hwkey"; //$NON-NLS-1$ - public static final String OPT_SWAP = "swap"; //$NON-NLS-1$ - public static final String OPT_CODEC = "codec"; //$NON-NLS-1$ - - public static final String OPT_JACK = "jack"; //$NON-NLS-1$ - public static final String OPT_EARJACK = "earjack"; //$NON-NLS-1$ - public static final String OPT_USB = "usb"; //$NON-NLS-1$ - public static final String OPT_CHARGER = "charger"; //$NON-NLS-1$ - - public static final String OPT_SENSOR = "sensor"; //$NON-NLS-1$ - public static final String OPT_ACCEL = "accel"; //$NON-NLS-1$ - public static final String OPT_GYRO = "gyro"; //$NON-NLS-1$ - public static final String OPT_GEO = "geo"; //$NON-NLS-1$ - public static final String OPT_LIGHT = "light"; //$NON-NLS-1$ - public static final String OPT_PROXI = "proxi"; //$NON-NLS-1$ - public static final String OPT_HAPTIC = "haptic"; //$NON-NLS-1$ - public static final String OPT_PRESS = "press"; // pressure //$NON-NLS-1$ - public static final String OPT_UV = "uv"; // ultra violet //$NON-NLS-1$ - public static final String OPT_HRM = "hrm"; // heartbeat rate meter //$NON-NLS-1$ - - public static final String OPT_EXPERIMENTAL = ItemListFactory.ITEM_EXPERIMENTAL; - public static final String OPT_QT_ENABLE = "qtEnable"; //$NON-NLS-1$ - - - // Network option. - public static final String OPT_NET_CONNECT_TYPE = CommonItemListFactory.ITEM_NET_CONNECT_TYPE; - public static final String OPT_NET_TAP_DEVICE = CommonItemListFactory.ITEM_NET_TAP_DEVICE; - public static final String OPT_NET_IP_INFO = CommonItemListFactory.ITEM_NET_IP_INFO; - public static final String OPT_NET_IPADDR = NetIPInfoViewItem.ITEM_IP; - public static final String OPT_NET_SUBNET = NetIPInfoViewItem.ITEM_SUBNET; - public static final String OPT_NET_GATEWAY = NetIPInfoViewItem.ITEM_GATEWAY; - public static final String OPT_NET_DNS = CommonItemListFactory.ITEM_NET_DNS; - public static final String OPT_NET_MAC = CommonItemListFactory.ITEM_NET_MAC; - public static final String OPT_NET_PROXY = CommonItemListFactory.ITEM_NET_PROXY; - public static final String OPT_NET_DHCP = NetIPInfoViewItem.ITEM_USE_DHCP; - - public static Launcher getInstance() { - if (launcher == null) { - launcher = new Launcher(); - } - return launcher; - } - - private Launcher() { - isConsole = EmulatorManager.isConsoleMode(); - } - - @Override - public List<String> getLaunchCommand(VMProperty property, String path) throws VMLauncherException { - String binary; - String hwVirtualization = null; - int portNo; - boolean useBridgeNet = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_CONNECT_TYPE).equals("Bridge") && //$NON-NLS-1$ - (EmulatorManager.isLinux() || EmulatorManager.isWin() || EmulatorManager.isMac()); - String tapName = null; - if (useBridgeNet) { - if (EmulatorManager.isWin()) { - tapName = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_TAP_DEVICE); - if (TapUtil.nameNotExist(tapName)) - throw new VMLauncherException((new StringBuilder()) - .append("Tap device is not exist : ").append(tapName) //$NON-NLS-1$ - .append("\nCheck VM's tap configuration.").toString()); //$NON-NLS-1$ - if (isTapUsing(tapName)) - throw new VMLauncherException( - (new StringBuilder()) - .append("Tap device(") //$NON-NLS-1$ - .append(tapName) - .append(") is being used by other VM.") //$NON-NLS-1$ - .append("\nPlease select another tap device for current VM.") //$NON-NLS-1$ - .toString()); - String ipAddr = property.getPropertyValue() - .getAdvancedOptionSubValue(OPT_NET_IP_INFO, "ipAddr"); //$NON-NLS-1$ - if (isIpAddrUsing(ipAddr)) - throw new VMLauncherException((new StringBuilder()) - .append("VM's ip address(").append(ipAddr) //$NON-NLS-1$ - .append(") is being used by other VM.") //$NON-NLS-1$ - .append("\nPlease modify current VM's ip address.") //$NON-NLS-1$ - .toString()); - } - if (EmulatorManager.isWin()) { - try { - if (!TapUtil.isTapInBridge(tapName)) { - MessageDialog dialog = new MessageDialog(); - int res = dialog - .openWarningAndSelectionDialog("\nTap device is not connected with Bridge." //$NON-NLS-1$ - + "\nGuest network would work as NAT." //$NON-NLS-1$ - + "\nKeep launching ?"); //$NON-NLS-1$ - if (res != SWT.OK) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - } - useBridgeNet = false; - } - - } catch (VMWorkerException e) { - throw new VMLauncherException(e.getMessage()); - } - } - } - /* check available port number */ - portNo = new PortHelper().getPortNo(); - if(portNo == -1) { - String error = "Can not execute emulator." //$NON-NLS-1$ - + StringResources.NEW_LINE - + "All available ports are in use."; //$NON-NLS-1$ - throw new VMLauncherException(error); - } - - if (property.getArch().toString().equals("x86")) { //$NON-NLS-1$ - if (EmulatorManager.isWin()) { - binary = "emulator-x86.exe"; //$NON-NLS-1$ - } else { - binary = "emulator-x86"; //$NON-NLS-1$ - } - } else { - if (EmulatorManager.isWin()) { - binary = "emulator-arm.exe"; //$NON-NLS-1$ - } else { - binary = "emulator-arm"; //$NON-NLS-1$ - } - } - - // check disk image - File child = new File(property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()); - File base = new File(property.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue()); - if (!child.exists()) { - throw new VMLauncherException("Child disk image does not exist." //$NON-NLS-1$ - + StringResources.NEW_LINE + child.getAbsolutePath() - , true); - } - if (!base.exists()) { - throw new VMLauncherException("Base disk image does not exist." //$NON-NLS-1$ - + StringResources.NEW_LINE + base.getAbsolutePath() - , true); - } - - if (property.getConfiguration().getUsability().isHwVirtualization() && CheckVT.isVTSupported()) { - hwVirtualization = CheckVT.getVTEnablingCommand(); - } - - List<String> cmd = new ArrayList<String>(); - int width = property.getConfiguration().getDevice().getDisplay().getResolution().getWidth(); - int height = property.getConfiguration().getDevice().getDisplay().getResolution().getHeight(); - String skinPath = null; - if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) { - skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath(); - if (skinPath != null && skinPath.isEmpty()) { - skinPath = null; - } - } - String fileshare = property.getConfiguration().getUsability().getFileSharing().getPath(); - //String osVersion = System.getProperty("os.version"); - boolean isFileshare = true; - if (fileshare == null) { - isFileshare = false; - } - - /* get MAC address of host set as guest MAC address */ - String macAddr = useBridgeNet ? property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_MAC) : SettingInfoFile - .getMACaddr(); - - if(macAddr.isEmpty()) { - macAddr = "52:54:00:12:34:56"; //$NON-NLS-1$ - EMLogger.getLogger().log(Level.INFO, String.format("MAC set as default = %s", macAddr)); //$NON-NLS-1$ - } - - emulatorPath = property.getPropertyValue().baseImage.getPlatform().getEmulatorPath(); - if (path == null || path.isEmpty()) { - cmd.add(FilePathResources.getEmulatorBinPath(emulatorPath) + File.separator + binary); - } else { - this.binPath = path; - cmd.add(binPath + File.separator + binary); - } - - cmd.add("--skin-args"); //$NON-NLS-1$ - cmd.add("width=" + width); //$NON-NLS-1$ - cmd.add("height=" + height); //$NON-NLS-1$ - if (skinPath != null) { - cmd.add("skin.path=" + skinPath); //$NON-NLS-1$ - } - - if (RemoteManager.getSpiceMode()) { - cmd.add("hb.ignore=true"); //$NON-NLS-1$ - } - - cmd.add("--qemu-args"); //$NON-NLS-1$ - - // x86 part of cmd - if (property.getArch().toString().equals("x86")) { //$NON-NLS-1$ - cmd.add("-drive"); //$NON-NLS-1$ - cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()+ ",if=virtio,index=1"); //$NON-NLS-1$ //$NON-NLS-2$ - cmd.add( "-boot"); //$NON-NLS-1$ - cmd.add("c"); //$NON-NLS-1$ - cmd.add("-append"); //$NON-NLS-1$ - String kernelOption = "console=ttyS0 video=LVDS-1:" //$NON-NLS-1$ - + width - + "x" //$NON-NLS-1$ - + height - + "-32@60" //$NON-NLS-1$ - + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 //$NON-NLS-1$ - + getIP(useBridgeNet, property) - + " vm_name=" + property.getConfiguration().getBaseInformation().getName(); //$NON-NLS-1$ - String hostIp = "10.0.2.2"; //$NON-NLS-1$ - if (useBridgeNet) { - String bridgeIp = TapUtil.getBridgeIpAddr(property - .getPropertyValue().getAdvancedOptionValue( - OPT_NET_TAP_DEVICE)); - if (bridgeIp == null) { - MessageDialog dialog = new MessageDialog(); - int res = dialog.openInfoDialog( - "\nCannot find host(bridge) IP address." //$NON-NLS-1$ - + "\nTo use bridge network, host IP is required." //$NON-NLS-1$ - + "\nPlease input manually."); //$NON-NLS-1$ - if (res != SWT.OK) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - } - - // Input host IP address. - String ip = IPAddressInputDialog.open("Input host's IP address"); //$NON-NLS-1$ - if (ip == null) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - - } else { - hostIp = ip; - } - - } else { - hostIp = bridgeIp; - } - } - kernelOption += " host_ip=" + hostIp; //$NON-NLS-1$ - - // Set proxy. - String proxyConfig = null; - String proxyMode = property.getPropertyValue(). - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_PROXY_MODE); - if (proxyMode.equals(NetProxyViewItem.MODE_AUTO)) { - proxyConfig = getHostProxy(); - - } else if (proxyMode.equals(NetProxyViewItem.MODE_MANUAL)) { - proxyConfig = "http_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_HTTP_PROXY) - + " https_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_HTTPS_PROXY) - + " ftp_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_FTP_PROXY) - + " socks_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_SOCKS_PROXY); - } - - if (proxyConfig != null) { - kernelOption += (" " + proxyConfig); //$NON-NLS-1$ - } - - /* set virtio-9p string in case of using directory share [kernel option] */ - if(isFileshare) { - kernelOption += " virtio-9p"; //$NON-NLS-1$ - } - - /* - if(property.getPropertyValue().skin != null && property.getPropertyValue().skin.getButtonType() == SKIN_BUTTON_TYPE.THREE_BUTTON_TYPE) { - kernelOption += " platform_feature=3btn"; - } else { - kernelOption += " platform_feature=1btn"; - } - */ - - cmd.add(kernelOption); - - /* use fileshare [non-kernel option] */ - if(isFileshare) { - cmd.add("-virtfs"); //$NON-NLS-1$ - cmd.add("local,path=" + property.getConfiguration().getUsability().getFileSharing().getPath() +",security_model=none,mount_tag=fileshare"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - cmd.add("-serial"); //$NON-NLS-1$ - cmd.add("file:" + FilePathResources.getTizenVmsPath() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CpuType cpuOption = property.getConfiguration().getDevice().getCPU(); - if (cpuOption != null) { - cmd.add("-smp"); //$NON-NLS-1$ - cmd.add(String.valueOf(cpuOption.getValue().getValue())); - } - cmd.add("-m"); //$NON-NLS-1$ - cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue())); - cmd.add("-M"); //$NON-NLS-1$ - cmd.add("maru-x86-machine"); //$NON-NLS-1$ - cmd.add("-net"); //$NON-NLS-1$ - cmd.add("nic,model=virtio,macaddr=" + macAddr); //$NON-NLS-1$ - cmd.add("-soundhw"); //$NON-NLS-1$ - cmd.add("all"); //$NON-NLS-1$ - cmd.add("-usb"); //$NON-NLS-1$ - cmd.add("-vga"); //$NON-NLS-1$ - cmd.add("none"); //$NON-NLS-1$ - cmd.add("-enable-vigs"); //$NON-NLS-1$ - cmd.add("-L"); //$NON-NLS-1$ - cmd.add(FilePathResources.getEmulatorBiosPath(emulatorPath)); - cmd.add("-kernel"); //$NON-NLS-1$ - cmd.add(FilePathResources.getEmulatorKernelPath(emulatorPath) + File.separator+ "bzImage." + property.getArch().toString()); //$NON-NLS-1$ - cmd.add("-net"); //$NON-NLS-1$ - if (useBridgeNet) { - if (EmulatorManager.isWin()) { - tapName = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_TAP_DEVICE); - if (TapUtil.nameNotExist(tapName)) { - throw new VMLauncherException("Tap device is not exist : " //$NON-NLS-1$ - + tapName + "\nCheck VM's tap configuration."); //$NON-NLS-1$ - } - cmd.add("tap,ifname=" + tapName + ",script=no,downscript=no"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - cmd.add("tap,script=/etc/" + IFUP_SCRIPT +",downscript=no"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } else { - cmd.add("user,dhcpstart=10.0.2.16"); //$NON-NLS-1$ - } - - cmd.add("-rtc"); //$NON-NLS-1$ - cmd.add("base=utc"); //$NON-NLS-1$ - if (property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage() != null - && checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_SWAP))) { - cmd.add("-drive"); //$NON-NLS-1$ - cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage().getValue() + ",if=virtio,index=2"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /* append HW virtualization option if supports */ - if (hwVirtualization != null) { - cmd.add(hwVirtualization); - } - - // add hw gl acceleration - if (property.getConfiguration().getUsability().isHwGLAcceleration() - && CheckGPU.isGPUSupported()) { -// cmd.add(CheckVirtualization.getInstance().getGPU_enable_command()); - cmd.add("-vigs-backend"); //$NON-NLS-1$ - cmd.add("gl"); //$NON-NLS-1$ - cmd.add("-enable-yagl"); //$NON-NLS-1$ - cmd.add("-yagl-backend"); //$NON-NLS-1$ - cmd.add("vigs"); //$NON-NLS-1$ - } else { - cmd.add("-vigs-backend"); //$NON-NLS-1$ - cmd.add("sw"); //$NON-NLS-1$ - } - - // for suspend - if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE - && property.getConfiguration().getUsability().isSupportSuspend()) { - cmd.add("-enable-suspend"); //$NON-NLS-1$ - } - - // for bootup status - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-esm-pci"); //$NON-NLS-1$ - - // for host keyboard - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-keyboard-pci"); //$NON-NLS-1$ - - // for ecp - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-evdi-pci,profile=" + property.getPropertyValue().baseImage.getProfile()); //$NON-NLS-1$ - - // for brightness - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("maru-brightness"); //$NON-NLS-1$ - - // for vmodem - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-vmodem-pci"); //$NON-NLS-1$ - - // for hardware key - if (checkOnOff(property.getPropertyValue().getAdvancedOptionValue(OPT_HWKEY))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-hwkey-pci"); //$NON-NLS-1$ - } - - // for codec - if (checkOnOff(property.getPropertyValue().getAdvancedOptionValue(OPT_CODEC))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("codec-pci"); //$NON-NLS-1$ - } - - // for nfc - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_NFC))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-nfc-pci"); //$NON-NLS-1$ - } - - // for battery - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-power-pci"); //$NON-NLS-1$ - /*if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_BATTERY))) { - cmd.add("-device"); - cmd.add("virtio-power-pci"); - }*/ - - // for camera - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_CAMERA))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("maru-camera"); //$NON-NLS-1$ - } - - cmd.add("-device"); //$NON-NLS-1$ - TouchType touchType = property.getConfiguration().getDevice().getTouch(); - if (touchType != null) { - cmd.add("virtio-touchscreen-pci,max_point=" + touchType.getMaxTouchPoint()); //$NON-NLS-1$ - } else { - cmd.add("virtio-touchscreen-pci"); //$NON-NLS-1$ - } - - // for sensor (accel, geo, gyro, light, proxi, haptic, pressure, ultra violet, heart rate meter) - OptionType sensor = property.getPropertyValue().getAdvancedOption(OPT_SENSOR); - if (sensor != null) { - cmd.add("-device"); //$NON-NLS-1$ - - StringBuilder sb = new StringBuilder(); - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_ACCEL))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("accel"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_GEO))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("geo"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_GYRO))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("gyro"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_LIGHT))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("light"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_PROXI))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("proxi"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_HAPTIC))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("haptic"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_PRESS))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("press"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_UV))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("uv"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_HRM))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("hrm"); //$NON-NLS-1$ - } - - if (sb.toString().isEmpty()) { - cmd.add("virtio-sensor-pci"); //$NON-NLS-1$ - } else { - sb.insert(0, "virtio-sensor-pci,sensors="); //$NON-NLS-1$ - cmd.add(sb.toString()); - } - } - - // for jacks (enabled charger, earjack and usb) - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-jack-pci,jacks=earjack&charger&usb"); //$NON-NLS-1$ - /* OptionType jacks = property.getPropertyValue().getAdvancedOption(OPT_JACK); - if (jacks != null) { - cmd.add("-device"); - - StringBuilder sb = new StringBuilder(); - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_EARJACK))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("earjack"); - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_CHARGER))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("charger"); - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_USB))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("usb"); - } - - if (sb.toString().isEmpty()) { - cmd.add("virtio-jack-pci"); - } else { - sb.insert(0, "virtio-jack-pci,jacks="); - cmd.add(sb.toString()); - } - } */ - } - - /* append user added options if exists */ - String advancedOptions = property.getConfiguration().getUsability().getAdvancedOptions(); - if (advancedOptions != null) { - String[] arrOptions = advancedOptions.split(" "); //$NON-NLS-1$ - for (String option : arrOptions) { - cmd.add(option); - } - } - - /* spice options */ - if (RemoteManager.getSpiceMode() - || CheckingRunningEmulator.isRemote(property)) { - cmd.add("-spice"); //$NON-NLS-1$ - cmd.add("disable-ticketing"); //$NON-NLS-1$ - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0"); //$NON-NLS-1$ - cmd.add("-chardev"); //$NON-NLS-1$ - cmd.add("spicevmc,id=vdagent,name=vdagent"); //$NON-NLS-1$ - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0"); //$NON-NLS-1$ - } - - //for qt enable - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( - OPT_EXPERIMENTAL, OPT_QT_ENABLE))) { - if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE) { - cmd.add("-display"); //$NON-NLS-1$ - if (EmulatorManager.isMac()) { - cmd.add("maru_qt,rendering=offscreen"); //$NON-NLS-1$ - } else { - cmd.add("maru_qt,rendering=onscreen"); //$NON-NLS-1$ - } - } - } - - EMLogger.getLogger().log(Level.INFO, "Starting Emulator Command : "); //$NON-NLS-1$ - String temp = cmd.get(0) + " "; //$NON-NLS-1$ - for (String s : cmd.subList(1, cmd.size())) { - temp += ("\"" + s + "\" "); //$NON-NLS-1$ //$NON-NLS-2$ - } - EMLogger.getLogger().log(Level.INFO, temp); - System.out.println("cmd : " + cmd); //$NON-NLS-1$ - return cmd; - } - - @Override - public boolean launch(VMProperty property) throws VMLauncherException { - return launch(property, false); - } - - @Override - public boolean launch(VMProperty property, boolean wait) throws VMLauncherException { - List<String> cmd; - - cmd = getLaunchCommand(property, null); - - if (cmd == null) { - return false; - } - - CheckingRunningEmulator.addEmulator(property); - MonitoringEmulator monitor = new MonitoringEmulator(property); - Process process = launch(cmd); - if (process != null) { - monitor.setProcess(process); - monitor.start(); - if (wait) { - try { - monitor.join(); - } catch (InterruptedException e) { - EMLogger.getLogger().warning(e.getMessage()); - } - if (monitor.isSuccess()) { - return true; - } else { - return false; - } - } - return true; - } else { - CheckingRunningEmulator.removeEmulator(property, false); - monitor.interrupt(); - return false; - } - } - - @Override - public Process launch(List<String> cmd) { - ProcessBuilder pb = new ProcessBuilder(cmd); - Map<String, String> env = pb.environment(); - if (EmulatorManager.isLinux()) { - String value = env.get("LD_LIBRARY_PATH"); //$NON-NLS-1$ - env.put("LD_LIBRARY_PATH", ((value == null) ? "" : value + ":") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + FilePathResources.getEmulatorBinPath(emulatorPath) + ":" + FilePathResources.getToolEmulatorRemotePath() + File.separator + "lib:"); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "LD_LIBRARY_PATH=" + env.get("LD_LIBRARY_PATH")); //$NON-NLS-1$ //$NON-NLS-2$ - } - env.put("GL_VERSION", "2"); //$NON-NLS-1$ //$NON-NLS-2$ - env.put("VIGS_SYNC_READ_PIXELS", "1"); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "GL_VERSION: " + env.get("GL_VERSION")); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "VIGS_SYNC_READ_PIXELS: " + env.get("VIGS_SYNC_READ_PIXELS")); //$NON-NLS-1$ //$NON-NLS-2$ - - if (this.binPath == null || this.binPath.isEmpty()) { - pb.directory(new File(FilePathResources.getEmulatorBinPath(emulatorPath))); - } else { - pb.directory(new File(this.binPath)); - } - - Process process = null; - try { - process = pb.start(); - } catch (IOException e) { - if (!isConsole) { - MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); - msg.openWarningDialog("Failed to launch" + StringResources.NEW_LINE + e.getMessage()); //$NON-NLS-1$ - } - EMLogger.getLogger().log(Level.WARNING, "Failed to launch." + StringResources.NEW_LINE + e.getMessage()); //$NON-NLS-1$ - } - - return process; - } - - - private boolean checkOnOff(String value) { - if (value.toLowerCase().equals("on")) { //$NON-NLS-1$ - return true; - } else if (value.toLowerCase().equals("off")) { //$NON-NLS-1$ - return false; - } else if (value.isEmpty()){ - return true; - } else { - return false; - } - } - - private boolean checkOn(String value) { - if (value.toLowerCase().equals("on")) { //$NON-NLS-1$ - return true; - } - return false; - } - - - @Override - public void sendRemoteLog(String msg) { - EMLogger.getLogger().info("Launcher log : " + msg); //$NON-NLS-1$ - } - - private static boolean isTapUsing(String tapName) { - boolean isUsing = false; -// VMProperty arr[] = (VMProperty[]) EmulatorVMList.getInstance() -// .getProperties(); -// int len$ = arr$.length; -// for (int i$ = 0; i$ < len$; i$++) { - for (VMProperty prop : EmulatorVMList.getInstance().getProperties()) { - if (!prop.isRunning()) { - continue; - } - String name = prop.getPropertyValue().getAdvancedOptionValue( - OPT_NET_TAP_DEVICE); - if (tapName.equals(name)) { - isUsing = true; - break; - } - } - - return isUsing; - } - - private static boolean isIpAddrUsing(String ipAddr) { - boolean isUsing = false; - - for (VMProperty prop : EmulatorVMList.getInstance().getProperties()) { - if (!prop.isRunning()) { - continue; - } - String ip = prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, "ipAddr"); //$NON-NLS-1$ - if (!ipAddr.equals(ip)) { - continue; - } - isUsing = true; - break; - } - - return isUsing; - } - - private String getIP(boolean useBridgeNet, VMProperty prop) { - StringBuilder sb = new StringBuilder(); - sb.append(" ip="); //$NON-NLS-1$ - if (useBridgeNet) { - String useDHCP = prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_DHCP); - if (checkOn(useDHCP)) { - return ""; //$NON-NLS-1$ - } - - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_IPADDR)); - sb.append("::"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_GATEWAY)); - sb.append(":"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_SUBNET)); - sb.append("::eth0:none:"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionValue( - OPT_NET_DNS)); - - } else { // NAT (default) - //sb.append("10.0.2.16::10.0.2.2:255.255.255.0::eth0:none:10.0.2.3"); - return ""; //$NON-NLS-1$ - } - return sb.toString(); - } - - private String getHostProxy() throws VMLauncherException{ - String result = null; - String proxyCommand = "check-net"; //$NON-NLS-1$ - if (EmulatorManager.isWin()) { - proxyCommand = "check-net.exe"; //$NON-NLS-1$ - } - - List<String> cmd = Arrays.asList(FilePathResources.getEmulatorCheckToolPath() + File.separator + proxyCommand, "--proxy"); //$NON-NLS-1$ - ProcessResult res = HelperClass.runProcess(cmd); - boolean isCommandSuccess = false; - if (res.isSuccess()) { - for (String str : res.getStdOutMsg()) { - if (str.startsWith("MODE:")) { //$NON-NLS-1$ - isCommandSuccess = true; - } - if (str.startsWith("http_proxy")) { //$NON-NLS-1$ - result = str; - } - } - - } else if (!res.isSuccess() || !isCommandSuccess) { - EMLogger.getLogger().warning(res.getResultMessage()); - int dialogRes = new MessageDialog().openWarningAndSelectionDialog - ("Failed to get host proxy setting." //$NON-NLS-1$ - + "\n" + res.getResultMessage() //$NON-NLS-1$ - + "\nContinue launching anyway ?"); //$NON-NLS-1$ - if (dialogRes != SWT.OK) { - throw new VMLauncherException("User canceled launching VM."); //$NON-NLS-1$ - } - } - - if (result == null) { - EMLogger.getLogger().warning("Can't find host proxy setting."); //$NON-NLS-1$ - EMLogger.getLogger().warning("check-net result : " + res.getResultMessage()); //$NON-NLS-1$ - } - - return result; - } -} diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/VMWorker.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/VMWorker.java index 791405c..4058ae5 100644 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/VMWorker.java +++ b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/VMWorker.java @@ -39,9 +39,4 @@ public class VMWorker extends VMWorkerCommon { EMLogger.getLogger().info("Launcher log : " + msg); //$NON-NLS-1$ } - @Override - public void initLauncher() { - setLauncher(Launcher.getInstance()); - } - } diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/OptionFactory.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/OptionFactoryV2.java index 6d0aaa5..d2c904d 100644 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/OptionFactory.java +++ b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/OptionFactoryV2.java @@ -1,11 +1,13 @@ -/* Emulator Manager +/* + * Emulator Manager * * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: * Minkee Lee <minkee.lee@samsung.com> + * JiHye Kim <jihye424.kim@samsung.com> * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> + * Sangho Park <sangho.p@samsung.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -31,23 +33,22 @@ package org.tizen.emulator.manager.tv.vms.option; import java.util.ArrayList; import java.util.List; -import org.tizen.emulator.manager.ui.detail.item.ItemName; +import org.tizen.emulator.manager.template.renewal.VMItem; +import org.tizen.emulator.manager.ui.renewal.item.CommonOptionFactory; import org.tizen.emulator.manager.vms.option.CommonOption; -import org.tizen.emulator.manager.vms.option.CommonOptionFactroy; import org.tizen.emulator.manager.vms.option.DisplayModeOption; +import org.tizen.emulator.manager.vms.option.ForcePatOption; import org.tizen.emulator.manager.vms.option.IOption; import org.tizen.emulator.manager.vms.option.Option; import org.tizen.emulator.manager.vms.option.RemoteOption; -import org.tizen.emulator.manager.vms.xml.template.Item; -import org.tizen.emulator.manager.vms.xml.template.ItemList; -public class OptionFactory extends CommonOptionFactroy { +public class OptionFactoryV2 extends CommonOptionFactory { @Override - public List<IOption> makeOptionList(ItemList itemTemplate) { + public List<IOption> makeOptionList(List<VMItem> itemList) { List<IOption> optionList = new ArrayList<IOption>(); - makeCommonOptionList(optionList, itemTemplate); + makeCommonOptionList(optionList, itemList); // Add other options optionList.add(Option.getInstance(CommonOption.class)); @@ -55,27 +56,14 @@ public class OptionFactory extends CommonOptionFactroy { optionList.add(Option.getInstance(RemoteOption.class)); optionList.add(Option.getInstance(TDefaultOption.class)); optionList.add(Option.getInstance(DisplayModeOption.class)); - + optionList.add(Option.getInstance(ForcePatOption.class)); return optionList; } - @Override - public void addDeviceOption(Item item, List<IOption> optionList) { - String name = item.getName(); - if (name.equals(ItemName.SENSOR)) { - optionList.add(Option.getInstance(TSensorOption.class)); - - } else if (name.equals(ItemName.DEVICE)) { - optionList.add(Option.getInstance(TDeviceOption.class)); - - } else if (name.equals(ItemName.JACK)) { - optionList.add(Option.getInstance(TJackOption.class)); - } else if (name.equals(ItemName.DISPLAY_MODE)) { - return; - - } else { - super.addDeviceOption(item, optionList); - } + @Override + public void addOption(List<IOption> optionList, VMItem item) { + super.addOption(optionList, item); } -} + +}
\ No newline at end of file diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TDefaultOption.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TDefaultOption.java index 35954e2..3c25c3c 100644 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TDefaultOption.java +++ b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TDefaultOption.java @@ -29,15 +29,13 @@ package org.tizen.emulator.manager.tv.vms.option; import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.helper.VMLauncherException; import org.tizen.emulator.manager.vms.option.LaunchConfig; import org.tizen.emulator.manager.vms.option.Option; public class TDefaultOption extends Option { @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) - throws VMLauncherException { + public void getLaunchArgument(LaunchConfig config, VMProperty property) { config.addQemuOption("-device AC97"); //$NON-NLS-1$ config.addQemuOption("-device virtio-maru-esm-pci"); //$NON-NLS-1$ diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TDeviceOption.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TDeviceOption.java deleted file mode 100644 index 01d69d5..0000000 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TDeviceOption.java +++ /dev/null @@ -1,59 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.tv.vms.option; - -import org.tizen.emulator.manager.tv.ui.detail.TItemName; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.Option; - -public class TDeviceOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - // for nfc - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( - TItemName.DEVICE, TItemName.NFC))) { - config.addQemuOption("-device", "virtio-maru-nfc-pci"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // for battery -// if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( -// MItemName.DEVICE, MItemName.BATTERY))) { -// config.addQemuOption("-device", "virtio-power-pci"); -// } - - // for camera -// if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( -// TItemName.DEVICE, TItemName.CAMERA))) { -// config.addQemuOption("-device", "maru-camera"); -// } - } - -} diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TJackOption.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TJackOption.java deleted file mode 100644 index 3fa00bc..0000000 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TJackOption.java +++ /dev/null @@ -1,77 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.tv.vms.option; - -import org.tizen.emulator.manager.tv.ui.detail.TItemName; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.OPTION_KEY; -import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.OptionType; - -public class TJackOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - OptionType jacks = property.getPropertyValue().getAdvancedOption( - TItemName.JACK); - StringBuilder sb = new StringBuilder(); - if (jacks != null) { - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.JACK, - TItemName.EARJACK))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("earjack"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.JACK, - TItemName.CHARGER))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("charger"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.JACK, TItemName.USB))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("usb"); //$NON-NLS-1$ - } - } - -// config.addVariable(VAR_JACKS, sb.toString()); - config.addVariable(OPTION_KEY.VAR_JACKS, "earjack&charger&usb"); //$NON-NLS-1$ - config.addQemuOption("-device", "virtio-jack-pci,jacks=" //$NON-NLS-1$ //$NON-NLS-2$ - + varForm(OPTION_KEY.VAR_JACKS)); - } - -} diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TSensorOption.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TSensorOption.java deleted file mode 100644 index b320515..0000000 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TSensorOption.java +++ /dev/null @@ -1,119 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.tv.vms.option; - -import org.tizen.emulator.manager.tv.ui.detail.TItemName; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.OPTION_KEY; -import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.OptionType; - -public class TSensorOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - OptionType sensor = property.getPropertyValue().getAdvancedOption( - TItemName.SENSOR); - StringBuilder sb = new StringBuilder(); - if (sensor != null) { - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.ACCEL))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("accel"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.GEO))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("geo"); //$NON-NLS-1$ - } - if (checkOnOff(property - .getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.GYRO))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("gyro"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.LIGHT))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("light"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.PROXI))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("proxi"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.HAPTIC))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("haptic"); //$NON-NLS-1$ - } - if (checkOnOff(property - .getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.UV))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("uv"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.PRESS))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("press"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(TItemName.SENSOR, TItemName.HRM))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("hrm"); //$NON-NLS-1$ - } - } - - config.addVariable(OPTION_KEY.VAR_SENSORS, sb.toString()); - config.addQemuOption("-device", "virtio-maru-sensor-pci,sensors=" //$NON-NLS-1$ //$NON-NLS-2$ - + varForm(OPTION_KEY.VAR_SENSORS)); - - } - -} diff --git a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TTouchPointOption.java b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TTouchPointOption.java index e6bf2d2..0a11d8a 100644 --- a/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TTouchPointOption.java +++ b/plugins/tv/src/org/tizen/emulator/manager/tv/vms/option/TTouchPointOption.java @@ -33,17 +33,14 @@ import org.tizen.emulator.manager.vms.VMProperty; import org.tizen.emulator.manager.vms.option.LaunchConfig; import org.tizen.emulator.manager.vms.option.OPTION_KEY; import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.TouchType; public class TTouchPointOption extends Option { @Override public void getLaunchArgument(LaunchConfig config, VMProperty property) { - TouchType touchType = property.getConfiguration().getDevice() - .getTouch(); - if (touchType != null && touchType.getMaxTouchPoint() > 0) { + if (property.getPropertyValue().maxTouchCount > 0) { config.addVariable(OPTION_KEY.VAR_MAX_POINT, - String.valueOf(touchType.getMaxTouchPoint())); + String.valueOf(property.getPropertyValue().maxTouchCount)); config.addQemuOption("-device", "virtio-maru-touchscreen-pci,max_point=" //$NON-NLS-1$ //$NON-NLS-2$ + varForm(OPTION_KEY.VAR_MAX_POINT)); } else { diff --git a/plugins/tv/template/x86-standard-template-v2.xml b/plugins/tv/template/x86-standard-template-v2.xml new file mode 100644 index 0000000..811afea --- /dev/null +++ b/plugins/tv/template/x86-standard-template-v2.xml @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> + +<!-- This file describes component of VM property UI in Emulator manager. + (VM property UI descriptor) + Each element in this file is matched with an item of vm property UI. --> + +<ItemList xmlns="http://www.tizen.org/em/template" version="2.0"> + <information profile="tv" version="3.0" image="x86-standard"/> + + <itemGroup name="default"> + <item name="name" title="VM Name" type="textInput"/> + <item name="profile" title="Profile"/> + <item name="baseImage" title="Base Image"/> + <item name="deviceTemplate" title="Device" type="treeRoot"> + <item type="label" name="display" title="Display"> + <item name="resolution" title="Resolution" type="combo" > + <!-- name, width, height, dpi --> + <option name="hd1080"> HD1080,1920,1080,254 </option> + </item> + <item name="size" title="Size" type="textInput" /> + <item name="skin" title="Skin" type="combo" /> + </item> + <item name="processors" title="Processors" type="combo" /> + <item name="ramSize" title="Ram" type="combo" > + <option name="useConfig">false</option> + <option name="list">512,768,1024</option> + </item> + </item> + </itemGroup> + + + <itemGroup name="advanced"> +<!-- <item type="combo" name="maxTouch" title="Max Touch Point"/> --> + <item name="fileShare" title="File Sharing" type="file"> + <option name="dialogType">directory</option> + </item> + <item name="hwSupport" title="HW Support" type="label" > + <item name="cpu" title="CPU VT" type="toggle" /> + <item name="gpu" title="GPU" type="toggle" /> + </item> + <item name="glVersion" title="OpenGL ES Ver" type="combo"> + <option name="v2.0_v3.0">v2.0 & v3.0</option> + <option name="v1.1_v2.0">v1.1 & v2.0</option> + <option name="supportOS">mac</option> + </item> + <item name="network" title="Network" type="label"> + <item name="proxy" title="Proxy" type="combo" > + <option name="none">No proxy</option> + <option name="auto">Use host proxy</option> + <option name="manual">Use manual proxy</option> + <option name="defaultValue">auto</option> + </item> + <item name="netConnectType" title="Connect Type" type="combo" > + <option name="list">NAT, Bridge</option> + </item> + <item name="netTapDevice" title="Base Network" type="combo"> + <option name="supportOS">mac,linux</option> + </item> + <item name="netTapDevice" title="Tap Device" type="combo"> + <option name="supportOS">win</option> + </item> + <item name="netIpInfo" title="VM IP info" type="subLabel"> + <item name="useDHCP" title="Use DHCP" type="checkbox" > + <option name="defaultValue">on</option> + </item> + <item name="ipAddr" title="IP Address" type="text" /> + <item name="subnet" title="Subnet" type="text"/> + <item name="gateway" title="Gateway" type="text"/> + </item> + <item name="netDns" type="text" title="DNS" /> + <item name="netMac" type="text" title="MAC" /> + </item> + </itemGroup> + +</ItemList> + diff --git a/plugins/tv/template/x86-standard-template.xml b/plugins/tv/template/x86-standard-template.xml deleted file mode 100644 index 3f1f641..0000000 --- a/plugins/tv/template/x86-standard-template.xml +++ /dev/null @@ -1,139 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> - -<!-- This file describes component of VM property UI in Emulator manager. - (VM property UI descriptor) - Each element in this file is matched with an item of vm property UI. --> - -<ItemList xmlns="http://www.tizen.org/em/template" profile="tv" image="x86-standard"> - - <propertyList> - <item type="text" name="vmName" title="Name"/> - <item type="file" name="baseImage" title="Base Image"> - <option name="dialogType">file</option> - </item> - <item type="label" name="display" title="Display"> - <item type="combo" name="resolution" title="Resolution"> - <!-- name, width, height, dpi --> -<!-- <option name="experimental"> ,320,320,316 </option> --> -<!-- <option name="experimental"> HVGA,320,480,160 </option> --> -<!-- <option name="wvga"> WVGA,480,800,233 </option> --> -<!-- <option name="wsvga"> WSVGA,600,1024,207 </option> --> -<!-- <option name="experimental"> WSVGA,600,1024,207 </option> --> -<!-- <option name="qhd"> qHD,540,960,220 </option> --> -<!-- <option name="hd"> HD,720,1280,306 </option> --> -<!-- <option name="experimental"> WXGA,1280,800,300 </option> --> -<!-- <option name="experimental"> WQXGA,2560,1600,301 </option> --> -<!-- <option name="experimental"> FULLHD,1080,1920,314 </option> --> - <option name="hd1080"> HD1080,1920,1080,254 </option> - </item> - <item type="spinner" name="dpi" title="Density"/> - <item type="combo" name="skin" title="Skin"/> - </item> - <item type="combo" name="processors" title="Processors" /> - <item type="combo" name="ramSize" title="RAM Size"> - <option name="list">512,768,1024</option> - </item> -<!-- <item type="combo" name="maxTouch" title="Max Touch Point"/> --> - <item type="label" name="fileShare" title="File Sharing"> - <item type="toggle" name="share" title="Sharing"/> - <item type="file" name="directory" title="Directory"> - <option name="dialogType">directory</option> - </item> - </item> - <item type="label" name="hwSupport" title="HW Support"> - <item type="toggle" name="cpu" title="CPU VT"/> - <item type="toggle" name="gpu" title="GPU"/> - </item> - <item type="combo" name="glVersion" title="OpenGL ES Ver"> - <option name="v2.0_v3.0">v2.0 & v3.0</option> - <option name="v1.1_v2.0">v1.1 & v2.0</option> - <option name="supportOS">mac</option> - </item> - </propertyList> - -<!-- Followings are drawn as check box in Emulator Manager vm property UI.--> - <deviceList> - <item type="lineLabel" name="advancedOption" title="Advanced Option"/> - <item type="label" name="camera" title="Camera"> -<!-- <item type="combo" name="frontType" title="Front"/> --> -<!-- <item type="file" name="frontImage" title="(image)"/> --> - <item type="combo" name="rearType" title="Rear"/> - <item type="file" name="rearImage" title="(image)"/> - </item> -<!-- <item type="checkLabel" name="sensor" title="Sensor"> --> -<!-- <item type="checkbox" name="accel" title="Accelerometer"/> --> -<!-- <item type="checkbox" name="gyro" title="Gyroscope"/> --> -<!-- <item type="checkbox" name="geo" title="Geo-magnetic"/> --> -<!-- <item type="checkbox" name="proxi" title="Proximity"/> --> -<!-- <item type="checkbox" name="light" title="Light"/> --> -<!-- <item type="checkbox" name="haptic" title="Haptic"/> --> -<!-- <item type="checkbox" name="press" title="Pressure"/> --> -<!-- <item type="checkbox" name="uv" title="Ultraviolet"/> --> -<!-- <item type="checkbox" name="hrm" title="Heartbeat Rate"/> --> -<!-- </item> --> -<!-- <item type="checkLabel" name="device" title="Device"> --> -<!-- <item type="checkbox" name="nfc" title="NFC"/> --> -<!-- <item type="checkbox" name="camera" title="Camera"/> --> -<!-- <item type="checkbox" name="battery" title="Battery"/> --> -<!-- <item type="checkbox" name="swap" title="Swap Image"> --> -<!-- <option name="defaultOnCreate">on</option> --> -<!-- </item> --> -<!-- <item type="checkbox" name="hwkey" title="HW Key"/> --> -<!-- </item> --> -<!-- <item type="checkLabel" name="jack" title="Jack"> --> -<!-- <item type="checkbox" name="earjack" title="Ear Jack"/> --> -<!-- <item type="checkbox" name="charger" title="Charger"/> --> -<!-- <item type="checkbox" name="usb" title="USB"/> --> -<!-- </item> --> - - - <!-- Network configuration --> - <item name="netConfig" type="lineLabel" title="Network Configuration"> - <option name="spreadOnStart">false</option> - </item> - <item name="proxy" type="combo" title="Proxy"> - <option name="none">No proxy</option> - <option name="auto">Use host proxy</option> - <option name="manual">Use manual proxy</option> - <option name="defaultOnCreate">auto</option> - </item> - <item name="netConnectType" type="combo" title="Connect Type"> - <option name="list">NAT, Bridge</option> - </item> - <item name="netTapDevice" type="combo" title="Base Network"> - <option name="supportOS">mac,linux</option> - </item> - <item name="netTapDevice" type="combo" title="Tap Device"> - <option name="supportOS">win</option> - </item> - <item name="netIpInfo" type="label" title="VM IP info"> - <item name="useDHCP" type="checkbox" title="Use DHCP"> - <option name="defaultOnCreate">off</option> - </item> - <item name="ipAddr" type="text" title="IP Address" /> - <item name="subnet" type="text" title="Subnet" /> - <item name="gateway" type="text" title="Gateway" /> - </item> - <item name="netDns" type="text" title="DNS" /> - <item name="netMac" type="text" title="MAC" /> - - - <item type="lineLabel" name="experimental" title="Experimental Options"/> - <item type="label" name="viewer" title="Viewer"> - <item type="combo" name="type" title="Type"> - <option name="list">Native, Web</option> - <option name="defaultOnCreate">Native</option> - </item> - </item> - <item type="checkLabel" name="displayMode" title="Display Mode"> -<!-- <option name="hideLabel">on</option> --> - <item type="checkbox" name="qtEnable" title="Direct Rendering"> - <option name="defaultIfEmpty">on</option> - <option name="defaultOnCreate">on</option> - </item> - </item> - - </deviceList> - -</ItemList> - diff --git a/plugins/tv/template/x86-standard.xml b/plugins/tv/template/x86-standard.xml index a2d323b..728bac3 100644 --- a/plugins/tv/template/x86-standard.xml +++ b/plugins/tv/template/x86-standard.xml @@ -28,5 +28,22 @@ <option name="displayMode"> <subOption name="qtEnable" value="on"/> </option> + <option name="netIpInfo"> + <subOption name="useDHCP" value="off"/> + <subOption name="ipAddr" value=""/> + <subOption name="subnet" value=""/> + <subOption name="gateway" value=""/> + </option> + <option name="proxy"> + <subOption name="proxyMode" value="auto"/> + <subOption name="httpProxy" value=""/> + <subOption name="httpsProxy" value=""/> + <subOption name="ftpProxy" value=""/> + <subOption name="socksProxy" value=""/> + </option> + <option name="netConnectType" value="NAT"/> + <option name="netTapDevice" value=""/> + <option name="netDns" value=""/> + <option name="netMac" value=""/> </advancedOption> </EmulatorConfiguration> diff --git a/plugins/wearable/.classpath b/plugins/wearable/.classpath index 3b8e13c..1e4c2b3 100644 --- a/plugins/wearable/.classpath +++ b/plugins/wearable/.classpath @@ -3,6 +3,5 @@ <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry combineaccessrules="false" kind="src" path="/EmulatorManager"/> - <classpathentry kind="lib" path="/EmulatorManager/lib/swt.jar" sourcepath="/EmulatorManager/lib/src.zip"/> <classpathentry kind="output" path="bin"/> </classpath> diff --git a/plugins/wearable/build.xml b/plugins/wearable/build.xml index 9fd8dd3..151c3f3 100644 --- a/plugins/wearable/build.xml +++ b/plugins/wearable/build.xml @@ -7,13 +7,11 @@ <property name="profile" value="wearable"/> <property name="plugin.file" value="em-plugin-${profile}.jar" /> - <property name="item.factory" value="org.tizen.emulator.manager.${profile}.ui.detail.ItemListFactory" /> <property name="vm.worker" value="org.tizen.emulator.manager.${profile}.vms.VMWorker" /> - <property name="vmbutton.painter" value="org.tizen.emulator.manager.${profile}.ui.widget.VMButtonPainter" /> - <property name="option.factory" value="org.tizen.emulator.manager.${profile}.vms.option.OptionFactory" /> + <property name="option.factory.v2" value="org.tizen.emulator.manager.${profile}.vms.option.OptionFactoryV2" /> <path id="plugin-classpath"> - <fileset dir="${common.libpath}" includes="swt.jar,emulator-manager.jar" /> + <fileset dir="${common.libpath}" includes="emulator-manager.jar" /> </path> <target name="clean"> @@ -43,11 +41,10 @@ <jar jarfile="${plugin.file}" basedir="${build.dir}" duplicate="add"> <manifest> <attribute name="Platform-Version" value="${platform.version}"/> - <attribute name="Platform-Profile" value="${profile}"/> - <attribute name="Item-Factory" value="${item.factory}"/> + <attribute name="Platform-Profile" value="${profile}"/> <attribute name="VM-Worker" value="${vm.worker}" /> - <attribute name="VMButton-Painter" value="${vmbutton.painter}" /> - <attribute name="Option-Factory" value="${option.factory}" /> + <attribute name="Option-Factory-v2" value="${option.factory.v2}" /> + <attribute name="Package-Version" value="${package.version}" /> </manifest> </jar> </target> diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/detail/ItemListFactory.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/detail/ItemListFactory.java deleted file mode 100644 index 8a41dbc..0000000 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/detail/ItemListFactory.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JiHye Kim <jihye1128.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.wearable.ui.detail; - -import java.util.List; - -import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory; -import org.tizen.emulator.manager.ui.detail.item.IViewItem; -import org.tizen.emulator.manager.vms.xml.template.ItemList; - -public class ItemListFactory extends CommonItemListFactory { - @Override - public void makeItemList(List<? extends IViewItem> itemList, ItemList template) { - makePropertyItemList(itemList, template.getPropertyList()); - makeDeviceItemList(itemList, template.getDeviceList()); - } -} diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/detail/WItemName.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/detail/WItemName.java deleted file mode 100644 index 87c2d99..0000000 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/detail/WItemName.java +++ /dev/null @@ -1,54 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.wearable.ui.detail; - -import org.tizen.emulator.manager.ui.detail.item.ItemName; - -public class WItemName extends ItemName { - // Jack - public static final String EARJACK = "earjack"; //$NON-NLS-1$ - public static final String USB = "usb"; //$NON-NLS-1$ - public static final String CHARGER = "charger"; //$NON-NLS-1$ - - // Sensor - public static final String ACCEL = "accel"; //$NON-NLS-1$ - public static final String GYRO = "gyro"; //$NON-NLS-1$ - public static final String GEO = "geo"; //$NON-NLS-1$ - public static final String LIGHT = "light"; //$NON-NLS-1$ - public static final String PROXI = "proxi"; //$NON-NLS-1$ - public static final String HAPTIC = "haptic"; //$NON-NLS-1$ - public static final String PRESS = "press"; // pressure //$NON-NLS-1$ - public static final String UV = "uv"; // ultra violet //$NON-NLS-1$ - public static final String HRM = "hrm"; // heartbeat rate meter //$NON-NLS-1$ - - // Device - public static final String NFC = "nfc"; //$NON-NLS-1$ - public static final String BATTERY = "battery"; //$NON-NLS-1$ - public static final String CAMERA = "camera"; //$NON-NLS-1$ -} diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/widget/VMButtonPainter.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/widget/VMButtonPainter.java deleted file mode 100644 index 319aa76..0000000 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/ui/widget/VMButtonPainter.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2013 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * JiHye Kim <jihye1128.kim@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.wearable.ui.widget; - -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Rectangle; -import org.tizen.emulator.manager.resources.FontResources; -import org.tizen.emulator.manager.ui.widgets.CommonVMButtonPainter; -import org.tizen.emulator.manager.ui.widgets.VMButton; -import org.tizen.emulator.manager.ui.widgets.WSTATE; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.VMPropertyValue; - -public class VMButtonPainter extends CommonVMButtonPainter { - - public VMButtonPainter() { - TEXT_X_POINT = 50 + BUTTON_X_OFFSET; - TEXT_Y_POINT = 36 + BUTTON_Y_OFFSET; - TEXT_Y_GAP = 18; - TEXT_RE_X_POINT = 28 + BUTTON_X_OFFSET; - - TITLE_X_OFFSET = 21; - TITLE_Y_OFFSET = 6; - - LAUNCH_BUTTON_LEFT_OFFSET = 22; - LAUNCH_BUTTON_BOTTOM_OFFSET = 8; - } - - @Override - public void drawButtonText(GC gc, Rectangle rect, VMButton button) { - VMProperty property = button.getProperty(); - if (property == null) { - return; - } - - // drawing Title - gc.setForeground(button.getFontColor(button.currentState())); - gc.setFont(FontResources.VM_BUTTON_TITLE_FONT.getFont()); - - gc.setBackground(button.getBackgroundColor(button.currentState())); - gc.drawString(button.getTitle(), button.getTitle_x(), TITLE_Y_OFFSET, true); - - // reset font color - gc.setForeground(button.getFontColor(WSTATE.NORMAL)); - - VMPropertyValue value = property.getPropertyValue(); - String version = value.baseImage.isStandard() ? - property.getImageVersion() : "custom"; - - gc.drawString(version, TEXT_X_POINT, TEXT_Y_POINT - 1, true); - gc.drawString(property.getArch().name(), TEXT_X_POINT, TEXT_Y_POINT + TEXT_Y_GAP, true); - gc.drawString(Integer.toString(value.ramSize), TEXT_X_POINT, TEXT_Y_POINT + TEXT_Y_GAP * 2 + 1, true); - gc.drawString(value.resolution.getStrValue(), TEXT_RE_X_POINT, TEXT_Y_POINT + TEXT_Y_GAP * 3 + 2, true); - } -} diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/Launcher.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/Launcher.java deleted file mode 100644 index a35a774..0000000 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/Launcher.java +++ /dev/null @@ -1,872 +0,0 @@ -/* - * Emulator Manager - * - * Copyright (C) 2011 - 2012 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * MunKyu Im <munkyu.im@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * JiHye Kim <jihye1128.kim@samsung.com> - * YeongKyoon Lee <yeongkyoon.lee@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.wearable.vms; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.logging.Level; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.tizen.emulator.manager.EmulatorManager; -import org.tizen.emulator.manager.EmulatorManager.ManagerModeType; -import org.tizen.emulator.manager.console.RemoteManager; -import org.tizen.emulator.manager.job.CheckGPU; -import org.tizen.emulator.manager.job.CheckVT; -import org.tizen.emulator.manager.logging.EMLogger; -import org.tizen.emulator.manager.wearable.ui.detail.ItemListFactory; -import org.tizen.emulator.manager.resources.FilePathResources; -import org.tizen.emulator.manager.resources.StringResources; -import org.tizen.emulator.manager.tool.PortHelper; -import org.tizen.emulator.manager.tool.SettingInfoFile; -import org.tizen.emulator.manager.tool.TapUtil; -import org.tizen.emulator.manager.ui.detail.item.CommonItemListFactory; -import org.tizen.emulator.manager.ui.detail.item.property.NetIPInfoViewItem; -import org.tizen.emulator.manager.ui.detail.item.property.NetProxyViewItem; -import org.tizen.emulator.manager.ui.dialog.IPAddressInputDialog; -import org.tizen.emulator.manager.ui.dialog.MessageDialog; -import org.tizen.emulator.manager.vms.EmulatorVMList; -import org.tizen.emulator.manager.vms.ILauncher; -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.helper.CheckingRunningEmulator; -import org.tizen.emulator.manager.vms.helper.HelperClass; -import org.tizen.emulator.manager.vms.helper.MonitoringEmulator; -import org.tizen.emulator.manager.vms.helper.ProcessResult; -import org.tizen.emulator.manager.vms.helper.VMLauncherException; -import org.tizen.emulator.manager.vms.xml.CpuType; -import org.tizen.emulator.manager.vms.xml.OptionType; -import org.tizen.emulator.manager.vms.helper.VMWorkerException; -import org.tizen.emulator.manager.vms.xml.TouchType; - -public class Launcher implements ILauncher { - private boolean isConsole = false; - private String binPath = null; - private String emulatorPath; - private static Launcher launcher; - public static final String IFUP_SCRIPT = "emulator-ifup.sh"; //$NON-NLS-1$ - - // Option names in vm_config.xml - // Add if need. - public static final String OPT_DEVICE = "device"; //$NON-NLS-1$ - public static final String OPT_NFC = "nfc"; //$NON-NLS-1$ - public static final String OPT_BATTERY = "battery"; //$NON-NLS-1$ - public static final String OPT_CAMERA = "camera"; //$NON-NLS-1$ - public static final String OPT_HWKEY = "hwkey"; //$NON-NLS-1$ - public static final String OPT_SWAP = "swap"; //$NON-NLS-1$ - public static final String OPT_CODEC = "codec"; //$NON-NLS-1$ - - public static final String OPT_JACK = "jack"; //$NON-NLS-1$ - public static final String OPT_USB = "usb"; //$NON-NLS-1$ - public static final String OPT_CHARGER = "charger"; //$NON-NLS-1$ - - public static final String OPT_SENSOR = "sensor"; //$NON-NLS-1$ - public static final String OPT_ACCEL = "accel"; //$NON-NLS-1$ - public static final String OPT_GYRO = "gyro"; //$NON-NLS-1$ - public static final String OPT_GEO = "geo"; //$NON-NLS-1$ - public static final String OPT_LIGHT = "light"; //$NON-NLS-1$ - public static final String OPT_PROXI = "proxi"; //$NON-NLS-1$ - public static final String OPT_HAPTIC = "haptic"; //$NON-NLS-1$ - public static final String OPT_PRESS = "press"; // pressure //$NON-NLS-1$ - public static final String OPT_UV = "uv"; // ultra violet //$NON-NLS-1$ - public static final String OPT_HRM = "hrm"; // heartbeat rate meter //$NON-NLS-1$ - - public static final String OPT_EXPERIMENTAL = ItemListFactory.ITEM_EXPERIMENTAL; - public static final String OPT_QT_ENABLE = "qtEnable"; //$NON-NLS-1$ - - // Network option. - public static final String OPT_NET_CONNECT_TYPE = CommonItemListFactory.ITEM_NET_CONNECT_TYPE; - public static final String OPT_NET_TAP_DEVICE = CommonItemListFactory.ITEM_NET_TAP_DEVICE; - public static final String OPT_NET_IP_INFO = CommonItemListFactory.ITEM_NET_IP_INFO; - public static final String OPT_NET_IPADDR = NetIPInfoViewItem.ITEM_IP; - public static final String OPT_NET_SUBNET = NetIPInfoViewItem.ITEM_SUBNET; - public static final String OPT_NET_GATEWAY = NetIPInfoViewItem.ITEM_GATEWAY; - public static final String OPT_NET_DNS = CommonItemListFactory.ITEM_NET_DNS; - public static final String OPT_NET_MAC = CommonItemListFactory.ITEM_NET_MAC; - public static final String OPT_NET_PROXY = CommonItemListFactory.ITEM_NET_PROXY; - public static final String OPT_NET_DHCP = NetIPInfoViewItem.ITEM_USE_DHCP; - - public static Launcher getInstance() { - if (launcher == null) { - launcher = new Launcher(); - } - return launcher; - } - - public Launcher() { - isConsole = EmulatorManager.isConsoleMode(); - } - - @Override - public List<String> getLaunchCommand(VMProperty property, String path) - throws VMLauncherException { - String binary; - String hwVirtualization = null; - int portNo; - boolean useBridgeNet = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_CONNECT_TYPE).equals("Bridge") && //$NON-NLS-1$ - (EmulatorManager.isLinux() || EmulatorManager.isWin() || EmulatorManager.isMac()); - String tapName = null; - if (useBridgeNet) { - if (EmulatorManager.isWin()) { - tapName = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_TAP_DEVICE); - if (TapUtil.nameNotExist(tapName)) - throw new VMLauncherException((new StringBuilder()) - .append("Tap device is not exist : ").append(tapName) //$NON-NLS-1$ - .append("\nCheck VM's tap configuration.").toString()); //$NON-NLS-1$ - if (isTapUsing(tapName)) - throw new VMLauncherException( - (new StringBuilder()) - .append("Tap device(") //$NON-NLS-1$ - .append(tapName) - .append(") is being used by other VM.") //$NON-NLS-1$ - .append("\nPlease select another tap device for current VM.") //$NON-NLS-1$ - .toString()); - String ipAddr = property.getPropertyValue() - .getAdvancedOptionSubValue(OPT_NET_IP_INFO, "ipAddr"); //$NON-NLS-1$ - if (isIpAddrUsing(ipAddr)) - throw new VMLauncherException((new StringBuilder()) - .append("VM's ip address(").append(ipAddr) //$NON-NLS-1$ - .append(") is being used by other VM.") //$NON-NLS-1$ - .append("\nPlease modify current VM's ip address.") //$NON-NLS-1$ - .toString()); - } - if (EmulatorManager.isWin()) { - try { - if (!TapUtil.isTapInBridge(tapName)) { - MessageDialog dialog = new MessageDialog(); - int res = dialog - .openWarningAndSelectionDialog("\nTap device is not connected with Bridge." //$NON-NLS-1$ - + "\nGuest network would work as NAT." //$NON-NLS-1$ - + "\nKeep launching ?"); //$NON-NLS-1$ - if (res != SWT.OK) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - } - useBridgeNet = false; - } - - } catch (VMWorkerException e) { - throw new VMLauncherException(e.getMessage()); - } - } - } - /* check available port number */ - portNo = new PortHelper().getPortNo(); - if(portNo == -1) { - String error = "Can not execute emulator." //$NON-NLS-1$ - + StringResources.NEW_LINE - + "All available ports are in use."; //$NON-NLS-1$ - throw new VMLauncherException(error); - } - - if (property.getArch().toString().equals("x86")) { //$NON-NLS-1$ - if (EmulatorManager.isWin()) { - binary = "emulator-x86.exe"; //$NON-NLS-1$ - } else { - binary = "emulator-x86"; //$NON-NLS-1$ - } - } else { - if (EmulatorManager.isWin()) { - binary = "emulator-arm.exe"; //$NON-NLS-1$ - } else { - binary = "emulator-arm"; //$NON-NLS-1$ - } - } - - // check disk image - File child = new File(property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()); - File base = new File(property.getConfiguration().getBaseInformation().getDiskImage().getBaseDiskImage().getValue()); - if (!child.exists()) { - throw new VMLauncherException("Child disk image does not exist." //$NON-NLS-1$ - + StringResources.NEW_LINE + child.getAbsolutePath() - , true); - } - if (!base.exists()) { - throw new VMLauncherException("Base disk image does not exist." //$NON-NLS-1$ - + StringResources.NEW_LINE + base.getAbsolutePath() - , true); - } - - if (property.getConfiguration().getUsability().isHwVirtualization() && CheckVT.isVTSupported()) { - hwVirtualization = CheckVT.getVTEnablingCommand(); - } - - List<String> cmd = new ArrayList<String>(); - int width = property.getConfiguration().getDevice().getDisplay().getResolution().getWidth(); - int height = property.getConfiguration().getDevice().getDisplay().getResolution().getHeight(); - String skinPath = null; - if (property.getConfiguration().getDevice().getDisplay().getSkinPath() != null) { - skinPath = property.getConfiguration().getDevice().getDisplay().getSkinPath().getPath(); - if (skinPath != null && skinPath.isEmpty()) { - skinPath = null; - } - } - String fileshare = property.getConfiguration().getUsability().getFileSharing().getPath(); - //String osVersion = System.getProperty("os.version"); - boolean isFileshare = true; - if (fileshare == null) { - isFileshare = false; - } - - /* get MAC address of host set as guest MAC address */ - String macAddr = useBridgeNet ? property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_MAC) : SettingInfoFile - .getMACaddr(); - - if(macAddr.isEmpty()) { - macAddr = "52:54:00:12:34:56"; //$NON-NLS-1$ - EMLogger.getLogger().log(Level.INFO, String.format("MAC set as default = %s", macAddr)); //$NON-NLS-1$ - } - - emulatorPath = property.getPropertyValue().baseImage.getPlatform().getEmulatorPath(); - if (path == null || path.isEmpty()) { - cmd.add(FilePathResources.getEmulatorBinPath(emulatorPath) + File.separator + binary); - } else { - this.binPath = path; - cmd.add(binPath + File.separator + binary); - } - - cmd.add("--skin-args"); //$NON-NLS-1$ - cmd.add("width=" + width); //$NON-NLS-1$ - cmd.add("height=" + height); //$NON-NLS-1$ - if (skinPath != null) { - cmd.add("skin.path=" + skinPath); //$NON-NLS-1$ - } - - if (RemoteManager.getSpiceMode()) { - cmd.add("hb.ignore=true"); //$NON-NLS-1$ - } - - cmd.add("--qemu-args"); //$NON-NLS-1$ - // x86 part of cmd - if (property.getArch().toString().equals("x86")) { //$NON-NLS-1$ - cmd.add("-drive"); //$NON-NLS-1$ - cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()+ ",if=virtio,index=1"); //$NON-NLS-1$ //$NON-NLS-2$ - cmd.add( "-boot"); //$NON-NLS-1$ - cmd.add("c"); //$NON-NLS-1$ - cmd.add("-append"); //$NON-NLS-1$ - - String kernelOption = "console=ttyS0 video=LVDS-1:" //$NON-NLS-1$ - + width - + "x" //$NON-NLS-1$ - + height - + "-32@60" //$NON-NLS-1$ - + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 //$NON-NLS-1$ - + getIP(useBridgeNet, property) - + " vm_name=" + property.getConfiguration().getBaseInformation().getName(); //$NON-NLS-1$ - String hostIp = "10.0.2.2"; //$NON-NLS-1$ - if (useBridgeNet) { - String bridgeIp = TapUtil.getBridgeIpAddr(property - .getPropertyValue().getAdvancedOptionValue( - OPT_NET_TAP_DEVICE)); - if (bridgeIp == null) { - MessageDialog dialog = new MessageDialog(); - int res = dialog.openInfoDialog( - "\nCannot find host(bridge) IP address." //$NON-NLS-1$ - + "\nTo use bridge network, host IP is required." //$NON-NLS-1$ - + "\nPlease input manually."); //$NON-NLS-1$ - if (res != SWT.OK) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - } - - // Input host IP address. - String ip = IPAddressInputDialog.open("Input host's IP address"); //$NON-NLS-1$ - if (ip == null) { - throw new VMLauncherException("User canceled."); //$NON-NLS-1$ - - } else { - hostIp = ip; - } - - } else { - hostIp = bridgeIp; - } - } - kernelOption += " host_ip=" + hostIp; //$NON-NLS-1$ - - // Set proxy. - String proxyConfig = null; - String proxyMode = property.getPropertyValue(). - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_PROXY_MODE); - if (proxyMode.equals(NetProxyViewItem.MODE_AUTO)) { - proxyConfig = getHostProxy(); - - } else if (proxyMode.equals(NetProxyViewItem.MODE_MANUAL)) { - proxyConfig = "http_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_HTTP_PROXY) - + " https_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_HTTPS_PROXY) - + " ftp_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_FTP_PROXY) - + " socks_proxy=" + property.getPropertyValue(). //$NON-NLS-1$ - getAdvancedOptionSubValue(OPT_NET_PROXY, NetProxyViewItem.ITEM_SOCKS_PROXY); - } - - if (proxyConfig != null) { - kernelOption += (" " + proxyConfig); //$NON-NLS-1$ - } - - /* set virtio-9p string in case of using directory share [kernel option] */ - if(isFileshare) { - kernelOption += " virtio-9p"; //$NON-NLS-1$ - } - /* - if(property.getPropertyValue().skin != null && property.getPropertyValue().skin.getButtonType() == SKIN_BUTTON_TYPE.THREE_BUTTON_TYPE) { - kernelOption += " platform_feature=3btn"; - } else { - kernelOption += " platform_feature=1btn"; - } - */ - - cmd.add(kernelOption); - - /* use fileshare [non-kernel option] */ - if (isFileshare) { - cmd.add("-virtfs"); //$NON-NLS-1$ - cmd.add("local,path=" + property.getConfiguration().getUsability().getFileSharing().getPath() +",security_model=none,mount_tag=fileshare"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - cmd.add("-serial"); //$NON-NLS-1$ - cmd.add("file:" + FilePathResources.getTizenVmsPath() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - CpuType cpuOption = property.getConfiguration().getDevice().getCPU(); - if (cpuOption != null) { - cmd.add("-smp"); //$NON-NLS-1$ - cmd.add(String.valueOf(cpuOption.getValue().getValue())); - } - cmd.add("-m"); //$NON-NLS-1$ - cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue())); - cmd.add("-M"); //$NON-NLS-1$ - cmd.add("maru-x86-machine"); //$NON-NLS-1$ - cmd.add("-net"); //$NON-NLS-1$ - cmd.add("nic,model=virtio,macaddr=" + macAddr); //$NON-NLS-1$ - cmd.add("-soundhw"); //$NON-NLS-1$ - cmd.add("all"); //$NON-NLS-1$ - cmd.add("-usb"); //$NON-NLS-1$ - cmd.add("-vga"); //$NON-NLS-1$ - cmd.add("none"); //$NON-NLS-1$ - cmd.add("-enable-vigs"); //$NON-NLS-1$ - cmd.add("-L"); //$NON-NLS-1$ - cmd.add(FilePathResources.getEmulatorBiosPath(emulatorPath)); - cmd.add("-kernel"); //$NON-NLS-1$ - cmd.add(FilePathResources.getEmulatorKernelPath(emulatorPath) + File.separator+ "bzImage." + property.getArch().toString()); //$NON-NLS-1$ - cmd.add("-net"); //$NON-NLS-1$ - if (useBridgeNet) { - if (EmulatorManager.isWin()) { - tapName = property.getPropertyValue() - .getAdvancedOptionValue(OPT_NET_TAP_DEVICE); - if (TapUtil.nameNotExist(tapName)) { - throw new VMLauncherException("Tap device is not exist : " //$NON-NLS-1$ - + tapName + "\nCheck VM's tap configuration."); //$NON-NLS-1$ - } - cmd.add("tap,ifname=" + tapName + ",script=no,downscript=no"); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - cmd.add("tap,script=/etc/" + IFUP_SCRIPT +",downscript=no"); //$NON-NLS-1$ //$NON-NLS-2$ - } - } else { - cmd.add("user,dhcpstart=10.0.2.16"); //$NON-NLS-1$ - } - - cmd.add("-rtc"); //$NON-NLS-1$ - cmd.add("base=utc"); //$NON-NLS-1$ - if (property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage() != null) { - cmd.add("-drive"); //$NON-NLS-1$ - cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getSwapDiskImage().getValue() + ",if=virtio,index=2"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /* append HW virtualization option if supports */ - if (hwVirtualization != null) { - cmd.add(hwVirtualization); - } - - // add hw gl acceleration - if (property.getConfiguration().getUsability().isHwGLAcceleration() - && CheckGPU.isGPUSupported()) { - //cmd.add(CheckVirtualization.getInstance().getGPU_enable_command()); - cmd.add("-vigs-backend"); //$NON-NLS-1$ - cmd.add("gl"); //$NON-NLS-1$ - cmd.add("-enable-yagl"); //$NON-NLS-1$ - cmd.add("-yagl-backend"); //$NON-NLS-1$ - cmd.add("vigs"); //$NON-NLS-1$ - } else { - cmd.add("-vigs-backend"); //$NON-NLS-1$ - cmd.add("sw"); //$NON-NLS-1$ - } - - // for bootup status - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-esm-pci"); //$NON-NLS-1$ - - // for brightness - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("maru-brightness"); //$NON-NLS-1$ - - // for vmodem - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-vmodem-pci"); //$NON-NLS-1$ - - // for hardware key - if (checkOnOff(property.getPropertyValue().getAdvancedOptionValue(OPT_HWKEY))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-hwkey-pci"); //$NON-NLS-1$ - } - - // for codec - if (checkOnOff(property.getPropertyValue().getAdvancedOptionValue(OPT_CODEC))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("codec-pci"); //$NON-NLS-1$ - } - - // for ecp - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-evdi-pci,profile=" + property.getPropertyValue().baseImage.getProfile()); //$NON-NLS-1$ - - // for camera - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_CAMERA))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("maru-camera"); //$NON-NLS-1$ - } - - // for battery - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-power-pci"); //$NON-NLS-1$ - - // for nfc - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_DEVICE, OPT_NFC))) { - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-nfc-pci"); //$NON-NLS-1$ - } - - // for sensor (accel, geo, gyro, light, proxi, haptic, pressure, ultra violet, heart rate meter) - OptionType sensor = property.getPropertyValue().getAdvancedOption(OPT_SENSOR); - if (sensor != null) { - cmd.add("-device"); //$NON-NLS-1$ - - StringBuilder sb = new StringBuilder(); - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_ACCEL))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("accel"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_GEO))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("geo"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_GYRO))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("gyro"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_LIGHT))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("light"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_PROXI))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("proxi"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_HAPTIC))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("haptic"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_PRESS))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("press"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_UV))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("uv"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_SENSOR, OPT_HRM))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("hrm"); //$NON-NLS-1$ - } - - if (sb.toString().isEmpty()) { - cmd.add("virtio-sensor-pci"); //$NON-NLS-1$ - } else { - sb.insert(0, "virtio-sensor-pci,sensors="); //$NON-NLS-1$ - cmd.add(sb.toString()); - } - } - - // for jacks (enabled charger, and usb) - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-jack-pci,jacks=charger&usb"); //$NON-NLS-1$ - /* OptionType jacks = property.getPropertyValue().getAdvancedOption(OPT_JACK); - if (jacks != null) { - cmd.add("-device"); - - StringBuilder sb = new StringBuilder(); - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_CHARGER))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("charger"); - } - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue(OPT_JACK, OPT_USB))) { - if(!sb.toString().isEmpty()) { - sb.append("&"); - } - sb.append("usb"); - } - - if (sb.toString().isEmpty()) { - cmd.add("virtio-jack-pci"); - } else { - sb.insert(0, "virtio-jack-pci,jacks="); - cmd.add(sb.toString()); - } - } */ - - - cmd.add("-device"); //$NON-NLS-1$ - TouchType touchType = property.getConfiguration().getDevice().getTouch(); - if (touchType != null) { - cmd.add("virtio-touchscreen-pci,max_point=" + touchType.getMaxTouchPoint()); //$NON-NLS-1$ - } else { - cmd.add("virtio-touchscreen-pci"); //$NON-NLS-1$ - } - - } else { // ARM part of cmd - cmd.add("-drive"); //$NON-NLS-1$ - cmd.add("file=" + property.getConfiguration().getBaseInformation().getDiskImage().getCurrentDiskImage().getValue()+ ",id=virtio-blk,if=none"); //$NON-NLS-1$ //$NON-NLS-2$ - cmd.add( "-device"); //$NON-NLS-1$ - cmd.add("virtio-blk,drive=virtio-blk,transport=virtio-mmio.0"); //$NON-NLS-1$ - cmd.add("-netdev"); //$NON-NLS-1$ - cmd.add("user,id=virtio-net"); //$NON-NLS-1$ - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-net,netdev=virtio-net,transport=virtio-mmio.1"); //$NON-NLS-1$ - cmd.add("-append"); //$NON-NLS-1$ - cmd.add("yagl=1 console=ttySAC2,115200 video=s3cfb:" //$NON-NLS-1$ - + width - + "x" //$NON-NLS-1$ - + height - + "-24" //$NON-NLS-1$ - + " dpi=" + property.getConfiguration().getDevice().getDisplay().getDensity().getValue() * 10 //$NON-NLS-1$ - + " rootwait root=/dev/vda rw rootfstype=ext4" //$NON-NLS-1$ - + " ip=10.0.2.16::10.0.2.2:255.255.255.0::eth0:none" //$NON-NLS-1$ - + " vm_name=" + property.getConfiguration().getBaseInformation().getName() //$NON-NLS-1$ - + " virtio_mmio.device=4K@0x10AD0000:423 virtio_mmio.device=4K@0x10AC0000:422"); //$NON-NLS-1$ - cmd.add("-serial"); //$NON-NLS-1$ - cmd.add(EmulatorManager.isLinux() ? "/dev/null" : "none"); //$NON-NLS-1$ //$NON-NLS-2$ - cmd.add("-serial"); //$NON-NLS-1$ - cmd.add(EmulatorManager.isLinux() ? "/dev/null" : "none"); //$NON-NLS-1$ //$NON-NLS-2$ - cmd.add("-serial"); //$NON-NLS-1$ - cmd.add("file:" + FilePathResources.getTizenVmsPath() + File.separator + property.getName() + File.separator + "logs" + File.separator + "emulator.klog"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - cmd.add("-m"); //$NON-NLS-1$ - cmd.add(String.valueOf(property.getConfiguration().getDevice().getRAM().getSize().getValue())); - cmd.add("-M"); //$NON-NLS-1$ - cmd.add("maru-arm-machine"); //$NON-NLS-1$ - cmd.add("-soundhw"); //$NON-NLS-1$ - cmd.add("all"); //$NON-NLS-1$ - cmd.add("-usb"); //$NON-NLS-1$ - cmd.add("-usbdevice"); //$NON-NLS-1$ - cmd.add("maru-touchscreen"); //$NON-NLS-1$ - cmd.add("-kernel"); //$NON-NLS-1$ - cmd.add(FilePathResources.getEmulatorKernelPath(emulatorPath) + File.separator+ "bzImage." + property.getArch().toString()); //$NON-NLS-1$ - } - - //} - - /* append user added options if exists */ - String advancedOptions = property.getConfiguration().getUsability().getAdvancedOptions(); - if (advancedOptions != null) { - String[] arrOptions = advancedOptions.split(" "); //$NON-NLS-1$ - for (String option : arrOptions) { - cmd.add(option); - } - } - - /* spice options */ - if (RemoteManager.getSpiceMode()) { - cmd.add("-spice"); //$NON-NLS-1$ - cmd.add("disable-ticketing"); //$NON-NLS-1$ - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0"); //$NON-NLS-1$ - cmd.add("-chardev"); //$NON-NLS-1$ - cmd.add("spicevmc,id=vdagent,name=vdagent"); //$NON-NLS-1$ - cmd.add("-device"); //$NON-NLS-1$ - cmd.add("virtserialport,nr=1,bus=virtio-serial0.0,chardev=vdagent,name=com.redhat.spice.0"); //$NON-NLS-1$ - } - - //for qt enable - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( - OPT_EXPERIMENTAL, OPT_QT_ENABLE))) { - if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE) { - cmd.add("-display"); //$NON-NLS-1$ - if (EmulatorManager.isMac()) { - cmd.add("maru_qt,rendering=offscreen"); //$NON-NLS-1$ - } else { - cmd.add("maru_qt,rendering=onscreen"); //$NON-NLS-1$ - } - } - } - - EMLogger.getLogger().log(Level.INFO, "Starting Emulator Command : "); //$NON-NLS-1$ - String temp = cmd.get(0) + " "; //$NON-NLS-1$ - for (String s : cmd.subList(1, cmd.size())) { - temp += ("\"" + s + "\" "); //$NON-NLS-1$ //$NON-NLS-2$ - } - EMLogger.getLogger().log(Level.INFO, temp); - System.out.println("cmd : " + cmd); //$NON-NLS-1$ - return cmd; - } - - @Override - public boolean launch(VMProperty property) throws VMLauncherException { - return launch(property, false); - } - - @Override - public boolean launch(VMProperty property, boolean wait) throws VMLauncherException { - List<String> cmd; - - cmd = getLaunchCommand(property, null); - - if (cmd == null) { - return false; - } - - CheckingRunningEmulator.addEmulator(property); - MonitoringEmulator monitor = new MonitoringEmulator(property); - Process process = launch(cmd); - if (process != null) { - monitor.setProcess(process); - monitor.start(); - if (wait) { - try { - monitor.join(); - } catch (InterruptedException e) { - EMLogger.getLogger().warning(e.getMessage()); - } - if (monitor.isSuccess()) { - return true; - } else { - return false; - } - } - return true; - } else { - CheckingRunningEmulator.removeEmulator(property, false); - monitor.interrupt(); - return false; - } - } - - @Override - public Process launch(List<String> cmd) { - ProcessBuilder pb = new ProcessBuilder(cmd); - Map<String, String> env = pb.environment(); - if (EmulatorManager.isLinux()) { - String value = env.get("LD_LIBRARY_PATH"); //$NON-NLS-1$ - env.put("LD_LIBRARY_PATH", ((value == null) ? "" : value + ":") //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + FilePathResources.getEmulatorBinPath(emulatorPath) + ":" + FilePathResources.getToolEmulatorRemotePath() + File.separator + "lib:"); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "LD_LIBRARY_PATH=" + env.get("LD_LIBRARY_PATH")); //$NON-NLS-1$ //$NON-NLS-2$ - } - env.put("GL_VERSION", "2"); //$NON-NLS-1$ //$NON-NLS-2$ - env.put("VIGS_SYNC_READ_PIXELS", "1"); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "GL_VERSION: " + env.get("GL_VERSION")); //$NON-NLS-1$ //$NON-NLS-2$ - EMLogger.getLogger().log(Level.INFO, "VIGS_SYNC_READ_PIXELS: " + env.get("VIGS_SYNC_READ_PIXELS")); //$NON-NLS-1$ //$NON-NLS-2$ - - if (this.binPath == null || this.binPath.isEmpty()) { - pb.directory(new File(FilePathResources.getEmulatorBinPath(emulatorPath))); - } else { - pb.directory(new File(this.binPath)); - } - - Process process = null; - try { - process = pb.start(); - } catch (IOException e) { - if (!isConsole) { - MessageDialog msg = new MessageDialog(new Shell(Display.getCurrent())); - msg.openWarningDialog("Failed to launch" + StringResources.NEW_LINE + e.getMessage()); //$NON-NLS-1$ - } - EMLogger.getLogger().log(Level.WARNING, "Failed to launch." + StringResources.NEW_LINE + e.getMessage()); //$NON-NLS-1$ - } - - return process; - } - - private boolean checkOnOff(String value) { - if (value.toLowerCase().equals("on")) { //$NON-NLS-1$ - return true; - } else if (value.toLowerCase().equals("off")) { //$NON-NLS-1$ - return false; - } else if (value.isEmpty()){ - return true; - } else { - return false; - } - } - - private boolean checkOn(String value) { - if (value.toLowerCase().equals("on")) { //$NON-NLS-1$ - return true; - } - return false; - } - - @Override - public void sendRemoteLog(String msg) { - EMLogger.getLogger().info("Launcher log : " + msg); //$NON-NLS-1$ - } - - private static boolean isTapUsing(String tapName) { - boolean isUsing = false; -// VMProperty arr[] = (VMProperty[]) EmulatorVMList.getInstance() -// .getProperties(); -// int len$ = arr$.length; -// for (int i$ = 0; i$ < len$; i$++) { - for (VMProperty prop : EmulatorVMList.getInstance().getProperties()) { - if (!prop.isRunning()) { - continue; - } - String name = prop.getPropertyValue().getAdvancedOptionValue( - OPT_NET_TAP_DEVICE); - if (tapName.equals(name)) { - isUsing = true; - break; - } - } - - return isUsing; - } - - private static boolean isIpAddrUsing(String ipAddr) { - boolean isUsing = false; - - for (VMProperty prop : EmulatorVMList.getInstance().getProperties()) { - if (!prop.isRunning()) { - continue; - } - String ip = prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, "ipAddr"); //$NON-NLS-1$ - if (!ipAddr.equals(ip)) { - continue; - } - isUsing = true; - break; - } - - return isUsing; - } - - private String getIP(boolean useBridgeNet, VMProperty prop) { - StringBuilder sb = new StringBuilder(); - sb.append(" ip="); //$NON-NLS-1$ - if (useBridgeNet) { - String useDHCP = prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_DHCP); - if (checkOn(useDHCP)) { - return ""; //$NON-NLS-1$ - } - - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_IPADDR)); - sb.append("::"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_GATEWAY)); - sb.append(":"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionSubValue( - OPT_NET_IP_INFO, OPT_NET_SUBNET)); - sb.append("::eth0:none:"); //$NON-NLS-1$ - sb.append(prop.getPropertyValue().getAdvancedOptionValue( - OPT_NET_DNS)); - - } else { // NAT (default) - //sb.append("10.0.2.16::10.0.2.2:255.255.255.0::eth0:none:10.0.2.3"); - return ""; //$NON-NLS-1$ - } - return sb.toString(); - } - - private String getHostProxy() throws VMLauncherException{ - String result = null; - String proxyCommand = "check-net"; //$NON-NLS-1$ - if (EmulatorManager.isWin()) { - proxyCommand = "check-net.exe"; //$NON-NLS-1$ - } - - List<String> cmd = Arrays.asList(FilePathResources.getEmulatorCheckToolPath() + File.separator + proxyCommand, "--proxy"); //$NON-NLS-1$ - ProcessResult res = HelperClass.runProcess(cmd); - boolean isCommandSuccess = false; - if (res.isSuccess()) { - for (String str : res.getStdOutMsg()) { - if (str.startsWith("MODE:")) { //$NON-NLS-1$ - isCommandSuccess = true; - } - if (str.startsWith("http_proxy")) { //$NON-NLS-1$ - result = str; - } - } - - } else if (!res.isSuccess() || !isCommandSuccess) { - EMLogger.getLogger().warning(res.getResultMessage()); - int dialogRes = new MessageDialog().openWarningAndSelectionDialog - ("Failed to get host proxy setting." //$NON-NLS-1$ - + "\n" + res.getResultMessage() //$NON-NLS-1$ - + "\nContinue launching anyway ?"); //$NON-NLS-1$ - if (dialogRes != SWT.OK) { - throw new VMLauncherException("User canceled launching VM."); //$NON-NLS-1$ - } - } - - if (result == null) { - EMLogger.getLogger().warning("Can't find host proxy setting."); //$NON-NLS-1$ - EMLogger.getLogger().warning("check-net result : " + res.getResultMessage()); //$NON-NLS-1$ - } - - return result; - } - -} diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/VMWorker.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/VMWorker.java index b0e55a9..3c9be76 100644 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/VMWorker.java +++ b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/VMWorker.java @@ -39,9 +39,4 @@ public class VMWorker extends VMWorkerCommon { EMLogger.getLogger().info("Launcher log : " + msg); //$NON-NLS-1$ } - @Override - public void initLauncher() { - setLauncher(Launcher.getInstance()); - } - }
\ No newline at end of file diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/OptionFactory.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/OptionFactoryV2.java index 3988b50..5e2abe6 100644 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/OptionFactory.java +++ b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/OptionFactoryV2.java @@ -1,11 +1,13 @@ -/* Emulator Manager +/* + * Emulator Manager * * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. * * Contact: * Minkee Lee <minkee.lee@samsung.com> + * JiHye Kim <jihye424.kim@samsung.com> * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> + * Sangho Park <sangho.p@samsung.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -26,29 +28,27 @@ * */ - package org.tizen.emulator.manager.wearable.vms.option; import java.util.ArrayList; import java.util.List; -import org.tizen.emulator.manager.ui.detail.item.ItemName; +import org.tizen.emulator.manager.template.renewal.VMItem; +import org.tizen.emulator.manager.ui.renewal.item.CommonOptionFactory; import org.tizen.emulator.manager.vms.option.CommonOption; -import org.tizen.emulator.manager.vms.option.CommonOptionFactroy; import org.tizen.emulator.manager.vms.option.DisplayModeOption; +import org.tizen.emulator.manager.vms.option.ForcePatOption; import org.tizen.emulator.manager.vms.option.IOption; import org.tizen.emulator.manager.vms.option.Option; import org.tizen.emulator.manager.vms.option.RemoteOption; -import org.tizen.emulator.manager.vms.xml.template.Item; -import org.tizen.emulator.manager.vms.xml.template.ItemList; -public class OptionFactory extends CommonOptionFactroy { +public class OptionFactoryV2 extends CommonOptionFactory { @Override - public List<IOption> makeOptionList(ItemList itemTemplate) { + public List<IOption> makeOptionList(List<VMItem> itemList) { List<IOption> optionList = new ArrayList<IOption>(); - makeCommonOptionList(optionList, itemTemplate); + makeCommonOptionList(optionList, itemList); // Add other options optionList.add(Option.getInstance(CommonOption.class)); @@ -57,27 +57,14 @@ public class OptionFactory extends CommonOptionFactroy { optionList.add(Option.getInstance(RotaryOption.class)); optionList.add(Option.getInstance(WDefaultOption.class)); optionList.add(Option.getInstance(DisplayModeOption.class)); - + optionList.add(Option.getInstance(ForcePatOption.class)); return optionList; } - @Override - public void addDeviceOption(Item item, List<IOption> optionList) { - String name = item.getName(); - if (name.equals(ItemName.SENSOR)) { - optionList.add(Option.getInstance(WSensorOption.class)); - - } else if (name.equals(ItemName.DEVICE)) { - optionList.add(Option.getInstance(WDeviceOption.class)); - } else if (name.equals(ItemName.JACK)) { - optionList.add(Option.getInstance(WJackOption.class)); - - } else if (name.equals(ItemName.DISPLAY_MODE)) { - return; - - } else { - super.addDeviceOption(item, optionList); - } + @Override + public void addOption(List<IOption> optionList, VMItem item) { + super.addOption(optionList, item); } + } diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WDefaultOption.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WDefaultOption.java index f869bb6..29497b8 100644 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WDefaultOption.java +++ b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WDefaultOption.java @@ -29,7 +29,6 @@ package org.tizen.emulator.manager.wearable.vms.option; import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.helper.VMLauncherException; import org.tizen.emulator.manager.vms.option.LaunchConfig; import org.tizen.emulator.manager.vms.option.OPTION_KEY; import org.tizen.emulator.manager.vms.option.Option; @@ -37,8 +36,7 @@ import org.tizen.emulator.manager.vms.option.Option; public class WDefaultOption extends Option { @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) - throws VMLauncherException { + public void getLaunchArgument(LaunchConfig config, VMProperty property) { config.addQemuOption("-device AC97"); //$NON-NLS-1$ config.addQemuOption("-device virtio-maru-esm-pci"); //$NON-NLS-1$ diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WDeviceOption.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WDeviceOption.java deleted file mode 100644 index 9f43aa3..0000000 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WDeviceOption.java +++ /dev/null @@ -1,59 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.wearable.vms.option; - -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.wearable.ui.detail.WItemName; - -public class WDeviceOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - // for nfc - if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( - WItemName.DEVICE, WItemName.NFC))) { - config.addQemuOption("-device", "virtio-maru-nfc-pci"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - // for battery -// if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( -// WItemName.DEVICE, WItemName.BATTERY))) { -// config.addQemuOption("-device", "virtio-power-pci"); -// } - - // for camera -// if (checkOnOff(property.getPropertyValue().getAdvancedOptionSubValue( -// WItemName.DEVICE, WItemName.CAMERA))) { -// config.addQemuOption("-device", "maru-camera"); -// } - } - -} diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WJackOption.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WJackOption.java deleted file mode 100644 index beb2bdb..0000000 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WJackOption.java +++ /dev/null @@ -1,77 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.wearable.vms.option; - -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.OPTION_KEY; -import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.OptionType; -import org.tizen.emulator.manager.wearable.ui.detail.WItemName; - -public class WJackOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - OptionType jacks = property.getPropertyValue().getAdvancedOption( - WItemName.JACK); - StringBuilder sb = new StringBuilder(); - if (jacks != null) { - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.JACK, - WItemName.EARJACK))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("earjack"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.JACK, - WItemName.CHARGER))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("charger"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.JACK, WItemName.USB))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("usb"); //$NON-NLS-1$ - } - } - - // TODO duplicated in WDefaultOption.java - config.addVariable(OPTION_KEY.VAR_JACKS, sb.toString()); - config.addQemuOption("-device", "virtio-jack-pci,jacks=" //$NON-NLS-1$ //$NON-NLS-2$ - + varForm(OPTION_KEY.VAR_JACKS)); - } - -} diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WSensorOption.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WSensorOption.java deleted file mode 100644 index 03d4ae4..0000000 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WSensorOption.java +++ /dev/null @@ -1,119 +0,0 @@ -/* Emulator Manager - * - * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved. - * - * Contact: - * Minkee Lee <minkee.lee@samsung.com> - * SeokYeon Hwang <syeon.hwang@samsung.com> - * Sangho Park <sangho1206.park@samsung.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Contributors: - * - S-Core Co., Ltd - * - */ - -package org.tizen.emulator.manager.wearable.vms.option; - -import org.tizen.emulator.manager.vms.VMProperty; -import org.tizen.emulator.manager.vms.option.LaunchConfig; -import org.tizen.emulator.manager.vms.option.OPTION_KEY; -import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.OptionType; -import org.tizen.emulator.manager.wearable.ui.detail.WItemName; - -public class WSensorOption extends Option { - - @Override - public void getLaunchArgument(LaunchConfig config, VMProperty property) { - OptionType sensor = property.getPropertyValue().getAdvancedOption( - WItemName.SENSOR); - StringBuilder sb = new StringBuilder(); - if (sensor != null) { - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.ACCEL))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("accel"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.GEO))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("geo"); //$NON-NLS-1$ - } - if (checkOnOff(property - .getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.GYRO))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("gyro"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.LIGHT))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("light"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.PROXI))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("proxi"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.HAPTIC))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("haptic"); //$NON-NLS-1$ - } - if (checkOnOff(property - .getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.UV))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("uv"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.PRESS))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("press"); //$NON-NLS-1$ - } - if (checkOnOff(property.getPropertyValue() - .getAdvancedOptionSubValue(WItemName.SENSOR, WItemName.HRM))) { - if (!sb.toString().isEmpty()) { - sb.append("&"); //$NON-NLS-1$ - } - sb.append("hrm"); //$NON-NLS-1$ - } - } - - config.addVariable(OPTION_KEY.VAR_SENSORS, sb.toString()); - config.addQemuOption("-device", "virtio-maru-sensor-pci,sensors=" //$NON-NLS-1$ //$NON-NLS-2$ - + varForm(OPTION_KEY.VAR_SENSORS)); - - } - -} diff --git a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WTouchPointOption.java b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WTouchPointOption.java index 12dac7c..d526421 100644 --- a/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WTouchPointOption.java +++ b/plugins/wearable/src/org/tizen/emulator/manager/wearable/vms/option/WTouchPointOption.java @@ -33,17 +33,14 @@ import org.tizen.emulator.manager.vms.VMProperty; import org.tizen.emulator.manager.vms.option.LaunchConfig; import org.tizen.emulator.manager.vms.option.OPTION_KEY; import org.tizen.emulator.manager.vms.option.Option; -import org.tizen.emulator.manager.vms.xml.TouchType; public class WTouchPointOption extends Option { @Override public void getLaunchArgument(LaunchConfig config, VMProperty property) { - TouchType touchType = property.getConfiguration().getDevice() - .getTouch(); - if (touchType != null && touchType.getMaxTouchPoint() > 0) { + if (property.getPropertyValue().maxTouchCount > 0) { config.addVariable(OPTION_KEY.VAR_MAX_POINT, - String.valueOf(touchType.getMaxTouchPoint())); + String.valueOf(property.getPropertyValue().maxTouchCount)); config.addQemuOption("-device", "virtio-maru-touchscreen-pci,max_point=" //$NON-NLS-1$ //$NON-NLS-2$ + varForm(OPTION_KEY.VAR_MAX_POINT)); } else { diff --git a/plugins/wearable/template/3.0-wearable-circle-i386-template-v2.xml b/plugins/wearable/template/3.0-wearable-circle-i386-template-v2.xml new file mode 100644 index 0000000..45b437a --- /dev/null +++ b/plugins/wearable/template/3.0-wearable-circle-i386-template-v2.xml @@ -0,0 +1,102 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> + +<!-- This file describes component of VM property UI in Emulator manager. + (VM property UI descriptor) + Each element in this file is matched with an item of vm property UI. --> + +<ItemList xmlns="http://www.tizen.org/em/template" version="2.0"> + <information profile="wearable" version="3.0" image="3.0-wearable-circle-i386"/> + + <itemGroup name="default"> + <item name="name" title="VM Name" type="textInput"/> + <item name="profile" title="Profile"/> + <item name="baseImage" title="Base Image"/> + <item name="deviceTemplate" title="Device" type="treeRoot"> + <item type="label" name="display" title="Display"> + <item name="resolution" title="Resolution" type="combo" > + <!-- name, width, height, dpi --> + <option name="360"> ,360,360,302 </option> + </item> + <item name="size" title="Size" type="textInput" /> + <item name="skin" title="Skin" type="combo" /> + </item> + <item name="processors" title="Processors" type="combo" /> + <item name="ramSize" title="Ram" type="combo" > + <option name="useConfig">false</option> + <option name="list">512,768,1024</option> + </item> + <item name="sensor" title="Sensor" type="checkLabel" > + <item name="accel" title="Accelerometer" type="checkbox" /> + <item name="gyro" title="Gyroscope" type="checkbox" /> + <item name="geo" title="Geo-magnetic" type="checkbox" /> + <item name="proxi" title="Proximity" type="checkbox"/> + <item name="light" title="Light" type="checkbox"/> + <item name="haptic" title="Haptic" type="checkbox"/> + <item name="press" title="Pressure" type="checkbox"/> + <item name="uv" title="Ultraviolet" type="checkbox"/> + <item name="hrm" title="Heartbeat Rate" type="checkbox"/> + <option name="numColumn">2</option> + </item> + <item name="connectivity" title="Connectivity" type="checkLabel"> + <item name="nfc" title="NFC" type="checkbox" /> + <option name="numColumn">2</option> + </item> + + </item> + </itemGroup> + + + <itemGroup name="advanced"> + <item name="suspendSupport" title="Suspend" type="toggle" > + <option name="experimental">true</option> + </item> +<!-- <item type="combo" name="maxTouch" title="Max Touch Point"/> --> + <item name="fileShare" title="File Sharing" type="file"> + <option name="dialogType">directory</option> + </item> + <item name="camera" title="Camera" type="label" > +<!-- <item type="combo" name="frontType" title="Front"/> --> +<!-- <item type="file" name="frontImage" title="(image)"/> --> + <item type="combo" name="rearType" title="Rear"/> + <item type="file" name="rearImage" title="(image)"/> + </item> + <item name="hwSupport" title="HW Support" type="label" > + <item name="cpu" title="CPU VT" type="toggle" /> + <item name="gpu" title="GPU" type="toggle" /> + </item> + <item name="glVersion" title="OpenGL ES Ver" type="combo"> + <option name="v2.0_v3.0">v2.0 & v3.0</option> + <option name="v1.1_v2.0">v1.1 & v2.0</option> + <option name="supportOS">mac</option> + </item> + <item name="network" title="Network" type="label"> + <item name="proxy" title="Proxy" type="combo" > + <option name="none">No proxy</option> + <option name="auto">Use host proxy</option> + <option name="manual">Use manual proxy</option> + <option name="defaultValue">auto</option> + </item> + <item name="netConnectType" title="Connect Type" type="combo" > + <option name="list">NAT, Bridge</option> + </item> + <item name="netTapDevice" title="Base Network" type="combo"> + <option name="supportOS">mac,linux</option> + </item> + <item name="netTapDevice" title="Tap Device" type="combo"> + <option name="supportOS">win</option> + </item> + <item name="netIpInfo" title="VM IP info" type="subLabel"> + <item name="useDHCP" title="Use DHCP" type="checkbox" > + <option name="defaultValue">on</option> + </item> + <item name="ipAddr" title="IP Address" type="text" /> + <item name="subnet" title="Subnet" type="text"/> + <item name="gateway" title="Gateway" type="text"/> + </item> + <item name="netDns" type="text" title="DNS" /> + <item name="netMac" type="text" title="MAC" /> + </item> + </itemGroup> + +</ItemList> + diff --git a/plugins/wearable/template/3.0-wearable-circle-i386.xml b/plugins/wearable/template/3.0-wearable-circle-i386.xml deleted file mode 100644 index 7cb1204..0000000 --- a/plugins/wearable/template/3.0-wearable-circle-i386.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> -<EmulatorConfiguration xmlns="http://www.tizen.org/em"> - <baseInformation> - <diskImage profile="wearable"/> - </baseInformation> - <usability> - <logging> - <level>NONE</level> - </logging> - <fileSharing/> - <hwVirtualization>true</hwVirtualization> - <hwGLAcceleration>true</hwGLAcceleration> - </usability> - <device> - <display> - <resolution> - <width>360</width> - <height>360</height> - </resolution> - <density unit="dpi">302</density> - </display> - <RAM> - <size unit="MiB">512</size> - </RAM> - <touch maxTouchPoint="2"/> - </device> - <advancedOption> - <option name="displayMode"> - <subOption name="qtEnable" value="on"/> - </option> - <option name="device"> - <subOption name="nfc" value="on"/> - </option> - <option name="jack"> - <subOption name="charger" value="on"/> - <subOption name="usb" value="on"/> - </option> - <option name="sensor"> - <subOption name="accel" value="on"/> - <subOption name="gyro" value="on"/> - <subOption name="geo" value="on"/> - <subOption name="light" value="on"/> - <subOption name="proxi" value="on"/> - <subOption name="haptic" value="on"/> - <subOption name="press" value="on"/> - <subOption name="uv" value="on"/> - <subOption name="hrm" value="on"/> - </option> - </advancedOption> -</EmulatorConfiguration> diff --git a/plugins/wearable/template/x86-standard-template-v2.xml b/plugins/wearable/template/x86-standard-template-v2.xml new file mode 100644 index 0000000..c79c18e --- /dev/null +++ b/plugins/wearable/template/x86-standard-template-v2.xml @@ -0,0 +1,104 @@ +<?xml version="1.0" encoding="UTF-8" standalone="yes"?> + +<!-- This file describes component of VM property UI in Emulator manager. + (VM property UI descriptor) + Each element in this file is matched with an item of vm property UI. --> + +<ItemList xmlns="http://www.tizen.org/em/template" version="2.0"> + <information profile="wearable" version="3.0" image="x86-standard"/> + + <itemGroup name="default"> + <item name="name" title="VM Name" type="textInput"/> + <item name="profile" title="Profile"/> + <item name="baseImage" title="Base Image"/> + <item name="deviceTemplate" title="Device" type="treeRoot"> + <item type="label" name="display" title="Display"> + <item name="resolution" title="Resolution" type="combo" > + <!-- name, width, height, dpi --> + <option name="320"> ,320,320,316 </option> + <option name="360"> ,360,360,302 </option> + <option name="480"> ,360,480,300 </option> + </item> + <item name="size" title="Size" type="textInput" /> + <item name="skin" title="Skin" type="combo" /> + </item> + <item name="processors" title="Processors" type="combo" /> + <item name="ramSize" title="Ram" type="combo" > + <option name="useConfig">false</option> + <option name="list">512,768,1024</option> + </item> + <item name="sensor" title="Sensor" type="checkLabel" > + <item name="accel" title="Accelerometer" type="checkbox" /> + <item name="gyro" title="Gyroscope" type="checkbox" /> + <item name="geo" title="Geo-magnetic" type="checkbox" /> + <item name="proxi" title="Proximity" type="checkbox"/> + <item name="light" title="Light" type="checkbox"/> + <item name="haptic" title="Haptic" type="checkbox"/> + <item name="press" title="Pressure" type="checkbox"/> + <item name="uv" title="Ultraviolet" type="checkbox"/> + <item name="hrm" title="Heartbeat Rate" type="checkbox"/> + <option name="numColumn">2</option> + </item> + <item name="connectivity" title="Connectivity" type="checkLabel"> + <item name="nfc" title="NFC" type="checkbox" /> + <option name="numColumn">2</option> + </item> + + </item> + </itemGroup> + + + <itemGroup name="advanced"> + <item name="suspendSupport" title="Suspend" type="toggle" > + <option name="experimental">true</option> + </item> +<!-- <item type="combo" name="maxTouch" title="Max Touch Point"/> --> + <item name="fileShare" title="File Sharing" type="file"> + <option name="dialogType">directory</option> + </item> + <item name="camera" title="Camera" type="label" > +<!-- <item type="combo" name="frontType" title="Front"/> --> +<!-- <item type="file" name="frontImage" title="(image)"/> --> + <item type="combo" name="rearType" title="Rear"/> + <item type="file" name="rearImage" title="(image)"/> + </item> + <item name="hwSupport" title="HW Support" type="label" > + <item name="cpu" title="CPU VT" type="toggle" /> + <item name="gpu" title="GPU" type="toggle" /> + </item> + <item name="glVersion" title="OpenGL ES Ver" type="combo"> + <option name="v2.0_v3.0">v2.0 & v3.0</option> + <option name="v1.1_v2.0">v1.1 & v2.0</option> + <option name="supportOS">mac</option> + </item> + <item name="network" title="Network" type="label"> + <item name="proxy" title="Proxy" type="combo" > + <option name="none">No proxy</option> + <option name="auto">Use host proxy</option> + <option name="manual">Use manual proxy</option> + <option name="defaultValue">auto</option> + </item> + <item name="netConnectType" title="Connect Type" type="combo" > + <option name="list">NAT, Bridge</option> + </item> + <item name="netTapDevice" title="Base Network" type="combo"> + <option name="supportOS">mac,linux</option> + </item> + <item name="netTapDevice" title="Tap Device" type="combo"> + <option name="supportOS">win</option> + </item> + <item name="netIpInfo" title="VM IP info" type="subLabel"> + <item name="useDHCP" title="Use DHCP" type="checkbox" > + <option name="defaultValue">on</option> + </item> + <item name="ipAddr" title="IP Address" type="text" /> + <item name="subnet" title="Subnet" type="text"/> + <item name="gateway" title="Gateway" type="text"/> + </item> + <item name="netDns" type="text" title="DNS" /> + <item name="netMac" type="text" title="MAC" /> + </item> + </itemGroup> + +</ItemList> + diff --git a/plugins/wearable/template/x86-standard-template.xml b/plugins/wearable/template/x86-standard-template.xml deleted file mode 100644 index dc9ec32..0000000 --- a/plugins/wearable/template/x86-standard-template.xml +++ /dev/null @@ -1,122 +0,0 @@ -<?xml version="1.0" encoding="UTF-8" standalone="yes"?> - -<!-- This file describes component of VM property UI in Emulator manager. - (VM property UI descriptor) - Each element in this file is matched with an item of vm property UI. --> - -<ItemList xmlns="http://www.tizen.org/em/template" profile="wearable" image="x86-standard"> - - <propertyList> - <item type="text" name="vmName" title="Name"/> - <item type="file" name="baseImage" title="Base Image"> - <option name="dialogType">file</option> - </item> - <item type="label" name="display" title="Display"> - <item type="combo" name="resolution" title="Resolution"> - <!-- name, width, height, dpi --> - <option name="320"> ,320,320,316 </option> - <option name="360"> ,360,360,302 </option> - <option name="480"> ,360,480,300 </option> -<!-- <option name="hvga"> HVGA,320,480,160 </option> --> -<!-- <option name="wvga"> WVGA,480,800,207 </option> --> -<!-- <option name="wsvga"> WSVGA,600,1024,207 </option> --> -<!-- <option name="qhd"> QHD,540,960,244 </option> --> -<!-- <option name="hd"> HD,720,1280,316 </option> --> -<!-- <option name="wxga"> WXGA,1280,800,300 </option> --> -<!-- <option name="hd1080"> HD1080,1920,1080,314 </option> --> -<!-- <option name="wqxga"> WQXGA,2560,1600,301 </option> --> -<!-- <option name="fullhd"> FULLHD,1080,1920,314 </option> --> - </item> - <item type="spinner" name="dpi" title="Density"/> - <item type="combo" name="skin" title="Skin"/> - </item> - <item type="combo" name="processors" title="Processors" /> - <item type="combo" name="ramSize" title="RAM Size"> - <option name="list">512,768,1024</option> - </item> -<!-- <item type="combo" name="maxTouch" title="Max Touch Point"/> --> - <item type="label" name="fileShare" title="File Sharing"> - <item type="toggle" name="share" title="Sharing"/> - <item type="file" name="directory" title="Directory"> - <option name="dialogType">directory</option> - </item> - </item> - <item type="label" name="hwSupport" title="HW Support"> - <item type="toggle" name="cpu" title="CPU VT"/> - <item type="toggle" name="gpu" title="GPU"/> - </item> - <item type="combo" name="glVersion" title="OpenGL ES Ver"> - <option name="v2.0_v3.0">v2.0 & v3.0</option> - <option name="v1.1_v2.0">v1.1 & v2.0</option> - <option name="supportOS">mac</option> - </item> - </propertyList> - -<!-- Followings are drawn as check box in Emulator Manager vm property UI.--> - <deviceList> - <item type="lineLabel" name="advancedOption" title="Advanced Option"/> - <item type="label" name="camera" title="Camera"> -<!-- <item type="combo" name="frontType" title="Front"/> --> -<!-- <item type="file" name="frontImage" title="(image)"/> --> - <item type="combo" name="rearType" title="Rear"/> - <item type="file" name="rearImage" title="(image)"/> - </item> - <item type="checkLabel" name="sensor" title="Sensor"> - <item type="checkbox" name="accel" title="Accelerometer"/> - <item type="checkbox" name="gyro" title="Gyroscope"/> - <item type="checkbox" name="geo" title="Geomagnetic"/> - <item type="checkbox" name="proxi" title="Proximity"/> - <item type="checkbox" name="light" title="Light"/> - <item type="checkbox" name="haptic" title="Haptic"/> - <item type="checkbox" name="press" title="Pressure"/> - <item type="checkbox" name="uv" title="Ultraviolet"/> - <item type="checkbox" name="hrm" title="Heartbeat Rate"/> - </item> - <item type="checkLabel" name="device" title="Device"> - <item type="checkbox" name="nfc" title="NFC"/> -<!-- <item type="checkbox" name="camera" title="Camera"/> --> -<!-- <item type="checkbox" name="battery" title="Battery"/> --> -<!-- <item type="checkbox" name="swap" title="Swap Image"> --> -<!-- <option name="defaultOnCreate">on</option> --> -<!-- </item> --> -<!-- <item type="checkbox" name="hwkey" title="HW Key"/> --> - </item> -<!-- <item type="checkLabel" name="jack" title="Jack"> --> -<!-- <item type="checkbox" name="charger" title="Charger"/> --> -<!-- <item type="checkbox" name="usb" title="USB"/> --> -<!-- </item> --> - - - <!-- Network configuration --> - <item name="netConfig" type="lineLabel" title="Network Configuration"> - <option name="spreadOnStart">false</option> - </item> - <item name="proxy" type="combo" title="Proxy"> - <option name="none">No proxy</option> - <option name="auto">Use host proxy</option> - <option name="manual">Use manual proxy</option> - <option name="defaultOnCreate">auto</option> - </item> - <item name="netConnectType" type="combo" title="Connect Type"> - <option name="list">NAT, Bridge</option> - </item> - <item name="netTapDevice" type="combo" title="Base Network"> - <option name="supportOS">mac,linux</option> - </item> - <item name="netTapDevice" type="combo" title="Tap Device"> - <option name="supportOS">win</option> - </item> - <item name="netIpInfo" type="label" title="VM IP info"> - <item name="useDHCP" type="checkbox" title="Use DHCP"> - <option name="defaultOnCreate">off</option> - </item> - <item name="ipAddr" type="text" title="IP Address" /> - <item name="subnet" type="text" title="Subnet" /> - <item name="gateway" type="text" title="Gateway" /> - </item> - <item name="netDns" type="text" title="DNS" /> - <item name="netMac" type="text" title="MAC" /> - </deviceList> - -</ItemList> - diff --git a/plugins/wearable/template/x86-standard.xml b/plugins/wearable/template/x86-standard.xml index ed9f0a6..fff82cd 100644 --- a/plugins/wearable/template/x86-standard.xml +++ b/plugins/wearable/template/x86-standard.xml @@ -46,5 +46,25 @@ <subOption name="uv" value="on"/> <subOption name="hrm" value="on"/> </option> + <option name="netIpInfo"> + <subOption name="useDHCP" value="off"/> + <subOption name="ipAddr" value=""/> + <subOption name="subnet" value=""/> + <subOption name="gateway" value=""/> + </option> + <option name="connectivity"> + <subOption name="nfc" value="on"/> + </option> + <option name="proxy"> + <subOption name="proxyMode" value="auto"/> + <subOption name="httpProxy" value=""/> + <subOption name="httpsProxy" value=""/> + <subOption name="ftpProxy" value=""/> + <subOption name="socksProxy" value=""/> + </option> + <option name="netConnectType" value="NAT"/> + <option name="netTapDevice" value=""/> + <option name="netDns" value=""/> + <option name="netMac" value=""/> </advancedOption> </EmulatorConfiguration> |