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 );
899 const std::string& aUnit )
901 std::vector<PARAM::INFO> paramInfos;
902 PARAM::INFO paramInfo;
904 paramInfo.name =
"rms";
906 paramInfo.unit = aUnit;
907 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
908 paramInfo.defaultValue =
"0";
909 paramInfo.description =
"White noise RMS amplitude";
910 paramInfos.push_back( paramInfo );
912 paramInfo.name =
"dt";
914 paramInfo.unit =
"s";
915 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
916 paramInfo.defaultValue =
"0";
917 paramInfo.description =
"Time step";
918 paramInfos.push_back( paramInfo );
927 const std::string& aUnit )
929 std::vector<PARAM::INFO> paramInfos;
930 PARAM::INFO paramInfo;
932 paramInfo.name =
"rms";
935 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
936 paramInfo.defaultValue =
"0";
937 paramInfo.description =
"1/f noise RMS amplitude";
938 paramInfos.push_back( paramInfo );
940 paramInfo.name =
"slope";
943 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
944 paramInfo.defaultValue =
"1";
945 paramInfo.description =
"1/f noise exponent";
946 paramInfos.push_back( paramInfo );
948 paramInfo.name =
"dt";
950 paramInfo.unit =
"s";
951 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
952 paramInfo.defaultValue =
"0";
953 paramInfo.description =
"Time step";
954 paramInfos.push_back( paramInfo );
963 const std::string& aUnit )
965 std::vector<PARAM::INFO> paramInfos;
966 PARAM::INFO paramInfo;
968 paramInfo.name =
"ampl";
970 paramInfo.unit = aUnit;
971 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
972 paramInfo.defaultValue =
"0";
973 paramInfo.description =
"Burst noise amplitude";
974 paramInfos.push_back( paramInfo );
976 paramInfo.name =
"tcapt";
978 paramInfo.unit =
"s";
979 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
980 paramInfo.defaultValue =
"0";
981 paramInfo.description =
"Burst noise trap capture time";
982 paramInfos.push_back( paramInfo );
984 paramInfo.name =
"temit";
986 paramInfo.unit =
"s";
987 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
988 paramInfo.defaultValue =
"0";
989 paramInfo.description =
"Burst noise trap emission time";
990 paramInfos.push_back( paramInfo );
999 const std::string& aUnit )
1001 std::vector<PARAM::INFO> paramInfos;
1002 PARAM::INFO paramInfo;
1004 paramInfo.name =
"ts";
1006 paramInfo.unit =
"s";
1007 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1008 paramInfo.defaultValue =
"";
1009 paramInfo.description =
"Individual voltage duration";
1010 paramInfos.push_back( paramInfo );
1012 paramInfo.name =
"td";
1014 paramInfo.unit =
"s";
1015 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1016 paramInfo.defaultValue =
"0";
1017 paramInfo.description =
"Delay";
1018 paramInfos.push_back( paramInfo );
1020 paramInfo.name =
"range";
1022 paramInfo.unit = aUnit;
1023 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1024 paramInfo.defaultValue =
"1";
1025 paramInfo.description =
"Range";
1026 paramInfos.push_back( paramInfo );
1028 paramInfo.name =
"offset";
1030 paramInfo.unit = aUnit;
1031 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1032 paramInfo.defaultValue =
"0";
1033 paramInfo.description =
"Offset";
1034 paramInfos.push_back( paramInfo );
1043 const std::string& aUnit )
1045 std::vector<PARAM::INFO> paramInfos;
1046 PARAM::INFO paramInfo;
1048 paramInfo.name =
"ts";
1050 paramInfo.unit =
"s";
1051 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1052 paramInfo.defaultValue =
"";
1053 paramInfo.description =
"Individual voltage duration";
1054 paramInfos.push_back( paramInfo );
1056 paramInfo.name =
"td";
1058 paramInfo.unit =
"s";
1059 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1060 paramInfo.defaultValue =
"0";
1061 paramInfo.description =
"Delay";
1062 paramInfos.push_back( paramInfo );
1064 paramInfo.name =
"stddev";
1066 paramInfo.unit = aUnit;
1067 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1068 paramInfo.defaultValue =
"1";
1069 paramInfo.description =
"Standard deviation";
1070 paramInfos.push_back( paramInfo );
1072 paramInfo.name =
"mean";
1074 paramInfo.unit = aUnit;
1075 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1076 paramInfo.defaultValue =
"0";
1077 paramInfo.description =
"Mean";
1078 paramInfos.push_back( paramInfo );
1087 const std::string& aUnit )
1089 std::vector<PARAM::INFO> paramInfos;
1090 PARAM::INFO paramInfo;
1092 paramInfo.name =
"ts";
1094 paramInfo.unit =
"s";
1095 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1096 paramInfo.defaultValue =
"";
1097 paramInfo.description =
"Individual voltage duration";
1098 paramInfos.push_back( paramInfo );
1100 paramInfo.name =
"td";
1102 paramInfo.unit =
"s";
1103 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1104 paramInfo.defaultValue =
"0";
1105 paramInfo.description =
"Delay";
1106 paramInfos.push_back( paramInfo );
1108 paramInfo.name =
"mean";
1110 paramInfo.unit = aUnit;
1111 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1112 paramInfo.defaultValue =
"1";
1113 paramInfo.description =
"Mean";
1114 paramInfos.push_back( paramInfo );
1116 paramInfo.name =
"offset";
1118 paramInfo.unit = aUnit;
1119 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1120 paramInfo.defaultValue =
"0";
1121 paramInfo.description =
"Offset";
1122 paramInfos.push_back( paramInfo );
1131 const std::string& aUnit )
1133 std::vector<PARAM::INFO> paramInfos;
1134 PARAM::INFO paramInfo;
1136 paramInfo.name =
"ts";
1138 paramInfo.unit =
"s";
1139 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1140 paramInfo.defaultValue =
"";
1141 paramInfo.description =
"Individual voltage duration";
1142 paramInfos.push_back( paramInfo );
1144 paramInfo.name =
"td";
1146 paramInfo.unit =
"s";
1147 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1148 paramInfo.defaultValue =
"0";
1149 paramInfo.description =
"Delay";
1150 paramInfos.push_back( paramInfo );
1152 paramInfo.name =
"lambda";
1154 paramInfo.unit = aUnit;
1155 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1156 paramInfo.defaultValue =
"1";
1157 paramInfo.description =
"Lambda";
1158 paramInfos.push_back( paramInfo );
1160 paramInfo.name =
"offset";
1162 paramInfo.unit = aUnit;
1163 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1164 paramInfo.defaultValue =
"0";
1165 paramInfo.description =
"Offset";
1166 paramInfos.push_back( paramInfo );
1175 PARAM::INFO paramInfo;
1177 paramInfo.name =
"ac";
1179 paramInfo.unit = aUnit;
1180 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
1181 paramInfo.defaultValue =
"0";
1182 paramInfo.description =
"AC magnitude";
1183 aParamInfos.push_back( paramInfo );
1185 paramInfo.name =
"ph";
1187 paramInfo.unit =
"°";
1188 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
1189 paramInfo.defaultValue =
"0";
1190 paramInfo.description =
"AC phase";
1191 aParamInfos.push_back( paramInfo );
1195 const std::string& aUnit )
1197 PARAM::INFO paramInfo;
1199 if( !strcmp( aUnit.c_str(),
"V" ) )
1201 paramInfo.name =
"portnum";
1203 paramInfo.unit =
"";
1204 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::S_PARAM;
1205 paramInfo.defaultValue =
"";
1206 paramInfo.description =
"Port number";
1207 aParamInfos.push_back( paramInfo );
1209 paramInfo.name =
"z0";
1211 paramInfo.unit =
"Ohm";
1212 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::S_PARAM;
1213 paramInfo.defaultValue =
"";
1214 paramInfo.description =
"Internal impedance";
1215 aParamInfos.push_back( paramInfo );
1223 return {
"+",
"-",
"C+",
"C-" };
1225 return {
"+",
"-" };
1232 case SIM_MODEL::TYPE::V:
1233 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.