epdi / CDRH104RNP-220NC

Files

Pins

Symbol

PCB

Open in Flux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Howdy 👋.
// If you are new to writing code in Flux make sure to check out our get started docs: https://docs.flux.ai/reference/introduction 
// We also have a Flux Slack Community in case you need help: https://join.slack.com/t/fluxcommunity/shared_invite/zt-p48n941f-wzQ06kGmuFJ2HXnGYT1JkA 
// To infinity and beyond 🚀 
const p1TerminalId = "b768ec21-c56b-dbb5-cb30-f29d59675d9b"; //P1
const p2TerminalId = "31c6f0d0-50f6-960d-170d-c511f55a9b68"; //P2
const p1Terminal = flux.getNodeById(p1TerminalId, "elementTerminal");
const p2Terminal = flux.getNodeById(p2TerminalId, "elementTerminal");
const outputVoltage = flux.createOutputNode("vout");
const inputVoltage = flux.createOutputNode("vin");
const current = flux.createOutputNode("I");
//setup event
flux.on("setup", () => {
    const inductance = Number(flux.properties.find((prop) => prop.name === "Inductance")?.value || 0.000001);
    flux.simulationModel =  simModel(inductance);
});
// Property was changed event
flux.on("propertyChange", (event: PropertyChangeEvent) => {
    if (event.property_name === "Inductance") {
        flux.notify(event.property_name + " changed to " + event.value + "H", {
            variant: "success",
        });
        flux.simulationModel =  simModel(Number(event.value));   
    }
});
Design view of CDRH104RNP-220NCDesign view of CDRH104RNP-220NC
Enter to Rename, Shift+Enter to Preview

Reviews