Skip to content

Commit

Permalink
Merge pull request #305 from tinymovr/studio/gui_improvements
Browse files Browse the repository at this point in the history
GUI improvements
  • Loading branch information
yconst authored Oct 10, 2023
2 parents b30b800 + f05c66f commit 3302c39
Show file tree
Hide file tree
Showing 7 changed files with 1,033 additions and 132 deletions.
2 changes: 1 addition & 1 deletion firmware/src/can/can_endpoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


uint8_t (*avlos_endpoints[79])(uint8_t * buffer, uint8_t * buffer_len, Avlos_Command cmd) = {&avlos_protocol_hash, &avlos_uid, &avlos_fw_version, &avlos_hw_revision, &avlos_Vbus, &avlos_Ibus, &avlos_power, &avlos_temp, &avlos_calibrated, &avlos_errors, &avlos_save_config, &avlos_erase_config, &avlos_reset, &avlos_enter_dfu, &avlos_scheduler_errors, &avlos_controller_state, &avlos_controller_mode, &avlos_controller_warnings, &avlos_controller_errors, &avlos_controller_position_setpoint, &avlos_controller_position_p_gain, &avlos_controller_velocity_setpoint, &avlos_controller_velocity_limit, &avlos_controller_velocity_p_gain, &avlos_controller_velocity_i_gain, &avlos_controller_velocity_deadband, &avlos_controller_velocity_increment, &avlos_controller_current_Iq_setpoint, &avlos_controller_current_Id_setpoint, &avlos_controller_current_Iq_limit, &avlos_controller_current_Iq_estimate, &avlos_controller_current_bandwidth, &avlos_controller_current_Iq_p_gain, &avlos_controller_current_max_Ibus_regen, &avlos_controller_current_max_Ibrake, &avlos_controller_voltage_Vq_setpoint, &avlos_controller_calibrate, &avlos_controller_idle, &avlos_controller_position_mode, &avlos_controller_velocity_mode, &avlos_controller_current_mode, &avlos_controller_set_pos_vel_setpoints, &avlos_comms_can_rate, &avlos_comms_can_id, &avlos_motor_R, &avlos_motor_L, &avlos_motor_pole_pairs, &avlos_motor_type, &avlos_motor_offset, &avlos_motor_direction, &avlos_motor_calibrated, &avlos_motor_I_cal, &avlos_motor_errors, &avlos_encoder_position_estimate, &avlos_encoder_velocity_estimate, &avlos_encoder_type, &avlos_encoder_bandwidth, &avlos_encoder_calibrated, &avlos_encoder_errors, &avlos_traj_planner_max_accel, &avlos_traj_planner_max_decel, &avlos_traj_planner_max_vel, &avlos_traj_planner_t_accel, &avlos_traj_planner_t_decel, &avlos_traj_planner_t_total, &avlos_traj_planner_move_to, &avlos_traj_planner_move_to_tlimit, &avlos_traj_planner_errors, &avlos_homing_velocity, &avlos_homing_max_homing_t, &avlos_homing_retract_dist, &avlos_homing_warnings, &avlos_homing_stall_detect_velocity, &avlos_homing_stall_detect_delta_pos, &avlos_homing_stall_detect_t, &avlos_homing_home, &avlos_watchdog_enabled, &avlos_watchdog_triggered, &avlos_watchdog_timeout };
uint32_t avlos_proto_hash = 4118115615;
uint32_t avlos_proto_hash = 3526126264;

uint32_t _avlos_get_proto_hash(void)
{
Expand Down
7 changes: 5 additions & 2 deletions studio/Python/tinymovr/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
display_file_open_dialog,
display_file_save_dialog,
magnitude_of,
hold_sema,
TimedGetter,
check_selected_items,
get_dynamic_attrs,
is_dark_mode
)
from tinymovr.gui.widgets import (
OurQTreeWidget,
NodeTreeWidgetItem,
AttrTreeWidgetItem,
FuncTreeWidgetItem,
OptionsTreeWidgetItem,
PlaceholderQTreeWidget,
IconComboBoxWidget,
ArgumentInputDialog
)
Expand Down
79 changes: 64 additions & 15 deletions studio/Python/tinymovr/gui/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
QPushButton {
background-color: #ededef;
border-radius: 4px;
margin: 0 0 1px 0;
margin: 3px 10px 3px 0;
}
QPushButton:pressed {
background-color: #cdcdcf;
Expand All @@ -44,6 +44,22 @@
background-color: #eaeaec;
}
/* --------------------------------------- QComboBox -----------------------------------*/
QComboBox {
margin: 0 10px 0 5px;
}
QComboBox {
margin: 0 10px 0 0;
}
QComboBox::drop-down {
border: none;
background-color: #ededef;
border-radius: 4px;
}
/* --------------------------------------- QScrollBar -----------------------------------*/
QScrollBar:horizontal
Expand All @@ -57,7 +73,7 @@
QScrollBar::handle:horizontal
{
background-color: #dfdfe1; /* #605F5F; */
background-color: #dfdfe1;
min-width: 5px;
border-radius: 4px;
}
Expand Down Expand Up @@ -175,6 +191,11 @@
{
background: none;
}
QAbstractScrollArea::corner {
background: #dfdfe1;
border: none;
}
"""


Expand All @@ -185,7 +206,7 @@
QPushButton {
background-color: #363638;
border-radius: 4px;
margin: 0 0 1px 0;
margin: 3px 10px 3px 0;
}
QPushButton:pressed {
background-color: #767678;
Expand All @@ -196,6 +217,37 @@
background-color: #464648;
}
/* --------------------------------------- QComboBox -----------------------------------*/
QComboBox {
margin: 0 10px 0 5px;
}
QComboBox::drop-down {
border: none;
background-color: #363638;
border-radius: 4px;
}
QComboBox::down-arrow
{
border: 0px;
background-repeat: no-repeat;
background-position: center center;
border-image: url(:/qss_icons/rc/down_arrow.png);
height:20px;
width:20px;
}
/* ----------------------------------- Headers (dark only) -------------------------------*/
QHeaderView::section {
border-right-color: #262628;
border-right-width: 1px;
border-style: solid;
margin: 0 4px;
}
/* --------------------------------------- QScrollBar -----------------------------------*/
QScrollBar:horizontal
Expand All @@ -204,12 +256,12 @@
margin: 3px 15px 3px 15px;
border: 1px transparent white;
border-radius: 4px;
background-color: white;
background-color: #363638;
}
QScrollBar::handle:horizontal
{
background-color: #dfdfe1; /* #605F5F; */
background-color: #605F5F;
min-width: 5px;
border-radius: 4px;
}
Expand Down Expand Up @@ -266,7 +318,7 @@
QScrollBar:vertical
{
background-color: white;
background-color: #363638;
width: 15px;
margin: 15px 3px 15px 3px;
border: 1px transparent white;
Expand All @@ -275,7 +327,7 @@
QScrollBar::handle:vertical
{
background-color: #dfdfe1;
background-color: #605F5F;
min-height: 5px;
border-radius: 4px;
}
Expand Down Expand Up @@ -327,6 +379,11 @@
{
background: none;
}
QAbstractScrollArea::corner {
background: #363638;
border: none;
}
"""


Expand Down Expand Up @@ -407,14 +464,6 @@ def magnitude_of(val):
return val


def hold_sema(sema):
sema.acquire()
try:
yield
finally:
sema.release()


class TimedGetter:
"""
An interface class that maintains timing
Expand Down
Loading

0 comments on commit 3302c39

Please sign in to comment.