39 std::vector<SCH_PIN*> pins;
43 model->SetParamValue(
"pwl", aPwlValue );
50 return model->SpiceGenerator().ItemLine( item );
60 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1 1 2 0" );
62 BOOST_CHECK( out.find(
"PWL(" ) != std::string::npos );
63 BOOST_CHECK( out.find(
"0 0 1 1 2 0" ) != std::string::npos );
70 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1u 0 2u 1" );
72 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
73 BOOST_CHECK( out.find(
"2u" ) != std::string::npos );
74 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
80 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1m 1 2m 0" );
82 BOOST_CHECK( out.find(
"1m" ) != std::string::npos );
83 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
90 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1M 1" );
92 BOOST_CHECK( out.find(
"1Meg" ) != std::string::npos );
99 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 {t_start} 1" );
101 BOOST_CHECK( out.find(
"{t_start}" ) != std::string::npos );
102 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
108 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
109 "0 0 {t_rise} 1u {t_fall} 0" );
111 BOOST_CHECK( out.find(
"{t_rise}" ) != std::string::npos );
112 BOOST_CHECK( out.find(
"{t_fall}" ) != std::string::npos );
113 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
119 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::I_PWL,
120 "0 0 1u 500m {t_end} 1" );
122 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
123 BOOST_CHECK( out.find(
"500m" ) != std::string::npos );
124 BOOST_CHECK( out.find(
"{t_end}" ) != std::string::npos );
131 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
132 "0 0 {t_start + 1u} 1" );
134 BOOST_CHECK( out.find(
"{t_start + 1u}" ) != std::string::npos );
135 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
141 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
142 "0 0 {max( {t_a}, {t_b} )} 1" );
144 BOOST_CHECK( out.find(
"{max( {t_a}, {t_b} )}" ) != std::string::npos );
152 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
153 "0 0 {t_start + 1M} 1" );
155 BOOST_CHECK( out.find(
"1Meg" ) != std::string::npos );
156 BOOST_CHECK( out.find(
"1M}" ) == std::string::npos );
164 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
165 "0 0 {t_start + 1u * scale} 1" );
167 BOOST_CHECK( out.find(
"{t_start + 1u * scale}" ) != std::string::npos );
174 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
175 "0 0 {1Meg + t_start} 1" );
177 BOOST_CHECK( out.find(
"{1Meg + t_start}" ) != std::string::npos );
static std::unique_ptr< SIM_MODEL > Create(TYPE aType, const std::vector< SCH_PIN * > &aPins, REPORTER &aReporter)
std::string GeneratePwlItemLine(SIM_MODEL::TYPE aType, const std::string &aPwlValue) const
A wrapper for reporting to a wxString object.
std::vector< std::string > pinNetNames
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST_INFO("Parsed: "<< path)
BOOST_AUTO_TEST_CASE(PwlPlainNumbers)