Skip to content

Commit

Permalink
Merge pull request #248 from Kaustuv942/addParams
Browse files Browse the repository at this point in the history
Transfer Function Analysis, Multiple node selection in plot, Component and Analysis Parameters
  • Loading branch information
firuza authored Jun 8, 2021
2 parents f70a162 + 2418402 commit 7ce33fe
Show file tree
Hide file tree
Showing 11 changed files with 860 additions and 478 deletions.
9 changes: 9 additions & 0 deletions eda-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions eda-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"chartjs-plugin-colorschemes": "^0.4.0",
"file-saver": "^2.0.2",
"material-ui-popup-state": "^1.5.4",
"multiselect-react-dropdown": "^1.6.11",
"mxgraph": "^4.1.1",
"query-string": "^6.12.1",
"randomstring": "^1.2.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ const ComponentParameters = {
VALUE: '',
EXTRA_EXPRESSION: '',
MODEL: '',
VALUE_UNIT: 'F'
VALUE_UNIT: 'F',
IC: '0'
},

D: {
Expand All @@ -17,7 +18,7 @@ const ComponentParameters = {
N1: '',
N2: '',
EXTRA_EXPRESSION: '',
MODEL: ''
MODEL: '.model mydiode D'
},

I: {
Expand Down Expand Up @@ -133,7 +134,8 @@ const ComponentParameters = {
NC2: '',
VALUE: '',
EXTRA_EXPRESSION: '',
MODEL: ''
MODEL: '',
VALUE_UNIT: 'mho'
},

F: {
Expand Down Expand Up @@ -198,7 +200,9 @@ const ComponentParameters = {
VALUE: '',
EXTRA_EXPRESSION: '',
MODEL: '',
VALUE_UNIT: 'H'
VALUE_UNIT: 'H',
IC: '0',
DTEMP:'27',
},

M: {
Expand All @@ -209,7 +213,9 @@ const ComponentParameters = {
N3: '',
N4: '',
EXTRA_EXPRESSION: '',
MODEL: ''
MULTIPLICITY_PARAMETER: '1',
MODEL: '.model mymosfet NMOS',
DTEMP:'27',
},

Q: {
Expand All @@ -219,7 +225,9 @@ const ComponentParameters = {
N2: '',
N3: '',
EXTRA_EXPRESSION: '',
MODEL: ''
MODEL: '.model mybjt PNP',
MULTIPLICITY_PARAMETER: '1',
DTEMP:'27',
},

V: {
Expand Down Expand Up @@ -333,7 +341,11 @@ const ComponentParameters = {
VALUE: '1',
EXTRA_EXPRESSION: '',
MODEL: '',
VALUE_UNIT: 'Ohm'
VALUE_UNIT: 'Ohm',
SHEET_RESISTANCE:'0',
FIRST_ORDER_TEMPERATURE_COEFF:'0',
SECOND_ORDER_TEMPERATURE_COEFF:'0',
PARAMETER_MEASUREMENT_TEMPERATURE:'27',
},

Z: {
Expand All @@ -346,7 +358,7 @@ const ComponentParameters = {
MODEL: ''
},

S: {
SW: {
PREFIX: 'S',
NAME: '',
N1: '',
Expand All @@ -366,7 +378,19 @@ const ComponentParameters = {
MODEL: '',
EXTRA_EXPRESSION: ''

}
},
E: {
PREFIX: 'E',
NAME: '',
N1: '',
N2: '',
NC1: '',
NC2: '',
MODEL: '',
VALUE: '1',
EXTRA_EXPRESSION: ''
},


}

Expand Down
59 changes: 55 additions & 4 deletions eda-frontend/src/components/SchematicEditor/Helper/ToolbarTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ export function GenerateNetList() {
netlist.componentlist.push(component.properties.PREFIX)
netlist.nodelist.push(compobj.node2, compobj.node1)
}
console.log('component properties', component.properties)
if (component.properties.MODEL.length > 0) {
k = k + ' ' + component.properties.MODEL.split(' ')[1]
}

if (component.properties.PREFIX.charAt(0) === 'V' || component.properties.PREFIX.charAt(0) === 'v' || component.properties.PREFIX.charAt(0) === 'I' || component.properties.PREFIX.charAt(0) === 'i') {
const comp = component.properties
if (comp.NAME === 'SINE') {
Expand All @@ -361,7 +366,55 @@ export function GenerateNetList() {
component.value = component.value + '\n' + component.properties.VALUE
}
}
} else {
}else if(component.properties.PREFIX.charAt(0) === 'C' || component.properties.PREFIX.charAt(0) === 'c'){
k = k + ' ' + component.properties.VALUE
if(component.properties.IC != 0){
k = k + ' IC=' + component.properties.IC
}
component.value = component.value + '\n' + component.properties.VALUE
}else if(component.properties.PREFIX.charAt(0) === 'L' || component.properties.PREFIX.charAt(0) === 'l'){
k = k + ' ' + component.properties.VALUE
if(component.properties.IC != 0){
k = k + ' IC=' + component.properties.IC
}
if(component.properties.DTEMP != 27){
k = k + ' dtemp=' + component.properties.DTEMP
}
component.value = component.value + '\n' + component.properties.VALUE
}else if(component.properties.PREFIX.charAt(0) === 'M' || component.properties.PREFIX.charAt(0) === 'm'){
// k = k + ' ' + component.properties.VALUE
if(component.properties.MULTIPLICITY_PARAMETER != 1){
k = k + ' m=' + component.properties.MULTIPLICITY_PARAMETER
}
if(component.properties.DTEMP != 27){
k = k + ' dtemp=' + component.properties.DTEMP
}
// component.value = component.value + '\n' + component.properties.VALUE
}else if(component.properties.PREFIX.charAt(0) === 'Q' || component.properties.PREFIX.charAt(0) === 'q'){
// k = k + ' ' + component.properties.VALUE
if(component.properties.MULTIPLICITY_PARAMETER != 1){
k = k + ' m=' + component.properties.MULTIPLICITY_PARAMETER
}
if(component.properties.DTEMP != 27){
k = k + ' dtemp=' + component.properties.DTEMP
}
// component.value = component.value + '\n' + component.properties.VALUE
}else if(component.properties.PREFIX.charAt(0) === 'R' || component.properties.PREFIX.charAt(0) === 'r'){
k = k + ' ' + component.properties.VALUE
if(component.properties.SHEET_RESISTANCE != 0){
k = k + ' RSH=' + component.properties.SHEET_RESISTANCE
}
if(component.properties.FIRST_ORDER_TEMPERATURE_COEFF != 0){
k = k + ' tc1=' + component.properties.FIRST_ORDER_TEMPERATURE_COEFF
}
if(component.properties.SECOND_ORDER_TEMPERATURE_COEFF != 0){
k = k + ' tc2=' + component.properties.SECOND_ORDER_TEMPERATURE_COEFF
}
if(component.properties.PARAMETER_MEASUREMENT_TEMPERATURE != 27){
k = k + ' TNOM=' + component.properties.PARAMETER_MEASUREMENT_TEMPERATURE
}
component.value = component.value + '\n' + component.properties.VALUE
}else {
if (component.properties.VALUE !== undefined) {
k = k + ' ' + component.properties.VALUE
component.value = component.value + '\n' + component.properties.VALUE
Expand All @@ -372,9 +425,7 @@ export function GenerateNetList() {
k = k + ' ' + component.properties.EXTRA_EXPRESSION
component.value = component.value + ' ' + component.properties.EXTRA_EXPRESSION
}
if (component.properties.MODEL.length > 0) {
k = k + ' ' + component.properties.MODEL.split(' ')[1]
}

if (component.properties.MODEL.length > 0) {
spiceModels += component.properties.MODEL + '\n'
}
Expand Down
15 changes: 14 additions & 1 deletion eda-frontend/src/components/SchematicEditor/SchematicToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,24 @@ export default function SchematicToolbar ({ mobileClose, gridRef }) {

const handleClickOpen = () => {
var compNetlist = GenerateNetList()
var printToPlotControlBlock =""
var ctrlblk = netfile.controlBlock.split('\n')
for (var line = 0; line < ctrlblk.length; line++) {
if (ctrlblk[line].includes('print')) {
printToPlotControlBlock += 'plot '
var cleanCode= ctrlblk[line].split('print ')[1]
cleanCode = cleanCode.split('>')[0]
printToPlotControlBlock += cleanCode + '\n'
}
else{
printToPlotControlBlock += ctrlblk[line] + '\n'
}
}
var netlist = netfile.title + '\n\n' +
compNetlist.models + '\n' +
compNetlist.main + '\n' +
netfile.controlLine + '\n' +
netfile.controlBlock + '\n'
printToPlotControlBlock + '\n'
genNetlist(netlist)
setOpen(true)
}
Expand Down
Loading

0 comments on commit 7ce33fe

Please sign in to comment.