Skip to content

Commit

Permalink
Added days, weeks, years. Rehashed.
Browse files Browse the repository at this point in the history
  • Loading branch information
DFPercush committed Jun 8, 2020
1 parent d4896c3 commit 6482412
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
6 changes: 5 additions & 1 deletion src/PhysicalUnitDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,14 @@ DEFINE_CONST_ARRAY(PhysicalQuantity::UnitDefinition, PhysicalQuantity::KnownUnit
// Ma Di Ti Te Cu

// Time
{UN("s", "second","seconds"),1, {0,0,1,0,0}}, //, NOPREFIX},
{UN("s", "second","seconds"),1, {0,0,1,0,0}},
{UN("min", "minute","minutes"),60, {0,0,1,0,0}, NOPREFIX},
{UN("hr", "hour","hours"),3600, {0,0,1,0,0}, NOPREFIX},
{UN("h", "hour","hours"),3600, {0,0,1,0,0}, NOPREFIX},
{UN("d", "day","days"),3600*24, {0,0,1,0,0}, NOPREFIX},
{UN("w", "week","weeks"),3600*24*7, {0,0,1,0,0}, NOPREFIX | EXPLICIT},
{UN("y", "year","years"),3600*24*365.25, {0,0,1,0,0}, NOPREFIX},


{UN("Hz", "hertz","hertz"),1, {0,0,-1,0,0}},
// TODO: Angle flag
Expand Down
17 changes: 10 additions & 7 deletions src/hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ typedef PhysicalQuantity::CSubString csubstr;
const size_t PhysicalQuantity::defaultHashSeed = 8;

#ifdef PQ_GENCODE
const int PhysicalQuantity::default_hashTableSize_UnitSymbols = 233;
const int PhysicalQuantity::defaultHashSeed_UnitSymbols = 18;
const int PhysicalQuantity::default_hashTableSize_UnitLongNames = 80;
const int PhysicalQuantity::defaultHashSeed_UnitLongNames = 202;
const int PhysicalQuantity::default_hashTableSize_UnitPlurals = 123;
const int PhysicalQuantity::defaultHashSeed_UnitPlurals = 85;
const int PhysicalQuantity::default_hashTableSize_UnitSymbols = 110;
const int PhysicalQuantity::defaultHashSeed_UnitSymbols = 229;

const int PhysicalQuantity::default_hashTableSize_UnitLongNames = 108;
const int PhysicalQuantity::defaultHashSeed_UnitLongNames = 181;

const int PhysicalQuantity::default_hashTableSize_UnitPlurals = 117;
const int PhysicalQuantity::defaultHashSeed_UnitPlurals = 177;

const int PhysicalQuantity::default_hashTableSize_PrefixSymbols = 14;
const int PhysicalQuantity::defaultHashSeed_PrefixSymbols = 6;
const int PhysicalQuantity::defaultHashSeed_PrefixSymbols = 2;
#endif


Expand Down

0 comments on commit 6482412

Please sign in to comment.