Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: bidirectional AWG/mm2 unit conversion #41

Merged
merged 7 commits into from
Jun 29, 2020

Commits on Jun 28, 2020

  1. Merge branch 'dev'

    formatc1702 committed Jun 28, 2020
    Configuration menu
    Copy the full SHA
    4aac32b View commit details
    Browse the repository at this point in the history
  2. Merge branch 'dev'

    formatc1702 committed Jun 28, 2020
    Configuration menu
    Copy the full SHA
    8326ddd View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2020

  1. Merge branch 'dev'

    formatc1702 committed Jun 29, 2020
    Configuration menu
    Copy the full SHA
    7458118 View commit details
    Browse the repository at this point in the history
  2. Fix AWG<-> mm2 conversions

    Add an inverted dictionary and a lookup function from awg -> mm2. Also
    do some minor refactoring. Both sides of the conversion table were
    converted to strings, since '0000' and '2/0' are perfectly valid AWG
    values.
    n42 committed Jun 29, 2020
    Configuration menu
    Copy the full SHA
    c6d32f6 View commit details
    Browse the repository at this point in the history
  3. Update example ex02 with awg -> mm2 conversion

    Show conversions for ex02, and make sure it displays conversions in both
    directions. Rebuild the example files.
    n42 committed Jun 29, 2020
    Configuration menu
    Copy the full SHA
    2b307b0 View commit details
    Browse the repository at this point in the history
  4. Fix faulty conversion of non-(mm2,AWG) units

    The parsing allows arbitrary units to be used for cable dimensions --
    this might be valid units, e.g. square inches, or invalid, e.g. bananas.
    We only allow conversion between mm2 and AWG, so check that the
    gauge_unit is either of those before conversion. If not, pass through as
    is.
    n42 committed Jun 29, 2020
    Configuration menu
    Copy the full SHA
    625b21e View commit details
    Browse the repository at this point in the history
  5. Fix AWG string casing in output

    Convert e.g. 'awg, 'AwG' to upper case for consistent rendering. Leave
    any other input gauge units as they were.
    n42 committed Jun 29, 2020
    Configuration menu
    Copy the full SHA
    6de215e View commit details
    Browse the repository at this point in the history