Checks the model parameters of subcircuit elements (X). If the model parameters correspond with those of the prototype, the values will be passed to the instance of the prototype. if no values are given with the element, default values of the prototype will be used. The model a
(circuitObject, el)
| 846 | return circuitObject |
| 847 | |
| 848 | def _checkSubCircuitElementModelParams(circuitObject, el): |
| 849 | """ |
| 850 | Checks the model parameters of subcircuit elements (X). |
| 851 | If the model parameters correspond with those of the prototype, the values |
| 852 | will be passed to the instance of the prototype. if no values are given |
| 853 | with the element, default values of the prototype will be used. |
| 854 | |
| 855 | The model attribute will be replaced with its prototype subcircuit. |
| 856 | |
| 857 | :param circuitObject: Circuit object that holds the element. |
| 858 | :type circuitObject: SLiCAPprotos.circuit |
| 859 | |
| 860 | :param el: Element that needs to be checked |
| 861 | :type el: SLiCAPprotos.element |
| 862 | |
| 863 | :return: circuit object with updated element el. |
| 864 | :rtype: SLiCAPprotos.circuit |
| 865 | """ |
| 866 | if type(el.model) != circuit: |
| 867 | if el.model in circuitObject.circuits.keys(): |
| 868 | validParams = circuitObject.circuits[el.model].params |
| 869 | el.model = circuitObject.circuits[el.model] |
| 870 | elif el.model in _USERCIRCUITS.keys(): |
| 871 | validParams = _USERCIRCUITS[el.model].params |
| 872 | el.model = _USERCIRCUITS[el.model] |
| 873 | elif el.model in _SLiCAPCIRCUITS.keys(): |
| 874 | validParams = _SLiCAPCIRCUITS[el.model].params |
| 875 | el.model = _SLiCAPCIRCUITS[el.model] |
| 876 | elif el.model in _CIRCUITS.keys(): |
| 877 | validParams = _CIRCUITS[el.model].params |
| 878 | el.model = _CIRCUITS[el.model] |
| 879 | else: |
| 880 | print("Error: missing definition of subcircuit: " + el.model + ".") |
| 881 | circuitObject.errors += 1 |
| 882 | el.model = False |
| 883 | validParams = {} |
| 884 | for parName in el.params: |
| 885 | if parName not in validParams.keys(): |
| 886 | print("Error: unknown model parameter: " + parName) |
| 887 | circuitObject.errors += 1 |
| 888 | elif ini.laplace in el.params[parName].atoms(sp.Symbol): |
| 889 | print("Error: Laplace variable not allowed in subcircuit calls!\n Parameter: '%s', element: `%s`, circuit: '%s'."%(parName, el.ID, circuitObject.title)) |
| 890 | circuitObject.errors += 1 |
| 891 | circuitObject.elements[el.refDes] = el |
| 892 | return circuitObject |
| 893 | |
| 894 | """ PASS 3 FUNCTIONS """ |
| 895 |
no outgoing calls
no test coverage detected