Пример #1
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("positive", "The positive pin.", this, new(0, -4), new(0, -1)), "p", "pos", "a");
                Pins.Add(new FixedOrientedPin("negative", "The negative pin.", this, new(0, 4), new(0, 1)), "n", "neg", "b");

                DrawingVariants = Variant.All(
                    Variant.Do(DrawSpeaker),
                    Variant.IfNot("off").Then(DrawOn));
            }
Пример #2
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("positive", "The positive pin.", this, new(-5, 0), new(-1, 0)), "p", "pos", "a");
                Pins.Add(new FixedOrientedPin("negative", "The negative pin.", this, new(5, 0), new(1, 0)), "n", "neg", "b");

                DrawingVariants = Variant.All(
                    Variant.Do(DrawMotor),
                    Variant.If("signs").Then(DrawSigns));
            }
Пример #3
0
 public Instance(string type, string name, Options options)
     : base(name, options)
 {
     Type = type;
     Pins.Add(new FixedOrientedPin("positive", "The positive pin.", this, new(-6, 0), new(-1, 0)), "p", "pos", "a");
     Pins.Add(new FixedOrientedPin("negative", "The negative pin.", this, new(6, 0), new(1, 0)), "n", "neg", "b");
     DrawingVariants = Variant.All(
         Variant.Do(DrawImpedance),
         Variant.If("programmable").Then(DrawProgrammable));
 }
Пример #4
0
            /// <summary>
            /// Initializes a new instance of the <see cref="Instance"/> class.
            /// </summary>
            /// <param name="name">The name.</param>
            /// <param name="options">Options that can be used for the component.</param>
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("p", "The positive pin.", this, new(-6, 0), new(-1, 0)), "p", "pos", "a");
                Pins.Add(new FixedOrientedPin("ctrl", "The controlling pin.", this, new(0, 8), new(0, 1)), "c", "ctrl");
                Pins.Add(new FixedOrientedPin("n", "The negative pin.", this, new(6, 0), new(1, 0)), "n", "neg", "b");

                DrawingVariants = Variant.All(
                    Variant.Do(DrawANSIResistor),
                    Variant.If("programmable").Then(DrawProgrammable));
            }
Пример #5
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("anode", "The anode.", this, new(-4, 0), new(-1, 0)), "p", "a", "anode");
                Pins.Add(new FixedOrientedPin("cathode", "The cathode.", this, new(4, 0), new(1, 0)), "n", "c", "cathode");

                DrawingVariants = Variant.All(
                    Variant.If("photodiode").Then(DrawPhotodiode),
                    Variant.If("led").Then(DrawLed),
                    Variant.Do(DrawDiode));
            }
Пример #6
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("positive", "The positive pin.", this, new(), new(-1, 0)), "in", "a");
                Pins.Add(new FixedOrientedPin("negative", "The negative pin.", this, new(), new(1, 0)), "out", "b");

                DrawingVariants = Variant.All(
                    Variant.Do(DrawPlug),
                    Variant.If("earth").Then(DrawProtectiveConnection),
                    Variant.If("sealed").Then(DrawSealed),
                    Variant.If("child").Then(DrawChildProtection));
            }
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("pole", "The pole pin.", this, new(-8, 0), new(-1, 0)), "p", "pole");
                Pins.Add(new FixedOrientedPin("control", "The controlling pin.", this, new(0, 0), new(0, 1)), "c", "ctrl");
                Pins.Add(new FixedOrientedPin("control2", "The backside controlling pin.", this, new(0, 0), new(0, -1)), "c2", "ctrl2");
                Pins.Add(new FixedOrientedPin("throw1", "The first throwing pin.", this, new(8, 4), new(1, 0)), "t1");
                Pins.Add(new FixedOrientedPin("throw2", "The second throwing pin.", this, new(8, -4), new(1, 0)), "t2");

                DrawingVariants = Variant.Map("t1", "t2", "swap", DrawSwitch);
                PinUpdate       = Variant.All(
                    Variant.Map("swap", UpdatePins),
                    Variant.Map("swap", "t1", "t2", UpdateControlPin));
            }
