commit 905d5cb08a7b6851608d48981db90e8c9783388a
parent 66ec16f9692fee2fd38256196e4324350f811293
Author: Adam M <[email protected]>
Date: Tue, 12 Feb 2019 18:03:16 -0600
Readier for v1
Diffstat:
2 files changed, 72 insertions(+), 41 deletions(-)
diff --git a/res/ComputerscareIsoPanel.svg b/res/ComputerscareIsoPanel.svg
@@ -9,9 +9,9 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="140"
+ width="150"
height="380"
- viewBox="0 0 37.041668 100.54167"
+ viewBox="0 0 39.687501 100.54167"
version="1.1"
id="svg8"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
@@ -34,9 +34,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="32.000002"
- inkscape:cx="88.487053"
- inkscape:cy="381.43432"
+ inkscape:zoom="5.6568546"
+ inkscape:cx="36.135136"
+ inkscape:cy="317.79471"
inkscape:document-units="mm"
inkscape:current-layer="g1669"
showgrid="false"
@@ -55,7 +55,7 @@
inkscape:snap-nodes="false"
inkscape:snap-global="false"
showguides="false"
- showborder="false" />
+ showborder="true" />
<metadata
id="metadata5">
<rdf:RDF>
@@ -156,18 +156,22 @@
width="17.3057"
height="14.873548"
x="7.1093688"
- y="234.32529" />
+ y="234.32529"
+ inkscape:label="indentFloor" />
<path
- style="fill:#dedede;stroke:#000000;stroke-width:0.26458332px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
- d="m 3.414368,230.30288 3.6014567,4.02241 H 24.508614 l -2.572469,-3.92887 z"
+ style="fill:#dedede;fill-opacity:1;stroke:#000000;stroke-width:0.26840547px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="m 3.4203939,230.3057 3.7114704,4.01677 H 25.159006 l -1.855924,-3.87659 z"
id="path4030"
- inkscape:connector-curvature="0" />
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccc"
+ inkscape:label="indentSouth" />
<path
inkscape:connector-curvature="0"
id="path1647"
- d="m 3.3734373,199.56716 33.7854697,-0.063 c 0.337568,36.38983 0.04575,63.57854 -0.08071,97.43061 l -33.6386089,-9.6e-4 -0.024402,-35.91696 -0.011235,-16.53636 18.5195719,-2.7e-4 -0.0018,-14.023 -18.5273031,3.6e-4 z"
- style="opacity:1;vector-effect:none;fill:#f9f9f9;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.235;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
- sodipodi:nodetypes="cccccccccc" />
+ d="m 3.3776331,199.57135 36.2445539,-0.063 c 0.362139,36.38669 0.04908,63.57306 -0.08658,97.42221 l -36.0870043,-9.6e-4 -0.026179,-35.91386 -0.012052,-16.53493 19.8675243,-2.7e-4 -0.0019,-14.0218 -19.8758181,3.6e-4 z"
+ style="opacity:1;vector-effect:none;fill:#f9f9f9;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.24339159;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
+ sodipodi:nodetypes="cccccccccc"
+ inkscape:label="groundFloor" />
<g
aria-label="computerscare"
transform="matrix(1.3123272,0.02710821,-0.03314708,1.073241,7.0489753,-22.594823)"
@@ -301,18 +305,21 @@
style="opacity:1;vector-effect:none;fill:#f9f9f9;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.273;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:normal"
d="m 0.18378203,196.58837 22.22692397,-0.009 c 0.222081,5.39584 0.0301,9.42735 -0.05309,14.44691 l -22.13030777,-1.5e-4 z"
id="path4018"
- inkscape:connector-curvature="0" />
+ inkscape:connector-curvature="0"
+ inkscape:label="pimpleFloor" />
<path
style="fill:#dedede;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 0.22583599,210.93842 -0.007612,0.1447 3.10076081,2.90385 21.2862902,0.0222 -0.02052,-0.97531 -2.227465,-2.08961 z"
id="path4020"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccccc" />
+ sodipodi:nodetypes="ccccccc"
+ inkscape:label="pimpleSouth" />
<path
style="fill:#bababa;fill-opacity:1;stroke:#000000;stroke-width:0.26499999;stroke-linecap:butt;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 22.30768,196.58236 0.129574,0.0666 2.168994,2.91823 0.0017,14.38667 -0.0083,0.1158 -2.24231,-3.12539 z"
id="path4022"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="ccccccc" />
+ sodipodi:nodetypes="ccccccc"
+ inkscape:label="pimpleEast" />
</g>
</svg>
diff --git a/src/ComputerscareIso.cpp b/src/ComputerscareIso.cpp
@@ -30,13 +30,10 @@ struct ComputerscareIso : Module {
ComputerscareIso() {
config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS);
-
-
- printf("ujje\n");
+
for (int i = 0; i < numKnobs; i++) {
-
params[KNOB + i].config(0.0f, 10.0f, 0.0f);
- params[KNOB+i].config(0.f, 10.f, 0.f, "Channel "+std::to_string(i) + " Voltage", " Volts");
+ params[KNOB+i].config(0.f, 10.f, 0.f, "Channel "+std::to_string(i+1) + " Voltage", " Volts");
}
params[TOGGLES].config(0.0f, 1.0f, 0.0f);
outputs[POLY_OUTPUT].setChannels(16);
@@ -45,7 +42,6 @@ struct ComputerscareIso : Module {
for (int i = 0; i < numKnobs; i++) {
outputs[POLY_OUTPUT].setVoltage(params[KNOB+i].getValue(),i);
}
-
}
};
@@ -57,7 +53,7 @@ struct ComputerscareIsoWidget : ModuleWidget {
//setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/ComputerscareIsoPanel.svg")));
float outputY = 334;
- box.size = Vec(15*9, 380);
+ box.size = Vec(150, 380);
{
ComputerscareSVGPanel *panel = new ComputerscareSVGPanel();
panel->box.size = box.size;
@@ -69,33 +65,61 @@ struct ComputerscareIsoWidget : ModuleWidget {
}
addParam(createParam<IsoButton>(Vec(10, 5), module, ComputerscareIso::TOGGLES));
- addParam(createParam<ComputerscareClockButton>(Vec(10,40),module,ComputerscareIso::TOGGLES+2));
- addParam(createParam<ComputerscareResetButton>(Vec(55,40),module,ComputerscareIso::TOGGLES+1));
-
-
- smallLetterDisplay = new SmallLetterDisplay();
- smallLetterDisplay->box.pos = Vec(20,77);
- smallLetterDisplay->box.size = Vec(60, 30);
- smallLetterDisplay->value = "1";
- smallLetterDisplay->baseColor = COLOR_COMPUTERSCARE_TRANSPARENT;
- addChild(smallLetterDisplay);
+ addParam(createParam<ComputerscareClockButton>(Vec(10,40),module,ComputerscareIso::TOGGLES+1));
+ addParam(createParam<ComputerscareResetButton>(Vec(55,40),module,ComputerscareIso::TOGGLES+2));
-
- addParam(createParam<Davies1900hBlackKnob>(Vec(28, 87), module, ComputerscareIso::KNOB));
- addParam(createParam<MediumSnapKnob>(Vec(68, 97), module, ComputerscareIso::KNOB+1));
+ addLabeledKnob("1",20,77,module,0,0);
+ addLabeledKnob("2",84,86,module,1,2);
+
+ addLabeledKnob("3",30, 157,module,2,1);
+ addLabeledKnob("4",62, 157, module, 3,1);
- addParam(createParam<SmoothKnob>(Vec(30, 147), module, ComputerscareIso::KNOB+2));
- addParam(createParam<SmallKnob>(Vec(62, 147), module, ComputerscareIso::KNOB+3));
- addParam(createParam<BigSmoothKnob>(Vec(68, 187), module, ComputerscareIso::KNOB+4));
- addParam(createParam<MediumSnapKnob>(Vec(68, 267), module, ComputerscareIso::KNOB+5));
-
+ addLabeledKnob("5",98, 167, module,4,2);
+ addLabeledKnob("6",68, 197, module,5,0);
+ addLabeledKnob("7",68, 237, module,6,3);
+ addLabeledKnob("8",168, 237, module,7,3);
+ addLabeledKnob("9",68, 277, module,8,3);
+ addLabeledKnob("10",168, 277, module,9,4);
addOutput(createOutput<OutPort>(Vec(33, outputY), module, ComputerscareIso::POLY_OUTPUT));
addOutput(createOutput<PointingUpPentagonPort>(Vec(63, outputY), module, ComputerscareIso::POLY_OUTPUT+1));
addOutput(createOutput<InPort>(Vec(93, outputY), module, ComputerscareIso::POLY_OUTPUT+2));
}
+void addLabeledKnob(std::string label,int x, int y, ComputerscareIso *module,int index,int type) {
+ smallLetterDisplay = new SmallLetterDisplay();
+ smallLetterDisplay->box.pos = Vec(x+12,y-10);
+ smallLetterDisplay->box.size = Vec(60, 30);
+ smallLetterDisplay->value = label;
+ //smallLetterDisplay->baseColor = COLOR_COMPUTERSCARE_TRANSPARENT;
+ addChild(smallLetterDisplay);
+ float ru = random::uniform();
+ if(type == 0) {
+ addParam(createParam<SmoothKnob>(Vec(x,y),module,ComputerscareIso::KNOB+index));
+ }
+ else if(type ==1) {
+ addParam(createParam<SmallKnob>(Vec(x,y),module,ComputerscareIso::KNOB+index));
+
+ }
+ else if(type==2) {
+ addParam(createParam<BigSmoothKnob>(Vec(x,y),module,ComputerscareIso::KNOB+index));
+
+ }
+ else if (type==3) {
+ addParam(createParam<LrgKnob>(Vec(x,y),module,ComputerscareIso::KNOB+index));
+ }
+ else if (type==4) {
+ addParam(createParam<BigSmoothKnob>(Vec(x,y),module,ComputerscareIso::KNOB+index));
+ }
+
+
+ else {
+ addParam(createParam<MediumSnapKnob>(Vec(x,y),module,ComputerscareIso::KNOB+index));
+
+ }
+
+}
SmallLetterDisplay* smallLetterDisplay;
};