LDraw.org Discussion Forums

Full Version: DATHeader - new feature
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Based on an idea of Magnus Forsberg [MagFors] I have updated DATHeader.

We have an article that clearly states that leading or / and trailing zeros are not allowed in good files.

For example the current file p\4-4ring1.dat contains the following line, that is not correct:
4 16 -1.8478 0 0.7654 -0.9239 0 0.3827 -0.7071 0 0.7071 -1.4142 0 1.41420

This is clearly a task for DATHeader Smile.

DATHeader now detects this and also can correct this error.

If you have any other wish for DATHeader, please let me know and I am looking what can be done.

You can download DATHeader as usually from DATHeader homepage.

Michael Heidemann Wrote:If you have any other wish for DATHeader, please let me know and I am looking what can be done.

* I wish:

DATheader would not rip off my empty lines I use to group certain sections of my parts and leave this code:

3 16 -60 -112 -10 -60 -54 -2 -60 -52 -10

2 24 -56.8 -108.8 -10 -57.5 -108.8 -10
2 24 -50.4 -108.8 -10 -53.6 -108.8 -10

3 16 -52.485 -108.8 -10.15 -53.25 -108.8 -10 -50.4 -108.8 -10

as it is.

* I wish DATHeader would somehow warn me if "Part Type:" isn't set to "Unofficial_part". I always forget to set it when I fix parts downloaded from the PT. (Well actually I do not understand why the PT accept such parts?).
* I think the menu Edit -> CheckOfficial (should probably read "Check Official") is somehow cryptic. I guess something like "Check is this is an official part" or "Check against official part" would be more meaningful.
* The menu ? -> test leads to the pop-up: "The file C:\User\Michael\Desktop\complete.zip could not be found!"
* I'm still irritated (now call my picky) by DATHeaders desktop icon and would prefer it would be something in the line with the other LD progs and star a brick (maybe with some tools).

Thank you very much for your feedback.

1) I'll investigate how to preserve those empty lines. I am not sure that I will be successfull as this empty lines already costs me some days of work in the past Smile
Edit: Should now work from next release on - stupid error. Sad

2) Generally it is ok if a file do not have the prefix "Unofficial_". So it will never be an error for DATHeader if this is not set. But I can imagine to introduce a setting where the user can choose to be warned if this is not the prefix of the parttype. I'll see.
Edit: If you save your work in a new file you will be asked for that prefix already. Maybe another workflow on your side can solve your problem.

3) You are very right! - I will use your suggestion "Check is this is an official part" from next version on.

4) The "test" menu entry was never meant to go into a release version Smile - It will be removed in the next version.

5) I like this friendly smile for a perfect part Smile - on the other hand I am not a designer, so if someone has a good icon for me to use for DATHeader I can be convinced to use that in the future. I am looking for your suggestions.
Quote:1) I'll investigate how to preserve those empty lines.
OTOH I would be happy to have a function (or option?) to automatically remove all comments not in header. Most of the times the comments I have in my files are meaningless...
Ok, but that is something different than Willy is talking about.

An empty line (Willy) is not the same than a comment line.

For your purpose I could imagine a new feature during the autooptimize process.
If DATHeader detects comments in the body section you will be asked to delete those lines. Because I think that many people do not want this to be asked each time, this test should only be done if a checkbox in the options "detect comments in the body" is checked.

Does anybody has a better idea to solve this issue?

I am looking forward to your further comments.
Seems to work fine with me... Actually it would be great to heve two levels, one that removes all comments and empty lines, the other that only removes comments beginning with 0 (and empty lines) but not comments starting with 0 //

Otherwise, could you remove the obligation to have category on subparts? It has been stated many times that valid category is not needed for subfiles.
Michael Heidemann Wrote:on the other hand I am not a designer, so if someone has a good icon for me to use for DATHeader I can be convinced to use that in the future. I am looking for your suggestions.

Size, file type, alpha channel yes/no, ...

What about something link this as an icon?
[Image: datheader.png]

