29#include <pegtl/contrib/parse_tree.hpp>
49 std::string result =
"";
53 case SIM_MODEL::TYPE::V:
54 case SIM_MODEL::TYPE::I:
75 bool emptyLine =
true;
87 item.
modelName += fmt::format(
"DC {} ", dc );
94 std::string args =
"";
98 case SIM_MODEL::TYPE::V_PWL:
99 case SIM_MODEL::TYPE::I_PWL:
102 std::unique_ptr<tao::pegtl::parse_tree::node> root;
110 catch(
const tao::pegtl::parse_error& )
117 for(
const auto& node : root->children )
120 SIM_VALUE::NOTATION::SI>>() )
130 case SIM_MODEL::TYPE::V_WHITENOISE:
131 case SIM_MODEL::TYPE::I_WHITENOISE:
134 args.append(
"0 0 0 0 0 " );
137 case SIM_MODEL::TYPE::V_PINKNOISE:
138 case SIM_MODEL::TYPE::I_PINKNOISE:
143 args.append(
"0 0 0 " );
146 case SIM_MODEL::TYPE::V_BURSTNOISE:
147 case SIM_MODEL::TYPE::I_BURSTNOISE:
148 args.append(
"0 0 0 0 " );
154 case SIM_MODEL::TYPE::V_RANDUNIFORM:
155 case SIM_MODEL::TYPE::I_RANDUNIFORM:
165 case SIM_MODEL::TYPE::V_RANDGAUSSIAN:
166 case SIM_MODEL::TYPE::I_RANDGAUSSIAN:
174 case SIM_MODEL::TYPE::V_RANDEXP:
175 case SIM_MODEL::TYPE::I_RANDEXP:
183 case SIM_MODEL::TYPE::V_RANDPOISSON:
184 case SIM_MODEL::TYPE::I_RANDPOISSON:
197 if( ac !=
"" && (
param.Matches(
"ac" ) ||
param.Matches(
"ph" ) ) )
203 args.append( argStr +
" " );
215 case SIM_MODEL::TYPE::V_VCL:
216 case SIM_MODEL::TYPE::I_VCL:
223 case SIM_MODEL::TYPE::V_CCL:
224 case SIM_MODEL::TYPE::I_CCL:
244 item.
modelName += fmt::format(
"AC {} {} ", ac, ph );
247 std::string portnum =
"";
254 item.
modelName += fmt::format(
"portnum {} ", portnum );
262 item.
modelName += fmt::format(
"z0 {} ", z0 );
275 const std::string& aDefaultValue )
const
277 std::string result =
"";
283 result = aDefaultValue;
304 for(
int paramIndex = aParamIndex; paramIndex <
GetParamCount(); ++paramIndex )
306 m_params.at( aParamIndex ).value =
"";
311 for(
int paramIndex = 0; paramIndex < aParamIndex; ++paramIndex )
316 wxString defaultValue =
m_params.at( aParamIndex ).info.defaultValue;
318 if( !defaultValue.ToDouble( &
dummy ) )
319 defaultValue = wxT(
"0" );
321 m_params.at( aParamIndex ).value = defaultValue;
382 case TYPE::V:
return vdc;
383 case TYPE::I:
return idc;
384 case TYPE::V_SIN:
return vsin;
385 case TYPE::I_SIN:
return isin;
386 case TYPE::V_PULSE:
return vpulse;
387 case TYPE::I_PULSE:
return ipulse;
388 case TYPE::V_EXP:
return vexp;
389 case TYPE::I_EXP:
return iexp;
390 case TYPE::V_AM:
return vam;
391 case TYPE::I_AM:
return iam;
392 case TYPE::V_SFFM:
return vsffm;
393 case TYPE::I_SFFM:
return isffm;
394 case TYPE::V_VCL:
return vcvs;
395 case TYPE::V_CCL:
return ccvs;
396 case TYPE::V_PWL:
return vpwl;
397 case TYPE::I_VCL:
return vccs;
398 case TYPE::I_CCL:
return cccs;
399 case TYPE::I_PWL:
return ipwl;
400 case TYPE::V_WHITENOISE:
return vwhitenoise;
401 case TYPE::I_WHITENOISE:
return iwhitenoise;
402 case TYPE::V_PINKNOISE:
return vpinknoise;
403 case TYPE::I_PINKNOISE:
return ipinknoise;
404 case TYPE::V_BURSTNOISE:
return vburstnoise;
405 case TYPE::I_BURSTNOISE:
return iburstnoise;
406 case TYPE::V_RANDUNIFORM:
return vrandomuniform;
407 case TYPE::I_RANDUNIFORM:
return irandomuniform;
408 case TYPE::V_RANDGAUSSIAN:
return vrandomnormal;
409 case TYPE::I_RANDGAUSSIAN:
return irandomnormal;
410 case TYPE::V_RANDEXP:
return vrandomexp;
411 case TYPE::I_RANDEXP:
return irandomexp;
412 case TYPE::V_RANDPOISSON:
return vrandompoisson;
413 case TYPE::I_RANDPOISSON:
return irandompoisson;
415 wxFAIL_MSG(
"Unhandled SIM_MODEL type in SIM_MODEL_SOURCE" );
416 static std::vector<SIM_MODEL::PARAM::INFO>
empty;
423 const std::string& aUnit )
425 std::vector<PARAM::INFO> paramInfos;
426 PARAM::INFO paramInfo;
428 paramInfo.name =
"dc";
430 paramInfo.unit = aUnit;
431 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
432 paramInfo.defaultValue =
"0";
433 paramInfo.description =
"DC value";
434 paramInfos.push_back( paramInfo );
443 const std::string& aUnit )
445 std::vector<PARAM::INFO> paramInfos;
446 PARAM::INFO paramInfo;
448 paramInfo.name =
"dc";
450 paramInfo.unit = aUnit;
451 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
452 paramInfo.defaultValue =
"";
453 paramInfo.description =
"DC offset";
454 paramInfos.push_back( paramInfo );
456 paramInfo.name =
"ampl";
458 paramInfo.unit = aUnit;
459 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
460 paramInfo.defaultValue =
"";
461 paramInfo.description =
"Amplitude";
462 paramInfos.push_back( paramInfo );
464 paramInfo.name =
"f";
466 paramInfo.unit =
"Hz";
467 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
468 paramInfo.defaultValue =
"1/tstop";
469 paramInfo.description =
"Frequency";
470 paramInfos.push_back( paramInfo );
472 paramInfo.name =
"td";
474 paramInfo.unit =
"s";
475 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
476 paramInfo.defaultValue =
"0";
477 paramInfo.description =
"Delay";
478 paramInfos.push_back( paramInfo );
480 paramInfo.name =
"theta";
482 paramInfo.unit =
"1/s";
483 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
484 paramInfo.defaultValue =
"0";
485 paramInfo.description =
"Damping factor";
486 paramInfos.push_back( paramInfo );
488 paramInfo.name =
"phase";
490 paramInfo.unit =
"°";
491 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
492 paramInfo.defaultValue =
"0";
493 paramInfo.description =
"Phase";
494 paramInfos.push_back( paramInfo );
503 const std::string& aUnit )
505 std::vector<PARAM::INFO> paramInfos;
506 PARAM::INFO paramInfo;
508 paramInfo.name = aPrefix +
"1";
510 paramInfo.unit = aUnit;
511 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
512 paramInfo.defaultValue =
"";
513 paramInfo.description =
"Initial value";
514 paramInfos.push_back( paramInfo );
516 paramInfo.name = aPrefix +
"2";
518 paramInfo.unit = aUnit;
519 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
520 paramInfo.defaultValue =
"";
521 paramInfo.description =
"Pulsed value";
522 paramInfos.push_back( paramInfo );
524 paramInfo.name =
"td";
526 paramInfo.unit =
"s";
527 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
528 paramInfo.defaultValue =
"0";
529 paramInfo.description =
"Delay";
530 paramInfos.push_back( paramInfo );
532 paramInfo.name =
"tr";
534 paramInfo.unit =
"s";
535 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
536 paramInfo.defaultValue =
"tstep";
537 paramInfo.description =
"Rise time";
538 paramInfos.push_back( paramInfo );
540 paramInfo.name =
"tf";
542 paramInfo.unit =
"s";
543 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
544 paramInfo.defaultValue =
"tstep";
545 paramInfo.description =
"Fall time";
546 paramInfos.push_back( paramInfo );
548 paramInfo.name =
"tw";
550 paramInfo.unit =
"s";
551 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
552 paramInfo.defaultValue =
"tstop";
553 paramInfo.description =
"Pulse width";
554 paramInfos.push_back( paramInfo );
556 paramInfo.name =
"per";
558 paramInfo.unit =
"s";
559 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
560 paramInfo.defaultValue =
"tstop";
561 paramInfo.description =
"Period";
562 paramInfos.push_back( paramInfo );
564 paramInfo.name =
"np";
567 paramInfo.category = PARAM::CATEGORY::PRINCIPAL;
568 paramInfo.defaultValue =
"";
569 paramInfo.description =
"Number of pulses";
570 paramInfos.push_back( paramInfo );
579 const std::string& aUnit )
581 std::vector<PARAM::INFO> paramInfos;
582 PARAM::INFO paramInfo;
584 paramInfo.name = aPrefix +
"1";
586 paramInfo.unit = aUnit;
587 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
588 paramInfo.defaultValue =
"";
589 paramInfo.description =
"Initial value";
590 paramInfos.push_back( paramInfo );
592 paramInfo.name = aPrefix +
"2";
594 paramInfo.unit = aUnit;
595 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
596 paramInfo.defaultValue =
"";
597 paramInfo.description =
"Pulsed value";
598 paramInfos.push_back( paramInfo );
600 paramInfo.name =
"td1";
602 paramInfo.unit =
"s";
603 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
604 paramInfo.defaultValue =
"0";
605 paramInfo.description =
"Rise delay time";
606 paramInfos.push_back( paramInfo );
608 paramInfo.name =
"tau1";
610 paramInfo.unit =
"s";
611 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
612 paramInfo.defaultValue =
"tstep";
613 paramInfo.description =
"Rise time constant";
614 paramInfos.push_back( paramInfo );
616 paramInfo.name =
"td2";
618 paramInfo.unit =
"s";
619 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
620 paramInfo.defaultValue =
"td1+tstep";
621 paramInfo.description =
"Fall delay time";
622 paramInfos.push_back( paramInfo );
624 paramInfo.name =
"tau2";
626 paramInfo.unit =
"s";
627 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
628 paramInfo.defaultValue =
"tstep";
629 paramInfo.description =
"Fall time constant";
630 paramInfos.push_back( paramInfo );
639 const std::string& aUnit )
641 std::vector<PARAM::INFO> paramInfos;
642 PARAM::INFO paramInfo;
644 paramInfo.name =
"vo";
646 paramInfo.unit = aUnit;
647 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
648 paramInfo.defaultValue =
"";
649 paramInfo.description =
"Overall offset";
650 paramInfos.push_back( paramInfo );
652 paramInfo.name =
"vmo";
654 paramInfo.unit = aUnit;
655 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
656 paramInfo.defaultValue =
"";
657 paramInfo.description =
"Modulation signal offset";
658 paramInfos.push_back( paramInfo );
660 paramInfo.name =
"vma";
662 paramInfo.unit = aUnit;
663 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
664 paramInfo.defaultValue =
"";
665 paramInfo.description =
"Modulation signal amplitude";
666 paramInfos.push_back( paramInfo );
668 paramInfo.name =
"fm";
670 paramInfo.unit =
"Hz";
671 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
672 paramInfo.defaultValue =
"5/tstop";
673 paramInfo.description =
"Modulation signal frequency";
674 paramInfos.push_back( paramInfo );
676 paramInfo.name =
"fc";
678 paramInfo.unit =
"Hz";
679 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
680 paramInfo.defaultValue =
"500/tstop";
681 paramInfo.description =
"Carrier signal frequency";
682 paramInfos.push_back( paramInfo );
684 paramInfo.name =
"td";
686 paramInfo.unit =
"s";
687 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
688 paramInfo.defaultValue =
"0";
689 paramInfo.description =
"Overall delay";
690 paramInfos.push_back( paramInfo );
692 paramInfo.name =
"phasem";
694 paramInfo.unit =
"°";
695 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
696 paramInfo.defaultValue =
"0";
697 paramInfo.description =
"Modulation signal phase";
698 paramInfos.push_back( paramInfo );
700 paramInfo.name =
"phasec";
702 paramInfo.unit =
"°";
703 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
704 paramInfo.defaultValue =
"0";
705 paramInfo.description =
"Carrier signal phase";
706 paramInfos.push_back( paramInfo );
715 const std::string& aUnit )
717 std::vector<PARAM::INFO> paramInfos;
718 PARAM::INFO paramInfo;
720 paramInfo.name =
"vo";
722 paramInfo.unit = aUnit;
723 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
724 paramInfo.defaultValue =
"";
725 paramInfo.description =
"DC offset";
726 paramInfos.push_back( paramInfo );
728 paramInfo.name =
"va";
730 paramInfo.unit = aUnit;
731 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
732 paramInfo.defaultValue =
"";
733 paramInfo.description =
"Amplitude";
734 paramInfos.push_back( paramInfo );
736 paramInfo.name =
"fm";
738 paramInfo.unit =
"Hz";
739 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
740 paramInfo.defaultValue =
"5/tstop";
741 paramInfo.description =
"Modulating frequency";
742 paramInfos.push_back( paramInfo );
744 paramInfo.name =
"mdi";
747 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
748 paramInfo.defaultValue =
"";
749 paramInfo.description =
"Modulation index";
750 paramInfos.push_back( paramInfo );
752 paramInfo.name =
"fc";
754 paramInfo.unit =
"Hz";
755 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
756 paramInfo.defaultValue =
"500/tstop";
757 paramInfo.description =
"Carrier frequency";
758 paramInfos.push_back( paramInfo );
760 paramInfo.name =
"phasem";
762 paramInfo.unit =
"°";
763 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
764 paramInfo.defaultValue =
"0";
765 paramInfo.description =
"Modulating signal phase";
766 paramInfos.push_back( paramInfo );
768 paramInfo.name =
"phasec";
770 paramInfo.unit =
"°";
771 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
772 paramInfo.defaultValue =
"0";
773 paramInfo.description =
"Carrier signal phase";
774 paramInfos.push_back( paramInfo );
784 std::vector<PARAM::INFO> paramInfos;
785 PARAM::INFO paramInfo;
787 paramInfo.name =
"gain";
790 paramInfo.unit = aGainUnit;
791 paramInfo.description =
"Gain";
792 paramInfos.push_back( paramInfo );
794 paramInfo.name =
"control";
798 paramInfo.description =
"Controlling voltage source";
799 paramInfos.push_back( paramInfo );
807 std::vector<PARAM::INFO> paramInfos;
808 PARAM::INFO paramInfo;
810 paramInfo.name =
"gain";
813 paramInfo.unit = aGainUnit;
814 paramInfo.description =
"Gain";
815 paramInfos.push_back( paramInfo );
822 const std::string& aQuantity,
823 const std::string& aUnit )
825 std::vector<PARAM::INFO> paramInfos;
826 PARAM::INFO paramInfo;
828 paramInfo.name =
"pwl";
830 paramInfo.unit =
"s," + aUnit;
831 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
832 paramInfo.defaultValue =
"";
833 paramInfo.description = aUnit ==
"V" ?
"Time-voltage points" :
"Time-current points";
834 paramInfos.push_back( paramInfo );
897 const std::string& aUnit )
899 std::vector<PARAM::INFO> paramInfos;
900 PARAM::INFO paramInfo;
902 paramInfo.name =
"rms";
904 paramInfo.unit = aUnit;
905 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
906 paramInfo.defaultValue =
"0";
907 paramInfo.description =
"White noise RMS amplitude";
908 paramInfos.push_back( paramInfo );
910 paramInfo.name =
"dt";
912 paramInfo.unit =
"s";
913 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
914 paramInfo.defaultValue =
"0";
915 paramInfo.description =
"Time step";
916 paramInfos.push_back( paramInfo );
925 const std::string& aUnit )
927 std::vector<PARAM::INFO> paramInfos;
928 PARAM::INFO paramInfo;
930 paramInfo.name =
"rms";
933 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
934 paramInfo.defaultValue =
"0";
935 paramInfo.description =
"1/f noise RMS amplitude";
936 paramInfos.push_back( paramInfo );
938 paramInfo.name =
"slope";
941 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
942 paramInfo.defaultValue =
"1";
943 paramInfo.description =
"1/f noise exponent";
944 paramInfos.push_back( paramInfo );
946 paramInfo.name =
"dt";
948 paramInfo.unit =
"s";
949 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
950 paramInfo.defaultValue =
"0";
951 paramInfo.description =
"Time step";
952 paramInfos.push_back( paramInfo );
961 const std::string& aUnit )
963 std::vector<PARAM::INFO> paramInfos;
964 PARAM::INFO paramInfo;
966 paramInfo.name =
"ampl";
968 paramInfo.unit = aUnit;
969 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
970 paramInfo.defaultValue =
"0";
971 paramInfo.description =
"Burst noise amplitude";
972 paramInfos.push_back( paramInfo );
974 paramInfo.name =
"tcapt";
976 paramInfo.unit =
"s";
977 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
978 paramInfo.defaultValue =
"0";
979 paramInfo.description =
"Burst noise trap capture time";
980 paramInfos.push_back( paramInfo );
982 paramInfo.name =
"temit";
984 paramInfo.unit =
"s";
985 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
986 paramInfo.defaultValue =
"0";
987 paramInfo.description =
"Burst noise trap emission time";
988 paramInfos.push_back( paramInfo );
997 const std::string& aUnit )
999 std::vector<PARAM::INFO> paramInfos;
1000 PARAM::INFO paramInfo;
1002 paramInfo.name =
"ts";
1004 paramInfo.unit =
"s";
1005 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1006 paramInfo.defaultValue =
"";
1007 paramInfo.description =
"Individual voltage duration";
1008 paramInfos.push_back( paramInfo );
1010 paramInfo.name =
"td";
1012 paramInfo.unit =
"s";
1013 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1014 paramInfo.defaultValue =
"0";
1015 paramInfo.description =
"Delay";
1016 paramInfos.push_back( paramInfo );
1018 paramInfo.name =
"range";
1020 paramInfo.unit = aUnit;
1021 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1022 paramInfo.defaultValue =
"1";
1023 paramInfo.description =
"Range";
1024 paramInfos.push_back( paramInfo );
1026 paramInfo.name =
"offset";
1028 paramInfo.unit = aUnit;
1029 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1030 paramInfo.defaultValue =
"0";
1031 paramInfo.description =
"Offset";
1032 paramInfos.push_back( paramInfo );
1041 const std::string& aUnit )
1043 std::vector<PARAM::INFO> paramInfos;
1044 PARAM::INFO paramInfo;
1046 paramInfo.name =
"ts";
1048 paramInfo.unit =
"s";
1049 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1050 paramInfo.defaultValue =
"";
1051 paramInfo.description =
"Individual voltage duration";
1052 paramInfos.push_back( paramInfo );
1054 paramInfo.name =
"td";
1056 paramInfo.unit =
"s";
1057 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1058 paramInfo.defaultValue =
"0";
1059 paramInfo.description =
"Delay";
1060 paramInfos.push_back( paramInfo );
1062 paramInfo.name =
"stddev";
1064 paramInfo.unit = aUnit;
1065 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1066 paramInfo.defaultValue =
"1";
1067 paramInfo.description =
"Standard deviation";
1068 paramInfos.push_back( paramInfo );
1070 paramInfo.name =
"mean";
1072 paramInfo.unit = aUnit;
1073 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1074 paramInfo.defaultValue =
"0";
1075 paramInfo.description =
"Mean";
1076 paramInfos.push_back( paramInfo );
1085 const std::string& aUnit )
1087 std::vector<PARAM::INFO> paramInfos;
1088 PARAM::INFO paramInfo;
1090 paramInfo.name =
"ts";
1092 paramInfo.unit =
"s";
1093 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1094 paramInfo.defaultValue =
"";
1095 paramInfo.description =
"Individual voltage duration";
1096 paramInfos.push_back( paramInfo );
1098 paramInfo.name =
"td";
1100 paramInfo.unit =
"s";
1101 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1102 paramInfo.defaultValue =
"0";
1103 paramInfo.description =
"Delay";
1104 paramInfos.push_back( paramInfo );
1106 paramInfo.name =
"mean";
1108 paramInfo.unit = aUnit;
1109 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1110 paramInfo.defaultValue =
"1";
1111 paramInfo.description =
"Mean";
1112 paramInfos.push_back( paramInfo );
1114 paramInfo.name =
"offset";
1116 paramInfo.unit = aUnit;
1117 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1118 paramInfo.defaultValue =
"0";
1119 paramInfo.description =
"Offset";
1120 paramInfos.push_back( paramInfo );
1129 const std::string& aUnit )
1131 std::vector<PARAM::INFO> paramInfos;
1132 PARAM::INFO paramInfo;
1134 paramInfo.name =
"ts";
1136 paramInfo.unit =
"s";
1137 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1138 paramInfo.defaultValue =
"";
1139 paramInfo.description =
"Individual voltage duration";
1140 paramInfos.push_back( paramInfo );
1142 paramInfo.name =
"td";
1144 paramInfo.unit =
"s";
1145 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1146 paramInfo.defaultValue =
"0";
1147 paramInfo.description =
"Delay";
1148 paramInfos.push_back( paramInfo );
1150 paramInfo.name =
"lambda";
1152 paramInfo.unit = aUnit;
1153 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1154 paramInfo.defaultValue =
"1";
1155 paramInfo.description =
"Lambda";
1156 paramInfos.push_back( paramInfo );
1158 paramInfo.name =
"offset";
1160 paramInfo.unit = aUnit;
1161 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::PRINCIPAL;
1162 paramInfo.defaultValue =
"0";
1163 paramInfo.description =
"Offset";
1164 paramInfos.push_back( paramInfo );
1173 PARAM::INFO paramInfo;
1175 paramInfo.name =
"ac";
1177 paramInfo.unit = aUnit;
1178 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
1179 paramInfo.defaultValue =
"0";
1180 paramInfo.description =
"AC magnitude";
1181 aParamInfos.push_back( paramInfo );
1183 paramInfo.name =
"ph";
1185 paramInfo.unit =
"°";
1186 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::AC;
1187 paramInfo.defaultValue =
"0";
1188 paramInfo.description =
"AC phase";
1189 aParamInfos.push_back( paramInfo );
1193 const std::string& aUnit )
1195 PARAM::INFO paramInfo;
1197 if( !strcmp( aUnit.c_str(),
"V" ) )
1199 paramInfo.name =
"portnum";
1201 paramInfo.unit =
"";
1202 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::S_PARAM;
1203 paramInfo.defaultValue =
"";
1204 paramInfo.description =
"Port number";
1205 aParamInfos.push_back( paramInfo );
1207 paramInfo.name =
"z0";
1209 paramInfo.unit =
"Ohm";
1210 paramInfo.category = SIM_MODEL::PARAM::CATEGORY::S_PARAM;
1211 paramInfo.defaultValue =
"";
1212 paramInfo.description =
"Internal impedance";
1213 aParamInfos.push_back( paramInfo );
1221 return {
"+",
"-",
"C+",
"C-" };
1223 return {
"+",
"-" };
1230 case SIM_MODEL::TYPE::V:
1231 case SIM_MODEL::TYPE::I:
return &
GetParam( 0 );
break;
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
const PARAM * FindParam(const std::string &aParamName) 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)
SPICE_INFO GetSpiceInfo() const
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