Dumb stuff
This commit is contained in:
parent
2871fd974a
commit
e513fc1083
4 changed files with 10 additions and 5 deletions
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include <hexagram/gauge.h>
|
||||
|
||||
#define HEXAGRAM_SPEEDO_MAX_KPH 289.682
|
||||
|
||||
typedef struct _hexagram_speedo {
|
||||
hexagram_gauge gauge;
|
||||
} hexagram_speedo;
|
||||
|
|
|
@ -126,7 +126,7 @@ void hexagram_cluster_draw_fg(hexagram_cluster *cluster,
|
|||
cluster->state.rpm);
|
||||
|
||||
hexagram_speedo_draw_needle(&cluster->speedo, cr,
|
||||
(2.00152 * cluster->state.rps * 3600) / 1000.0);
|
||||
cluster->state.rps);
|
||||
|
||||
hexagram_thermo_draw_needle(&cluster->thermo, cr,
|
||||
cluster->state.temp);
|
||||
|
|
|
@ -66,7 +66,7 @@ void hexagram_gauge_draw_needle(hexagram_gauge *gauge,
|
|||
/*
|
||||
* Draw the gauge pivot
|
||||
*/
|
||||
cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
|
||||
cairo_set_source_rgb(cr, 0.4, 0.4, 0.4);
|
||||
|
||||
cairo_arc(cr,
|
||||
gauge->x,
|
||||
|
@ -78,7 +78,8 @@ void hexagram_gauge_draw_needle(hexagram_gauge *gauge,
|
|||
cairo_stroke(cr);
|
||||
|
||||
/*
|
||||
* Draw the needle above the pivot */
|
||||
* Draw the needle above the pivot
|
||||
*/
|
||||
cairo_move_to(cr, gauge->x, gauge->y);
|
||||
|
||||
cairo_set_source_rgb(cr, 0, 0.25, 1.0);
|
||||
|
|
|
@ -60,7 +60,9 @@ void hexagram_speedo_draw_face(hexagram_speedo *speedo,
|
|||
|
||||
void hexagram_speedo_draw_needle(hexagram_speedo *speedo,
|
||||
cairo_t *cr,
|
||||
double kph) {
|
||||
double rps) {
|
||||
double kph = (2.00152 * rps * 3600) / 1000.0;
|
||||
|
||||
if (kph < 0) {
|
||||
kph = 0;
|
||||
} else if (kph > 290) {
|
||||
|
@ -70,5 +72,5 @@ void hexagram_speedo_draw_needle(hexagram_speedo *speedo,
|
|||
hexagram_gauge_draw_needle(&speedo->gauge,
|
||||
cr,
|
||||
0.8,
|
||||
kph / 289.682);
|
||||
kph / HEXAGRAM_SPEEDO_MAX_KPH);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue