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

Drawn Object Names #80

Open
Smewhen opened this issue Feb 24, 2016 · 6 comments
Open

Drawn Object Names #80

Smewhen opened this issue Feb 24, 2016 · 6 comments

Comments

@Smewhen
Copy link
Collaborator

Smewhen commented Feb 24, 2016

Current names are automatically assigned an Object + numeric name based on how many previous objects have been created, perhaps giving users the ability to control or set names for objects.

@Smewhen Smewhen added the future label Feb 24, 2016
@Syntaf Syntaf added this to the 0.15.2.c milestone Mar 16, 2016
@stapleCamel stapleCamel self-assigned this Jun 26, 2016
@stapleCamel
Copy link
Member

Right now, if I remember correctly, the shape database uses the shape's name as a unique identifier. We can certainly allow users to customize shape names, but we'll need something else then to track shapes uniquely.

@Syntaf
Copy link
Member

Syntaf commented Jun 28, 2016

as @stapleCamel said, the shape names are used as a unique identifier. If we remove this attribute and allow people to use their own identifiers, we will inevitably run into name conflicts when databases are merged and such.

We could make the ID internal, and allow users to see the assigned names in the database and not care about duplicate names. If no unique name is given we can assign it the internal ID

@kdottiemo
Copy link
Collaborator

That's what I'm thinking. Front-facing ID is editable but remains the default/rear-facing if no change is made.

@Syntaf
Copy link
Member

Syntaf commented Jun 28, 2016

One important thing to note is a change like this breaks backwards compatibility (i'll make a tag for that), the database won't be able to be migrated if we release a new version with this change. I doubt it a problem right now though, with our whopping user base of ~1 (probably closer to 0).

Agreed w/ @kdottiemo , that should be the way to proceed.

@stapleCamel
Copy link
Member

For the rear-facing ID, I was thinking of generating random unique id's for each shape. Python already has a module for generating UUIDs which we can use.

@Syntaf
Copy link
Member

Syntaf commented Jul 5, 2016

@stapleCamel That sounds like it would be a better solution than currently. if I remember correctly, here's what is done atm:

  • Program starts up, db.py searching the current database for the highest numbered shape using the ID field
  • The highest number + 1 becomes the first id to start on for new shapes created
  • During a database merge, one database is selected as the parent db and the other db has it's ID's appended to the highest number of the original database

If we implement names, we could simply assign a unique number to the ID field and never have to worry about conflicts of backend id's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants