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

Mirror climb #88

Merged
merged 14 commits into from
Sep 8, 2024
Merged

Mirror climb #88

merged 14 commits into from
Sep 8, 2024

Conversation

ItsDang
Copy link
Contributor

@ItsDang ItsDang commented Sep 2, 2024

For #48, Added mirror climb button to drop down menu. It acts like a toggle. Currently it resets back to not mirrored if you refresh or switch searches. Also logs mirrored send, I've tested send.

Add mirror climb function to js. Copies the values from the current holds, resets them and sets the mirrored hold.
Temp button on a new row, need to disable if board is not mirrored.
Added Mirror Climb button to dropdown.
Making button toggle.
Toggle and auto mirroring the climbs during draw climb.
Also updating sends/attempts for mirrored.
@gardaholm
Copy link
Contributor

Nice, had a quick play today – logging seems to work fine 👌
Only thing missing is that you can't send the mirrored version to the board via bluetooth. Tried it on the TB2 but I only get the original layout. Would be great to have this addition to.

Copy link
Owner

@lemeryfertitta lemeryfertitta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ItsDang! Tested and looks great to me, nice clean implementation as well. Just one change needed to hide (or disable) the button on non-symmetrical layouts.

climbdex/templates/results.html.j2 Show resolved Hide resolved
Added <li> id, and added script to hide Mirror Climb button if there isn't a circle with data-mirror-id attribute.
Instead of using DOM search pass is_mirrored through instead.
Change from is_mirrored to layout_is_mirrored and is_mirrored to is_mirrored_mode so avoid confusion with whether the mirror mode is on or not.
Create mirroredFrames variable, passing blank from search query. Alternative is to create and store in the db, would require changes in Boardlib.
Still need to create bluetooth packet and have it send the mirrored when mirrored mode is on.
Refactored isMirroredMode().
Pulling whether layout is mirrored from db instead of from DOM.
Removed console logs.
Passing frames as mirroredFrames, until in js determined layout is mirrored and generate real mirroredFrames. Could use sql, but way more complex.
@ItsDang
Copy link
Contributor Author

ItsDang commented Sep 6, 2024

Pulling whether layout is mirrored from db and using to show or hide Mirror Climb button. Updated Bluetooth to pass mirrored, will test on a TB2 at another gym when I can. Refactored whether the the Mirror Climb button is pressed or not.

@ItsDang
Copy link
Contributor Author

ItsDang commented Sep 7, 2024

Realized I mixed up the mirrored sending to board over Bluetooth, was able to test on tb2 at another gym.

Was sending mirrored when should be unmirrored, and vice versa, corrected.
@ItsDang
Copy link
Contributor Author

ItsDang commented Sep 7, 2024

Commited the change to light up the right version, should be ready for review.

climbdex/db.py Outdated Show resolved Hide resolved
climbdex/db.py Outdated Show resolved Hide resolved
climbdex/static/js/results.js Outdated Show resolved Hide resolved
climbdex/static/js/results.js Outdated Show resolved Hide resolved
climbdex/static/js/results.js Outdated Show resolved Hide resolved
Removed variables that were being passed from db, that weren't didn't contain real data.
Also swapped bluetooth pass to be more concise per Luke's comment.
@ItsDang
Copy link
Contributor Author

ItsDang commented Sep 8, 2024

Thanks for comments, it's cleaner. I've implemented and tested the mirrored button except for the Bluetooth on an actual board.

Copy link
Owner

@lemeryfertitta lemeryfertitta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for this very useful feature. I won't be near a board to test the bluetooth anytime soon, but the logic looks correct and we can always push another update if needed. Will get this merged and deployed now

@lemeryfertitta lemeryfertitta merged commit cba0c2d into lemeryfertitta:main Sep 8, 2024
@gardaholm
Copy link
Contributor

Nice and really needed addition!
Will do some tests tomorrow

@ItsDang
Copy link
Contributor Author

ItsDang commented Sep 9, 2024

@lemeryfertitta, Thanks for the help cleaning up the code! And thanks for testing @gardaholm.

@gardaholm
Copy link
Contributor

Didn't had any troubles with mirroring and lighting up the routes. Also behaves as I would expect it (similar to the app). If you mirror once, all upcoming routes show up as mirrored. Really nice!

Only issue I had is documented here #45 (comment), but thats part of the overall bluetoot discussion I guess

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

Successfully merging this pull request may close these issues.

3 participants