Skip to content

Commit

Permalink
voltage divider calculator updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Mar 11, 2020
1 parent 6f853c1 commit 7b214a3
Show file tree
Hide file tree
Showing 10 changed files with 102,183 additions and 82,466 deletions.
52,858 changes: 36,199 additions & 16,659 deletions modular-psu-firmware.eez-project

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
"active": true,
"permanent": true,
"state": {
"1": {}
"3": {
"$selected": true
}
}
}
],
Expand All @@ -35,10 +37,10 @@
"pageEditorCanvasViewState": {
"transform": {
"translate": {
"x": -815.0999999999999,
"y": -640.0545454545453
"x": -240,
"y": -136
},
"scale": 16
"scale": 1
}
}
}
Expand Down
20 changes: 12 additions & 8 deletions scripts/voltage-divider-calculator/voltage-divider-calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,27 @@ def can_calc_Vin():

def calc_Vin():
if can_calc_Vin():
Vin = round(Vout * (R1 + R2) / R2, 3)
scpi("DISP:DIALog:DATA \"Vin\",FLOAT,VOLT," + str(Vin))
global Vin
Vin = Vout * (R1 + R2) / R2
scpi("DISP:DIALog:DATA \"Vin\",FLOAT,VOLT," + str(round(Vin, 3)))

def calc_R1():
if can_calc_R1():
R1 = round(R2 * (Vin - Vout) / Vout, 3)
scpi("DISP:DIALog:DATA \"R1\",FLOAT,OHM," + str(R1))
global R1
R1 = R2 * (Vin - Vout) / Vout
scpi("DISP:DIALog:DATA \"R1\",FLOAT,OHM," + str(round(R1, 3)))

def calc_R2():
if can_calc_R2():
R2 = round(R1 * Vout / (Vin - Vout), 3)
scpi("DISP:DIALog:DATA \"R2\",FLOAT,OHM," + str(R2))
global R2
R2 = R1 * Vout / (Vin - Vout)
scpi("DISP:DIALog:DATA \"R2\",FLOAT,OHM," + str(round(R2, 3)))

def calc_Vout():
if can_calc_Vout():
Vout = round(Vin * R2 / (R1 + R2), 3)
scpi("DISP:DIALog:DATA \"Vout\",FLOAT,VOLT," + str(Vout))
global Vout
Vout = Vin * R2 / (R1 + R2)
scpi("DISP:DIALog:DATA \"Vout\",FLOAT,VOLT," + str(round(Vout, 3)))

scpi("DISP:DIALog:OPEN \"/Scripts/voltage-divider-calculator.res\"")
while True:
Expand Down
Binary file not shown.
71,172 changes: 35,621 additions & 35,551 deletions src/eez/gui/document_simulator.cpp

Large diffs are not rendered by default.