Пример #8
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("input", "The input.", this, new(-4, 0), new(-1, 0)), "i", "a", "in", "input");
                Pins.Add(new FixedOrientedPin("output", "The output.", this, new(4, 0), new(1, 0)), "o", "b", "out", "output");

                DrawingVariants = Variant.All(
                    Variant.Do(DrawWire),
                    Variant.If("underground").Then(DrawUnderground),
                    Variant.If("air").Then(DrawAir),
                    Variant.If("tube").Then(DrawTube),
                    Variant.If("inwall").Then(DrawInWall),
                    Variant.If("onwall").Then(DrawOnWall)
                    );
            }
Пример #9
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("negative", "The negative pin", this, new(-6, 0), new(-1, 0)), "n", "neg", "b");
                Pins.Add(new FixedOrientedPin("positive", "The positive pin", this, new(6, 0), new(1, 0)), "p", "pos", "a");

                if (options?.SmallSignal ?? false)
                {
                    AddVariant("ac");
                }

                DrawingVariants = Variant.All(
                    Variant.If("ac").Then(DrawAC).Else(DrawDC),
                    Variant.Do(DrawSource));
            }
Пример #10
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("positiveinput", "The (positive) input.", this, new(-9, 0), new(-1, 0)), "input", "in", "pi", "inp");
                Pins.Add(new FixedOrientedPin("negativeinput", "The negative input.", this, new(-9, 0), new(-1, 0)), "inn", "ni");
                Pins.Add(new FixedOrientedPin("negativeoutput", "The negative output.", this, new(9, 0), new(1, 0)), "outn", "no");
                Pins.Add(new FixedOrientedPin("positiveoutput", "The (positive) output.", this, new(9, 0), new(1, 0)), "output", "out", "po", "outp");

                PinUpdate = Variant.All(
                    Variant.Map("diffin", RedefineInputPins),
                    Variant.Map("diffout", RedefineOutputPins));
                DrawingVariants = Variant.All(
                    Variant.Do(DrawADC),
                    Variant.If("diffin").Then(DrawInputSigns),
                    Variant.If("diffout").Then(DrawOutputSigns));
            }
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("negative", "The negative input.", this, new(-5, -4), new(-1, 0)), "n", "neg");
                Pins.Add(new FixedOrientedPin("positive", "The positive input.", this, new(-5, 4), new(-1, 0)), "p", "pos");
                Pins.Add(new FixedOrientedPin("negativepower", "The negative power.", this, new(0, -7), new(0, -1)), "vneg", "vn");
                Pins.Add(new FixedOrientedPin("positivepower", "The positive power.", this, new(0, 7), new(0, 1)), "vpos", "vp");
                Pins.Add(new FixedOrientedPin("negativeoutput", "The negative output.", this, new(5, 0), new(1, 0)), "no", "outn");
                Pins.Add(new FixedOrientedPin("positiveoutput", "The output.", this, new(5, 0), new(1, 0)), "o", "out", "output");

                PinUpdate = Variant.All(
                    Variant.Map("diffin", "swapin", RedefineInput),
                    Variant.Map("diffout", "swapout", RedefineOutput));
                DrawingVariants = Variant.All(
                    Variant.Do(DrawOTA),
                    Variant.If("diffin").Then(Variant.Map("swapin", DrawInputSigns)),
                    Variant.If("diffout").Then(Variant.Map("swapout", DrawOutputSigns)),
                    Variant.If("programmable").Then(DrawProgrammable));
            }
Пример #12
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("positive", "The positive pin.", this, new(-4, 0), new(-1, 0)), "a", "p", "pos");
                Pins.Add(new FixedOrientedPin("negative", "The negative pin.", this, new(4, 0), new(1, 0)), "b", "n", "neg");

                DrawingVariants = Variant.All(
                    Variant.Do(DrawLamp),
                    Variant.IfNot("arei").Then(DrawCasing),
                    Variant.If("projector").Then(DrawProjector),
                    Variant.If("direction").Then(Variant.Map("diverging", DrawDirectional)),
                    Variant.If("emergency").Then(DrawEmergency));
                PinUpdate = Variant.Map("arei", UpdatePins);

                if (options?.AREI ?? false)
                {
                    AddVariant("arei");
                }
            }