I am also using empty lines to structure my files and I find them helpful, also comments on the structure of the parts are sometimes good to have in my opinion.
That all is not the problem. Just send what you like to have. We will get best results if width and height of the original picture are the same. The size should be in idle case 256 x 256, and all the other sizes can be done from that original.

A humble attempt.

Nice! but I'm afraid it's a bit too detailed to properly show at regular 32x32 icon size. I like the magnifier on brick concept...

Here we go.

What about this variant with a magnifying magnifier?
I like this attempt a lot, but since 2006 prominent color of the logo is yellow. So I would much prefer a yellow block Smile
What do you think?
First i like to clear the second item you mentioned.
Until now DATHeader do not care about the category for the following part types:
"Unofficial_48_Primitive", "48_Primitive", "Unofficial_Primitive", "Primitive", "Unofficial_8_Primitive", "8_Primitive"

So you like me to add to this list also the part types: "Unofficial_Subpart", "Subpart".

Is that correct?
Yes, exactly!

Now I am working on the solution for deleting the comments if wished.
I'll keep you informed.
This is now my favorite Smile Thanks !

I will use this for the next release Smile
I now had a look into the current implementation of DATHeaders correction for comments.

If a line starts with '0' only it will leave a complete blank line.
If a line starts with '0 //' only it will leave a complete blank line.
If a line starts with '0 // text' it will leave the line untouched.
If a line is a blank line it will leave the line untouched.

Based on this I try to analyse what we expect to find in the files.
1) empty line
2) line with '0' only
3) line with '0 text'
4) line with '0 //' only
5) line with '0 // text

5) is a good style comment
3) is old style comment and should be translated to 5)
2) and 4) can be switched to empty line and only one occurence of an empty line in series is allowed?

I am not sure how to deal with this to fulfill your special needs and the mainstream needs Smile
Sometimes I use two empty lines, for example if I want to divide bigger sections.

I like all of these suggestions.

Max' complaint can maybe resolved by an optional setting
"[ ] compress multiple empty lines to one"
There is also the original variant of 3) : 0 WRITE text
This is not allowed in official library files. Only for those DATHeader is written!
Quote:This is not allowed in official library files.
That's precisely why it must be corrected and translated to 5)!
As a user of LDDP as my main editor today, I dislike any software that shuffle up my code.
I like all of the suggested changes as long I get to choose when it is applied on my file.

Some of Philo's tools a really annoying when all empty lines are removed.
I have to add empty comments just to keep the structure of my file.

Some other tools give me the choice. Select 'Move all affected code to end of file'. Good. I get to choose.

I hope Nils's LPE is letting me be the editor and keep the structure intact in my file.
LPC don't give me much choice of were in my file triangles are added.

Would it be possible to add some sort of choice option in DATHeader?
Warn me about an error, but let me decide if it should be fixed? I sometimes don't want it to optimize my code.
Correct warp quads, but don't add a cond-line. Why is the other half of a warped quad moved to the end of the file?
Or don't create quads from triangles.

But otoh, that might better be a choice in a part editor, than in DatHeader.

I like to be the decision maker. Apply this, but don't do that.
Ok, I just checked this and this is the way it is handled by DATHeader already.
I understand your concerns very well. On the other side there are user that do not like to be asked for everything. DATHeader should just care about correct output.

I understand both viewpoints. But I have not found yet a good solution to fulfill both in one app. Sad
I think you can just deliver your app so that its default setting is only
"correct errors"
and not yet

A user who wants beautification then can simply go to the options and enable
the beautifications he wants to be applied by your app automatically.

I think it is that simple Smile
Sorry if I'm reviving an old discussion. I've a bit of catching up to do ;-)
It may be a bit of work to implement but you could have a preference page for the optimise section. For each optimisation give the user three options:
- Never apply
- Ask
- Always apply
You can argue over what the ootb settings should be but everyone can then set the app up to their own liking. For example you can set it to always remove empty lines but ask about removing comments.