254 changes: 128 additions & 126 deletions src/eez/gui/document_simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,8 @@ enum FontsEnum {
FONT_ID_OSWALD24 = 2,
FONT_ID_OSWALD17 = 3,
FONT_ID_OSWALD14 = 4,
FONT_ID_OSWALD20 = 5,
FONT_ID_HEYDINGS14 = 6,
FONT_ID_HEYDINGS14 = 5,
FONT_ID_OSWALD20 = 6,
FONT_ID_WEB_HOSTING_HUB24 = 7,
FONT_ID_OSWALD48 = 8,
FONT_ID_OSWALD38 = 9,
Expand Down Expand Up @@ -1296,128 +1296,130 @@ enum StylesEnum {
STYLE_ID_EDIT_VALUE_ACTIVE_S_CENTER = 6,
STYLE_ID_DEFAULT_S = 7,
STYLE_ID_DEFAULT_S_LEFT = 8,
STYLE_ID_ERROR_ALERT = 9,
STYLE_ID_ERROR_ALERT_BUTTON = 10,
STYLE_ID_YT_GRAPH_U_DEFAULT = 11,
STYLE_ID_YT_GRAPH_I_DEFAULT = 12,
STYLE_ID_YT_GRAPH_P_DEFAULT = 13,
STYLE_ID_YT_GRAPH_UNREGULATED = 14,
STYLE_ID_YT_GRAPH_Y1 = 15,
STYLE_ID_YT_GRAPH_Y2 = 16,
STYLE_ID_YT_GRAPH_Y3 = 17,
STYLE_ID_YT_GRAPH_Y4 = 18,
STYLE_ID_YT_GRAPH_Y5 = 19,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER = 20,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER_S = 21,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM = 22,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM_S = 23,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM = 24,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM_S = 25,
STYLE_ID_INFO_ALERT = 26,
STYLE_ID_MENU_WITH_BUTTONS_MESSAGE = 27,
STYLE_ID_MENU_WITH_BUTTONS_CONTAINER = 28,
STYLE_ID_MENU_WITH_BUTTONS_BUTTON = 29,
STYLE_ID_CHANNEL1 = 30,
STYLE_ID_CHANNEL2 = 31,
STYLE_ID_CHANNEL3 = 32,
STYLE_ID_CHANNEL4 = 33,
STYLE_ID_CHANNEL5 = 34,
STYLE_ID_CHANNEL6 = 35,
STYLE_ID_CHANNEL1_INVERSE = 36,
STYLE_ID_CHANNEL2_INVERSE = 37,
STYLE_ID_CHANNEL3_INVERSE = 38,
STYLE_ID_CHANNEL4_INVERSE = 39,
STYLE_ID_CHANNEL5_INVERSE = 40,
STYLE_ID_CHANNEL6_INVERSE = 41,
STYLE_ID_STATUS_BGND = 52,
STYLE_ID_STATUS_ICON_ENABLED_AND_ERROR = 78,
STYLE_ID_STATUS_ICON_ENABLED = 79,
STYLE_ID_TOUCH_CALIBRATION = 99,
STYLE_ID_BOTTOM_BUTTON_BACKGROUND = 104,
STYLE_ID_BOTTOM_BUTTON = 105,
STYLE_ID_STATUS_ICON_DISABLED = 106,
STYLE_ID_STATUS_ICON_ENABLED_WITH_NEED_ATTENTION = 107,
STYLE_ID_STATUS_ICON_ENABLED_AND_ACTIVE = 109,
STYLE_ID_OVERLAY = 113,
STYLE_ID_EDIT_VALUE_S_LEFT = 116,
STYLE_ID_VALUE_S = 117,
STYLE_ID_EDIT_VALUE_M_LEFT = 118,
STYLE_ID_KEY_ICONS = 120,
STYLE_ID_KEY = 121,
STYLE_ID_TAB_PAGE_SELECTED = 124,
STYLE_ID_TAB_PAGE = 125,
STYLE_ID_DEFAULT_INVERSE = 132,
STYLE_ID_NON_INTERACTIVE_BUTTON_S = 133,
STYLE_ID_SLIDER_SHADE_1 = 134,
STYLE_ID_SLIDER_SHADE_2 = 135,
STYLE_ID_SLIDER_SHADE_3 = 136,
STYLE_ID_SLIDER_SHADE_4 = 137,
STYLE_ID_SLIDER_SHADE_5 = 138,
STYLE_ID_YES_NO = 139,
STYLE_ID_YES_NO_BUTTON = 140,
STYLE_ID_YES_NO_MESSAGE = 141,
STYLE_ID_TEXT_MESSAGE = 143,
STYLE_ID_ASYNC_OPERATION = 146,
STYLE_ID_SCROLLBAR_THUMB = 157,
STYLE_ID_SCROLLBAR_BUTTON = 158,
STYLE_ID_BOTTOM_BUTTON_TEXTUAL_S_LEFT = 159,
STYLE_ID_KEY_SPEC_ICONS = 162,
STYLE_ID_KEY_SPEC_ICONS_DISABLED = 164,
STYLE_ID_KEY_DISABLED = 165,
STYLE_ID_EDIT_VALUE_S_CENTERED = 166,
STYLE_ID_VALUE_M = 174,
STYLE_ID_DEFAULT_DISABLED_M_LEFT = 177,
STYLE_ID_YT_GRAPH = 178,
STYLE_ID_LIST_GRAPH_CURSOR = 179,
STYLE_ID_YT_GRAPH_U_DEFAULT_LABEL = 180,
STYLE_ID_YT_GRAPH_I_DEFAULT_LABEL = 181,
STYLE_ID_EDIT_VALUE_FOCUS_S_CENTER = 182,
STYLE_ID_VALUE = 187,
STYLE_ID_DEFAULT_M = 191,
STYLE_ID_NON_INTERACTIVE_BUTTON_M = 192,
STYLE_ID_OPTION_TOGGLE_L_CENTER = 193,
STYLE_ID_EVENT_ERROR = 194,
STYLE_ID_DEFAULT_DISABLED_S_LEFT = 195,
STYLE_ID_ICON_AND_TEXT_S = 197,
STYLE_ID_ICON_AND_TEXT_S_DISABLED = 198,
STYLE_ID_DEFAULT_DISABLED = 205,
STYLE_ID_EDIT_VALUE_M_CENTERED = 208,
STYLE_ID_EDIT_S = 209,
STYLE_ID_EVENT_WARNING = 225,
STYLE_ID_DISPLAY_OFF = 226,
STYLE_ID_DISPLAY_OFF_S = 227,
STYLE_ID_DEFAULT_GUI_TMPL = 230,
STYLE_ID_MON_VALUE_48_RIGHT = 231,
STYLE_ID_MON_VALUE_20_LEFT = 233,
STYLE_ID_ENCODER_CURSOR_14_DISABLED = 234,
STYLE_ID_ENCODER_CURSOR_14_ENABLED = 235,
STYLE_ID_ENCODER_CURSOR_14_FOCUSED = 236,
STYLE_ID_BAR_GRAPH_U_DEFAULT = 237,
STYLE_ID_BAR_GRAPH_TEXT = 238,
STYLE_ID_BAR_GRAPH_LIMIT_LINE = 240,
STYLE_ID_BAR_GRAPH_I_DEFAULT = 241,
STYLE_ID_TRIGGER_BUTTON_24 = 243,
STYLE_ID_MON_VALUE_14_RIGHT = 245,
STYLE_ID_ENCODER_CURSOR_14_RIGHT_DISABLED = 246,
STYLE_ID_ENCODER_CURSOR_14_RIGHT_ENABLED = 247,
STYLE_ID_ENCODER_CURSOR_14_RIGHT_FOCUSED = 248,
STYLE_ID_ENCODER_CURSOR_14_LEFT_DISABLED = 249,
STYLE_ID_CHANNEL_OFF_BUTTON_20 = 250,
STYLE_ID_TRIGGER_BUTTON_14 = 251,
STYLE_ID_CHANNEL_OFF_BUTTON_38 = 259,
STYLE_ID_INST_SELECTED = 260,
STYLE_ID_MON_VALUE_38_RIGHT = 261,
STYLE_ID_CH_PROT_OFF = 264,
STYLE_ID_CH_PROT_ON = 265,
STYLE_ID_CH_PROT_TRIPPED = 266,
STYLE_ID_BUTTON_BGND = 267,
STYLE_ID_MON_VALUE_24_RIGHT = 271,
STYLE_ID_MON_VALUE_14_CENTER = 272,
STYLE_ID_MON_VALUE_20_RIGHT = 279,
STYLE_ID_MON_VALUE_14_LEFT = 280,
STYLE_ID_CHANNEL_OFF_BUTTON_14 = 281,
STYLE_ID_SCROLLBAR_TRACK = 289,
STYLE_ID_NON_INTERACTIVE_BUTTON_S_DISABLED = 302
STYLE_ID_STATUS_ICON = 9,
STYLE_ID_STATUS_TITLE = 10,
STYLE_ID_ERROR_ALERT = 11,
STYLE_ID_ERROR_ALERT_BUTTON = 12,
STYLE_ID_YT_GRAPH_U_DEFAULT = 13,
STYLE_ID_YT_GRAPH_I_DEFAULT = 14,
STYLE_ID_YT_GRAPH_P_DEFAULT = 15,
STYLE_ID_YT_GRAPH_UNREGULATED = 16,
STYLE_ID_YT_GRAPH_Y1 = 17,
STYLE_ID_YT_GRAPH_Y2 = 18,
STYLE_ID_YT_GRAPH_Y3 = 19,
STYLE_ID_YT_GRAPH_Y4 = 20,
STYLE_ID_YT_GRAPH_Y5 = 21,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER = 22,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_CONTAINER_S = 23,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM = 24,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_ITEM_S = 25,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM = 26,
STYLE_ID_SELECT_ENUM_ITEM_POPUP_DISABLED_ITEM_S = 27,
STYLE_ID_INFO_ALERT = 28,
STYLE_ID_MENU_WITH_BUTTONS_MESSAGE = 29,
STYLE_ID_MENU_WITH_BUTTONS_CONTAINER = 30,
STYLE_ID_MENU_WITH_BUTTONS_BUTTON = 31,
STYLE_ID_CHANNEL1 = 32,
STYLE_ID_CHANNEL2 = 33,
STYLE_ID_CHANNEL3 = 34,
STYLE_ID_CHANNEL4 = 35,
STYLE_ID_CHANNEL5 = 36,
STYLE_ID_CHANNEL6 = 37,
STYLE_ID_CHANNEL1_INVERSE = 38,
STYLE_ID_CHANNEL2_INVERSE = 39,
STYLE_ID_CHANNEL3_INVERSE = 40,
STYLE_ID_CHANNEL4_INVERSE = 41,
STYLE_ID_CHANNEL5_INVERSE = 42,
STYLE_ID_CHANNEL6_INVERSE = 43,
STYLE_ID_STATUS_BGND = 54,
STYLE_ID_STATUS_ICON_ENABLED_AND_ERROR = 80,
STYLE_ID_STATUS_ICON_ENABLED = 81,
STYLE_ID_TOUCH_CALIBRATION = 101,
STYLE_ID_BOTTOM_BUTTON_BACKGROUND = 106,
STYLE_ID_BOTTOM_BUTTON = 107,
STYLE_ID_STATUS_ICON_DISABLED = 108,
STYLE_ID_STATUS_ICON_ENABLED_WITH_NEED_ATTENTION = 109,
STYLE_ID_STATUS_ICON_ENABLED_AND_ACTIVE = 111,
STYLE_ID_OVERLAY = 115,
STYLE_ID_EDIT_VALUE_S_LEFT = 118,
STYLE_ID_VALUE_S = 119,
STYLE_ID_EDIT_VALUE_M_LEFT = 120,
STYLE_ID_KEY_ICONS = 122,
STYLE_ID_KEY = 123,
STYLE_ID_TAB_PAGE_SELECTED = 126,
STYLE_ID_TAB_PAGE = 127,
STYLE_ID_DEFAULT_INVERSE = 134,
STYLE_ID_NON_INTERACTIVE_BUTTON_S = 135,
STYLE_ID_SLIDER_SHADE_1 = 136,
STYLE_ID_SLIDER_SHADE_2 = 137,
STYLE_ID_SLIDER_SHADE_3 = 138,
STYLE_ID_SLIDER_SHADE_4 = 139,
STYLE_ID_SLIDER_SHADE_5 = 140,
STYLE_ID_YES_NO = 141,
STYLE_ID_YES_NO_BUTTON = 142,
STYLE_ID_YES_NO_MESSAGE = 143,
STYLE_ID_TEXT_MESSAGE = 145,
STYLE_ID_ASYNC_OPERATION = 148,
STYLE_ID_SCROLLBAR_THUMB = 159,
STYLE_ID_SCROLLBAR_BUTTON = 160,
STYLE_ID_BOTTOM_BUTTON_TEXTUAL_S_LEFT = 161,
STYLE_ID_KEY_SPEC_ICONS = 164,
STYLE_ID_KEY_SPEC_ICONS_DISABLED = 166,
STYLE_ID_KEY_DISABLED = 167,
STYLE_ID_EDIT_VALUE_S_CENTERED = 168,
STYLE_ID_VALUE_M = 176,
STYLE_ID_DEFAULT_DISABLED_M_LEFT = 179,
STYLE_ID_YT_GRAPH = 180,
STYLE_ID_LIST_GRAPH_CURSOR = 181,
STYLE_ID_YT_GRAPH_U_DEFAULT_LABEL = 182,
STYLE_ID_YT_GRAPH_I_DEFAULT_LABEL = 183,
STYLE_ID_EDIT_VALUE_FOCUS_S_CENTER = 184,
STYLE_ID_VALUE = 189,
STYLE_ID_DEFAULT_M = 193,
STYLE_ID_NON_INTERACTIVE_BUTTON_M = 194,
STYLE_ID_OPTION_TOGGLE_L_CENTER = 195,
STYLE_ID_EVENT_ERROR = 196,
STYLE_ID_DEFAULT_DISABLED_S_LEFT = 197,
STYLE_ID_ICON_AND_TEXT_S = 199,
STYLE_ID_ICON_AND_TEXT_S_DISABLED = 200,
STYLE_ID_DEFAULT_DISABLED = 207,
STYLE_ID_EDIT_VALUE_M_CENTERED = 210,
STYLE_ID_EDIT_S = 211,
STYLE_ID_EVENT_WARNING = 227,
STYLE_ID_DISPLAY_OFF = 228,
STYLE_ID_DISPLAY_OFF_S = 229,
STYLE_ID_DEFAULT_GUI_TMPL = 232,
STYLE_ID_MON_VALUE_48_RIGHT = 233,
STYLE_ID_MON_VALUE_20_LEFT = 235,
STYLE_ID_ENCODER_CURSOR_14_DISABLED = 236,
STYLE_ID_ENCODER_CURSOR_14_ENABLED = 237,
STYLE_ID_ENCODER_CURSOR_14_FOCUSED = 238,
STYLE_ID_BAR_GRAPH_U_DEFAULT = 239,
STYLE_ID_BAR_GRAPH_TEXT = 240,
STYLE_ID_BAR_GRAPH_LIMIT_LINE = 242,
STYLE_ID_BAR_GRAPH_I_DEFAULT = 243,
STYLE_ID_TRIGGER_BUTTON_24 = 245,
STYLE_ID_MON_VALUE_14_RIGHT = 247,
STYLE_ID_ENCODER_CURSOR_14_RIGHT_DISABLED = 248,
STYLE_ID_ENCODER_CURSOR_14_RIGHT_ENABLED = 249,
STYLE_ID_ENCODER_CURSOR_14_RIGHT_FOCUSED = 250,
STYLE_ID_ENCODER_CURSOR_14_LEFT_DISABLED = 251,
STYLE_ID_CHANNEL_OFF_BUTTON_20 = 252,
STYLE_ID_TRIGGER_BUTTON_14 = 253,
STYLE_ID_CHANNEL_OFF_BUTTON_38 = 261,
STYLE_ID_INST_SELECTED = 262,
STYLE_ID_MON_VALUE_38_RIGHT = 263,
STYLE_ID_CH_PROT_OFF = 266,
STYLE_ID_CH_PROT_ON = 267,
STYLE_ID_CH_PROT_TRIPPED = 268,
STYLE_ID_BUTTON_BGND = 269,
STYLE_ID_MON_VALUE_24_RIGHT = 273,
STYLE_ID_MON_VALUE_14_CENTER = 274,
STYLE_ID_MON_VALUE_20_RIGHT = 281,
STYLE_ID_MON_VALUE_14_LEFT = 282,
STYLE_ID_CHANNEL_OFF_BUTTON_14 = 283,
STYLE_ID_SCROLLBAR_TRACK = 291,
STYLE_ID_NON_INTERACTIVE_BUTTON_S_DISABLED = 304
};

enum ThemesEnum {
Expand Down Expand Up @@ -1653,7 +1655,7 @@ enum PagesEnum {
};

#ifdef OPTION_SDRAM
extern const uint8_t assets[404250];
extern const uint8_t assets[403827];
#else
extern const uint8_t assets[3913632];
extern const uint8_t assets[3915168];
#endif
Loading

0 comments on commit 7b214a3

Please sign in to comment.