Displays the DC transfer, and tables with poles and zeros on the active HTML page. Not implemented with parameter stepping. :param instObj: Results of an instruction with data type 'poles', 'zeros' or 'pz'. :type instObj: SLiCAP.protos.allResults :param label: ID of t
(instObj, label = '', labelText = '')
| 619 | return html |
| 620 | |
| 621 | def pz2html(instObj, label = '', labelText = ''): |
| 622 | """ |
| 623 | Displays the DC transfer, and tables with poles and zeros on the active |
| 624 | HTML page. |
| 625 | |
| 626 | Not implemented with parameter stepping. |
| 627 | |
| 628 | :param instObj: Results of an instruction with data type 'poles', 'zeros' or 'pz'. |
| 629 | :type instObj: SLiCAP.protos.allResults |
| 630 | |
| 631 | :param label: ID of the label assigned to these tables; defaults to ''. |
| 632 | :type label: str |
| 633 | |
| 634 | :param labelText: Label text to be displayed by **links2html()**; defaults to '' |
| 635 | :type labelText: str |
| 636 | |
| 637 | :return: HTML string that will be placed on the page. |
| 638 | :rtype: str |
| 639 | """ |
| 640 | html = '' |
| 641 | if instObj.errors != 0: |
| 642 | print("Errors found in instruction.") |
| 643 | return html |
| 644 | elif instObj.dataType != 'poles' and instObj.dataType != 'zeros' and instObj.dataType != 'pz': |
| 645 | print("Error: 'pz2html()' expected dataType: 'poles', 'zeros', or 'pz', got: '{0}'.".format(instObj.dataType)) |
| 646 | return html |
| 647 | elif instObj.step == True : |
| 648 | print("Error: parameter stepping not implemented for 'pz2html()'.") |
| 649 | return html |
| 650 | label = _addLabel(label, caption=labelText, labelType="data") |
| 651 | (poles, zeros, DCgain) = (instObj.poles, instObj.zeros, instObj.DCvalue) |
| 652 | if type(DCgain) == list and len(DCgain) != 0: |
| 653 | DCgain = DCgain[0] |
| 654 | if instObj.dataType == 'poles': |
| 655 | headTxt = 'Poles ' |
| 656 | elif instObj.dataType == 'zeros': |
| 657 | headTxt = 'Zeros ' |
| 658 | elif instObj.dataType == 'pz': |
| 659 | headTxt = 'PZ ' |
| 660 | html = '<h2>' + label + headTxt + ' analysis results</h2>\n' |
| 661 | html += '<h3>Gain type: %s</h3>'%(instObj.gainType) |
| 662 | if DCgain != None and instObj.dataType =='pz': |
| 663 | if instObj.numeric == True: |
| 664 | html += '\n' + '<p>DC value = $' + sp.latex(roundN(sp.N(DCgain))) + '$</p>\n' |
| 665 | else: |
| 666 | html += '\n<p>DC gain = $' + sp.latex(roundN(DCgain)) + '$</p>\n' |
| 667 | elif instObj.dataType =='pz': |
| 668 | html += '<p>DC gain could not be determined.</p>\n' |
| 669 | if ini.hz == True: |
| 670 | unitsM = 'Mag [Hz]' |
| 671 | unitsR = 'Re [Hz]' |
| 672 | unitsI = 'Im [Hz]' |
| 673 | unitsS = '[Hz]' |
| 674 | else: |
| 675 | unitsM = 'Mag [rad/s]' |
| 676 | unitsR = 'Re [rad/s]' |
| 677 | unitsI = 'Im [rad/s]' |
| 678 | unitsS = '[rad/s]' |
nothing calls this directly
no test coverage detected