Example #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dev">The device</param>
        public SpiceTemperature(SpiceDevice dev)
        {
            // Get the
            string content = dev.GetMethod(SpiceDevice.Methods.Temperature);

            ReadMethod(content);
        }
Example #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dev">Device</param>
        public SpiceTruncate(SpiceDevice dev, SpiceSetup setup)
        {
            string content = dev.GetMethod(SpiceDevice.Methods.Trunc);

            ReadMethod(content);

            // Copy the matrix nodes
            states = setup.StatesVariable;
        }
Example #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dev">The device</param>
        public SpiceParam(SpiceDevice dev, Dictionary <string, ParameterExtractor.DeviceParameter> dp, SpiceDevice.Methods p, SpiceDevice.Methods a)
        {
            // Get the param method
            string content = dev.GetMethod(p);

            Code.GetSwitchCases(content, param);
            Code.GetMethodParameters(content, par_parameters, dev.GetMethodName(p));

            // Get the "here" variable
            var m = Regex.Match(content, $@"(\w+)\s*\*\s*(?<var>\w+)\s*\=\s*\(\s*\1\s*\*\s*\)\s*{par_parameters[2]}");

            if (m.Success)
            {
                par_here = m.Groups["var"].Value;
            }
            else
            {
                throw new Exception("Could not find 'here' parameter");
            }
            par_value = par_parameters[1];

            // Get the ask method
            content = dev.GetMethod(a);
            Code.GetSwitchCases(content, ask);
            Code.GetMethodParameters(content, ask_parameters, dev.GetMethodName(a));

            // Get the "here" variable
            m = Regex.Match(content, $@"(\w+)\s*\*\s*(?<var>\w+)\s*\=\s*\(\s*\1\s*\*\s*\)\s*{ask_parameters[1]}");
            if (m.Success)
            {
                ask_here = m.Groups["var"].Value;
            }
            else
            {
                throw new Exception("Could not find 'here' parameter");
            }
            ask_value = ask_parameters[3];

            BuildParameters(dp);
        }
Example #4
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dev">The Spice device</param>
        public SpiceAcLoad(SpiceDevice dev, SpiceSetup setup)
        {
            string content = dev.GetMethod(SpiceDevice.Methods.AcLoad);

            ReadMethod(content);

            // Copy the matrix nodes
            foreach (string n in setup.MatrixNodes.Keys)
            {
                matrixnodes.Add(n, setup.MatrixNodes[n]);
            }
            states = setup.StatesVariable;
        }
Example #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="dev">The device</param>
        public SpiceSetup(SpiceDevice dev)
        {
            // Get the
            string content = dev.GetMethod(SpiceDevice.Methods.Setup);

            // Get the parameters
            List <string> p = new List <string>();

            Code.GetMethodParameters(content, p, dev.GetMethodName(SpiceDevice.Methods.Setup));
            states = p[3];

            ReadMethod(content);
        }