commit 187fe1da18525f884b32e5ea24c4314fef15ca6d
parent f6f418b6623ed3de4ae022af7427a9ec163299fe
Author: Adam M <[email protected]>
Date: Tue, 16 Oct 2018 19:36:58 -0500
update panel to add labels. tighten up each row of LaundrySoup
Diffstat:
2 files changed, 61 insertions(+), 17 deletions(-)
diff --git a/res/ComputerscareLaundrySoupPanel.svg b/res/ComputerscareLaundrySoupPanel.svg
@@ -34,11 +34,11 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="1.4142136"
- inkscape:cx="108.40912"
- inkscape:cy="209.82193"
+ inkscape:zoom="4.0000001"
+ inkscape:cx="73.409121"
+ inkscape:cy="365.51563"
inkscape:document-units="mm"
- inkscape:current-layer="text1651"
+ inkscape:current-layer="g1669"
showgrid="false"
units="px"
inkscape:snap-bbox="true"
@@ -207,6 +207,52 @@
id="path939"
inkscape:connector-curvature="0" />
</g>
+ <g
+ aria-label="rst"
+ transform="matrix(1.9119826,-0.34464307,0.50786191,1.8921039,-36.890845,-192.32161)"
+ style="font-style:normal;font-weight:normal;font-size:1.90312397px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.01258837"
+ id="text864">
+ <path
+ d="m -41.275716,202.9985 c -0.02809,-0.0143 -0.05823,-0.0258 -0.09042,-0.0344 -0.03141,-0.009 -0.06577,-0.0154 -0.10308,-0.0195 -0.132321,-0.0146 -0.228975,0.007 -0.289963,0.0641 -0.06027,0.0567 -0.08086,0.14576 -0.06177,0.26708 l 0.08886,0.56511 -0.235378,-0.026 -0.168693,-1.07274 0.235378,0.026 0.0415,0.11733 c 0.03893,-0.0598 0.08009,-0.0516 0.154062,-0.0742 0.07386,-0.0233 0.167187,-0.0287 0.27999,-0.0162 0.01617,0.002 0.03416,0.005 0.05395,0.009 0.01967,0.003 0.04168,0.008 0.06602,0.0144 z"
+ style="stroke-width:0.01482364"
+ id="path870"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccc" />
+ <path
+ d="m -40.410807,203.11285 v 0.16169 q -0.07248,-0.0372 -0.15054,-0.0557 -0.07806,-0.0186 -0.161691,-0.0186 -0.127309,0 -0.191428,0.039 -0.06319,0.039 -0.06319,0.11709 0,0.0595 0.04553,0.0939 0.04553,0.0334 0.183064,0.0641 l 0.05854,0.013 q 0.182135,0.039 0.258334,0.11058 0.07713,0.0706 0.07713,0.19793 0,0.14497 -0.115228,0.22953 -0.114299,0.0846 -0.315019,0.0846 -0.08363,0 -0.174701,-0.0167 -0.09014,-0.0158 -0.190498,-0.0483 v -0.17656 q 0.09479,0.0493 0.186781,0.0743 0.092,0.0242 0.182135,0.0242 0.120804,0 0.185852,-0.0409 0.06505,-0.0418 0.06505,-0.11709 0,-0.0697 -0.04739,-0.10686 -0.04646,-0.0372 -0.205366,-0.0716 l -0.05947,-0.0139 q -0.158903,-0.0335 -0.229527,-0.10222 -0.07062,-0.0697 -0.07062,-0.1905 0,-0.14682 0.104077,-0.22674 0.104077,-0.0799 0.295505,-0.0799 0.09478,0 0.178418,0.0139 0.08363,0.0139 0.154257,0.0418 z"
+ style="stroke-width:0.01258837"
+ id="path872"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -39.571383,202.62755 -0.03453,0.33682 0.483556,0.002 -0.03123,0.14077 -0.467876,0.008 -0.06611,0.644 c -0.0099,0.0967 -0.0042,0.15873 0.01728,0.18596 0.02211,0.0272 0.0709,0.0403 0.146369,0.0394 l 0.18607,-0.003 -0.01679,0.16312 -0.18607,0.003 c -0.139777,0.002 -0.233377,-0.0247 -0.280802,-0.0801 -0.04736,-0.0558 -0.06343,-0.15786 -0.0482,-0.30618 l 0.06611,-0.64399 -0.132895,0.002 0.01555,-0.15148 0.132895,-0.002 0.03453,-0.33681 z"
+ style="stroke-width:0.0138234"
+ id="path874"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccccccc" />
+ </g>
+ <g
+ aria-label="clk"
+ transform="matrix(2.3525877,-0.10292753,0.2449229,1.9213172,39.342343,-189.28658)"
+ style="font-style:normal;font-weight:normal;font-size:1.90312397px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:0.01258837"
+ id="text868">
+ <path
+ d="m -47.023791,202.8756 0.02953,0.23933 c -0.06229,-0.0399 -0.123696,-0.0697 -0.184208,-0.0892 -0.05988,-0.0203 -0.119243,-0.0305 -0.178089,-0.0305 -0.13166,0 -0.227374,0.0529 -0.287143,0.15862 -0.05989,0.10481 -0.0781,0.2523 -0.05464,0.44245 0.02345,0.19016 0.07812,0.33811 0.163998,0.44386 0.08575,0.10481 0.194455,0.15721 0.326112,0.15721 0.05884,0 0.115746,-0.01 0.170717,-0.0291 0.05558,-0.0205 0.08125,0.026 0.133717,-0.0139 l 0.05753,0.16011 c -0.05251,0.0335 -0.108257,0.0585 -0.167252,0.0751 -0.05826,0.0167 -0.12159,0.025 -0.189991,0.025 -0.186089,0 -0.343029,-0.0737 -0.470822,-0.22124 -0.127791,-0.14748 -0.207137,-0.34644 -0.238039,-0.59689 -0.03136,-0.25416 -8.57e-4,-0.45405 0.09151,-0.59967 0.0931,-0.14563 0.235998,-0.21844 0.428707,-0.21844 0.06252,0 0.124597,0.008 0.18623,0.025 0.06153,0.0157 0.12224,0.0398 0.182141,0.0723 z"
+ style="stroke-width:0.0167841"
+ id="path877"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccscccsccccscscsccc" />
+ <path
+ d="m -46.874682,202.76379 0.142911,-0.0353 0.477431,1.633 -0.142911,0.0353 z"
+ style="stroke-width:0.01266381"
+ id="path879"
+ inkscape:connector-curvature="0" />
+ <path
+ d="m -45.316254,202.73781 0.105823,0 -0.30408,0.97435 0.684115,-0.51209 0.06147,0.0849 0.0099,0.0299 -0.587562,0.44072 0.393944,0.6319 -0.370906,-0.0255 -0.220701,-0.55448 -0.180998,0.57995 h -0.176676 z"
+ style="stroke-width:0.01363125"
+ id="path881"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccc" />
+ </g>
</g>
<text
id="text983"
diff --git a/src/ComputerscareLaundrySoup.cpp b/src/ComputerscareLaundrySoup.cpp
@@ -9,7 +9,7 @@
struct ComputerscareLaundrySoup;
-const int numFields = 5;
+const int numFields = 6;
const std::string b64lookup = "123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ&$0";
class MyTextField : public LedDisplayTextField {
@@ -48,7 +48,7 @@ public:
int begin = min(cursor, selection);
int end = (this == gFocusedWidget) ? max(cursor, selection) : -1;
//bndTextField(vg,textOffset.x,textOffset.y+2, box.size.x, box.size.y, -1, 0, 0, const char *text, int cbegin, int cend);
- bndIconLabelCaret(vg, textOffset.x, textOffset.y - 2,
+ bndIconLabelCaret(vg, textOffset.x, textOffset.y - 3,
box.size.x - 2*textOffset.x, box.size.y - 2*textOffset.y,
-1, color, fontSize, text.c_str(), highlightColor, begin, end);
@@ -137,9 +137,9 @@ ComputerscareLaundrySoup() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIG
}
void randomizeAllFields() {
std::string mainlookup ="111111111111111111122223333333344444444444444445556667778888888888888999abcdefgggggggggg";
- std::string string;
- std::string randchar;
- int length;
+ std::string string = "";
+ std::string randchar = "";
+ int length = 0;
for (int i = 0; i < numFields; i++) {
length = rand() % 12 + 1;
@@ -161,8 +161,8 @@ ComputerscareLaundrySoup() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIG
int numSteps = 0;
int mappedIndex = 0;
int currentVal = 0;
- int hashnum;
- int thisoffset;
+ int hashnum = 1;
+ int thisoffset = 0;
std::stringstream test(expr);
@@ -223,8 +223,6 @@ ComputerscareLaundrySoup() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIG
}
}
-
-
numStepStates[index] = numSteps;
numStepBlocks[index] = sequences[index].size();
@@ -362,8 +360,8 @@ void MyTextField::onTextChange() {
struct ComputerscareLaundrySoupWidget : ModuleWidget {
- int verticalSpacing = 22;
- int verticalStart = 23;
+ double verticalSpacing = 18.4;
+ int verticalStart = 22;
ComputerscareLaundrySoupWidget(ComputerscareLaundrySoup *module) : ModuleWidget(module) {
setPanel(SVG::load(assetPlugin(plugin, "res/ComputerscareLaundrySoupPanel.svg")));
@@ -374,7 +372,7 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget {
addInput(Port::create<InPort>(mm2px(Vec(12 , 0)), Port::INPUT, module, ComputerscareLaundrySoup::GLOBAL_RESET_INPUT));
for(int i = 0; i < numFields; i++) {
- addOutput(Port::create<OutPort>(mm2px(Vec(55 , verticalStart + verticalSpacing*i - 11)), Port::OUTPUT, module, ComputerscareLaundrySoup::TRG_OUTPUT + i));
+ addOutput(Port::create<OutPort>(mm2px(Vec(54 , verticalStart + verticalSpacing*i - 11)), Port::OUTPUT, module, ComputerscareLaundrySoup::TRG_OUTPUT + i));
addInput(Port::create<InPort>(mm2px(Vec(2, verticalStart + verticalSpacing*i-10)), Port::INPUT, module, ComputerscareLaundrySoup::CLOCK_INPUT + i));
@@ -383,7 +381,7 @@ struct ComputerscareLaundrySoupWidget : ModuleWidget {
textField = Widget::create<MyTextField>(mm2px(Vec(1, verticalStart + verticalSpacing*i)));
textField->setModule(module);
- textField->box.size = mm2px(Vec(63, 8));
+ textField->box.size = mm2px(Vec(63, 7));
textField->multiline = false;
textField->color = nvgRGB(0xC0, 0xE7, 0xDE);
addChild(textField);