Skip to content

Commit

Permalink
added mirror to all components, need to fix some components
Browse files Browse the repository at this point in the history
  • Loading branch information
ericx authored and ericx committed Mar 4, 2024
1 parent a6c03ee commit 9c0e17d
Show file tree
Hide file tree
Showing 41 changed files with 609 additions and 288 deletions.
4 changes: 3 additions & 1 deletion src/app/library/anode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default class Anode extends Template {
pegHeight: "Float",
pegWidth: "Float",
height: "Float",
rotation: "Float"
rotation: "Float",
mirrorByX: "Float",
mirrorByY: "Float"
};

this.__defaults = {
Expand Down
4 changes: 2 additions & 2 deletions src/app/library/betterMixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ export default class CurvedMixer extends Template {
}

serp.fillColor = color;
this.mirrorRender(params,serp);
return (serp.rotate(rotation, new paper.Point(x, y)) as unknown) as paper.CompoundPath;
this.transformRender(params,serp);
return serp;
}

render2DTarget(key: string | null, params: { [k: string]: any }) {
Expand Down
30 changes: 20 additions & 10 deletions src/app/library/blackBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default class BlackBox extends Template {
length: "Float",
height: "Float",
cornerRadius: "Float",
rotation: "Float"
rotation: "Float",
mirrorByX: "Float",
mirrorByY: "Float"
};

this.__defaults = {
Expand All @@ -28,7 +30,9 @@ export default class BlackBox extends Template {
length: 5000,
height: 250,
cornerRadius: 200,
rotation: 0
rotation: 0,
mirrorByX: 0,
mirrorByY: 0
};

this.__units = {
Expand All @@ -46,7 +50,9 @@ export default class BlackBox extends Template {
length: 5,
height: 1,
cornerRadius: 1,
rotation: 0
rotation: 0,
mirrorByX: 0,
mirrorByY: 0
};

this.__maximum = {
Expand All @@ -55,7 +61,9 @@ export default class BlackBox extends Template {
length: 50000,
height: 50000,
cornerRadius: 1000,
rotation: 360
rotation: 360,
mirrorByX: 1,
mirrorByY: 1
};

this.__featureParams = {
Expand All @@ -65,7 +73,9 @@ export default class BlackBox extends Template {
length: "length",
height: "height",
cornerRadius: "cornerRadius",
rotation: "rotation"
rotation: "rotation",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__targetParams = {
Expand All @@ -75,7 +85,9 @@ export default class BlackBox extends Template {
length: "length",
height: "height",
cornerRadius: "cornerRadius",
rotation: "rotation"
rotation: "rotation",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__placementTool = "componentPositionTool";
Expand Down Expand Up @@ -111,9 +123,6 @@ export default class BlackBox extends Template {

ports.push(new ComponentPort(-w / 2, 0, "4", LogicalLayerType.FLOW));

console.log("bb offset")
console.log(this.getDrawOffset(params))

return ports;
}

Expand Down Expand Up @@ -142,7 +151,8 @@ export default class BlackBox extends Template {
rendered.addChild(box);

rendered.fillColor = color;
rendered.rotate(rotation, new paper.Point(px, py));

this.transformRender(params,rendered);

return rendered;
}
Expand Down
31 changes: 20 additions & 11 deletions src/app/library/capacitancesensor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export default class CapacitanceSensor extends Template {
sensorWidth: "Float",
sensorLength: "Float",
channelDepth: "Float",
electrodeDepth: "Float"
electrodeDepth: "Float",
mirrorByX: "Float",
mirrorByY: "Float"
};

this.__defaults = {
Expand All @@ -40,7 +42,9 @@ export default class CapacitanceSensor extends Template {
sensorWidth: 1 * 1000,
sensorLength: 3 * 1000,
channelDepth: 1000,
electrodeDepth: 1000
electrodeDepth: 1000,
mirrorByX: 0,
mirrorByY: 0
};

this.__units = {
Expand Down Expand Up @@ -70,7 +74,9 @@ export default class CapacitanceSensor extends Template {
sensorWidth: 0.5 * 1000,
sensorLength: 1.5 * 1000,
channelDepth: 1000,
electrodeDepth: 1000
electrodeDepth: 1000,
mirrorByX: 0,
mirrorByY: 0
};

this.__maximum = {
Expand All @@ -85,7 +91,9 @@ export default class CapacitanceSensor extends Template {
sensorWidth: 1.5 * 1000,
sensorLength: 4.5 * 1000,
channelDepth: 1000,
electrodeDepth: 1000
electrodeDepth: 1000,
mirrorByX: 1,
mirrorByY: 1
};

this.__placementTool = "multilayerPositionTool";
Expand All @@ -106,7 +114,9 @@ export default class CapacitanceSensor extends Template {
sensorWidth: "sensorWidth",
sensorLength: "sensorLength",
channelDepth: "channelDepth",
electrodeDepth: "electrodeDepth"
electrodeDepth: "electrodeDepth",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__targetParams = {
Expand All @@ -120,7 +130,9 @@ export default class CapacitanceSensor extends Template {
sensorWidth: "sensorWidth",
sensorLength: "sensorLength",
channelDepth: "channelDepth",
electrodeDepth: "electrodeDepth"
electrodeDepth: "electrodeDepth",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__renderKeys = ["FLOW", "INTEGRATION"];
Expand Down Expand Up @@ -165,9 +177,8 @@ export default class CapacitanceSensor extends Template {

serp.addChild(new paper.Path.Rectangle(topLeft, bottomRight));

serp.rotate(rotation, new paper.Point(x, y));

serp.fillColor = color;
this.transformRender(params,serp);
return serp;
}

Expand Down Expand Up @@ -211,10 +222,8 @@ export default class CapacitanceSensor extends Template {
});

serp.addChild(elli);

serp.rotate(rotation, new paper.Point(x, y));

serp.fillColor = color;
this.transformRender(params,serp);
return serp;
}

Expand Down
4 changes: 3 additions & 1 deletion src/app/library/cathode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default class Cahode extends Template {
pegRadius: "Float",
pegThickness: "Float",
height: "Float",
rotation: "Float"
rotation: "Float",
mirrorByX: "Float",
mirrorByY: "Float"
};

this.__defaults = {
Expand Down
6 changes: 2 additions & 4 deletions src/app/library/celltrapL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ export default class CellTrapL extends Template {

traps = new paper.CompoundPath(chamberList);
traps.fillColor = color;
traps.rotate(rotation, new paper.Point(x, y));
this.mirrorRender(params,traps);
this.transformRender(params,traps);
return traps;
}

Expand Down Expand Up @@ -225,8 +224,7 @@ export default class CellTrapL extends Template {
}

chamberList.fillColor = color;
chamberList.rotate(rotation, new paper.Point(x, y));
this.mirrorRender(params,chamberList);
this.transformRender(params,chamberList);
return chamberList;
}
}
29 changes: 20 additions & 9 deletions src/app/library/celltrapS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export default class CellTrapS extends Template {
channelLength: "Float",
chamberWidth: "Float",
chamberLength: "Float",
chamberHeight: "Float"
chamberHeight: "Float",
mirrorByX: "Float",
mirrorByY: "Float"
};

this.__defaults = {
Expand All @@ -32,7 +34,9 @@ export default class CellTrapS extends Template {
channelLength: 4 * 1000,
chamberWidth: 2.5 * 1000,
chamberLength: 2.5 * 1000,
chamberHeight: 250
chamberHeight: 250,
mirrorByX: 0,
mirrorByY: 0
};

this.__units = {
Expand All @@ -54,7 +58,9 @@ export default class CellTrapS extends Template {
channelLength: 2.5 * 1000,
chamberWidth: 1.5 * 1000,
chamberLength: 1.5 * 1000,
chamberHeight: 10
chamberHeight: 10,
mirrorByX: 0,
mirrorByY: 0
};

this.__maximum = {
Expand All @@ -65,7 +71,9 @@ export default class CellTrapS extends Template {
channelLength: 6 * 1000,
chamberWidth: 4 * 1000,
chamberLength: 4 * 1000,
chamberHeight: 1200
chamberHeight: 1200,
mirrorByX: 1,
mirrorByY: 1
};

this.__featureParams = {
Expand All @@ -77,7 +85,9 @@ export default class CellTrapS extends Template {
channelLength: "channelLength",
chamberWidth: "chamberWidth",
chamberLength: "chamberLength",
chamberHeight: "chamberHeight"
chamberHeight: "chamberHeight",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__targetParams = {
Expand All @@ -88,7 +98,9 @@ export default class CellTrapS extends Template {
channelLength: "channelLength",
chamberWidth: "chamberWidth",
chamberLength: "chamberLength",
chamberHeight: "chamberHeight"
chamberHeight: "chamberHeight",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__placementTool = "CellPositionTool";
Expand Down Expand Up @@ -172,8 +184,7 @@ export default class CellTrapS extends Template {

traps.fillColor = color;

traps.rotate(rotation, new paper.Point(x, y));

this.transformRender(params,traps);
return traps;
}

Expand All @@ -195,7 +206,7 @@ export default class CellTrapS extends Template {
chamberList.addChild(new paper.Path.Rectangle(topLeft, bottomRight));

chamberList.fillColor = color;
chamberList.rotate(rotation, new paper.Point(x, y));
this.transformRender(params,chamberList);

return chamberList;
}
Expand Down
26 changes: 19 additions & 7 deletions src/app/library/chamber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export default class Chamber extends Template {
length: "Float",
height: "Float",
cornerRadius: "Float",
rotation: "Float"
rotation: "Float",
mirrorByX: "Float",
mirrorByY: "Float"
};

this.__defaults = {
Expand All @@ -28,7 +30,9 @@ export default class Chamber extends Template {
length: 5000,
height: 250,
cornerRadius: 200,
rotation: 0
rotation: 0,
mirrorByX: 0,
mirrorByY: 0
};

this.__units = {
Expand All @@ -46,7 +50,9 @@ export default class Chamber extends Template {
length: 5,
height: 1,
cornerRadius: 1,
rotation: 0
rotation: 0,
mirrorByX: 0,
mirrorByY: 0
};

this.__maximum = {
Expand All @@ -55,7 +61,9 @@ export default class Chamber extends Template {
length: 50000,
height: 50000,
cornerRadius: 1000,
rotation: 360
rotation: 360,
mirrorByX: 1,
mirrorByY: 1
};

this.__featureParams = {
Expand All @@ -65,7 +73,9 @@ export default class Chamber extends Template {
length: "length",
height: "height",
cornerRadius: "cornerRadius",
rotation: "rotation"
rotation: "rotation",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__targetParams = {
Expand All @@ -75,7 +85,9 @@ export default class Chamber extends Template {
length: "length",
height: "height",
cornerRadius: "cornerRadius",
rotation: "rotation"
rotation: "rotation",
mirrorByX: "mirrorByX",
mirrorByY: "mirrorByY"
};

this.__placementTool = "componentPositionTool";
Expand Down Expand Up @@ -135,7 +147,7 @@ export default class Chamber extends Template {
rendered.addChild(rec);

rendered.fillColor = color;
rendered.rotate(rotation, new paper.Point(px, py));
this.transformRender(params,rendered);
return rendered;
}

Expand Down
Loading

0 comments on commit 9c0e17d

Please sign in to comment.