Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validity #21

Closed
amarant opened this issue Jul 24, 2015 · 4 comments
Closed

validity #21

amarant opened this issue Jul 24, 2015 · 4 comments

Comments

@amarant
Copy link

amarant commented Jul 24, 2015

Hi,
Is there a way to tell if a symbol is valid ?
Thanks.

@spatialillusions
Copy link
Owner

Do you want to know if the SIDC you provided is valid and gives you a symbol present in the standards, or do you want to compare the milsymbol rendering to the rendering in the standards?

The way milsymbol is built is to be very flexible and always be able to return symbols. Because of this I will always return symbols for the parts of a SIDC that is valid. So even if you get the icon part of the SIDC wrong, you should always get the correct standard identity frame and color.

At the moment there isn't an API call that you can make to check if the icon part is correct, but it would be possible to add, it would actually be possible to add it as an extension to milsymbol 0.5, but I don't have any plans for it at the moment.

Regards
Måns Beckman
www.spatialillusions.com

@amarant
Copy link
Author

amarant commented Jul 24, 2015

The first one, if the SIDC has a meaning. Because when I use it on wrong SIDC like :

  • wrong number of letters
  • wrong letters on fields where there is a limited choice
    it shows in some case a yellow rectangle, or something invisible. I want to be able to show a default custom symbol that does not look like APP6 to clearly show that something is wrong.
    For now I use the code in unitgenerator.html to know the possible options for each fields, but I am not sure if it is exhaustive.
    Thanks.

@spatialillusions
Copy link
Owner

Oh, I see.

  1. The number of letters can be different, milsymbol only requires 4 letters to create a symbol, since that gives you all information about the basic properties of the symbol. Easiest thing here is to make your own sting length check before you send the string to milsymbol.
  2. The unit generator is a code mess. ;-) I was initially created for me to test the library, before I did the html pages that renders the whole standards. Then I realised that people actually was using it. I have an idea of storing the options in a code tree instead, and that would make things much easier to do what you want, but at the moment I have more ideas than time...
    Create a new issue and write down exactly how you would like a validation function to work, and I'll see what I can do.

Regards
Måns
www.spatialillusions.com

@amarant
Copy link
Author

amarant commented Jul 24, 2015

So I opened issue #24 about the validation and #25 for the second part.

@amarant amarant closed this as completed Jul 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants