Changeset 41 for trunk/EventBenchConsole/src/de/ugoe/cs
- Timestamp:
- 05/16/11 14:06:27 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/EventGenerator.java
r28 r41 396 396 } else if (genMsgChild.getName().equals("LPARAM")) { 397 397 String paramValueStr = getTermValue(null, termElement); 398 int paramValue = 0; 399 try { 400 paramValue = Integer.parseInt(paramValueStr); 401 generatedMessage.setLPARAM(paramValue); 402 } catch (NumberFormatException e) { 403 generatedMessage.setLPARAMasWindowDesc(paramValueStr); 398 long paramValue = 0; 399 Element loword = genMsgChild.getChild("LOWORD", rulesNamespace); 400 if( loword!=null ) { 401 paramValue = loHiWord(genMsgChild); 402 } else { 403 try { 404 paramValue = Integer.parseInt(paramValueStr); 405 generatedMessage.setLPARAM(paramValue); 406 } catch (NumberFormatException e) { 407 generatedMessage.setLPARAMasWindowDesc(paramValueStr); 408 } 404 409 } 405 410 } else if (genMsgChild.getName().equals("WPARAM")) { 406 411 String paramValueStr = getTermValue(null, termElement); 407 int paramValue = 0; 408 try { 409 paramValue = Integer.parseInt(paramValueStr); 410 generatedMessage.setWPARAM(paramValue); 411 } catch (NumberFormatException e) { 412 generatedMessage.setWPARAMasWindowDesc(paramValueStr); 412 long paramValue = 0; 413 Element loword = genMsgChild.getChild("LOWORD", rulesNamespace); 414 if( loword!=null ) { 415 paramValue = loHiWord(genMsgChild); 416 } else { 417 try { 418 paramValue = Integer.parseInt(paramValueStr); 419 generatedMessage.setWPARAM(paramValue); 420 } catch (NumberFormatException e) { 421 generatedMessage.setWPARAMasWindowDesc(paramValueStr); 422 } 413 423 } 414 424 } … … 711 721 } 712 722 } 723 724 private long loHiWord(Element param) { 725 Element loword = param.getChild("LOWORD", rulesNamespace); 726 Element hiword = param.getChild("HIWORD", rulesNamespace); 727 String lowordStr = getTermValue(null, (Element) loword.getChildren().get(0)); 728 String hiwordStr = getTermValue(null, (Element) hiword.getChildren().get(0)); 729 return LOWORD(Integer.parseInt(lowordStr))+HIWORD(Integer.parseInt(hiwordStr)); 730 } 731 732 private static short LOWORD(long data) { 733 return (short) (data & 0xffff); 734 } 735 736 private static short HIWORD(long data) { 737 return (short) (data >> 16); 738 } 713 739 714 740 }
Note: See TracChangeset
for help on using the changeset viewer.