LDraw.org Discussion Forums
[LSC Request] End of header meta command - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: Models and Parts (https://forums.ldraw.org/forum-18.html)
+--- Forum: Parts Authoring (https://forums.ldraw.org/forum-19.html)
+--- Thread: [LSC Request] End of header meta command (/thread-8081.html)

Pages: 1 2 3 4 5 6 7 8 9


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Arthur Sigg - 2014-01-12

Thanks for explaining. Any specifications of the current performance of DATHeader and a summary of what's missing/planned ?

I never stick my nose in other people's code, except the programmer asks me. And not in case of "horrible" written code, except a tool is "horrible sophisticated" and well documented so I could expect a learning gradient for myself :-)


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Michael Heidemann - 2014-01-12

Arthur Sigg Wrote:Thanks for explaining. Any specifications of the current performance of DATHeader and a summary of what's missing/planned ?

Hmmm....
summary of what's missing/planned
Hmmm...
missing - nothing I hope
planned - currently nothing as exactly that is missing Smile

I guess with performance you are talking about the things that DATHeader cares about?
Below the list of flags that I work with and that are hopefully self explaining.
Code:
Public Enum LDraw_ErrorCode
        PovCodeFound = 1
        WRITEfound = 2
        BFCCERTIFYINVERTNEXTfound = 3
        ROTATIONfound = 4
        COLORfound = 5
        CommentsNotCorrect = 6
        NotOnlyLDconfigColors = 7
        MatrixAllZero = 8
        IdenticalVertices = 9
        ColinearVertices = 10
        BadVertexSequenze = 11
        ConcaveQuads = 12
        NonCoplanarQuads = 13
        ColorWrongForLinetype = 14
        LoopInReference = 15
        DoubleLinesfound = 16
        ColorForSticker = 17
        PartDescriptionLength = 18
        PartDescriptionLeadingSpaces = 19
        KeywordsLength = 20
        KeywordsCorrect = 21
        FiletitleMatchesFilename = 22
        AuthorRealname = 23
        AuthorUsername = 24
        BFCset = 25
        LicenseSet = 26
        PartTypeSet = 27
        BFC_CCW_at_Primitive = 28
        Keywords_at_Primitives = 29
        PartDescriptionWithTab = 30
        HelpLength = 31
        NewNotUsed = 32
        NeedWorkComment = 33
        Category = 34
        Category_at_Primitives = 35
        Primitive48FilenameStartwith48 = 36
        PrimitivePartDescriptionStartWithout_orTilde = 37
        PartFilenameStartwithout48orS = 38
        SubpartFilenameStartWithS = 39
        SubpartDescriptionStartWithTilde = 40
        SubpartDescriptionStartWithout_ = 41
        PartDescriptionStartWithout_ = 42
        ShortCutPartDescriptionStartWith_ = 43
        ShortCutFilenameContains_d_or_c = 44
        NameExtensionIsDAT = 45
        NoSpecialCharacterInDescription = 46
        LineEndWithCRLF = 47
        HistoryEntryAuthorBracket = 48
        PrimitiveIsScaled = 49
        PrimitiveIsScaledY = 50
        BFCINVERTNEXTfollowedbylinetype1 = 51
        CorrectRGBvalue = 52
        NoMoveToReferenceUsed = 53
        NoBFCCERTIFIEDCWorCCWfound = 54
        KeywordsUnique = 55
        MinifigAccessoryNotFound = 56
        FigureAccessoryNotFound = 57
        NotNeededInvertNextUsed = 58
        TJunctionDetected = 59
        SquareBracketsAroundUsername = 60
        AliasPartDescriptionStartWithSame = 61
        PhysicalColorMentionedInDescription = 62
        PhysicalColorPartOnlyLinetype1Used = 63
        PhysicalColorPartCorrectColorsUsed = 64
        AliasPartOnlyLinetype1Used = 65
        AliasPartOnlyOneLinetype1 = 66
        AliasPartOnlyColor16Used = 67
        AliasPartAliasMentionedInComments = 68
        AliasPartAliasNumberInComment = 69
        OriginNOTInBoundingBox = 70
        AmericanEnglishWords = 71
        EmptyLinesAtTheEnd = 72
    End Enum

And here the messages you will see if all is correct:
Code:
Public Sub InitialiseOKMessages()        
        ReDim FileResultOKMessages([Enum].GetValues(GetType(LDraw_ErrorCode)).Length)
        FileResultOKMessages(LDraw_ErrorCode.PovCodeFound) = "OK" & XMPD.MSVB.Tab & "Embedded POV Code not found."
        FileResultOKMessages(LDraw_ErrorCode.WRITEfound) = "OK" & vbTab & "'0 WRITE' not found."
        FileResultOKMessages(LDraw_ErrorCode.BFCCERTIFYINVERTNEXTfound) = "OK" & vbTab & "'0 BFC CERTIFY INVERTNEXT' not found."
        FileResultOKMessages(LDraw_ErrorCode.ROTATIONfound) = "OK" & vbTab & "'0 ROTATION' not found."
        FileResultOKMessages(LDraw_ErrorCode.COLORfound) = "OK" & vbTab & "'0 COLOR' not found."
        FileResultOKMessages(LDraw_ErrorCode.CommentsNotCorrect) = "OK" & vbTab & "Correct use of '0 //' for comments."
        FileResultOKMessages(LDraw_ErrorCode.NotOnlyLDconfigColors) = "OK" & vbTab & "All used colors in LDConfig.ldr."
        FileResultOKMessages(LDraw_ErrorCode.MatrixAllZero) = "OK" & vbTab & "Matrix all zero not found."
        FileResultOKMessages(LDraw_ErrorCode.IdenticalVertices) = "OK" & vbTab & "Identical vertices not found."
        FileResultOKMessages(LDraw_ErrorCode.ColinearVertices) = "OK" & vbTab & "Colinear vertices not found."
        FileResultOKMessages(LDraw_ErrorCode.BadVertexSequenze) = "OK" & vbTab & "Bad Vertex Sequence not found."
        FileResultOKMessages(LDraw_ErrorCode.ConcaveQuads) = "OK" & vbTab & "Concave quads not found."
        FileResultOKMessages(LDraw_ErrorCode.NonCoplanarQuads) = "OK" & vbTab & "Coplanarity."
        FileResultOKMessages(LDraw_ErrorCode.ColorWrongForLinetype) = "OK" & vbTab & "Correct color for linetype."
        FileResultOKMessages(LDraw_ErrorCode.LoopInReference) = "OK" & vbTab & "Loop in reference not found."
        FileResultOKMessages(LDraw_ErrorCode.DoubleLinesfound) = "OK" & vbTab & "Double lines not found."
        FileResultOKMessages(LDraw_ErrorCode.ColorForSticker) = "OK" & vbTab & "Correct colors for sticker used."
        FileResultOKMessages(LDraw_ErrorCode.PartDescriptionLength) = "OK" & vbTab & "Length of part description."
        FileResultOKMessages(LDraw_ErrorCode.PartDescriptionLeadingSpaces) = "OK" & vbTab & "Leading spaces in part description."
        FileResultOKMessages(LDraw_ErrorCode.KeywordsLength) = "OK" & vbTab & "Keywords entry length."
        FileResultOKMessages(LDraw_ErrorCode.KeywordsCorrect) = "OK" & vbTab & "None of the keyword are used in in part description."
        FileResultOKMessages(LDraw_ErrorCode.FiletitleMatchesFilename) = "OK" & vbTab & "Filename matches filetitle."
        FileResultOKMessages(LDraw_ErrorCode.AuthorRealname) = "OK" & vbTab & "Author real name is set."
        FileResultOKMessages(LDraw_ErrorCode.AuthorUsername) = "OK" & vbTab & "Author user name is set."
        FileResultOKMessages(LDraw_ErrorCode.BFCset) = "OK" & vbTab & "BFC is set."
        FileResultOKMessages(LDraw_ErrorCode.LicenseSet) = "OK" & vbTab & "License is set."
        FileResultOKMessages(LDraw_ErrorCode.PartTypeSet) = "OK" & vbTab & "Part type is set."
        FileResultOKMessages(LDraw_ErrorCode.BFC_CCW_at_Primitive) = "OK" & vbTab & "Winding for part type."
        FileResultOKMessages(LDraw_ErrorCode.Keywords_at_Primitives) = "OK" & vbTab & "Use of keyword for part type."
        FileResultOKMessages(LDraw_ErrorCode.PartDescriptionWithTab) = "OK" & vbTab & "Part description without Tab character."
        FileResultOKMessages(LDraw_ErrorCode.HelpLength) = "OK" & vbTab & "HELP entry length."
        FileResultOKMessages(LDraw_ErrorCode.NewNotUsed) = "OK" & vbTab & "Word 'new' or 'old' not used in part description."
        FileResultOKMessages(LDraw_ErrorCode.NeedWorkComment) = "OK" & vbTab & "Use of (Needs work)."
        FileResultOKMessages(LDraw_ErrorCode.Category) = "OK" & vbTab & "Entry for category."
        FileResultOKMessages(LDraw_ErrorCode.Category_at_Primitives) = "OK" & vbTab & "Category is not set."
        FileResultOKMessages(LDraw_ErrorCode.Primitive48FilenameStartwith48) = "OK" & vbTab & "High-res primitive has to start with '48\'."
        FileResultOKMessages(LDraw_ErrorCode.PrimitivePartDescriptionStartWithout_orTilde) = "OK" & vbTab & "Description for primitives should not start with '_' or '~' or '='."
        FileResultOKMessages(LDraw_ErrorCode.PartFilenameStartwithout48orS) = "OK" & vbTab & "Filename for parts, shortcuts and primitives should not start with '48\' or 's\' or '8\'."
        FileResultOKMessages(LDraw_ErrorCode.SubpartFilenameStartWithS) = "OK" & vbTab & "Filename for subparts has to start with 's\'."
        FileResultOKMessages(LDraw_ErrorCode.SubpartDescriptionStartWithTilde) = "OK" & vbTab & "Description for subparts has to start with '~'."
        FileResultOKMessages(LDraw_ErrorCode.SubpartDescriptionStartWithout_) = "OK" & vbTab & "Description for subparts should not start with '_' or '='."
        FileResultOKMessages(LDraw_ErrorCode.PartDescriptionStartWithout_) = "OK" & vbTab & "Description for parts should not start with '_' or '='."
        FileResultOKMessages(LDraw_ErrorCode.ShortCutPartDescriptionStartWith_) = "OK" & vbTab & "Description for shortcuts and/or physical_colour parts has to start with '_'."
        FileResultOKMessages(LDraw_ErrorCode.ShortCutFilenameContains_d_or_c) = "OK" & vbTab & "Filename for shortcuts contains usually a 'c' or 'd'."
        FileResultOKMessages(LDraw_ErrorCode.NameExtensionIsDAT) = "OK" & vbTab & "Extension is .dat"
        FileResultOKMessages(LDraw_ErrorCode.NoSpecialCharacterInDescription) = "OK" & vbTab & "No special characters in description found."
        FileResultOKMessages(LDraw_ErrorCode.LineEndWithCRLF) = "OK" & vbTab & "Lines ends with <CR><LF>."
        FileResultOKMessages(LDraw_ErrorCode.HistoryEntryAuthorBracket) = "OK" & vbTab & "Author !HISTORY entry has brackets."
        FileResultOKMessages(LDraw_ErrorCode.PrimitiveIsScaled) = "OK" & vbTab & "Not scalable primitives are not scaled."
        FileResultOKMessages(LDraw_ErrorCode.PrimitiveIsScaledY) = "OK" & vbTab & "Primitives are only scaled in Y direction."
        FileResultOKMessages(LDraw_ErrorCode.BFCINVERTNEXTfollowedbylinetype1) = "OK" & vbTab & "First line after BFC INVERTNEXT is linetype 1."
        FileResultOKMessages(LDraw_ErrorCode.CorrectRGBvalue) = "OK" & vbTab & "Correct RGB values used."
        FileResultOKMessages(LDraw_ErrorCode.NoMoveToReferenceUsed) = "OK" & vbTab & "No '~Moved to' file used."        
        FileResultOKMessages(LDraw_ErrorCode.NoBFCCERTIFIEDCWorCCWfound) = "OK" & vbTab & "No wrong BFC command found."
        FileResultOKMessages(LDraw_ErrorCode.KeywordsUnique) = "OK" & vbTab & "None of the keyword are used twice."
        FileResultOKMessages(LDraw_ErrorCode.MinifigAccessoryNotFound) = "OK" & vbTab & "No 'Minifig Accessory' found in part description."
        FileResultOKMessages(LDraw_ErrorCode.FigureAccessoryNotFound) = "OK" & vbTab & "No 'Figure Accessory' found in part description."
        FileResultOKMessages(LDraw_ErrorCode.NotNeededInvertNextUsed) = "OK" & vbTab & "Usage of 'INVERTNEXT' seems to be ok."
        FileResultOKMessages(LDraw_ErrorCode.SquareBracketsAroundUsername) = "OK" & vbTab & "Correct brackets around username used."
        FileResultOKMessages(LDraw_ErrorCode.AliasPartDescriptionStartWithSame) = "OK" & vbTab & "Description for alias parts should start with '='"
        FileResultOKMessages(LDraw_ErrorCode.PhysicalColorMentionedInDescription) = "OK" & vbTab & "Description for physical_color parts mention the used colors"
        FileResultOKMessages(LDraw_ErrorCode.PhysicalColorPartOnlyLinetype1Used) = "OK" & vbTab & "Only linetype 0 and 1 are used in this Physical_Colour part."
        FileResultOKMessages(LDraw_ErrorCode.PhysicalColorPartCorrectColorsUsed) = "OK" & vbTab & "No wrong color used for Physical_Colour part"
        FileResultOKMessages(LDraw_ErrorCode.AliasPartOnlyLinetype1Used) = "OK" & vbTab & "Only linetype 0 and 1 are used in this Alias part."
        FileResultOKMessages(LDraw_ErrorCode.AliasPartOnlyOneLinetype1) = "OK" & vbTab & "Only one (1) linetype 1 is used in this Alias part."
        FileResultOKMessages(LDraw_ErrorCode.AliasPartOnlyColor16Used) = "OK" & vbTab & "Only color 16 is used in this Alias part."
        FileResultOKMessages(LDraw_ErrorCode.AliasPartAliasMentionedInComments) = "OK" & vbTab & "Alias is mentioned in the comments."
        FileResultOKMessages(LDraw_ErrorCode.AliasPartAliasNumberInComment) = "OK" & vbTab & "Number in the Alias comment is correct."
        FileResultOKMessages(LDraw_ErrorCode.OriginNOTInBoundingBox) = "OK" & vbTab & "Origin is inside the Boundingbox."
        FileResultOKMessages(LDraw_ErrorCode.AmericanEnglishWords) = "OK" & vbTab & "Only Australian English words are used in the part description."
        FileResultOKMessages(LDraw_ErrorCode.EmptyLinesAtTheEnd) = "OK" & vbTab & "No more Empty lines at the end as necessary."
    End Sub

For some of the check standard values are used f.e. identical vertices etc. For more details I would need to have a close look into the code, so if you need some more information, please specify.


Re: [LSC Request] End of header meta command - Steffen - 2014-01-14

+1


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Steffen - 2014-01-14

you are basically re-inventing XML here.

ldraw originally is a linewise format (opposed to a correctly-parenthesed formal multiline programming language).

I dislike changing the linewise principle.


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Steffen - 2014-01-14

I clearly favor solution 1).


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Roland Melkert - 2014-01-14

I'm leaning toward option 1 too:

Quote:1) Define a "needs work" meta-statement and update all such files.
The end-of header algorithm would then be the detection of a "0 // ..." comment or "0 BFC INVERTNEXT" or a non-type 0 line.
Algorithm clarity: medium, Implementation effort: low (154 official files).

