Commit 4ba8ae87 authored by lcgamboa's avatar lcgamboa

fix: Fix Oscilloscope to use all SpareParts pins.

parent 8edf0a7f
...@@ -625,40 +625,35 @@ void COscilloscope::SetBaseTimer(void) { ...@@ -625,40 +625,35 @@ void COscilloscope::SetBaseTimer(void) {
WindowCmd(PW_MAIN, "combo2", PWA_COMBODELETEITEMS, NULL); WindowCmd(PW_MAIN, "combo2", PWA_COMBODELETEITEMS, NULL);
WindowCmd(PW_MAIN, "combo3", PWA_COMBODELETEITEMS, NULL); WindowCmd(PW_MAIN, "combo3", PWA_COMBODELETEITEMS, NULL);
for (int i = 1; i <= PinCount; i++) {
std::string spin; if (pboard->GetUseSpareParts()) {
if (pboard->GetUseSpareParts()) { WindowCmd(PW_MAIN, "combo2", PWA_COMBOSETITEMS, SpareParts.GetPinsNames().c_str());
spin = SpareParts.GetPinName(i); WindowCmd(PW_MAIN, "combo3", PWA_COMBOSETITEMS, SpareParts.GetPinsNames().c_str());
} else { } else {
for (int i = 1; i <= PinCount; i++) {
std::string spin;
spin = pboard->MGetPinName(i); spin = pboard->MGetPinName(i);
} if (spin.compare("error")) {
if (spin.compare("error")) { WindowCmd(PW_MAIN, "combo2", PWA_COMBOADDITEM, (std::to_string(i) + " " + spin).c_str());
WindowCmd(PW_MAIN, "combo2", PWM_COMBOADDITEM, (std::to_string(i) + " " + spin).c_str()); WindowCmd(PW_MAIN, "combo3", PWA_COMBOADDITEM, (std::to_string(i) + " " + spin).c_str());
WindowCmd(PW_MAIN, "combo3", PWM_COMBOADDITEM, (std::to_string(i) + " " + spin).c_str()); }
} }
} }
if (chp[0] <= PinCount) { std::string spin;
std::string spin; if (pboard->GetUseSpareParts()) {
if (pboard->GetUseSpareParts()) { spin = SpareParts.GetPinName(chp[0]);
spin = SpareParts.GetPinName(chp[0]); } else {
} else { spin = pboard->MGetPinName(chp[0]);
spin = pboard->MGetPinName(chp[0]); }
} WindowCmd(PW_MAIN, "combo2", PWA_COMBOSETTEXT, (std::to_string(chp[0]) + " " + spin).c_str());
WindowCmd(PW_MAIN, "combo2", PWA_COMBOSETTEXT, (std::to_string(chp[0]) + " " + spin).c_str());
} else if (pboard->GetUseSpareParts()) {
WindowCmd(PW_MAIN, "combo2", PWA_COMBOSETTEXT, "1"); spin = SpareParts.GetPinName(chp[1]);
} else {
if (chp[1] <= PinCount) { spin = pboard->MGetPinName(chp[1]);
std::string spin; }
if (pboard->GetUseSpareParts()) { WindowCmd(PW_MAIN, "combo3", PWA_COMBOSETTEXT, (std::to_string(chp[1]) + " " + spin).c_str());
spin = SpareParts.GetPinName(chp[1]);
} else {
spin = pboard->MGetPinName(chp[1]);
}
WindowCmd(PW_MAIN, "combo3", PWA_COMBOSETTEXT, (std::to_string(chp[1]) + " " + spin).c_str());
} else
WindowCmd(PW_MAIN, "combo2", PWA_COMBOSETTEXT, "2");
WindowCmd(PW_MAIN, "spind5", PWA_SPINDGETVALUE, NULL, &tscale); WindowCmd(PW_MAIN, "spind5", PWA_SPINDGETVALUE, NULL, &tscale);
......
...@@ -42,7 +42,7 @@ enum PICSimLabWindowAction { ...@@ -42,7 +42,7 @@ enum PICSimLabWindowAction {
PWA_COMBOPROPEV, PWA_COMBOPROPEV,
PWA_COMBOPARTEV, PWA_COMBOPARTEV,
PWA_COMBODELETEITEMS, PWA_COMBODELETEITEMS,
PWM_COMBOADDITEM, PWA_COMBOADDITEM,
PWA_SPINDSETMAX, PWA_SPINDSETMAX,
PWA_SPINDSETMIN, PWA_SPINDSETMIN,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment