kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #45131
Odp: Re: SPICE_VALUE behavior
Hi Wayne, Dnia 19 maja 2021 00:32 Wayne Stambaugh < stambaughw@xxxxxxxxx > napisał(a): The test cases look correct so I don't see any issues here. Could you please check again with better formatting below? Hertz is a valid SI unit, so strings: "10m" and "10mHz" are valid, but values ending with "Hzz" are invalid: Scenario: Input: Actual behavior: Expected behavior: Result: Positive 10m Value parsed correctly Value parsed correctly PASS Positive 10mHz Value parsed correctly Value parsed correctly PASS Negative 10mHzz Value parsed correctly Exception thrown FAIL Positive 10Hz Exception thrown Value parsed correctly FAIL Negative 10Hzz Exception thrown Exception thrown PASS Parsing strings in V7 wouldn't hurt, that's no problem, but the easiest solution is to reject all extra characters: Input: Actual behavior: 10m Value parsed correctly 10mHz Exception thrown 10mHzz Exception thrown 10Hz Exception thrown 10Hzz Exception thrown Best regards, Sylwester Dnia 19 maja 2021 00:32 Wayne Stambaugh < stambaughw@xxxxxxxxx > napisał(a): Hi Sylwester, I don't know that we need to support SI units in spice strings but I suppose it wouldn't hurt. That would have to wait until V7 as it is a new feature. The test cases look correct so I don't see any issues here. - Wayne On 5/18/21 2:06 PM, Sylwester Kocjan wrote: Hello! I've noticed a minor bug in SPICE_VALUE class. Could you please let me know if we should parse SI units in SPICE strings or ignore them, so I can fix it? I think ngspice accepts units like, V, I, Ohm, but this may be an overkill. The easiest solution is to ignore everything after number and prefix. See below the testcases I made on AC tab of Simulation Settings dialog: Input: Actual behavior: Expected behavior: 10m Value parsed correctly Value parsed correctly 10mHz Value parsed correctly Value parsed correctly 10mHzz Value parsed correctly Exception thrown 10Hz Exception thrown Value parsed correctly 10Hzz Exception thrown Exception thrown Best regards, Sylwester ______________________________ Mailing list: launchpad.net launchpad.net Post to : kicad-developers@lists.launchp Unsubscribe : launchpad.net launchpad.net More help : help.launchpad.net help.launchpad.net ______________________________ Mailing list: launchpad.net launchpad.net Post to : kicad-developers@lists.launchp Unsubscribe : launchpad.net launchpad.net More help : help.launchpad.net help.launchpad.net
Follow ups
References