-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #169 from MandeepPaul/Mushroom_head_symbol
Introduce Mushroom Head Normally Open Momentary
- Loading branch information
Showing
8 changed files
with
819 additions
and
1 deletion.
There are no files selected for viewing
606 changes: 606 additions & 0 deletions
606
assets/generated/mushroom_head_normally_open_momentary.json
Large diffs are not rendered by default.
Oops, something went wrong.
133 changes: 133 additions & 0 deletions
133
assets/symbols/mushroom_head_normally_open_momentary.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export type BaseSymbolName = "ac_voltmeter" | "avalanche_diode" | "boxresistor" | "capacitor" | "constant_current_diode" | "crystal" | "dc_ammeter" | "dc_voltmeter" | "diac" | "diode" | "filled_diode" | "fuse" | "gunn_diode" | "igbt_transistor" | "laser_diode" | "led" | "mosfet_depletion_normally_on" | "n_channel_d_mosfet_transistor" | "njfet_transistor" | "npn_bipolar_transistor" | "p_channel_d_mosfet_transistor" | "p_channel_e_mosfet_transistor" | "photodiode" | "pjfet_transistor" | "pnp_bipolar_transistor" | "potentiometer" | "potentiometer2" | "power_factor_meter" | "push_button_normally_closed_momentary" | "push_button_normally_open_momentary" | "resonator" | "schottky_diode" | "silicon_controlled_rectifier" | "SPDT_switch" | "SPST_switch" | "step_recovery_diode" | "triac" | "tunnel_diode" | "unijunction_transistor" | "var_meter" | "varactor_diode" | "varistor" | "volt_meter" | "zener_diode"; | ||
export type BaseSymbolName = "ac_voltmeter" | "avalanche_diode" | "boxresistor" | "capacitor" | "constant_current_diode" | "crystal" | "dc_ammeter" | "dc_voltmeter" | "diac" | "diode" | "filled_diode" | "fuse" | "gunn_diode" | "igbt_transistor" | "laser_diode" | "led" | "mosfet_depletion_normally_on" | "mushroom_head_normally_open_momentary" | "n_channel_d_mosfet_transistor" | "njfet_transistor" | "npn_bipolar_transistor" | "p_channel_d_mosfet_transistor" | "p_channel_e_mosfet_transistor" | "photodiode" | "pjfet_transistor" | "pnp_bipolar_transistor" | "potentiometer" | "potentiometer2" | "power_factor_meter" | "push_button_normally_closed_momentary" | "push_button_normally_open_momentary" | "resonator" | "schottky_diode" | "silicon_controlled_rectifier" | "SPDT_switch" | "SPST_switch" | "step_recovery_diode" | "triac" | "tunnel_diode" | "unijunction_transistor" | "var_meter" | "varactor_diode" | "varistor" | "volt_meter" | "zener_diode"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { defineSymbol } from "drawing/defineSymbol" | ||
import svgJson from "assets/generated/mushroom_head_normally_open_momentary.json" | ||
import { Primitive } from "drawing/types" | ||
|
||
const { paths, texts, bounds, refblocks, circles } = svgJson | ||
|
||
export default defineSymbol({ | ||
primitives: [ | ||
...Object.values(paths), | ||
...Object.values(circles), | ||
{ ...texts.top1, anchor: "middle_bottom", x: 0 }, | ||
{ ...texts.bottom1, anchor: "middle_top", x: 0 }, | ||
] as Primitive[], | ||
ports: [ | ||
{ ...refblocks.left1, labels: ["1"] }, | ||
{ ...refblocks.right1, labels: ["2"] }, | ||
], | ||
size: { width: bounds.width, height: bounds.height }, | ||
center: { x: bounds.centerX + 0.006, y: bounds.centerY + 0.06 }, | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { rotateSymbol } from "drawing/rotateSymbol" | ||
import mushroom_head_normally_open_momentary_horz from "./mushroom_head_normally_open_momentary_horz" | ||
import type { TextPrimitive } from "drawing" | ||
|
||
const rotated = rotateSymbol(mushroom_head_normally_open_momentary_horz) | ||
|
||
const ref = rotated.primitives.find( | ||
(p) => p.type === "text" && p.text === "{REF}", | ||
)! as TextPrimitive | ||
const val = rotated.primitives.find( | ||
(p) => p.type === "text" && p.text === "{VAL}", | ||
)! as TextPrimitive | ||
|
||
ref.anchor = "middle_left" | ||
val.anchor = "middle_right" | ||
|
||
ref.x = ref.x - 0.03 | ||
ref.y = ref.y | ||
|
||
val.x = val.x | ||
val.y = 0 | ||
|
||
export default rotated |
16 changes: 16 additions & 0 deletions
16
tests/__snapshots__/mushroom_head_normally_open_momentary_horz.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.