Skip to content

Commit

Permalink
helper function in outport and show when in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamPorcineFudgepuppy committed Jul 7, 2024
1 parent ecd32f7 commit 3c7a996
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/complex/ComplexWidgets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,10 @@ struct CompolyInOrOutWidget : Widget {
leftLabel->setSVG("res/complex-labels/"+leftFilename);
rightLabel->visible=false;
}
void setPorts(std::string leftPortFilename,std::string rightPortFilename) {
ports[0]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/"+leftPortFilename)));
ports[1]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/"+rightPortFilename)));
}

void step() {
if(module) {
Expand All @@ -368,26 +372,23 @@ struct CompolyInOrOutWidget : Widget {
lastOutMode = outMode;
if(ports[0] && ports[1]) {
if(outMode==0) {
ports[0]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-skewL.svg")));
ports[1]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-skewL.svg")));
//leftLabel->setSVG(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-labels/r.svg")));
setPorts("complex-outjack-skewL.svg","complex-outjack-skewL.svg");
setLabels("xy.svg");
} else if(outMode==1) {
ports[0]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-slantL.svg")));
ports[1]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-slantL.svg")));

setPorts("complex-outjack-slantL.svg","complex-outjack-slantL.svg");
setLabels("rtheta.svg");
} else if(outMode==2) {
ports[0]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-skewL.svg")));
ports[1]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-skewR.svg")));
setPorts("complex-outjack-skewL.svg","complex-outjack-skewR.svg");
setLabels("x.svg","yy.svg");
} else if(outMode==3) {
ports[0]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-slantR.svg")));
ports[1]->setSvg(APP->window->loadSvg(asset::plugin(pluginInstance, "res/complex-outjack-slantL.svg")));
setPorts("complex-outjack-slantR.svg","complex-outjack-slantL.svg");
setLabels("r.svg","theta.svg");
}
}
}
} else {
setPorts("complex-outjack-skewL.svg","complex-outjack-skewL.svg");
setLabels("xy.svg");
}

Widget::step();
Expand Down

0 comments on commit 3c7a996

Please sign in to comment.