Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
“HelloWorld”TheCompleteBeginner’sGuidetoQIFImplementationRobert(Bob)StoneMemberDimensionalMetrologyStandardsConsortium
WhatisQIF?
…fromasoftwaredevelopersperspective?
• It’saStandard– downloadable,documented,stable• It’sanInformationFramework- adatamodel- listsofthingsjoinedtogetherbyids
• It’sscopeisQuality:results,statistics,resources,plans,rules,MBD,visualization
• It’sBIG
WhatisQIF?
…fromasoftwaredevelopersperspective?Part2.
• It’sadatamodeldefinedinXMLschemalanguage(xsd)
WhatisQIF?
…fromasoftwaredevelopersperspective?Part2.
• It’sadatamodeldefinedinXMLschemalanguage(xsd)
• “SupportingQIF”meansyouwillreadorwriteQIFdocumentsinXMLformat
WhatisQIF?
…fromasoftwaredevelopersperspective?Part2.
• It’sadatamodeldefinedinXMLschemalanguage(xsd)
• “SupportingQIF”meansyouwillreadorwriteQIFdocumentsinXMLformat
•AllQIFdocumentsmustbevalidtotheQIFXSDschemafiles
XSDschema:
QIFdocument:
Gettingstarted
• STEP1:downloadthestandardfromqifstandards.org
• STEP2:¯\_(ツ)_/¯print?Xpath?DOM?Sourcecodebindings?
Wheretofindthem?
TheInternetofcourse.
Searchfor“<language>classesfromxsd”or“xsd to<language>classgenerator”
Forexample,searchingfor“C++classesfromxsd”comesupwithanicereferencesite:
http://xmldatabinding.org/
Sourcecodebindinggenerators?
Whattheydowell:Automaticallycreateclassesfromschemafiles
Inthisprocesssomemagichappens:
auto-completecomesalive
Whattheydon’tdowell:- key/keyref checks
Sourcecodebindinggenerators
ToC++sourcecode:
Fromschemadefinition:
Rememberwhen…
• Youfirststartedcoding?• Themanualwasuseful•Butthatfirstfunctionalprogramiswhatreallygotyoustarted
• Tothatend,theDMSCpresents3,open-source,“HelloWorld”QIFapplications
Nowwhat?
ButFirst…
LEGALDISCLAIMERS• Thefree,opensourcesoftwareisprovided“asis”andwithoutanywarranty.READOUR“LICENSE.TXT”FORDETAILS
• TheDMSCdoesnotprovidethesourcecodegenerators,northecodegeneratedbythem.TherelationshipbetweenyouandthesourcecodegeneratoriscoveredbyTHEIRsoftwarelicense.READTHEIRSOFTWARELICENSETHOROUGHLY
• TheDMSCneitherendorsesnorrecommendsanyparticularsourcecodegenerator
What’savailable:• “QIF_CPlusPlus”C++(native)CodeSynthesis XSD3.3
• “QIFdotNET”C#(.NET,managed)MicrosoftXSD
• “demoQIFout”+“demoQIFin”PythonPyXB (pxybgen)
Logosand imagesaretrademarksoftheirrespectiveowners
Wheretofindtheapps:
qif-community
on
https://github.com/QualityInformationFramework/qif-community
Logosandimagesaretrademarksoftheirrespectiveowners
Whattheappsdo(OUTPUTside):
Encodesthis: Toproducethis:
(OUTPUT)ProducingQIFTheopensourceapplicationsdothis:• Setsupunits• Definedatums• Definedatumreferenceframes• Featuredefinitions,nominals,itemsandactuals• Hooksdatumtofeature• Characteristicdefinitions,nominals,itemsandactuals• Measurementresources• Trivialmeasurementplan• GeneratesvalidQIFdocument• ViewsQIFdocumentinNotePad Yourdatagoeshere
Whattheappsdo(INPUTside):
Consumesthis: Toproducethis:
(INPUT)ConsumingQIF
Theapplicationsdothis:• Extractsunits
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
(INPUT)ConsumingQIF
Theapplicationsdothis:• Extractsunits• Feature/characteristicrelationship
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
(INPUT)ConsumingQIF
Theapplicationsdothis:• Extractsunits• Feature/characteristicrelationship• Featurenominal
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
(INPUT)ConsumingQIF
Theapplicationsdothis:• Extractsunits• Feature/characteristicrelationship• Featurenominal• Characteristicnominal
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
(INPUT)ConsumingQIF
Theapplicationsdothis:• Extractsunits• Feature/characteristicrelationship• Featurenominal• Characteristicnominal• Featureactual
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
(INPUT)ConsumingQIF
Theapplicationsdothis:• Extractsunits• Feature/characteristicrelationship• Featurenominal• Characteristicnominal• Featureactual• Characteristicactual
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
(INPUT)ConsumingQIF
Theapplicationsdothis:• Extractsunits• Feature/characteristicrelationship• Featurenominal• Characteristicnominal• Featureactual• Characteristicactual• Datumdefinitions
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
(INPUT)ConsumingQIFTheapplicationsdothis:• Extractsunits• Feature/characteristicrelationship• Featurenominal• Characteristicnominal• Featureactual• Characteristicactual• Datumdefinitions• GeneratesDMISresultsdocument• ViewsDMOdocumentinNotePad
UNITS/MM,ANGDEC
$$ Plane nominal DAT_AOUTPUT/F(DAT_A),T(FLAT1)F(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1T(FLAT1)=TOL/FLAT,0.1$$ Plane actual DAT_AOUTPUT/FA(DAT_A),TA(FLAT1)FA(DAT_A)=FEAT/PLANE,CART,0,0,0,0,0,1TA(FLAT1)=TOL/FLAT,0.023,INTOLDATDEF/FA(DAT_A),DAT(A)
Watchthemrun
QIF_CPlusPlus
Watchthemrun
QIFdotNET
Watchthemrun
demoQIFoutdemoQIFin
Fromsouptonuts:
1. DownloadQIFschemafiles(fromQIFStandards.org)2. DownloadtheApp(fromqif-communityonGitHub)3. READOURLICENSEAGREEMENT4. Readthe“ReadMe.txt”andfollowtheinstructions5. Downloadthesourcecodegenerator6. READTHEIRLICENSEAGREEMENT7. *Replacetroublesomeschemafiles8. Makethesourcecodebindings9. *Massagethesourcecodebindings10. Buildandruntheapp
Thesourcecode:• Regionalized• Annotated• All3appshaveparallelimplementations
• Writetolists(n)• Checkforlists• Traverselists• HandlingSubstitutedElements
Details,details:
Thesourcecodegetsyoupastthesehurdles(thatyoudidn’tevenknowexisted):• GettingavalidheadertotheQIFdocumentistricky• C#listelements,substitutiongroups• C#elementsofsametype• C#enumerationsarenevernull• Pythonsubstitutiongroups• Byreferenceordeepclone?• C++resolvingnamespaceconflicts
Experiment:
C++ C# Python
Breakthesourcecode
Removearequiredattribute(idMax) random# idmax =0 exception
Removearequiredelement(QPId) exception noQPId exception
Removearequiredchoice(diameter tolerance) notolerance notolerance exception
BreaktheQIFdocument
MessupanXMLreference(htp insteadofhttp) exception nooutput exception
Removearequiredattribute(idMax) exception DMOok exception
Removearequiredelement(QPId) exception DMOok exception
Addanon-QIFattribute(myDat =“1”) DMOok DMOok exception
Addanon-QIFelement(<MyDat>1</MyDat>) nooutput DMOok exception
=bad(?) =good(?)
Bestofluck:Take-aways (wehope):• QIFworkswithXSDsourcecodebindinggenerators• ThereareDMSCopensourceQIFappsavailable• Thesecanbeusedasimplementationtemplatesforothersourcecodegenerators
• Therearesomeexperimentalteststoplaywithtohelpyouassesstherobustnessoftheautomaticallygeneratedsourcecode
Support:• Enteranissueqif-communityonGitHub
Contribute:
Doanappinadifferentlanguage:
OnadifferentOS:
Withadifferentcompiler:
Orwithadifferentsourcecodegenerator:
Andshare*Liquid XML Data Binding
Logosandimagesaretrademarksoftheirrespectiveowners*DONOTSHAREAUTOMATICALLYGENERATEDSOURCECODE
4.0
Thankyou
Questions?