Skip to content

Commit

Permalink
screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Jul 9, 2019
1 parent 7b7a6e7 commit aacd417
Show file tree
Hide file tree
Showing 30 changed files with 294 additions and 112 deletions.
7 changes: 7 additions & 0 deletions modular-psu-firmware.eez-project
Original file line number Diff line number Diff line change
Expand Up @@ -238546,6 +238546,13 @@
"response": {
"type": "numeric"
}
},
{
"name": "DISPlay:DATA?",
"parameters": [],
"response": {
"type": "data-block"
}
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion src/eez/apps/psu/conf_advanced.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,4 @@
#define CONF_DLOG_SYNC_FILE_TIME 10 // 10 seconds

/// Size of serial port output buffer
#define CONF_SERIAL_BUFFER_SIZE 64
#define CONF_SERIAL_BUFFER_SIZE 512
1 change: 0 additions & 1 deletion src/eez/apps/psu/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <eez/system.h>

#ifndef EEZ_PLATFORM_SIMULATOR
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>

Expand Down
6 changes: 1 addition & 5 deletions src/eez/apps/psu/devices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ bool anyFailed() {
strncpy(result + index, str, strLength); \
index = nextIndex

char *getSelfTestResultString() {
const int MAX_LENGTH = 255;
char *result = (char *)malloc(MAX_LENGTH + 1);
void getSelfTestResultString(char *result, int MAX_LENGTH) {
int index = 0;
int nextIndex;
const char *str;
Expand All @@ -142,8 +140,6 @@ char *getSelfTestResultString() {
}

*(result + index) = 0;

return result;
}

const char *getInstalledString(bool installed) {
Expand Down
2 changes: 1 addition & 1 deletion src/eez/apps/psu/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern Device devices[];
extern int numDevices;

bool anyFailed();
char *getSelfTestResultString();
void getSelfTestResultString(char *, int MAX_LENGTH);

const char *getInstalledString(bool installed);
const char *getTestResultString(TestResult g_testResult);
Expand Down
2 changes: 1 addition & 1 deletion src/eez/apps/psu/gui/page_ch_settings_adv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void ChSettingsAdvTrackingPage::toggleTrackingMode() {

////////////////////////////////////////////////////////////////////////////////

ChSettingsAdvViewPage::ChSettingsAdvViewPage() {
void ChSettingsAdvViewPage::pageWillAppear() {
origDisplayValue1 = displayValue1 = g_channel->flags.displayValue1;
origDisplayValue2 = displayValue2 = g_channel->flags.displayValue2;
origYTViewRate = ytViewRate = g_channel->ytViewRate;
Expand Down
2 changes: 1 addition & 1 deletion src/eez/apps/psu/gui/page_ch_settings_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ChSettingsAdvTrackingPage : public Page {

class ChSettingsAdvViewPage : public SetPage {
public:
ChSettingsAdvViewPage();
void pageWillAppear();

void editDisplayValue1();
void editDisplayValue2();
Expand Down
8 changes: 4 additions & 4 deletions src/eez/apps/psu/gui/page_ch_settings_protection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void ChSettingsProtectionSetPage::editDelay() {

////////////////////////////////////////////////////////////////////////////////

ChSettingsOvpProtectionPage::ChSettingsOvpProtectionPage() {
void ChSettingsOvpProtectionPage::pageWillAppear() {
origState = state = g_channel->prot_conf.flags.u_state ? 1 : 0;

origLimit = limit =
Expand Down Expand Up @@ -197,7 +197,7 @@ void ChSettingsOvpProtectionPage::setParams(bool checkLoad) {

////////////////////////////////////////////////////////////////////////////////

ChSettingsOcpProtectionPage::ChSettingsOcpProtectionPage() {
void ChSettingsOcpProtectionPage::pageWillAppear() {
origState = state = g_channel->prot_conf.flags.i_state ? 1 : 0;

origLimit = limit =
Expand Down Expand Up @@ -231,7 +231,7 @@ void ChSettingsOcpProtectionPage::setParams(bool checkLoad) {

////////////////////////////////////////////////////////////////////////////////

ChSettingsOppProtectionPage::ChSettingsOppProtectionPage() {
void ChSettingsOppProtectionPage::pageWillAppear() {
origState = state = g_channel->prot_conf.flags.p_state ? 1 : 0;

origLimit = limit =
Expand Down Expand Up @@ -275,7 +275,7 @@ void ChSettingsOppProtectionPage::setParams(bool checkLoad) {

////////////////////////////////////////////////////////////////////////////////

ChSettingsOtpProtectionPage::ChSettingsOtpProtectionPage() {
void ChSettingsOtpProtectionPage::pageWillAppear() {
#if EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R3B4 || \
EEZ_PSU_SELECTED_REVISION == EEZ_PSU_REVISION_R5B12
origState = state = temperature::getChannelSensorState(g_channel) ? 1 : 0;
Expand Down
8 changes: 4 additions & 4 deletions src/eez/apps/psu/gui/page_ch_settings_protection.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class ChSettingsProtectionSetPage : public SetPage {

class ChSettingsOvpProtectionPage : public ChSettingsProtectionSetPage {
public:
ChSettingsOvpProtectionPage();
void pageWillAppear();

protected:
void setParams(bool checkLoad);
Expand All @@ -85,7 +85,7 @@ class ChSettingsOvpProtectionPage : public ChSettingsProtectionSetPage {

class ChSettingsOcpProtectionPage : public ChSettingsProtectionSetPage {
public:
ChSettingsOcpProtectionPage();
void pageWillAppear();

protected:
void setParams(bool checkLoad);
Expand All @@ -96,7 +96,7 @@ class ChSettingsOcpProtectionPage : public ChSettingsProtectionSetPage {

class ChSettingsOppProtectionPage : public ChSettingsProtectionSetPage {
public:
ChSettingsOppProtectionPage();
void pageWillAppear();

protected:
void setParams(bool checkLoad);
Expand All @@ -107,7 +107,7 @@ class ChSettingsOppProtectionPage : public ChSettingsProtectionSetPage {

class ChSettingsOtpProtectionPage : public ChSettingsProtectionSetPage {
public:
ChSettingsOtpProtectionPage();
void pageWillAppear();

protected:
void setParams(bool checkLoad);
Expand Down
8 changes: 4 additions & 4 deletions src/eez/apps/psu/gui/page_ch_settings_trigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ static uint8_t g_newTriggerMode;

////////////////////////////////////////////////////////////////////////////////

ChSettingsTriggerPage::ChSettingsTriggerPage() {
}

void ChSettingsTriggerPage::onFinishTriggerModeSet() {
trigger::abort();
channel_dispatcher::setVoltageTriggerMode(*g_channel, (TriggerMode)g_newTriggerMode);
Expand Down Expand Up @@ -181,7 +178,10 @@ float ChSettingsListsPage::m_currentList[MAX_LIST_LENGTH];

float ChSettingsListsPage::m_dwellList[MAX_LIST_LENGTH];

ChSettingsListsPage::ChSettingsListsPage() : m_listVersion(0), m_iCursor(0) {
void ChSettingsListsPage::pageWillAppear() {
m_listVersion = 0;
m_iCursor = 0;

float *dwellList = list::getDwellList(*g_channel, &m_dwellListLength);
memcpy(m_dwellList, dwellList, m_dwellListLength * sizeof(float));

Expand Down
4 changes: 1 addition & 3 deletions src/eez/apps/psu/gui/page_ch_settings_trigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ namespace gui {

class ChSettingsTriggerPage : public Page {
public:
ChSettingsTriggerPage();

void editTriggerMode();

void editVoltageTriggerValue();
Expand All @@ -59,7 +57,7 @@ class ChSettingsTriggerPage : public Page {

class ChSettingsListsPage : public SetPage {
public:
ChSettingsListsPage();
void pageWillAppear();

void previousPage();
void nextPage();
Expand Down
6 changes: 4 additions & 2 deletions src/eez/apps/psu/gui/page_self_test_result.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@ namespace eez {
namespace psu {
namespace gui {

const int MAX_LENGTH = 255;
char SelfTestResultPage::m_selfTestResult[MAX_LENGTH + 1];

void SelfTestResultPage::pageWillAppear() {
m_selfTestResult = devices::getSelfTestResultString();
devices::getSelfTestResultString(m_selfTestResult, MAX_LENGTH);
}

void SelfTestResultPage::pageDidDisappear() {
free(m_selfTestResult);
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/eez/apps/psu/gui/page_self_test_result.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class SelfTestResultPage : public Page {
void pageWillAppear();
void pageDidDisappear();

char *m_selfTestResult;
static char m_selfTestResult[];
};

} // namespace gui
Expand Down
32 changes: 16 additions & 16 deletions src/eez/apps/psu/gui/page_sys_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace gui {

////////////////////////////////////////////////////////////////////////////////

SysSettingsDateTimePage::SysSettingsDateTimePage() {
void SysSettingsDateTimePage::pageWillAppear() {
#if OPTION_ETHERNET
ntpEnabled = origNtpEnabled = persist_conf::isNtpEnabled();
strcpy(ntpServer, persist_conf::devConf2.ntpServer);
Expand Down Expand Up @@ -289,7 +289,7 @@ void SysSettingsDateTimePage::doSet() {

#if OPTION_ETHERNET

SysSettingsEthernetPage::SysSettingsEthernetPage() {
void SysSettingsEthernetPage::pageWillAppear() {
m_enabledOrig = m_enabled = persist_conf::isEthernetEnabled();
m_dhcpEnabledOrig = m_dhcpEnabled = persist_conf::isEthernetDhcpEnabled();
m_ipAddressOrig = m_ipAddress = persist_conf::devConf2.ethernetIpAddress;
Expand Down Expand Up @@ -370,7 +370,7 @@ void SysSettingsEthernetPage::set() {

////////////////////////////////////////////////////////////////////////////////

SysSettingsEthernetStaticPage::SysSettingsEthernetStaticPage() {
void SysSettingsEthernetStaticPage::pageWillAppear() {
SysSettingsEthernetPage *page = (SysSettingsEthernetPage *)getPreviousPage();

m_ipAddressOrig = m_ipAddress = page->m_ipAddress;
Expand Down Expand Up @@ -470,7 +470,7 @@ void SysSettingsProtectionsPage::toggleForceDisablingAllOutputsOnPowerUp() {

////////////////////////////////////////////////////////////////////////////////

SysSettingsAuxOtpPage::SysSettingsAuxOtpPage() {
void SysSettingsAuxOtpPage::pageWillAppear() {
origState = state = temperature::sensors[temp_sensor::AUX].prot_conf.state ? 1 : 0;

origLevel = level =
Expand Down Expand Up @@ -592,7 +592,7 @@ void SysSettingsSoundPage::toggleClickSound() {

////////////////////////////////////////////////////////////////////////////////

SysSettingsEncoderPage::SysSettingsEncoderPage() {
void SysSettingsEncoderPage::pageWillAppear() {
origConfirmationMode = confirmationMode = persist_conf::devConf2.flags.encoderConfirmationMode;
origMovingSpeedDown = movingSpeedDown = persist_conf::devConf2.encoderMovingSpeedDown;
origMovingSpeedUp = movingSpeedUp = persist_conf::devConf2.encoderMovingSpeedUp;
Expand All @@ -619,7 +619,7 @@ void SysSettingsEncoderPage::set() {

////////////////////////////////////////////////////////////////////////////////

SysSettingsTriggerPage::SysSettingsTriggerPage() {
void SysSettingsTriggerPage::pageWillAppear() {
m_sourceOrig = m_source = trigger::getSource();
m_delayOrig = m_delay = trigger::getDelay();
m_initiateContinuouslyOrig = m_initiateContinuously =
Expand Down Expand Up @@ -689,18 +689,18 @@ void SysSettingsTriggerPage::set() {

////////////////////////////////////////////////////////////////////////////////

SysSettingsIOPinsPage::SysSettingsIOPinsPage() {
m_polarityOrig[0] = m_polarity[0] = (io_pins::Polarity)persist_conf::devConf2.ioPins[0].polarity;
m_functionOrig[0] = m_function[0] = (io_pins::Function)persist_conf::devConf2.ioPins[0].function;
void SysSettingsIOPinsPage::pageWillAppear() {
m_polarityOrig[0] = m_polarity[0] = (io_pins::Polarity)persist_conf::devConf2.ioPins[0].polarity;
m_functionOrig[0] = m_function[0] = (io_pins::Function)persist_conf::devConf2.ioPins[0].function;

m_polarityOrig[1] = m_polarity[1] = (io_pins::Polarity)persist_conf::devConf2.ioPinInput2.polarity;
m_functionOrig[1] = m_function[1] = (io_pins::Function)persist_conf::devConf2.ioPinInput2.function;
m_polarityOrig[1] = m_polarity[1] = (io_pins::Polarity)persist_conf::devConf2.ioPinInput2.polarity;
m_functionOrig[1] = m_function[1] = (io_pins::Function)persist_conf::devConf2.ioPinInput2.function;

m_polarityOrig[2] = m_polarity[2] = (io_pins::Polarity)persist_conf::devConf2.ioPins[1].polarity;
m_functionOrig[2] = m_function[2] = (io_pins::Function)persist_conf::devConf2.ioPins[1].function;
m_polarityOrig[2] = m_polarity[2] = (io_pins::Polarity)persist_conf::devConf2.ioPins[1].polarity;
m_functionOrig[2] = m_function[2] = (io_pins::Function)persist_conf::devConf2.ioPins[1].function;

m_polarityOrig[3] = m_polarity[3] = (io_pins::Polarity)persist_conf::devConf2.ioPins[2].polarity;
m_functionOrig[3] = m_function[3] = (io_pins::Function)persist_conf::devConf2.ioPins[2].function;
m_polarityOrig[3] = m_polarity[3] = (io_pins::Polarity)persist_conf::devConf2.ioPins[2].polarity;
m_functionOrig[3] = m_function[3] = (io_pins::Function)persist_conf::devConf2.ioPins[2].function;
}

void SysSettingsIOPinsPage::togglePolarity() {
Expand Down Expand Up @@ -757,7 +757,7 @@ void SysSettingsIOPinsPage::set() {

////////////////////////////////////////////////////////////////////////////////

SysSettingsSerialPage::SysSettingsSerialPage() {
void SysSettingsSerialPage::pageWillAppear() {
m_enabledOrig = m_enabled = persist_conf::isSerialEnabled();
m_baudIndexOrig = m_baudIndex = persist_conf::getSerialBaudIndex();
m_parityOrig = m_parity = (serial::Parity)persist_conf::getSerialParity();
Expand Down
16 changes: 8 additions & 8 deletions src/eez/apps/psu/gui/page_sys_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace gui {

class SysSettingsDateTimePage : public SetPage {
public:
SysSettingsDateTimePage();
void pageWillAppear();

void edit();
void setValue(float value);
Expand Down Expand Up @@ -79,7 +79,7 @@ class SysSettingsEthernetPage : public SetPage {
friend class SysSettingsEthernetStaticPage;

public:
SysSettingsEthernetPage();
void pageWillAppear();

void toggle();
void toggleDhcp();
Expand Down Expand Up @@ -123,7 +123,7 @@ class SysSettingsEthernetPage : public SetPage {

class SysSettingsEthernetStaticPage : public SetPage {
public:
SysSettingsEthernetStaticPage();
void pageWillAppear();

void editIpAddress();
void editDns();
Expand Down Expand Up @@ -162,7 +162,7 @@ class SysSettingsProtectionsPage : public Page {

class SysSettingsAuxOtpPage : public SetPage {
public:
SysSettingsAuxOtpPage();
void pageWillAppear();

int getDirty();
void set();
Expand Down Expand Up @@ -206,7 +206,7 @@ class SysSettingsSoundPage : public Page {

class SysSettingsEncoderPage : public SetPage {
public:
SysSettingsEncoderPage();
void pageWillAppear();

void toggleConfirmationMode();

Expand All @@ -227,7 +227,7 @@ class SysSettingsEncoderPage : public SetPage {

class SysSettingsTriggerPage : public SetPage {
public:
SysSettingsTriggerPage();
void pageWillAppear();

void selectSource();
void editDelay();
Expand All @@ -251,7 +251,7 @@ class SysSettingsTriggerPage : public SetPage {

class SysSettingsIOPinsPage : public SetPage {
public:
SysSettingsIOPinsPage();
void pageWillAppear();

void togglePolarity();
void selectFunction();
Expand All @@ -273,7 +273,7 @@ class SysSettingsIOPinsPage : public SetPage {

class SysSettingsSerialPage : public SetPage {
public:
SysSettingsSerialPage();
void pageWillAppear();

void toggle();
void selectParity();
Expand Down
Loading

0 comments on commit aacd417

Please sign in to comment.