<commit_before>﻿using ComputerAlgebra;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;
using Util;

namespace Circuit
{
    /// <summary>
    /// Interface for components that expose a pot controlled value.
    /// </summary>
    public interface IPotControl
    {
        /// <summary>
        /// The value of the pot.
        /// </summary>
        double PotValue { get; set; }
    }

    /// <summary>
    /// Interface for components that expose a button controlled value.
    /// </summary>
    public interface IButtonControl
    {
        void Click();

        string Group { get; }
    }

    /// <summary>
    /// Indicates the property should be serialized.
    /// </summary>
    public class Serialize : Attribute { };

    /// <summary>
    /// Components are capable of performing MNA to produce a set of equations and unknowns describing their behavior.
    /// </summary>
    public abstract class Component : INotifyPropertyChanged
    {
        /// <summary>
        /// Time of the simulation.
        /// </summary>
        public static readonly Variable t = Variable.New("t");
        /// <summary>
        /// Sampling period of the simulation.
        /// </summary>
        public static readonly Expression T = Variable.New("T");

        /// <summary>
        /// Thermal voltage. We assume ~room temperature.
        /// </summary>
        public static readonly Quantity VT = new Quantity(26e-3m, Units.V);

        private string name = "X1";
        [Serialize, Description("Unique name of this component.")]
        public virtual string Name { get { return name; } set { name = value; NotifyChanged("Name"); } }

        private string partNumber = "";
        [Serialize, DefaultValue(""), Description("Part name/number.")]
        public virtual string PartNumber { get { return partNumber; } set { partNumber = value; NotifyChanged("PartNumber"); } }

        private string description = "";
        [Serialize, DefaultValue(""), Description("Description of this component.")]
        public virtual string Description
        {
            get
            {
                if (!string.IsNullOrEmpty(description))
                    return description;
                else
                    return GetType().CustomAttribute<DescriptionAttribute>()?.Description;
            }
            set
            {
                description = value;<commit_msg>Change VT back, this makes a big difference!<commit_after>﻿using ComputerAlgebra;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Xml.Linq;
using Util;

namespace Circuit
{
    /// <summary>
    /// Interface for components that expose a pot controlled value.
    /// </summary>
    public interface IPotControl
    {
        /// <summary>
        /// The value of the pot.
        /// </summary>
        double PotValue { get; set; }
    }

    /// <summary>
    /// Interface for components that expose a button controlled value.
    /// </summary>
    public interface IButtonControl
    {
        void Click();

        string Group { get; }
    }

    /// <summary>
    /// Indicates the property should be serialized.
    /// </summary>
    public class Serialize : Attribute { };

    /// <summary>
    /// Components are capable of performing MNA to produce a set of equations and unknowns describing their behavior.
    /// </summary>
    public abstract class Component : INotifyPropertyChanged
    {
        /// <summary>
        /// Time of the simulation.
        /// </summary>
        public static readonly Variable t = Variable.New("t");
        /// <summary>
        /// Sampling period of the simulation.
        /// </summary>
        public static readonly Expression T = Variable.New("T");

        /// <summary>
        /// Thermal voltage. We assume ~room temperature.
        /// </summary>
        public static readonly Quantity VT = new Quantity(25.35e-3m, Units.V);

        private string name = "X1";
        [Serialize, Description("Unique name of this component.")]
        public virtual string Name { get { return name; } set { name = value; NotifyChanged("Name"); } }

        private string partNumber = "";
        [Serialize, DefaultValue(""), Description("Part name/number.")]
        public virtual string PartNumber { get { return partNumber; } set { partNumber = value; NotifyChanged("PartNumber"); } }

        private string description = "";
        [Serialize, DefaultValue(""), Description("Description of this component.")]
        public virtual string Description
        {
            get
            {
                if (!string.IsNullOrEmpty(description))
                    return description;
                else
                    return GetType().CustomAttribute<DescriptionAttribute>()?.Description;
            }
            set
            {
                description = value;
{'fraction_non_alphanumeric': 0.11200787401574804, 'fraction_numerical': 0.001968503937007874, 'mean_word_length': 2.0047309284447072, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '1959321', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1200, 'n_words': 414}