sw.c

来自「linux平台下类似著名的电路板作图软件 Spice的源代码」· C语言 代码 · 共 48 行

C
48
字号
/**********Copyright 1990 Regents of the University of California.  All rights reserved.Author: 1987**********/#include "spice.h"#include <stdio.h>#include "devdefs.h"#include "ifsim.h"#include "swdefs.h"#include "suffix.h"IFparm SWpTable[] = { /* parameters */  IP("on",           SW_IC_ON,  IF_FLAG,"Switch initially closed"), IP("off",          SW_IC_OFF, IF_FLAG,"Switch initially open"), IOPU("pos_node",    SW_POS_NODE,IF_INTEGER,"Positive node of switch"), IOPU("neg_node",    SW_NEG_NODE,IF_INTEGER,"Negative node of switch"), OPU("cont_p_node",SW_POS_CONT_NODE,IF_INTEGER,					"Positive contr. node of switch"), OPU("cont_n_node",SW_NEG_CONT_NODE,IF_INTEGER,					"Positive contr. node of switch"), OP("i",            SW_CURRENT, IF_REAL,    "Switch current"), OP("p",            SW_POWER,   IF_REAL,    "Switch power")};IFparm SWmPTable[] = { /* model parameters */ IOPU( "sw",   SW_MOD_SW,   IF_FLAG,"Switch model"), IOPU( "vt",   SW_MOD_VTH,  IF_REAL,"Threshold voltage"), IOPU( "vh",   SW_MOD_VHYS, IF_REAL,"Hysteresis voltage"), IOPU( "ron",  SW_MOD_RON,  IF_REAL,"Resistance when closed"), OPU( "gon", SW_MOD_GON,  IF_REAL,"Conductance when closed"), IOPU( "roff", SW_MOD_ROFF, IF_REAL,"Resistance when open"), OPU( "goff", SW_MOD_GOFF, IF_REAL,"Conductance when open")};char *SWnames[] = {    "S+",    "S-",    "SC+",    "SC-"};int	SWnSize = NUMELEMS(SWnames);int	SWpTSize = NUMELEMS(SWpTable);int	SWmPTSize = NUMELEMS(SWmPTable);int	SWiSize = sizeof(SWinstance);int	SWmSize = sizeof(SWmodel);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?