ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Allow the user to undo the invalid label #19

Closed ivoflipse closed 10 years ago

ivoflipse commented 11 years ago

In some cases you really disagree with the automatic labeling of invalid paws and you just want to include it, but currently there's no way to change the label if the paw is invalid.

This also applies for example to static measurements, which will probably never satisfy the force threshold requirements, such as this one:

image

ivoflipse commented 10 years ago

While it doesn't fix this specific example, users can now change the validation thresholds in the settings, which should at least let the user fix this for some contacts.

I'll still have to enable a way to change the -3 label to -2, so the user can assign it anyway. One problem at the moment is that I skip invalid paws, which I then probably shouldn't be doing.

ivoflipse commented 10 years ago

I've turned off the check that if a contact is invalid (-3) its automatically skipped. Now I have to decided how to allow the user to undo the invalid label. I think I'll add a shortcut + button which will bring up a popup where you can confirm whether you want to make this change or I'll add a toggle, where flipping it will toggle it invalid or valid.

The reason I'm hesitant to making it easy to change this, is because invalid contacts ruin the quality of the average. Alternatively is to allow you to label a contact, but mark it as 'invalid' or 'filtered', such that it won't be taken into account when calculating the averages.

ivoflipse commented 10 years ago

Whatever changes I made, I think I broke the way contacts are labeled by processing_widget.

ivoflipse commented 10 years ago

The problem was that next_contact and previous_contact would check if a contact was invalid, and if so skip it. I removed the invalid check, but this caused it to recursively call itself until it reached the end...

Now I can label again, but there's a problem that if I navigate through the contacts, it changes the contact label to -1 if its the current contact. So it effectively erases all contacts...

ivoflipse commented 10 years ago

I'm removing the contact_label == -3 when its invalid. Each widget should be using the contact class objects, which have an invalid attribute.

ivoflipse commented 10 years ago

I still have the function:

def invalid_contact(self):
    # Check if we have any contacts available, else don't bother
    if not self.contacts_available():
        return

    current_contact = self.get_current_contact()
    current_contact.invalid = True
    # Update the screen
    self.update_current_contact()

Perhaps I can toggle the status of the toolbar button if its invalid, but else I'd just make this function negate whatever status is has now.

ivoflipse commented 10 years ago

I've made it so when the current contact is selected, it checks whether it is invalid and if so toggle its button in the toolbar. Toggling the button again will mark the contact as no longer invalid.

image

I could set the contact to filtered by default as well, so I don't 'forget' that it ever was invalid. Then I could use that to prevent it from being taken into account when calculating averages and such. However, that would sort of beat the purpose, since you're most likely to use this function when you DO want the contact to count.

Perhaps I should consider adding a confirmation popup anyway, just to be sure.