29#include <pegtl/contrib/parse_tree.hpp>
53 case SIM_MODEL::TYPE::V:
54 case SIM_MODEL::TYPE::I:
55 result = fmt::format(
"alter @{}={:g}",
78 bool emptyLine =
true;
90 item.
modelName += fmt::format(
"DC {} ", dc );
93 if(
m_model.GetSpiceInfo().functionName !=
""
94 &&
m_model.GetType() != SIM_MODEL::TYPE::V
95 &&
m_model.GetType() != SIM_MODEL::TYPE::I )
97 std::string args =
"";
101 case SIM_MODEL::TYPE::V_PWL:
102 case SIM_MODEL::TYPE::I_PWL:
104 tao::pegtl::string_input<> in(
m_model.GetParam( 0 ).value,
"from_content" );
105 std::unique_ptr<tao::pegtl::parse_tree::node> root;
112 catch(
const tao::pegtl::parse_error& )
119 for(
const auto& node : root->children )
122 SIM_VALUE::NOTATION::SI>>() )
132 case SIM_MODEL::TYPE::V_WHITENOISE:
133 case SIM_MODEL::TYPE::I_WHITENOISE:
136 args.append(
"0 0 0 0 0 " );
139 case SIM_MODEL::TYPE::V_PINKNOISE:
140 case SIM_MODEL::TYPE::I_PINKNOISE:
145 args.append(
"0 0 0 " );
148 case SIM_MODEL::TYPE::V_BURSTNOISE:
149 case SIM_MODEL::TYPE::I_BURSTNOISE:
150 args.append(
"0 0 0 0 " );
156 case SIM_MODEL::TYPE::V_RANDUNIFORM:
157 case SIM_MODEL::TYPE::I_RANDUNIFORM:
167 case SIM_MODEL::TYPE::V_RANDGAUSSIAN:
168 case SIM_MODEL::TYPE::I_RANDGAUSSIAN:
176 case SIM_MODEL::TYPE::V_RANDEXP:
177 case SIM_MODEL::TYPE::I_RANDEXP:
185 case SIM_MODEL::TYPE::V_RANDPOISSON:
186 case SIM_MODEL::TYPE::I_RANDPOISSON:
195 for(
int ii = 0; ii <
m_model.GetParamCount(); ++ii )
199 if( ac !=
"" && (
param.Matches(
"ac" ) ||
param.Matches(
"ph" ) ) )
205 args.append( argStr +
" " );
212 item.
modelName += fmt::format(
"{}( {}) ",
m_model.GetSpiceInfo().functionName, args );
217 case SIM_MODEL::TYPE::V_VCL:
218 case SIM_MODEL::TYPE::I_VCL:
225 case SIM_MODEL::TYPE::V_CCL:
226 case SIM_MODEL::TYPE::I_CCL:
246 item.
modelName += fmt::format(
"AC {} {} ", ac, ph );
249 std::string portnum =
"";
256 item.
modelName += fmt::format(
"portnum {} ", portnum );
264 item.
modelName += fmt::format(
"z0 {} ", z0 );
277 const std::string& aDefaultValue )
const
281 if (
m_model.FindParam( aParamName ) )
306 for(
int paramIndex = aParamIndex; paramIndex <
GetParamCount(); ++paramIndex )
308 m_params.at( aParamIndex ).value =
"";
313 for(
int paramIndex = 0; paramIndex < aParamIndex; ++paramIndex )
315 if(
GetParam( paramIndex ).value ==
"" )
318 wxString defaultValue =
m_params.at( aParamIndex ).info.defaultValue;
320 if( !defaultValue.ToDouble( &
dummy ) )
321 defaultValue = wxT(
"0" );
323 m_params.at( aParamIndex ).value = defaultValue;
384 case TYPE::V:
return vdc;
385 case TYPE::I:
return idc;
386 case TYPE::V_SIN:
return vsin;
387 case TYPE::I_SIN:
return isin;
388 case TYPE::V_PULSE:
return vpulse;
389 case TYPE::I_PULSE:
return ipulse;
390 case TYPE::V_EXP:
return vexp;
391 case TYPE::I_EXP:
return iexp;
392 case TYPE::V_AM:
return vam;
393 case TYPE::I_AM:
return iam;
394 case TYPE::V_SFFM:
return vsffm;
395 case TYPE::I_SFFM:
return isffm;
396 case TYPE::V_VCL:
return vcvs;
397 case TYPE::V_CCL:
return ccvs;
398 case TYPE::V_PWL:
return vpwl;
399 case TYPE::I_VCL:
return vccs;
400 case TYPE::I_CCL:
return cccs;
401 case TYPE::I_PWL:
return ipwl;
402 case TYPE::V_WHITENOISE:
return vwhitenoise;
403 case TYPE::I_WHITENOISE:
return iwhitenoise;
404 case TYPE::V_PINKNOISE:
return vpinknoise;
405 case TYPE::I_PINKNOISE:
return ipinknoise;
406 case TYPE::V_BURSTNOISE:
return vburstnoise;
407 case TYPE::I_BURSTNOISE:
return iburstnoise;
408 case TYPE::V_RANDUNIFORM:
return vrandomuniform;
409 case TYPE::I_RANDUNIFORM:
return irandomuniform;
410 case TYPE::V_RANDGAUSSIAN:
return vrandomnormal;
411 case TYPE::I_RANDGAUSSIAN:
return irandomnormal;
412 case TYPE::V_RANDEXP:
return vrandomexp;
413 case TYPE::I_RANDEXP:
return irandomexp;
414 case TYPE::V_RANDPOISSON:
return vrandompoisson;
415 case TYPE::I_RANDPOISSON:
return irandompoisson;
417 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_SOURCE" );
418 static std::vector<SIM_MODEL::PARAM::INFO>
empty;
425 const std::string& aUnit )
427 std::vector<PARAM::INFO> paramInfos;
428 PARAM::INFO paramInfo;
430 paramInfo.name =
"dc";
432 paramInfo.unit = aUnit;
433 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
434 paramInfo.defaultValue =
"0";
435 paramInfo.description =
"DC value";
436 paramInfos.push_back( paramInfo );
445 const std::string& aUnit )
447 std::vector<PARAM::INFO> paramInfos;
448 PARAM::INFO paramInfo;
450 paramInfo.name =
"dc";
452 paramInfo.unit = aUnit;
453 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
454 paramInfo.defaultValue =
"";
455 paramInfo.description =
"DC offset";
456 paramInfos.push_back( paramInfo );
458 paramInfo.name =
"ampl";
460 paramInfo.unit = aUnit;
461 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
462 paramInfo.defaultValue =
"";
463 paramInfo.description =
"Amplitude";
464 paramInfos.push_back( paramInfo );
466 paramInfo.name =
"f";
468 paramInfo.unit =
"Hz";
469 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
470 paramInfo.defaultValue =
"1/tstop";
471 paramInfo.description =
"Frequency";
472 paramInfos.push_back( paramInfo );
474 paramInfo.name =
"td";
476 paramInfo.unit =
"s";
477 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
478 paramInfo.defaultValue =
"0";
479 paramInfo.description =
"Delay";
480 paramInfos.push_back( paramInfo );
482 paramInfo.name =
"theta";
484 paramInfo.unit =
"1/s";
485 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
486 paramInfo.defaultValue =
"0";
487 paramInfo.description =
"Damping factor";
488 paramInfos.push_back( paramInfo );
490 paramInfo.name =
"phase";
492 paramInfo.unit =
"°";
493 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
494 paramInfo.defaultValue =
"0";
495 paramInfo.description =
"Phase";
496 paramInfos.push_back( paramInfo );
505 const std::string& aUnit )
507 std::vector<PARAM::INFO> paramInfos;
508 PARAM::INFO paramInfo;
510 paramInfo.name = aPrefix +
"1";
512 paramInfo.unit = aUnit;
513 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
514 paramInfo.defaultValue =
"";
515 paramInfo.description =
"Initial value";
516 paramInfos.push_back( paramInfo );
518 paramInfo.name = aPrefix +
"2";
520 paramInfo.unit = aUnit;
521 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
522 paramInfo.defaultValue =
"";
523 paramInfo.description =
"Pulsed value";
524 paramInfos.push_back( paramInfo );
526 paramInfo.name =
"td";
528 paramInfo.unit =
"s";
529 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
530 paramInfo.defaultValue =
"0";
531 paramInfo.description =
"Delay";
532 paramInfos.push_back( paramInfo );
534 paramInfo.name =
"tr";
536 paramInfo.unit =
"s";
537 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
538 paramInfo.defaultValue =
"tstep";
539 paramInfo.description =
"Rise time";
540 paramInfos.push_back( paramInfo );
542 paramInfo.name =
"tf";
544 paramInfo.unit =
"s";
545 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
546 paramInfo.defaultValue =
"tstep";
547 paramInfo.description =
"Fall time";
548 paramInfos.push_back( paramInfo );
550 paramInfo.name =
"tw";
552 paramInfo.unit =
"s";
553 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
554 paramInfo.defaultValue =
"tstop";
555 paramInfo.description =
"Pulse width";
556 paramInfos.push_back( paramInfo );
558 paramInfo.name =
"per";
560 paramInfo.unit =
"s";
561 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
562 paramInfo.defaultValue =
"tstop";
563 paramInfo.description =
"Period";
564 paramInfos.push_back( paramInfo );
566 paramInfo.name =
"np";
569 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
570 paramInfo.defaultValue =
"";
571 paramInfo.description =
"Number of pulses";
572 paramInfos.push_back( paramInfo );
581 const std::string& aUnit )
583 std::vector<PARAM::INFO> paramInfos;
584 PARAM::INFO paramInfo;
586 paramInfo.name = aPrefix +
"1";
588 paramInfo.unit = aUnit;
589 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
590 paramInfo.defaultValue =
"";
591 paramInfo.description =
"Initial value";
592 paramInfos.push_back( paramInfo );
594 paramInfo.name = aPrefix +
"2";
596 paramInfo.unit = aUnit;
597 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
598 paramInfo.defaultValue =
"";
599 paramInfo.description =
"Pulsed value";
600 paramInfos.push_back( paramInfo );
602 paramInfo.name =
"td1";
604 paramInfo.unit =
"s";
605 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
606 paramInfo.defaultValue =
"0";
607 paramInfo.description =
"Rise delay time";
608 paramInfos.push_back( paramInfo );
610 paramInfo.name =
"tau1";
612 paramInfo.unit =
"s";
613 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
614 paramInfo.defaultValue =
"tstep";
615 paramInfo.description =
"Rise time constant";
616 paramInfos.push_back( paramInfo );
618 paramInfo.name =
"td2";
620 paramInfo.unit =
"s";
621 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
622 paramInfo.defaultValue =
"td1+tstep";
623 paramInfo.description =
"Fall delay time";
624 paramInfos.push_back( paramInfo );
626 paramInfo.name =
"tau2";
628 paramInfo.unit =
"s";
629 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
630 paramInfo.defaultValue =
"tstep";
631 paramInfo.description =
"Fall time constant";
632 paramInfos.push_back( paramInfo );
641 const std::string& aUnit )
643 std::vector<PARAM::INFO> paramInfos;
644 PARAM::INFO paramInfo;
646 paramInfo.name =
"vo";
648 paramInfo.unit = aUnit;
649 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
650 paramInfo.defaultValue =
"";
651 paramInfo.description =
"Overall offset";
652 paramInfos.push_back( paramInfo );
654 paramInfo.name =
"vmo";
656 paramInfo.unit = aUnit;
657 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
658 paramInfo.defaultValue =
"";
659 paramInfo.description =
"Modulation signal offset";
660 paramInfos.push_back( paramInfo );
662 paramInfo.name =
"vma";
664 paramInfo.unit = aUnit;
665 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
666 paramInfo.defaultValue =
"";
667 paramInfo.description =
"Modulation signal amplitude";
668 paramInfos.push_back( paramInfo );
670 paramInfo.name =
"fm";
672 paramInfo.unit =
"Hz";
673 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
674 paramInfo.defaultValue =
"5/tstop";
675 paramInfo.description =
"Modulation signal frequency";
676 paramInfos.push_back( paramInfo );
678 paramInfo.name =
"fc";
680 paramInfo.unit =
"Hz";
681 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
682 paramInfo.defaultValue =
"500/tstop";
683 paramInfo.description =
"Carrier signal frequency";
684 paramInfos.push_back( paramInfo );
686 paramInfo.name =
"td";
688 paramInfo.unit =
"s";
689 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
690 paramInfo.defaultValue =
"0";
691 paramInfo.description =
"Overall delay";
692 paramInfos.push_back( paramInfo );
694 paramInfo.name =
"phasem";
696 paramInfo.unit =
"°";
697 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
698 paramInfo.defaultValue =
"0";
699 paramInfo.description =
"Modulation signal phase";
700 paramInfos.push_back( paramInfo );
702 paramInfo.name =
"phasec";
704 paramInfo.unit =
"°";
705 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
706 paramInfo.defaultValue =
"0";
707 paramInfo.description =
"Carrier signal phase";
708 paramInfos.push_back( paramInfo );
717 const std::string& aUnit )
719 std::vector<PARAM::INFO> paramInfos;
720 PARAM::INFO paramInfo;
722 paramInfo.name =
"vo";
724 paramInfo.unit = aUnit;
725 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
726 paramInfo.defaultValue =
"";
727 paramInfo.description =
"DC offset";
728 paramInfos.push_back( paramInfo );
730 paramInfo.name =
"va";
732 paramInfo.unit = aUnit;
733 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
734 paramInfo.defaultValue =
"";
735 paramInfo.description =
"Amplitude";
736 paramInfos.push_back( paramInfo );
738 paramInfo.name =
"fm";
740 paramInfo.unit =
"Hz";
741 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
742 paramInfo.defaultValue =
"5/tstop";
743 paramInfo.description =
"Modulating frequency";
744 paramInfos.push_back( paramInfo );
746 paramInfo.name =
"mdi";
749 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
750 paramInfo.defaultValue =
"";
751 paramInfo.description =
"Modulation index";
752 paramInfos.push_back( paramInfo );
754 paramInfo.name =
"fc";
756 paramInfo.unit =
"Hz";
757 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
758 paramInfo.defaultValue =
"500/tstop";
759 paramInfo.description =
"Carrier frequency";
760 paramInfos.push_back( paramInfo );
762 paramInfo.name =
"phasem";
764 paramInfo.unit =
"°";
765 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
766 paramInfo.defaultValue =
"0";
767 paramInfo.description =
"Modulating signal phase";
768 paramInfos.push_back( paramInfo );
770 paramInfo.name =
"phasec";
772 paramInfo.unit =
"°";
773 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
774 paramInfo.defaultValue =
"0";
775 paramInfo.description =
"Carrier signal phase";
776 paramInfos.push_back( paramInfo );
786 std::vector<PARAM::INFO> paramInfos;
787 PARAM::INFO paramInfo;
789 paramInfo.name =
"gain";
792 paramInfo.unit = aGainUnit;
793 paramInfo.description =
"Gain";
794 paramInfos.push_back( paramInfo );
796 paramInfo.name =
"control";
800 paramInfo.description =
"Controlling voltage source";
801 paramInfos.push_back( paramInfo );
809 std::vector<PARAM::INFO> paramInfos;
810 PARAM::INFO paramInfo;
812 paramInfo.name =
"gain";
815 paramInfo.unit = aGainUnit;
816 paramInfo.description =
"Gain";
817 paramInfos.push_back( paramInfo );
824 const std::string& aQuantity,
825 const std::string& aUnit )
827 std::vector<PARAM::INFO> paramInfos;
828 PARAM::INFO paramInfo;
830 paramInfo.name =
"pwl";
832 paramInfo.unit =
"s," + aUnit;
833 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
834 paramInfo.defaultValue =
"";
835 paramInfo.description = aUnit ==
"V" ?
"Time-voltage points" :
"Time-current points";
836 paramInfos.push_back( paramInfo );
845 const std::string& aUnit )
847 std::vector<PARAM::INFO> paramInfos;
848 PARAM::INFO paramInfo;
850 paramInfo.name =
"rms";
852 paramInfo.unit = aUnit;
853 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
854 paramInfo.defaultValue =
"0";
855 paramInfo.description =
"White noise RMS amplitude";
856 paramInfos.push_back( paramInfo );
858 paramInfo.name =
"dt";
860 paramInfo.unit =
"s";
861 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
862 paramInfo.defaultValue =
"0";
863 paramInfo.description =
"Time step";
864 paramInfos.push_back( paramInfo );
873 const std::string& aUnit )
875 std::vector<PARAM::INFO> paramInfos;
876 PARAM::INFO paramInfo;
878 paramInfo.name =
"rms";
881 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
882 paramInfo.defaultValue =
"0";
883 paramInfo.description =
"1/f noise RMS amplitude";
884 paramInfos.push_back( paramInfo );
886 paramInfo.name =
"slope";
889 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
890 paramInfo.defaultValue =
"1";
891 paramInfo.description =
"1/f noise exponent";
892 paramInfos.push_back( paramInfo );
894 paramInfo.name =
"dt";
896 paramInfo.unit =
"s";
897 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
898 paramInfo.defaultValue =
"0";
899 paramInfo.description =
"Time step";
900 paramInfos.push_back( paramInfo );
909 const std::string& aUnit )
911 std::vector<PARAM::INFO> paramInfos;
912 PARAM::INFO paramInfo;
914 paramInfo.name =
"ampl";
916 paramInfo.unit = aUnit;
917 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
918 paramInfo.defaultValue =
"0";
919 paramInfo.description =
"Burst noise amplitude";
920 paramInfos.push_back( paramInfo );
922 paramInfo.name =
"tcapt";
924 paramInfo.unit =
"s";
925 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
926 paramInfo.defaultValue =
"0";
927 paramInfo.description =
"Burst noise trap capture time";
928 paramInfos.push_back( paramInfo );
930 paramInfo.name =
"temit";
932 paramInfo.unit =
"s";
933 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
934 paramInfo.defaultValue =
"0";
935 paramInfo.description =
"Burst noise trap emission time";
936 paramInfos.push_back( paramInfo );
945 const std::string& aUnit )
947 std::vector<PARAM::INFO> paramInfos;
948 PARAM::INFO paramInfo;
950 paramInfo.name =
"ts";
952 paramInfo.unit =
"s";
953 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
954 paramInfo.defaultValue =
"";
955 paramInfo.description =
"Individual voltage duration";
956 paramInfos.push_back( paramInfo );
958 paramInfo.name =
"td";
960 paramInfo.unit =
"s";
961 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
962 paramInfo.defaultValue =
"0";
963 paramInfo.description =
"Delay";
964 paramInfos.push_back( paramInfo );
966 paramInfo.name =
"range";
968 paramInfo.unit = aUnit;
969 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
970 paramInfo.defaultValue =
"1";
971 paramInfo.description =
"Range";
972 paramInfos.push_back( paramInfo );
974 paramInfo.name =
"offset";
976 paramInfo.unit = aUnit;
977 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
978 paramInfo.defaultValue =
"0";
979 paramInfo.description =
"Offset";
980 paramInfos.push_back( paramInfo );
989 const std::string& aUnit )
991 std::vector<PARAM::INFO> paramInfos;
992 PARAM::INFO paramInfo;
994 paramInfo.name =
"ts";
996 paramInfo.unit =
"s";
997 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
998 paramInfo.defaultValue =
"";
999 paramInfo.description =
"Individual voltage duration";
1000 paramInfos.push_back( paramInfo );
1002 paramInfo.name =
"td";
1004 paramInfo.unit =
"s";
1005 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1006 paramInfo.defaultValue =
"0";
1007 paramInfo.description =
"Delay";
1008 paramInfos.push_back( paramInfo );
1010 paramInfo.name =
"stddev";
1012 paramInfo.unit = aUnit;
1013 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1014 paramInfo.defaultValue =
"1";
1015 paramInfo.description =
"Standard deviation";
1016 paramInfos.push_back( paramInfo );
1018 paramInfo.name =
"mean";
1020 paramInfo.unit = aUnit;
1021 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1022 paramInfo.defaultValue =
"0";
1023 paramInfo.description =
"Mean";
1024 paramInfos.push_back( paramInfo );
1033 const std::string& aUnit )
1035 std::vector<PARAM::INFO> paramInfos;
1036 PARAM::INFO paramInfo;
1038 paramInfo.name =
"ts";
1040 paramInfo.unit =
"s";
1041 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1042 paramInfo.defaultValue =
"";
1043 paramInfo.description =
"Individual voltage duration";
1044 paramInfos.push_back( paramInfo );
1046 paramInfo.name =
"td";
1048 paramInfo.unit =
"s";
1049 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1050 paramInfo.defaultValue =
"0";
1051 paramInfo.description =
"Delay";
1052 paramInfos.push_back( paramInfo );
1054 paramInfo.name =
"mean";
1056 paramInfo.unit = aUnit;
1057 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1058 paramInfo.defaultValue =
"1";
1059 paramInfo.description =
"Mean";
1060 paramInfos.push_back( paramInfo );
1062 paramInfo.name =
"offset";
1064 paramInfo.unit = aUnit;
1065 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1066 paramInfo.defaultValue =
"0";
1067 paramInfo.description =
"Offset";
1068 paramInfos.push_back( paramInfo );
1077 const std::string& aUnit )
1079 std::vector<PARAM::INFO> paramInfos;
1080 PARAM::INFO paramInfo;
1082 paramInfo.name =
"ts";
1084 paramInfo.unit =
"s";
1085 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1086 paramInfo.defaultValue =
"";
1087 paramInfo.description =
"Individual voltage duration";
1088 paramInfos.push_back( paramInfo );
1090 paramInfo.name =
"td";
1092 paramInfo.unit =
"s";
1093 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1094 paramInfo.defaultValue =
"0";
1095 paramInfo.description =
"Delay";
1096 paramInfos.push_back( paramInfo );
1098 paramInfo.name =
"lambda";
1100 paramInfo.unit = aUnit;
1101 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1102 paramInfo.defaultValue =
"1";
1103 paramInfo.description =
"Lambda";
1104 paramInfos.push_back( paramInfo );
1106 paramInfo.name =
"offset";
1108 paramInfo.unit = aUnit;
1109 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1110 paramInfo.defaultValue =
"0";
1111 paramInfo.description =
"Offset";
1112 paramInfos.push_back( paramInfo );
1121 PARAM::INFO paramInfo;
1123 paramInfo.name =
"ac";
1125 paramInfo.unit = aUnit;
1126 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
1127 paramInfo.defaultValue =
"0";
1128 paramInfo.description =
"AC magnitude";
1129 aParamInfos.push_back( paramInfo );
1131 paramInfo.name =
"ph";
1133 paramInfo.unit =
"°";
1134 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
1135 paramInfo.defaultValue =
"0";
1136 paramInfo.description =
"AC phase";
1137 aParamInfos.push_back( paramInfo );
1141 const std::string& aUnit )
1143 PARAM::INFO paramInfo;
1145 if( !strcmp( aUnit.c_str(),
"V" ) )
1147 paramInfo.name =
"portnum";
1149 paramInfo.unit =
"";
1150 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::S_PARAM;
1151 paramInfo.defaultValue =
"";
1152 paramInfo.description =
"Port number";
1153 aParamInfos.push_back( paramInfo );
1155 paramInfo.name =
"z0";
1157 paramInfo.unit =
"Ohm";
1158 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::S_PARAM;
1159 paramInfo.defaultValue =
"";
1160 paramInfo.description =
"Internal impedance";
1161 aParamInfos.push_back( paramInfo );
1169 return {
"+",
"-",
"C+",
"C-" };
1171 return {
"+",
"-" };
1178 case SIM_MODEL::TYPE::V:
1179 case SIM_MODEL::TYPE::I:
static void appendAcParamInfos(std::vector< PARAM::INFO > &aParamInfos, const std::string &aUnit)
static std::vector< PARAM::INFO > makeBurstNoiseParamInfos(const std::string &aPrefix, const std::string &aUnit)
std::vector< std::string > GetPinNames() const override
const PARAM * GetTunerParam() const override
static const std::vector< PARAM::INFO > & makeParamInfos(TYPE aType)
static std::vector< PARAM::INFO > makeExpParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makeAMParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makeRandomNormalParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< SIM_MODEL::PARAM::INFO > makeVcParamInfos(const std::string &aGainUnit)
static void appendSpParamInfos(std::vector< PARAM::INFO > &aParamInfos, const std::string &aUnit)
SIM_MODEL_SOURCE(TYPE aType)
static std::vector< PARAM::INFO > makeRandomExpParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makeSFFMParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makeRandomUniformParamInfos(const std::string &aPrefix, const std::string &aUnit)
void doSetParamValue(int aParamIndex, const std::string &aValue) override
static std::vector< PARAM::INFO > makeRandomPoissonParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makeDcParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makePulseParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makePinkNoiseParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makeSinParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< PARAM::INFO > makePwlParamInfos(const std::string &aPrefix, const std::string &aQuantity, const std::string &aUnit)
static std::vector< PARAM::INFO > makeWhiteNoiseParamInfos(const std::string &aPrefix, const std::string &aUnit)
static std::vector< SIM_MODEL::PARAM::INFO > makeCcParamInfos(const std::string &aGainUnit)
void AddParam(const PARAM::INFO &aInfo)
const SPICE_GENERATOR & SpiceGenerator() const
virtual const PARAM & GetParam(unsigned aParamIndex) const
int GetParamCount() const
DEVICE_T GetDeviceType() const
virtual void doSetParamValue(int aParamIndex, const std::string &aValue)
std::vector< PARAM > m_params
void SetParamValue(int aParamIndex, const std::string &aValue, SIM_VALUE::NOTATION aNotation=SIM_VALUE::NOTATION::SI)
static std::string ToSpice(const std::string &aString)
std::string ModelLine(const SPICE_ITEM &aItem) const override
std::string ItemLine(const SPICE_ITEM &aItem) const override
std::string TunerCommand(const SPICE_ITEM &aItem, double aValue) const override
std::string getParamValueString(const std::string &aParamName, const std::string &aDefaultValue) const
virtual std::string ItemName(const SPICE_ITEM &aItem) const
virtual std::string ItemLine(const SPICE_ITEM &aItem) const
const SIM_MODEL & m_model
static bool empty(const wxTextEntryBase *aCtrl)
std::vector< FAB_LAYER_COLOR > dummy
wxString result
Test unit parsing edge cases and error handling.