QView™ Visualization & Monitoring - QTools - Quantum Leaps

文章推薦指數: 80 %
投票人數:10人

QView™ is a powerful Visualization and Monitoring facility, which allows embedded developers to rapidly create remote graphical user-interfaces to monitor ... QTools  7.0.0 CollectionofHost-BasedTools    AboutQView™ QView™isapowerfulVisualizationandMonitoringfacility,whichallowsembeddeddeveloperstorapidlycreateremotegraphicaluser-interfacestomonitorandcontroltheirembeddeddevicesfromahost(desktop)computer.TheinterfacescreatedbyQView™canvisualizethetracingdataproducedbyQP/Spyandcanalsointeractwiththetargetbysendingcommandsandinjectingeventstotheembeddedtarget. Asyoucanseeinthescreenshotsbelow,aQView™userinterfaceconsistsofatextboxwithextensiblemenusplusacustomizablecanvasthatcanserveasaremotegraphicaluser-interfacetoyourembeddeddevice.Thecanvascancontainvarious"widgets",suchasbuttons,sliders,gauges,graphs,animations,etc.TheactualfunctionalityofthevirtualGUIobviouslydependsonthetargetsystemandtheembeddedcodeitisrunning.Therefore,theQView™providesonlyaskeleton,whichisthencustomizedbyuser-suppliedscriptswritteninPython(version3). ExampleofaQView™sessiononanembeddedboard(Windowshost) ExampleofaQView™session(Linuxhost) What'sSpecialAboutIt? QView™hasbeenspecificallydesignedforextensibility,sothatyoucanquicklycustomizeitsGUIandbehaviortoyourspecificembeddedproject,sothatyoucanuseQView™asapowerfulcustomHuman-MachineInterface(HMI)foryourprojects.ThecusomizationisaccomplishedinPython(version3),whichmeansthatitisnaturallyplatform-neutralandrunswithoutanychangesonWindows,Linux,ormacOS. Outofthebox,QView™supportsthefollowingcommands(NOTE:ThisbasicfunctionalitycanbeextendedintheQView™customization): SetglobalQSfiltersinsidetheTarget SetlocalQSfiltersinsidetheTarget InjectanarbitraryeventtotheTarget(directpostorpublish) Executeauser-definedcommandfunctioninsidetheTargetwithargumentssuppliedfromQView™ PeekdatainsidetheTargetandsendtoQView™ Pokedata(suppliedfromQView™)intotheTarget ExecuteclocktickinsidetheTarget RemotelyresettheTarget. NoteAvisualizationandmonitoringsystemlikeQView™canbeusedinallstagesofdevelopment,duringmanufacturing,andalsoafterdeploymentforin-fieldservicingofembeddeddevices. QView™Structure ThesequencediagrambelowshowsthegeneralstructureofQView™.TheembeddedTargetisrunninganinstrumentedcodethatcommunicateswiththeQSPYHostapplicationovertheTargetdatalink(redarrows).ThiscommunicationisbasedontheQP/SpyProtocol. AttentionTheTargetmustberunningthe"Spy"buildconfiguration,inwhichtheQP/Spy™SoftwareTracingisenabled.Additionally,theQP/SpyimplementationintheTargetmustsupportbi-directionalcommunicationwithQSPY. TheQView™(Pythonscript)attachestotheQSPYhostapplicationbymeansoftheUDPsocketthatQSPYopensspecificallyforattachingvarious"front-ends".Thiscommunication(bluearrows)usesthesamepacketstructureastheQP/SpyProtocol,butwithouttheHDLCframing,withouttransparency(escaping),andwithoutthechecksum. CommunicationbetweenTarget,QSPY,andQView A ATargetproducesQStracerecords,whichtheQSPYBack-EndforwardstotheUDPSocket,sothatanyattachedFront-End(suchasQView™)receivesallthisdata. B TheFront-End(QView™)sendscommandsasUDPpacketstoQSPY.Forsomeofthosepackets,theQSPYBack-Endsuppliesadditionalinformation(e.g.,translationbetweensymbolicnamesandbinaryaddressesaccordingtotheQSdictionariescollectedfromtheTarget). C TheQSPYBack-EndthenforwardsthemodifiedpacketstotheTarget. RemarksWhyUDP?ThecommunicationbetweenQSPYandQViewisbasedonUDP,becauseUDPisinherentlypacket-oriented(asopposedtoTCP,whichisstream-oriented)andpreservesthepacketboundaries. Installation&Use Theqview.pyscriptcanbeusedstandalone,withoutanyinstallationinyourPythonsystem(seeRunningQView™below). NoteTheqview.pyscriptisincludedintheQTools™collection.Also,theQTools™collectionforWindowsalreadyincludesPython(3.8),soyoudon'tneedtoinstallanythingextra. Alternatively,youcanuseyourownPythoninstallation,intowhichyoucaninstallthelatestQView™withpipfromthePyPiindexbyexecutingthefollowingcommand: pipinstallqview RunningQView™ IfyouareusingQView™asastandalonePythonscript,youinvokeitasfollows: python3/qview.py[[[]]] Alternatively,ifyou'veinstalledQView™withpip,youinvokeitasfollows: qview[cust_script][qspy_host[:udp_port]][local_port] Command-lineOptions cust_script—optionalcustomizationPythonscriptforyourspecifictargetsystem.Ifnotspecified,qviewwillprovideonlythegenericuserinterfaceforinteractingwiththetarget(e.g.,reset,settingQSfilters,postingevents,etc.). qspy_host[:udp_port]—optionalhost-name/IP-address:portforthehostrunningtheQSPYhostutility.Ifnotspecified,thedefaultis'localhost:7701'. local_port—optionallocalUDPporttobeusedby"qview".Ifnotspecified,thedefaultis'0',whichmeansthattheoperatingsystemwillchooseanopenport. Examples WindowsHosts python3%QTOOLS%\qview\qview.py opensthegeneric(notcustomized)"qview". python3%QTOOLS%\qview\qview.pydpp.py opens"qview"withthecustomizationprovidedinthedpp.pyscriptlocatedinthecurrentdirectory. qview..\qview\dpp.pylocalhost:7701 opens"qview"(installedwithpip)withthecustomizationprovidedinthedpp.pyscriptlocatedinthedirectory..\qview.The"qview"willattachtotheQSPYutilityrunningatlocalhost:7701. qviewdpp.py192.168.1.100:7705 opens"qview"(installedwithpip)withthecustomizationprovidedinthedpp.pyscriptlocatedinthecurrentdirectory.The"qview"willattachtotheQSPYutilityrunningremotelyatIPaddress192.168.1.100:7705. Linux/MacOSHosts python3$(QTOOLS)/qview/qview.py opensthegeneric(notcustomized)"qview". python3$(QTOOLS)/qview/qview.pydpp.py opens"qview"withthecustomizationprovidedinthedpp.pyscriptlocatedinthecurrentdirectory. qview*.py../qview/dpp.pylocalhost:7701 opens"qview"(installedwithpip)withthecustomizationprovidedinthedpp.pyscriptlocatedinthedirectory../qview.The"qview"willattachtotheQSPYutilityrunningatlocalhost:7701. qviewdpp.py192.168.1.100:7705 opens"qview"(installedwithpip)withthecustomizationprovidedinthedpp.pyscriptlocatedinthecurrentdirectory.The"qview"willattachtotheQSPYutilityrunningremotelyatIPaddress192.168.1.100:7705. NoteInpractice,theeasiestwaytolaunchQView™istodefineashortcut,liketheoneprovidedwiththeDPPexample: qviewshortcutproperties AttachingQViewtoQSPY IncontrasttoTCP,whichisstream-oriented,UDPispacket-oriented,sotheonlywayto"attach"twoendsofcommunicationistoexchangepackets.Consequently,immediatelyafterQView™islaunched,ittriestoattachbysendingtheATTACHpackettoQSPY.IfQSPYrespondswiththeATTACHresponse,QView™considersthatitis"attached". However,iftheATTACHresponsedoesnotarrivewithinasecondortwo(perhapsbecauseQSPYisnotrunning),QView™opensamodaldialogboxthatremindsyoutorunQSPY,asshowninthescreen-shotbelow: AttachtoQSPYdialogbox DependinghowyoustartQSPY,thedialogboxmightcloseautomatically,whichmeansthatQViewhassuccessfullyattachedtoQSPY.However,ifthedialogboxdoesnotclose,youneedtoclicktheAttachbuttontosendATTACHpacketstoQSPY,untilQView™receivestheATTACHresponsefromQSPY.Ifyoucan't"attach",youcanclicktheClosebuttontocloseQView™. NoteBecauseUDPworksovernetworks,theQSPYBack-Endcanrunonadifferentmachine(e.g.,alabcomputer)thantheQView™Front-End(e.g.,officecomputer).Thesetwomachinescanevenrundifferentoperatingsystems,forexampleLinuxonthelabcomputerandWindowsintheoffice,orviceversa.Allyouneedtodoistoprovidethehost-nameparameterasthethirdcommand-lineargumenttotheqview.pyscript(e.g.,python3qview.pydpp.py192.168.1.101). RecognizingtheTarget BeforeQView™cancorrectlyinterpretanydatafromtheTarget,itneedstoobtaincertaininformationabouttheTarget,suchasthesizesofobjectpointers,functionpointers,eventsignals,etc.ThisinformationisprovidedintheQS_TARGET_INFOtracerecordcomingfromtheTarget. ToinformyouabouttheTargetstatus,QView™displaystheTarget:UNKNOWNinthestatusbarwhenthetargetis"unknown": TargetUNKNOWNstatus Ifthishappens,youcanexplicitlyrequesttheTargetinformationbymeansofthe"Commands->QueryTargetInfo"menu: TargetKNOWNstatus(buildtime-stamp) AftertheTargetinformationisreceived,theQView™statusbarshowsthebuildtime-stampoftheTargetimage. QUTest™ScriptReferenceQViewUserInterface



請為這篇文章評分?