<commit_before>﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ComputerAlgebra;

namespace Circuit
{
    [Category("Standard")]
    [DisplayName("Voltage Controller")]
    public class VoltageController : TwoTerminal
    {
        public VoltageController() { Name = "V1"; }

        public override void Analyze(Analysis Mna) 
        {
            Mna.AddDefinition("V[" + Name + "]", Anode.V - Cathode.V); 
        }

        public override void LayoutSymbol(SymbolLayout Sym)
        {
            base.LayoutSymbol(Sym);

            Sym.InBounds(new Coord(-10, -20), new Coord(10, 20));

            Sym.DrawPositive(EdgeType.Black, new Coord(0, 15));
            Sym.DrawNegative(EdgeType.Black, new Coord(0, -15));

            Sym.DrawText(() => Name.ToString(), new Point(0, 0), Alignment.Center, Alignment.Center);
        }
    }

    [Category("Standard")]
    [DisplayName("Current Controller")]
    public class CurrentController : TwoTerminal
    {
        public CurrentController() { Name = "I1"; }

        public override void Analyze(Analysis Mna) 
        { 
            Mna.AddDefinition("i[" + Name + "]", Conductor.Analyze(Mna, Anode, Cathode));
        }

        public override void LayoutSymbol(SymbolLayout Sym)
        {
            base.LayoutSymbol(Sym);

            Sym.AddWire(Anode, new Coord(0, 7));
            Sym.AddWire(Cathode, new Coord(0, -7));<commit_msg>Removed dependence on parsing controller keys<commit_after>﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ComputerAlgebra;

namespace Circuit
{
    [Category("Standard")]
    [DisplayName("Voltage Controller")]
    public class VoltageController : TwoTerminal
    {
        public VoltageController() { Name = "V1"; }

        public override void Analyze(Analysis Mna) 
        {
            Mna.AddDefinition(DependentVariable("V", Name), Anode.V - Cathode.V); 
        }

        public override void LayoutSymbol(SymbolLayout Sym)
        {
            base.LayoutSymbol(Sym);

            Sym.InBounds(new Coord(-10, -20), new Coord(10, 20));

            Sym.DrawPositive(EdgeType.Black, new Coord(0, 15));
            Sym.DrawNegative(EdgeType.Black, new Coord(0, -15));

            Sym.DrawText(() => Name.ToString(), new Point(0, 0), Alignment.Center, Alignment.Center);
        }
    }

    [Category("Standard")]
    [DisplayName("Current Controller")]
    public class CurrentController : TwoTerminal
    {
        public CurrentController() { Name = "I1"; }

        public override void Analyze(Analysis Mna) 
        { 
            Mna.AddDefinition(DependentVariable("i", Name), Conductor.Analyze(Mna, Anode, Cathode));
        }

        public override void LayoutSymbol(SymbolLayout Sym)
        {
            base.LayoutSymbol(Sym);

            Sym.AddWire(Anode, new Coord(0, 7));
            Sym.AddWire(Cathode, new Coord(0, -7));
{'fraction_non_alphanumeric': 0.1217564870259481, 'fraction_numerical': 0.014637391882900865, 'mean_word_length': 2.545990566037736, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5695274', 'n_tokens_mistral': 898, 'n_tokens_neox': 836, 'n_words': 196}