Skip to content

Commit

Permalink
Dashed current mow line
Browse files Browse the repository at this point in the history
  • Loading branch information
EinEinfach committed May 4, 2024
1 parent 0049c6b commit 67c44af
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CaSSAndRA/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

#Version:0.106.1 AT+P command is send agter every reconnect state, bug fix in MQTT settings
#Version:0.107.0 dashed current mow line
# package imports
import os
import sys
Expand Down
2 changes: 1 addition & 1 deletion CaSSAndRA/src/backend/data/appdata.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import logging
logger = logging.getLogger(__name__)

version = '0.106.1'
version = '0.107.0'
14 changes: 7 additions & 7 deletions CaSSAndRA/src/components/mapping/modal.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@
State(ids.DROPDOWNSUNRAYIMPORT, 'value'),
State(ids.MODALOVERWRITEPERIMETER, 'is_open'),
State(ids.INPUTPERIMETERNAME, 'value')])
def overwrite_perimeter(bsp_n_clicks: int, bok_n_clicks, map_nr: str(),
is_open: bool, perimeter_name: str()) -> bool:
def overwrite_perimeter(bsp_n_clicks: int, bok_n_clicks, map_nr: str,
is_open: bool, perimeter_name: str) -> bool:
context = ctx.triggered_id
if context == ids.OKBUTTONOVERWRITEPERIMTER:
mapping_maps.select_imported(map_nr)
Expand All @@ -149,7 +149,7 @@ def overwrite_perimeter(bsp_n_clicks: int, bok_n_clicks, map_nr: str(),
State(ids.DROPDOWNCHOOSEPERIMETER, 'value'),
State(ids.MODALSELECTEDPERIMETER, 'is_open'),])
def selected_perimeter(bsp_n_clicks: int, bok_n_clicks: int,
selected_perimeter: str(), is_open: bool) -> list:
selected_perimeter: str, is_open: bool) -> list:
context = ctx.triggered_id
if selected_perimeter == None:
return is_open
Expand Down Expand Up @@ -183,7 +183,7 @@ def new_perimeter(baddp_n_clicks: int, bok_n_clicks, is_open: bool) -> bool:
State(ids.DROPDOWNCHOOSEPERIMETER, 'value'),
State(ids.MODALCOPYPERIMETER, 'is_open')])
def copy_perimeter(bcp_n_clicks: int, bok_n_clicks: int,
cpy_perimeter_name: str(), selected_perimeter: str(),
cpy_perimeter_name: str, selected_perimeter: str,
is_open: bool) -> bool:
context = ctx.triggered_id
if context == ids.OKBUTTONCOPYPERIMETER:
Expand All @@ -199,7 +199,7 @@ def copy_perimeter(bcp_n_clicks: int, bok_n_clicks: int,
State(ids.DROPDOWNCHOOSEPERIMETER, 'value'),
State(ids.MODALREMOVEPERIMETER, 'is_open')])
def remove_perimeter(brp_n_clicks: int, bok_n_clicks,
selected_perimeter: str(), is_open: bool) -> bool:
selected_perimeter: str, is_open: bool) -> bool:
context = ctx.triggered_id
if context == ids.OKBUTTONREMOVEPERIMETER:
saveddata.remove_perimeter(mapping_maps.saved, selected_perimeter, tasks.saved, tasks.saved_parameters)
Expand All @@ -219,7 +219,7 @@ def remove_perimeter(brp_n_clicks: int, bok_n_clicks,
State(ids.INPUTNEWPERIMETERNAME, 'value'),
State(ids.MODALFINISHMAPPING, 'is_open')])
def finish_mapping(bff_n_clicks: int, bok_n_clicks: int,
perimeter_name: str(), is_open: bool) -> bool:
perimeter_name: str, is_open: bool) -> bool:
context = ctx.triggered_id
if context == ids.OKBUTTONFINISHMAPPING:
mapping_maps.check_dockpoints()
Expand Down Expand Up @@ -272,7 +272,7 @@ def nofix_solution(banp_n_clicks: int,
State(ids.DROPDOWNCHOOSEPERIMETER, 'value'),
State(ids.MODALRENAMEPERIMETER, 'is_open')])
def copy_perimeter(brp_n_clicks: int, bok_n_clicks: int,
new_perimeter_name: str(), selected_perimeter: str(),
new_perimeter_name: str, selected_perimeter: str,
is_open: bool) -> bool:
context = ctx.triggered_id
if context == ids.OKBUTTONRENAMEPERIMETER:
Expand Down
2 changes: 2 additions & 0 deletions CaSSAndRA/src/components/state/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,11 @@ def update(n_intervals: int,
current_mow_idx = 0
path_finished = filtered[filtered.index < robot.position_mow_point_index]
path_to_go = filtered[filtered.index >= current_mow_idx]
current_target = filtered[(filtered.index == current_mow_idx)|(filtered.index == current_mow_idx + 1)]
#add mow progress
traces.append(go.Scatter(x=path_finished['X'], y=path_finished['Y'], mode='lines', name='mow finished', opacity=0.5, line=dict(color='rgba(127, 127, 127, 0.25)')))
traces.append(go.Scatter(x=path_to_go['X'], y=path_to_go['Y'], mode='lines', name='mow to go', opacity=0.7, line=dict(color='#7fb249')))
traces.append(go.Scatter(x=current_target['X'], y=current_target['Y'], mode='lines', name='current target', opacity=0.8, line=dict(color='black', dash='dash', width=2)))
mowdata = [dict(text='Distance: '+str(current_map.finished_distance)+'m/'+str(current_map.distance)+'m ('+str(current_map.distance_perc)+'%)', showarrow=False, xref="paper", yref="paper",x=1,y=1),
dict(text='Index: '+str(current_map.finished_idx)+'/'+str(current_map.idx)+' ('+str(current_map.idx_perc)+'%)', showarrow=False, xref="paper", yref="paper",x=1,y=0.95),
dict(text='Area to mow: '+str(current_map.areatomow)+'sqm', showarrow=False, xref="paper", yref="paper",x=1,y=0.9)]
Expand Down

0 comments on commit 67c44af

Please sign in to comment.