From: giwoong.kim Date: Tue, 28 Aug 2012 08:38:29 +0000 (+0900) Subject: [Title] added Diagnosis menuitem X-Git-Tag: TizenStudio_2.0_p2.3~1363 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32a2ef1f3dbf2042936a508225644e2fd504129c;p=sdk%2Femulator%2Fqemu.git [Title] added Diagnosis menuitem [Type] feature [Module] Emulator / menu [Priority] major [Jira#] [Redmine#] [Problem] [Cause] RAM dump [Solution] [TestCase] --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java index c9ed794..6924171 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java @@ -1905,6 +1905,24 @@ public class EmulatorSkin { } + private Menu createDiagnosisMenu(Shell shell) { + Menu menu = new Menu(shell, SWT.DROP_DOWN); + + final MenuItem ramdumpItem = new MenuItem(menu, SWT.PUSH); + ramdumpItem.setText("&Ram Dump"); + + ramdumpItem.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected( SelectionEvent e ) { + logger.info("Ram dump menu is selected"); + + communicator.sendToQEMU(SendCommand.RAM_DUMP, null); + } + }); + + return menu; + } + private Menu createAdvancedMenu( final Shell shell ) { final Menu menu = new Menu( shell, SWT.DROP_DOWN ); @@ -1971,8 +1989,8 @@ public class EmulatorSkin { if ( item.getSelection() ) { boolean on = item.equals( usbOnItem ); isOnUsbKbd = on; - communicator - .sendToQEMU( SendCommand.USB_KBD, new BooleanData( on, SendCommand.USB_KBD.toString() ) ); + communicator.sendToQEMU( + SendCommand.USB_KBD, new BooleanData(on, SendCommand.USB_KBD.toString()) ); } } @@ -1983,11 +2001,14 @@ public class EmulatorSkin { usbKeyboardItem.setMenu( usbKeyBoardMenu ); - /* - // Diagnosis menu - final MenuItem diagnosisItem = new MenuItem(menu, SWT.PUSH); - diagnosisItem.setText("Diagnosis"); + /* Diagnosis menu */ + final MenuItem diagnosisItem = new MenuItem(menu, SWT.CASCADE); + diagnosisItem.setText("&Diagnosis"); + //diagnosisItem.setImage(imageRegistry.getIcon(IconName.XXX)); + Menu diagnosisMenu = createDiagnosisMenu(menu.getShell()); + diagnosisItem.setMenu(diagnosisMenu); + /* // Force close menu final MenuItem forceCloseItem = new MenuItem(menu, SWT.PUSH); forceCloseItem.setText("Force Close"); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java index f185d27..b2cac84 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java @@ -170,6 +170,7 @@ public interface ICommunicator extends Runnable { USB_KBD( (short)15 ), SCREEN_SHOT( (short)16 ), DETAIL_INFO( (short)17 ), + RAM_DUMP( (short)18 ), RESPONSE_HEART_BEAT( (short)900 ), CLOSE( (short)998 ), diff --git a/tizen/src/skin/maruskin_operation.c b/tizen/src/skin/maruskin_operation.c index 786db82..0789878 100644 --- a/tizen/src/skin/maruskin_operation.c +++ b/tizen/src/skin/maruskin_operation.c @@ -383,6 +383,11 @@ void onoff_usb_kbd( int on ) mloop_evcmd_usbkbd(on); } +void ram_dump(void) { + INFO("ram dump!\n"); + + //TODO: +} void request_close( void ) { diff --git a/tizen/src/skin/maruskin_operation.h b/tizen/src/skin/maruskin_operation.h index 7409d7a..4c83260 100644 --- a/tizen/src/skin/maruskin_operation.h +++ b/tizen/src/skin/maruskin_operation.h @@ -71,6 +71,8 @@ void open_shell(void); void onoff_usb_kbd( int on ); +void ram_dump(void); + void request_close( void ); void shutdown_qemu_gracefully( void ); diff --git a/tizen/src/skin/maruskin_server.c b/tizen/src/skin/maruskin_server.c index 6e352a3..6ecc726 100644 --- a/tizen/src/skin/maruskin_server.c +++ b/tizen/src/skin/maruskin_server.c @@ -102,6 +102,7 @@ enum { RECV_USB_KBD = 15, RECV_SCREEN_SHOT = 16, RECV_DETAIL_INFO = 17, + RECV_RAM_DUMP = 18, RECV_RESPONSE_HEART_BEAT = 900, RECV_CLOSE = 998, RECV_RESPONSE_SHUTDOWN = 999, @@ -751,6 +752,13 @@ static void* run_skin_server( void* args ) { break; } + case RECV_RAM_DUMP: { + log_cnt += sprintf(log_buf + log_cnt, "RECV_RAM_DUMP ==\n"); + TRACE(log_buf); + + ram_dump(); + break; + } case RECV_RESPONSE_HEART_BEAT: { log_cnt += sprintf( log_buf + log_cnt, "RECV_RESPONSE_HEART_BEAT ==\n" ); // TRACE( log_buf );