Skip to content

Commit

Permalink
Fix wind direction
Browse files Browse the repository at this point in the history
  • Loading branch information
Hoff97 committed Sep 27, 2024
1 parent 77df8b0 commit 984bed1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
8 changes: 3 additions & 5 deletions backend-rust/src/bin/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use core::f32;
use std::{
cmp::{max, min},
fs,
f32::consts::PI,
hash::{Hash, Hasher},
io::Cursor,
};
Expand All @@ -17,12 +17,10 @@ use quick_xml::{
Writer,
};
use rocket::{
config::TlsConfig,
fs::FileServer,
http::ContentType,
response::Redirect,
serde::{json::Json, Serialize},
Config,
};

use ndarray::{s, Array2};
Expand Down Expand Up @@ -52,7 +50,7 @@ const WIND_SPEED_MAXIMUM: f32 = 50.0;
const WIND_DIRECTION_DEFAULT: f32 = 0.0;
const TRIM_SPEED_DEFAULT: f32 = 38.0;
const TRIM_SPEED_MINIMUM: f32 = 0.0;
const TRIM_SPEED_MAXIMUM: f32 = 50.0;
const TRIM_SPEED_MAXIMUM: f32 = 80.0;
const SAFETY_MARGIN_DEFAULT: f32 = 0.0;
const SAFETY_MARGIN_MINIMUM: f32 = 0.0;
const START_DISTANCE_DEFAULT: f32 = 0.0;
Expand Down Expand Up @@ -183,7 +181,7 @@ pub fn search_from_request(
SearchQueryHashable {
additional_height: Distance(additional_height),
wind_speed: Distance(wind_speed),
wind_direction: Distance(wind_direction),
wind_direction: Distance(wind_direction / 180.0 * PI),
glide_ratio: Distance(1.0 / glide_number),
trim_speed: Distance(trim_speed),
safety_margin: Distance(safety_margin),
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -473,12 +473,12 @@ function SettingsCard({ settings, setSettings, setImageState, setGrid, grid, pat
labelStepSize={90} stepSize={15}></Slider>
Trim speed (km/h):
<Slider
initialValue={25}
min={25}
max={45}
initialValue={20}
min={20}
max={80}
onChange={setTrimSpeed}
value={settings.trimSpeed}
labelStepSize={5}
labelStepSize={10}
stepSize={1}
></Slider>
<Divider />
Expand Down
5 changes: 5 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docker buildx build --progress=plain -t hoff97/hikeandfly:latest ./
docker run -p 8080:8080 hoff97/hikeandfly:latest


docker buildx build --progress=plain -t hoff97/hikeandfly_slow:latest -f Dockerfile_python_backend ./

0 comments on commit 984bed1

Please sign in to comment.