SpeedView icon indicating copy to clipboard operation
SpeedView copied to clipboard

Reverse Speedometer

Open sgarala opened this issue 7 years ago • 6 comments

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

sgarala avatar Apr 20 '18 09:04 sgarala

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 avatar Apr 20 '18 11:04 anastr

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.

sgarala avatar Apr 20 '18 14:04 sgarala

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

anastr avatar Apr 20 '18 14:04 anastr

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;
    }
}

bluebeelab avatar May 10 '19 02:05 bluebeelab

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?

davidcz95 avatar May 19 '20 12:05 davidcz95

@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.

anastr avatar May 19 '20 12:05 anastr