Пример #13
0
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("positiveinput", "The (positive) input.", this, _inputCommon, new(-1, 0)), "i", "in", "inp", "pi", "p");
                Pins.Add(new FixedOrientedPin("negativeinput", "The negative input.", this, _inputCommon, new(-1, 0)), "inn", "ni", "n");
                Pins.Add(new FixedOrientedPin("positivepower", "The positive power supply.", this, _supplyPos, new(0, -1)), "vpos", "vp");
                Pins.Add(new FixedOrientedPin("negativepower", "The negative power supply.", this, _supplyNeg, new(0, 1)), "vneg", "vn");
                Pins.Add(new FixedOrientedPin("negativeoutput", "The negative output.", this, _outputCommon, new(1, 0)), "outn", "no");
                Pins.Add(new FixedOrientedPin("positiveoutput", "The (positive) output.", this, _outputCommon, new(1, 0)), "o", "out", "outp", "po");

                // Resolving pins
                PinUpdate = Variant.All(
                    Variant.Map("diffin", "swapin", (b1, b2) => RedefineInput(b1, b2)),
                    Variant.Map("diffout", "swapout", (b1, b2) => RedefineOutput(b1, b2))
                    );
                DrawingVariants = Variant.All(
                    Variant.If("diffin").Then(Variant.Map("swapin", DrawDifferentialInput)),
                    Variant.If("diffout").Then(Variant.Map("swapout", DrawDifferentialOutput)),
                    Variant.Do(DrawAmplifier),
                    Variant.If("programmable").Then(DrawProgrammable));
            }
Пример #14
0
 public Instance(string name, Options options)
     : base(name, options)
 {
     Pins.Add(new FixedOrientedPin("pos", "The positive pin", this, new(-1.5, 0), new(-1, 0)), "p", "pos", "a");
     Pins.Add(new FixedOrientedPin("neg", "the negative pin", this, new(1.5, 0), new(1, 0)), "n", "neg", "b");
     if (options?.PolarCapacitors ?? false)
     {
         AddVariant("polar");
         AddVariant("signs");
     }
     DrawingVariants = Variant.All(
         Variant.If("polar").Then(
             Variant.All(
                 Variant.Do(DrawPolar),
                 Variant.If("signs").Then(DrawPolarSigns)))
         .Else(
             Variant.All(
                 Variant.Do(DrawApolar),
                 Variant.If("signs").Then(DrawApolarSigns))),
         Variant.If("programmable").Then(DrawProgrammable));
 }
Пример #15
0
            /// <summary>
            /// Creates a new appliance.
            /// </summary>
            /// <param name="name">The name of the appliance.</param>
            /// <param name="options">The options.</param>
            public Instance(string name, Options options)
                : base(name, options)
            {
                Pins.Add(new FixedOrientedPin("p", "The connection.", this, new(), new(-1, 0)), "p", "a");

                DrawingVariants = Variant.All(
                    Variant.FirstOf(
                        Variant.If("ventilator").Then(DrawVentilator),
                        Variant.If("heater").Then(Variant.Map("ventilator", "accu", DrawHeater)),
                        Variant.If("boiler").Then(Variant.Map("accu", DrawBoiler)),
                        Variant.If("cooking").Then(DrawCooking),
                        Variant.If("microwave").Then(DrawMicroWave),
                        Variant.If("oven").Then(DrawOven),
                        Variant.If("washer").Then(DrawWasher),
                        Variant.If("dryer").Then(DrawDryer),
                        Variant.If("dishwasher").Then(DrawDishwasher),
                        Variant.If("refrigerator").Then(DrawRefrigerator),
                        Variant.If("fridge").Then(DrawRefrigerator),
                        Variant.If("freezer").Then(DrawFreezer),
                        Variant.Do(DrawDefault)
                        ),
                    Variant.Do(DrawLabel));
            }