35 std::vector<SCH_PIN*> pins;
39 model->SetParamValue(
"pwl", aPwlValue );
46 return model->SpiceGenerator().ItemLine( item );
56 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1 1 2 0" );
58 BOOST_CHECK( out.find(
"PWL(" ) != std::string::npos );
59 BOOST_CHECK( out.find(
"0 0 1 1 2 0" ) != std::string::npos );
66 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1u 0 2u 1" );
68 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
69 BOOST_CHECK( out.find(
"2u" ) != std::string::npos );
70 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
76 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1m 1 2m 0" );
78 BOOST_CHECK( out.find(
"1m" ) != std::string::npos );
79 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
86 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 1M 1" );
88 BOOST_CHECK( out.find(
"1Meg" ) != std::string::npos );
95 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
"0 0 {t_start} 1" );
97 BOOST_CHECK( out.find(
"{t_start}" ) != std::string::npos );
98 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
104 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
105 "0 0 {t_rise} 1u {t_fall} 0" );
107 BOOST_CHECK( out.find(
"{t_rise}" ) != std::string::npos );
108 BOOST_CHECK( out.find(
"{t_fall}" ) != std::string::npos );
109 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
115 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::I_PWL,
116 "0 0 1u 500m {t_end} 1" );
118 BOOST_CHECK( out.find(
"1u" ) != std::string::npos );
119 BOOST_CHECK( out.find(
"500m" ) != std::string::npos );
120 BOOST_CHECK( out.find(
"{t_end}" ) != std::string::npos );
127 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
128 "0 0 {t_start + 1u} 1" );
130 BOOST_CHECK( out.find(
"{t_start + 1u}" ) != std::string::npos );
131 BOOST_CHECK( out.find(
"PWL( )" ) == std::string::npos );
137 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
138 "0 0 {max( {t_a}, {t_b} )} 1" );
140 BOOST_CHECK( out.find(
"{max( {t_a}, {t_b} )}" ) != std::string::npos );
148 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
149 "0 0 {t_start + 1M} 1" );
151 BOOST_CHECK( out.find(
"1Meg" ) != std::string::npos );
152 BOOST_CHECK( out.find(
"1M}" ) == std::string::npos );
160 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
161 "0 0 {t_start + 1u * scale} 1" );
163 BOOST_CHECK( out.find(
"{t_start + 1u * scale}" ) != std::string::npos );
170 const std::string out = GeneratePwlItemLine( SIM_MODEL::TYPE::V_PWL,
171 "0 0 {1Meg + t_start} 1" );
173 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()
IbisParser parser & reporter
BOOST_TEST_INFO("Two-port Series .op current = "<< iDevice)
BOOST_AUTO_TEST_CASE(PwlPlainNumbers)