Skip to content

Commit

Permalink
send resistance
Browse files Browse the repository at this point in the history
  • Loading branch information
seveibar committed Aug 29, 2024
1 parent a9f675f commit 70dafaa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/components/normal-components/Resistor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { resistorProps } from "@tscircuit/props"
import type { PassivePorts, Ftype, BaseSymbolName } from "lib/utils/constants"
import { NormalComponent } from "../base-components/NormalComponent"
import type { SourceSimpleResistorInput } from "@tscircuit/soup"

export class Resistor extends NormalComponent<
typeof resistorProps,
Expand All @@ -16,4 +17,19 @@ export class Resistor extends NormalComponent<

pin1 = this.portMap.pin1
pin2 = this.portMap.pin2

doInitialSourceRender() {
const { db } = this.project!
const { _parsedProps: props } = this
const source_component = db.source_component.insert({
ftype: "simple_resistor",
name: props.name,
// @ts-ignore
manufacturer_part_number: props.manufacturerPartNumber ?? props.mfn,
supplier_part_numbers: props.supplierPartNumbers,

resistance: props.resistance,
} as SourceSimpleResistorInput)
this.source_component_id = source_component.source_component_id
}
}

0 comments on commit 70dafaa

Please sign in to comment.