-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpatch_3.txt
More file actions
23 lines (19 loc) · 985 Bytes
/
patch_3.txt
File metadata and controls
23 lines (19 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
gui/output_panel.py
Purpose: Wire array routing to popup, add helpers
Import ArrayEditDialog at line 22:
from .output_panel_array_edit import ArrayEditDialog
Add helper methods around line 236:
def _get_current_array_values(self, dataref_name: str) -> list:
"""Get current live values for array dataref."""
live = self.xplane_conn.get_live_value(dataref_name) if self.xplane_conn else None
if isinstance(live, (list, tuple)):
return list(live)
info = self.dataref_manager.get_dataref_info(dataref_name) or {}
dtype = info.get("type", "") if info else ""
size = self._parse_array_size(dtype)
return [0.0] * size if size > 0 else []
def _send_array_update(self, dataref_name: str, values: list):
"""Send array update to Arduino as comma-separated values."""
value_str = ",".join([f"{v:.4f}" if isinstance(v, float) else str(v) for v in values])
if self.dataref_writer:
self.dataref_writer.send_dataref(dataref_name, value_str)