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

Reverse Speedometer #85

Open
sgarala opened this issue Apr 20, 2018 · 6 comments
Open

Reverse Speedometer #85

sgarala opened this issue Apr 20, 2018 · 6 comments
Assignees
Labels
enhancement Need Time this issue need a lot of time. will Try we will try to fix it, but we don't make any promises.

Comments

@sgarala
Copy link

sgarala commented Apr 20, 2018

like right now it is left to right 0 to 100, but i need it 100 to 0 and starting of the marker from right to left?

image

@anastr
Copy link
Owner

anastr commented Apr 20, 2018

this isn't possible, for now at least.
i don't think it is easy to make a Reverse Speedometer while it's contain texts (speed, ticks, unit), but something like this worth trying.

@anastr anastr added enhancement Need Time this issue need a lot of time. will Try we will try to fix it, but we don't make any promises. labels Apr 20, 2018
@anastr anastr self-assigned this Apr 20, 2018
@anastr anastr changed the title Hi, Is it possible to flip ticks from right to left? Reverse Speedometer Apr 20, 2018
@sgarala
Copy link
Author

sgarala commented Apr 20, 2018

If possible can you please let me know by what time i can expected this one? i need it as soon as possible. Thanks for your instant reply.

@anastr
Copy link
Owner

anastr commented Apr 20, 2018

I don't really know!
It may takes a month before the next version, considering we didn't face any trouble.

@bluebeelab
Copy link

It can be implemented simply.

Speedometer.java

protected float getDegreeAtSpeed (float speed) {
    if(isClockwise()) {   // true: CW, false: CCW
        return (speed - getMinSpeed()) * (endDegree - startDegree) / (getMaxSpeed() - getMinSpeed()) + startDegree;
    }
    else {
        return (speed - getMaxSpeed()) * (startDegree - endDegree) / (getMaxSpeed() - getMinSpeed()) + startDegree;
    }
}

@davidcz95
Copy link

Hello,

I have a question regarding this issue would it be possible not to reverse the whole thing but just to decrease the value instead of increasing? For example from 3000 to 2500 in 4 sec or something like that? Is this possible to implement?

@anastr
Copy link
Owner

anastr commented May 19, 2020

@alpejczyk you can make smooth movement in 4 sec simply by:

// move to 3000 Km/s with Duration = 4 sec
speedometer.speedTo(3000, 4000)

if you want to revers speed value, well, you can play around custom tick label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Need Time this issue need a lot of time. will Try we will try to fix it, but we don't make any promises.
Projects
None yet
Development

No branches or pull requests

4 participants