But it might be useful to also 'invent' a LDraw spec version meta so we can link the allowed meta list to the spec version. This way software can determine the needed list and has some kind of forwards compatibility for when a new meta gets added to the allowed list it doesn't now of yet.

Based on the version number it knows there might be additional meta's in the header and it could fall back to just including all unknown meta's or something.


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Orion Pobursky - 2014-01-14

I'm in favor of a formal META for the reasons outlined by Allen. Unless someone come up with a compelling argument against his claims then I'm in his camp. Note that the reason "creates too much work" is null since these changes can be made on the back end by Chris without having to go through the PT.


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Roland Melkert - 2014-01-14

Well personally I like the idea to have strict info about all meta's allowed in a header. Software compliant with spec verison x then knows what it needs to read / manage from such a header.

Having the !EOH meta will solve the presentation part but allowing anything in the header makes it somewhat hard for software to support editing such a header.


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Steffen - 2014-01-15

I do not see the presentation issue big enough
to justify the introduction of a new !EOH keyword.
It's just a small, cosmetic issue which can be easily solved by polishing the affected mentioned 154 parts
and/or extending the PT logic.
We should avoid keyword clutter.
Introducing new keywords can be become an addiction.


Re: Call for LSC Vote Re: [LSC Request] End of header meta command - Arthur Sigg - 2014-01-15

... keyword clutter ! Never heard such a killer phrase ! That's the hammer on the nail ... unfortunately on the fingernail. This is definitively not the house I can live and work. The endless discussions in this "palaver hall" about the most simple things shows up the worst side of "democracy". I am a little bit disillusioned and somewhat disappointed, but I want to say "thank you" sincerely for all your help and kindness.

Good bye !
Arthur Sigg