Skip to content

Commit

Permalink
#46
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Sep 16, 2020
1 parent 04c6f8c commit 30ab4ac
Show file tree
Hide file tree
Showing 12 changed files with 12,551 additions and 12,540 deletions.
Binary file modified images/Module MIO168.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/Module SMX46.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25,037 changes: 12,513 additions & 12,524 deletions src/eez/gui/document_simulator.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/eez/gui/document_simulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -2081,4 +2081,4 @@ enum PagesEnum {
PAGE_ID_DIB_DCM224_SLOT_MICRO_2CH_OFF = 244
};

extern const uint8_t assets[531686];
extern const uint8_t assets[531519];
16 changes: 10 additions & 6 deletions src/eez/modules/dib-dcp405/dib-dcp405.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,18 @@ struct DcpChannel : public Channel {
}

void setDprogState(DprogState dprogState) override {
Channel::setDprogState(dprogState);

if (dprogState == DPROG_STATE_OFF) {
setDpEnable(false);
if (!isPsuThread()) {
sendMessageToPsu(PSU_MESSAGE_SET_DPROG_STATE, (channelIndex << 8) | dprogState);
} else {
setDpEnable(isOk() && ioexp.testBit(IOExpander::IO_BIT_OUT_OUTPUT_ENABLE));
Channel::setDprogState(dprogState);

if (dprogState == DPROG_STATE_OFF) {
setDpEnable(false);
} else {
setDpEnable(isOk() && ioexp.testBit(IOExpander::IO_BIT_OUT_OUTPUT_ENABLE));
}
delayed_dp_off = false;
}
delayed_dp_off = false;
}

void setRemoteSense(bool enable) override {
Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/dib-mio168/dib-mio168.eez-project

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/eez/modules/dib-smx46/dib-smx46.eez-project

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions src/eez/modules/psu/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1173,12 +1173,16 @@ bool Channel::isRemoteSensingEnabled() {
}

void Channel::remoteProgrammingEnable(bool enable) {
if (enable != flags.rprogEnabled) {
if (trigger::isActive()) {
trigger::abort();
if (!isPsuThread()) {
sendMessageToPsu(PSU_MESSAGE_REMOTE_PROGRAMMING_ENABLE, (channelIndex << 8) | (enable ? 1 : 0));
} else {
if (enable != flags.rprogEnabled) {
if (trigger::isActive()) {
trigger::abort();
}
doRemoteProgrammingEnable(enable);
event_queue::pushChannelEvent((enable ? event_queue::EVENT_INFO_CH_REMOTE_PROG_ENABLED : event_queue::EVENT_INFO_CH_REMOTE_PROG_DISABLED), channelIndex);
}
doRemoteProgrammingEnable(enable);
event_queue::pushChannelEvent((enable ? event_queue::EVENT_INFO_CH_REMOTE_PROG_ENABLED : event_queue::EVENT_INFO_CH_REMOTE_PROG_DISABLED), channelIndex);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/eez/modules/psu/channel_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ void disableOutputForAllTrackingChannels() {

void remoteSensingEnable(Channel &channel, bool enable) {
if (!isPsuThread()) {
sendMessageToPsu(PSU_MESSAGE_REMOTE_SENSING_EANBLE, (channel.channelIndex << 8) | (enable ? 1 : 0) );
sendMessageToPsu(PSU_MESSAGE_REMOTE_SENSING_EANBLE, (channel.channelIndex << 8) | (enable ? 1 : 0));
} else {
if (channel.channelIndex < 2 && (g_couplingType == COUPLING_TYPE_SERIES || g_couplingType == COUPLING_TYPE_PARALLEL)) {
Channel::get(0).remoteSensingEnable(enable);
Expand Down
6 changes: 6 additions & 0 deletions src/eez/modules/psu/psu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,12 @@ void onThreadMessage(uint8_t type, uint32_t param) {
} else if (type == PSU_MESSAGE_READ_CHANNEL_TEMPERATURE) {
Channel &channel = Channel::get(param);
channel.readTemperature();
} else if (type == PSU_MESSAGE_REMOTE_PROGRAMMING_ENABLE) {
Channel &channel = Channel::get((param >> 8) & 0xFF);
channel.remoteProgrammingEnable(param & 0xFF);
} else if (type == PSU_MESSAGE_SET_DPROG_STATE) {
Channel &channel = Channel::get((param >> 8) & 0xFF);
channel.setDprogState((DprogState)(param & 0xFF));
}
}

Expand Down
6 changes: 6 additions & 0 deletions src/eez/modules/psu/scpi/debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ scpi_result_t scpi_cmd_debug(scpi_t *context) {
taskEXIT_CRITICAL();
restart();
#endif
} else if (cmd == 30) {
int32_t delayMs;
if (!SCPI_ParamInt32(context, &delayMs, false)) {
return SCPI_RES_ERR;
}
osDelay(delayMs);
} else {
SCPI_ErrorPush(context, SCPI_ERROR_HARDWARE_MISSING);
return SCPI_RES_ERR;
Expand Down
4 changes: 3 additions & 1 deletion src/eez/tasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ enum HighPriorityThreadMessage {
PSU_MESSAGE_SLOT_SET_ENABLED,
PSU_MESSAGE_SET_CURRENT_RANGE_SELECTION_MODE,
PSU_MESSAGE_REMOTE_SENSING_EANBLE,
PSU_MESSAGE_READ_CHANNEL_TEMPERATURE
PSU_MESSAGE_READ_CHANNEL_TEMPERATURE,
PSU_MESSAGE_REMOTE_PROGRAMMING_ENABLE,
PSU_MESSAGE_SET_DPROG_STATE
};

enum LowPriorityThreadMessage {
Expand Down

0 comments on commit 30ab4ac

Please sign in to comment.