问题描述
Initialize()ReadEventPlayerFile()//ReadintheEventPlayerFileandstorein//Memory(iffilesdoesnotgettobig)//JustKeepProcessingtheEventPlayerFileRecordsuntilendreachedWHILEnotEndofFileDo://RetrievethenextrecordCurrentRecord=getCurrentRecord();//RetrievetheTimeTicsvaluefromcurrentrecordTimeTics=getTimeTics(CurrentRecord);//Determinehowlongfromnowtosendthenextmessage//Adderrorcheckingfornegativecases,etc…DiffTics=TimeTics-getCurrentSystemTimeTics();//SleepuntiltimetofiretheRawEventSleep(DiffTics)//WakeupandsendtheRawEventtotheidentifiedCOLLECTORsendRawEvent(CurrentRecord)END
上面是伪代码,完成的功能是读一个xml文档,然后按照xml文档里记录的事件依次运行,xml文档组织结构如下:<?xmlversion="1.0"encoding="UTF-8"?><javaversion="1.6.0_0"class="java.beans.XMLDecoder"><objectclass="EventList"><voidproperty="MEventList"><voidmethod="add"><objectclass="Event"><voidproperty="MCollectorId"><int>1</int></void><voidproperty="MRawEventCode"><int>50</int></void><voidproperty="MRepeatCode"><int>1</int></void><voidproperty="MTimeTics"><int>1300</int></void></object></void></void><voidmethod="add"><objectclass="Event"><voidproperty="MCollectorId"><int>8</int></void><voidproperty="MRawEventCode"><int>85</int></void><voidproperty="MRepeatCode"><int>1</int></void><voidproperty="MTimeTics"><int>2000</int></void></object></void><voidmethod="add"><objectclass="Event"><voidproperty="MCollectorId"><int>9</int></void><voidproperty="MRawEventCode"><int>90</int></void><voidproperty="MRepeatCode"><int>1</int></void><voidproperty="MTimeTics"><int>2100</int></void></object></void></void></object></java>
谢谢各位大侠了!
解决方案
解决方案二:
该回复于2010-05-26 08:25:28被版主删除
解决方案三:
顶起来不要沉,大侠们帮忙啊
解决方案四:
呵呵,顶一下