Compare commits
93 Commits
efda5b3029
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 858189d6da | |||
| ec42ebcb25 | |||
| f4629e5fcc | |||
| dafe4c5336 | |||
| 5439d5111a | |||
| 1e5ef47a4d | |||
| 2b87c67876 | |||
| 0db90c0e4b | |||
| 1e07093101 | |||
| ce25ee930a | |||
| a293e0286a | |||
| 012b8a7ff6 | |||
|
|
9610e7138d | ||
| d5d078413c | |||
| 17662ef7cb | |||
| 9d8da15d0e | |||
| d503cf5dc9 | |||
|
|
48a227d519 | ||
| f653a1e98c | |||
|
|
1725c5b0e9 | ||
|
|
d7cb8e1072 | ||
| 9b7a8ae2c8 | |||
|
|
dc50432ee8 | ||
|
|
c99d24e4c6 | ||
|
|
f9d1348fd0 | ||
|
|
428c611ec6 | ||
| 2fb73e6713 | |||
|
|
cffbd51d92 | ||
|
|
de0b947c56 | ||
|
|
d99561fa80 | ||
|
|
44033da15d | ||
| 3886277616 | |||
| 83018fabe0 | |||
| e72579e5d0 | |||
| 0fb42865ff | |||
| b2b811e802 | |||
| bde2dcf7d8 | |||
| 76570280bc | |||
| d7017b5d33 | |||
| f93603c182 | |||
| c261335df5 | |||
| a41f053d5d | |||
| 8d7d98f126 | |||
| 3f90685834 | |||
| efc97d6cd1 | |||
|
|
d72bfd5560 | ||
| 6d30e25daa | |||
| 16e202e841 | |||
|
|
241ed1d3cb | ||
| 3876f86530 | |||
| 56be0f1840 | |||
|
|
a30f2c90f4 | ||
| 302e122387 | |||
|
|
50f99fa642 | ||
| 494a688583 | |||
| c512c96636 | |||
|
|
eb15da2a63 | ||
| 6dcd3c3d26 | |||
| 958ec2269c | |||
|
|
83ca429bf5 | ||
|
|
222d0f56fc | ||
|
|
e1c6124cf0 | ||
|
|
e87f9da4bf | ||
| 0bccad05f8 | |||
| 7191e57aea | |||
| aec2d3692d | |||
|
|
7061d6a539 | ||
| 71643375fc | |||
|
|
2540d19b76 | ||
| f13ee68938 | |||
| 475caa90db | |||
| 9aa38f9000 | |||
| 4a6273b037 | |||
| 8c9301b128 | |||
| 30908365ba | |||
| 7cdfc87c83 | |||
| 839ae2f3da | |||
| 950ca2b6b4 | |||
| 0a9d4b1dda | |||
|
|
4665949c88 | ||
|
|
a2018509ef | ||
|
|
5ca7889af1 | ||
|
|
73f518ecc7 | ||
|
|
63c5463160 | ||
|
|
fe9a2c0e7c | ||
|
|
3198690a81 | ||
|
|
9e74f850c5 | ||
|
|
d409e16cc4 | ||
|
|
dbc36c2f57 | ||
|
|
08487ae280 | ||
|
|
26ed170932 | ||
|
|
bc9e3cda90 | ||
|
|
fda8cb33db |
98
LICENSE
98
LICENSE
@@ -1,9 +1,97 @@
|
|||||||
MIT License
|
OPENBARE LICENTIE VAN DE EUROPESE UNIE v. 1.2.
|
||||||
|
EUPL © Europese Unie 2007, 2016
|
||||||
|
Deze openbare licentie van de Europese Unie („EUPL”) is van toepassing op het werk (zoals hieronder gedefinieerd) dat onder de voorwaarden van deze licentie wordt verstrekt. Elk gebruik van het werk dat niet door deze licentie is toegestaan, is verboden (voor zover dit gebruik valt onder een recht van de houder van het auteursrecht op het werk). Het werk wordt verstrekt onder de voorwaarden van deze licentie wanneer de licentiegever (zoals hieronder gedefinieerd), direct volgend op de kennisgeving inzake het auteursrecht op het werk, de volgende kennisgeving opneemt:
|
||||||
|
In licentie gegeven krachtens de EUPL
|
||||||
|
of op een andere wijze zijn bereidheid te kennen heeft gegeven krachtens de EUPL in licentie te geven.
|
||||||
|
|
||||||
Copyright (c) 2025 RnD
|
1.Definities
|
||||||
|
In deze licentie wordt verstaan onder:
|
||||||
|
— „de licentie”:de onderhavige licentie;
|
||||||
|
— „het oorspronkelijke werk”:het werk dat of de software die door de licentiegever krachtens deze licentie wordt verspreid of medegedeeld, en dat/die beschikbaar is als broncode en, in voorkomend geval, ook als uitvoerbare code;
|
||||||
|
— „bewerkingen”:de werken of software die de licentiehouder kan creëren op grond van het oorspronkelijke werk of wijzigingen ervan. In deze licentie wordt niet gedefinieerd welke mate van wijziging of afhankelijkheid van het oorspronkelijke werk vereist is om een werk als een bewerking te kunnen aanmerken; dat wordt bepaald conform het auteursrecht dat van toepassing is in de in artikel 15 bedoelde staat;
|
||||||
|
— „het werk”:het oorspronkelijke werk of de bewerkingen ervan;
|
||||||
|
— „de broncode”:de voor mensen leesbare vorm van het werk, die het gemakkelijkste door mensen kan worden bestudeerd en gewijzigd;
|
||||||
|
— „de uitvoerbare code”:elke code die over het algemeen is gecompileerd en is bedoeld om door een computer als een programma te worden uitgevoerd;
|
||||||
|
— „de licentiegever”:de natuurlijke of rechtspersoon die het werk krachtens de licentie verspreidt of mededeelt;
|
||||||
|
— „bewerker(s)”:elke natuurlijke of rechtspersoon die het werk krachtens de licentie wijzigt of op een andere wijze bijdraagt tot de totstandkoming van een bewerking;
|
||||||
|
— „de licentiehouder” of „u”:elke natuurlijke of rechtspersoon die het werk onder de voorwaarden van de licentie gebruikt; — „verspreiding” of „mededeling”:het verkopen, geven, uitlenen, verhuren, verspreiden, mededelen, doorgeven, of op een andere wijze online of offline beschikbaar stellen van kopieën van het werk of het verlenen van toegang tot de essentiële functies ervan ten behoeve van andere natuurlijke of rechtspersonen.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2.Draagwijdte van de uit hoofde van de licentie verleende rechten
|
||||||
|
De licentiegever verleent u hierbij een wereldwijde, royaltyvrije, niet-exclusieve, voor een sublicentie in aanmerking komende licentie, om voor de duur van het aan het oorspronkelijke werk verbonden auteursrecht, het volgende te doen:
|
||||||
|
— het werk in alle omstandigheden en voor ongeacht welk doel te gebruiken;
|
||||||
|
— het werk te verveelvoudigen;
|
||||||
|
— het werk te wijzigen en op grond van het werk bewerkingen te ontwikkelen;
|
||||||
|
— het werk aan het publiek mede te delen, waaronder het recht om het werk of kopieën ervan aan het publiek ter beschikking te stellen of te vertonen, en het werk, in voorkomend geval, in het openbaar uit te voeren;
|
||||||
|
— het werk of kopieën ervan te verspreiden;
|
||||||
|
— het werk of kopieën ervan uit te lenen en te verhuren;
|
||||||
|
— de rechten op het werk of op kopieën ervan in sublicentie te geven.
|
||||||
|
Deze rechten kunnen worden uitgeoefend met gebruikmaking van alle thans bekende of nog uit te vinden media, dragers en formaten, voor zover het toepasselijke recht dit toestaat. In de landen waar immateriële rechten van toepassing zijn, doet de licentiegever afstand van zijn recht op uitoefening van zijn immateriële rechten in de mate die door het toepasselijke recht wordt toegestaan teneinde een doeltreffende uitoefening van de bovenvermelde in licentie gegeven economische rechten mogelijk te maken. De licentiegever verleent de licentiehouder een royaltyvrij, niet-exclusief gebruiksrecht op alle octrooien van de licentiegever, voor zover dit noodzakelijk is om de uit hoofde van deze licentie verleende rechten op het werk te gebruiken.
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
3.Mededeling van de broncode
|
||||||
|
De licentiegever kan het werk verstrekken in zijn broncode of als uitvoerbare code. Indien het werk als uitvoerbare code wordt verstrekt, verstrekt de licentiegever bij elke door hem verspreide kopie van het werk tevens een machinaal leesbare kopie van de broncode van het werk of geeft hij in een mededeling, volgende op de bij het werk gevoegde auteursrechtelijke kennisgeving, de plaats aan waar de broncode gemakkelijk en vrij toegankelijk is, zolang de licentiegever het werk blijft verspreiden of mededelen.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
4.Beperkingen van het auteursrecht
|
||||||
|
Geen enkele bepaling in deze licentie heeft ten doel de licentiehouder het recht te ontnemen een beroep te doen op een uitzondering op of een beperking van de exclusieve rechten van de rechthebbenden op het werk, of op de uitputting van die rechten of andere toepasselijke beperkingen daarvan.
|
||||||
|
|
||||||
|
5.Verplichtingen van de licentiehouder
|
||||||
|
De verlening van de bovenvermelde rechten is onderworpen aan een aantal aan de licentiehouder opgelegde beperkingen en verplichtingen. Het gaat om de onderstaande verplichtingen.
|
||||||
|
|
||||||
|
Attributierecht: de licentiehouder moet alle auteurs-, octrooi- of merkenrechtelijke kennisgevingen onverlet laten alsook alle kennisgevingen die naar de licentie en de afwijzing van garanties verwijzen. De licentiehouder moet een afschrift van deze kennisgevingen en een afschrift van de licentie bij elke kopie van het werk voegen die hij verspreidt of mededeelt. De licentiehouder moet in elke bewerking duidelijk aangeven dat het werk is gewijzigd, en eveneens de datum van wijziging vermelden.
|
||||||
|
|
||||||
|
Copyleftclausule: wanneer de licentiehouder kopieën van het oorspronkelijke werk of bewerkingen verspreidt of mededeelt, geschiedt die verspreiding of mededeling onder de voorwaarden van deze licentie of van een latere versie van deze licentie, tenzij het oorspronkelijke werk uitdrukkelijk alleen onder deze versie van de licentie wordt verspreid — bijvoorbeeld door de mededeling „alleen EUPL v. 1.2”. De licentiehouder (die licentiegever wordt) kan met betrekking tot het werk of de bewerkingen geen aanvullende bepalingen of voorwaarden opleggen of stellen die de voorwaarden van de licentie wijzigen of beperken.
|
||||||
|
|
||||||
|
Verenigbaarheidsclausule: wanneer de licentiehouder bewerkingen of kopieën ervan verspreidt of mededeelt die zijn gebaseerd op het werk en op een ander werk dat uit hoofde van een verenigbare licentie in licentie is gegeven, kan die verspreiding of mededeling geschieden onder de voorwaarden van deze verenigbare licentie. Voor de toepassing van deze clausule wordt onder „verenigbare licentie” verstaan, de licenties die in het aanhangsel bij deze licentie zijn opgesomd. Indien de verplichtingen van de licentiehouder uit hoofde van de verenigbare licentie in strijd zijn met diens verplichtingen uit hoofde van deze licentie, hebben de verplichtingen van de verenigbare licentie voorrang.
|
||||||
|
|
||||||
|
Verstrekking van de broncode: bij de verspreiding of mededeling van kopieën van het werk verstrekt de licentiehouder een machinaal leesbare kopie van de broncode of geeft hij aan waar deze broncode gemakkelijk en vrij toegankelijk is, zolang de licentiehouder het werk blijft verspreiden of mededelen.
|
||||||
|
|
||||||
|
Juridische bescherming: deze licentie verleent geen toestemming om handelsnamen, handelsmerken, dienstmerken of namen van de licentiegever te gebruiken, behalve wanneer dit op grond van een redelijk en normaal gebruik noodzakelijk is om de oorsprong van het werk te beschrijven en de inhoud van de auteursrechtelijke kennisgeving te herhalen.
|
||||||
|
|
||||||
|
6.Auteursketen
|
||||||
|
De oorspronkelijke licentiegever garandeert dat hij houder is van het hierbij verleende auteursrecht op het oorspronkelijke werk dan wel dat dit hem in licentie is gegeven en dat hij de bevoegdheid heeft de licentie te verlenen. Elke bewerker garandeert dat hij houder is van het auteursrecht op de door hem aan het werk aangebrachte wijzigingen dan wel dat dit hem in licentie is gegeven en dat hij de bevoegdheid heeft de licentie te verlenen. Telkens wanneer u de licentie aanvaardt, verlenen de oorspronkelijke licentiegever en de opeenvolgende bewerkers u een licentie op hun bijdragen aan het werk onder de voorwaarden van deze licentie.
|
||||||
|
|
||||||
|
7.Uitsluiting van garantie
|
||||||
|
Het werk is een werk in ontwikkeling, dat voortdurend door vele bewerkers wordt verbeterd. Het is een onvoltooid werk, dat bijgevolg nog tekortkomingen of programmeerfouten („bugs”) kan vertonen, die onlosmakelijk verbonden zijn met dit soort ontwikkeling. Om die reden wordt het werk op grond van de licentie verstrekt „zoals het is” en zonder enige garantie met betrekking tot het werk te geven, met inbegrip van, maar niet beperkt tot garanties met betrekking tot de verhandelbaarheid, de geschiktheid voor een specifiek doel, de afwezigheid van tekortkomingen of fouten, de nauwkeurigheid, de eerbiediging van andere intellectuele-eigendomsrechten dan het in artikel 6 van deze licentie bedoelde auteursrecht. Deze uitsluiting van garantie is een essentieel onderdeel van de licentie en een voorwaarde voor de verlening van rechten op het werk.
|
||||||
|
|
||||||
|
8.Uitsluiting van aansprakelijkheid
|
||||||
|
Behoudens in het geval van een opzettelijke fout of directe schade aan natuurlijke personen, is de licentiegever in geen enkel geval aansprakelijk voor ongeacht welke directe of indirecte, materiële of immateriële schade die voortvloeit uit de licentie of het gebruik van het werk, met inbegrip van, maar niet beperkt tot schade als gevolg van het verlies van goodwill, verloren werkuren, een computerdefect of computerfout, het verlies van gegevens, of enige andere commerciële schade, zelfs indien de licentiegever werd gewezen op de mogelijkheid van dergelijke schade. De licentiegever is echter aansprakelijk op grond van de wetgeving inzake productaansprakelijkheid, voor zover deze wetgeving op het werk van toepassing is.
|
||||||
|
|
||||||
|
9.Aanvullende overeenkomsten
|
||||||
|
Bij de verspreiding van het werk kunt u ervoor kiezen een aanvullende overeenkomst te sluiten, waarin de verplichtingen of diensten overeenkomstig deze licentie worden omschreven. Indien deze verplichtingen worden aanvaard, kunt u echter alleen in eigen naam en onder eigen verantwoordelijkheid handelen, en dus niet in naam van de oorspronkelijke licentiegever of een bewerker, en kunt u voorts alleen handelen indien u ermee instemt alle bewerkers schadeloos te stellen, te verdedigen of te vrijwaren met betrekking tot de aansprakelijkheid van of vorderingen tegen deze bewerkers op grond van het feit dat u een garantie of aanvullende aansprakelijkheid hebt aanvaard.
|
||||||
|
|
||||||
|
10.Aanvaarding van de licentie
|
||||||
|
De bepalingen van deze licentie kunnen worden aanvaard door te klikken op het pictogram „Ik ga akkoord”, dat zich bevindt onderaan het venster waarin de tekst van deze licentie is weergegeven, of door overeenkomstig de toepasselijke wetsbepalingen op een soortgelijke wijze met de licentie in te stemmen. Door op dat pictogram te klikken geeft u aan dat u deze licentie en alle voorwaarden ervan ondubbelzinnig en onherroepelijk aanvaardt. Evenzo aanvaardt u onherroepelijk deze licentie en alle voorwaarden ervan door uitoefening van de rechten die u in artikel 2 van deze licentie zijn verleend, zoals het gebruik van het werk, het creëren door u van een bewerking of de verspreiding of mededeling door u van het werk of kopieën ervan.
|
||||||
|
|
||||||
|
11.Voorlichting van het publiek
|
||||||
|
Indien u het werk verspreidt of mededeelt door middel van elektronische communicatiemiddelen (bijvoorbeeld door voor te stellen het werk op afstand te downloaden), moet het distributiekanaal of het medium (bijvoorbeeld een website) het publiek ten minste de gegevens verschaffen die door het toepasselijke recht zijn voorgeschreven met betrekking tot de licentiegever, de licentie en de wijze waarop deze kan worden geraadpleegd, gesloten, opgeslagen en gereproduceerd door de licentiehouder.
|
||||||
|
|
||||||
|
12.Einde van de licentie
|
||||||
|
De licentie en de uit hoofde daarvan verleende rechten eindigen automatisch bij elke inbreuk door de licentiehouder op de voorwaarden van de licentie. Dit einde beëindigt niet de licenties van personen die het werk van de licentiehouder krachtens de licentie hebben ontvangen, mits deze personen zich volledig aan de licentie houden.
|
||||||
|
|
||||||
|
13.Overige
|
||||||
|
Onverminderd artikel 9 vormt de licentie de gehele overeenkomst tussen de partijen met betrekking tot het werk. Indien een bepaling van de licentie volgens het toepasselijke recht ongeldig is of niet uitvoerbaar is, doet dit geen afbreuk aan de geldigheid of uitvoerbaarheid van de licentie in haar geheel. Deze bepaling dient zodanig te worden uitgelegd of gewijzigd dat zij geldig en uitvoerbaar wordt. De Europese Commissie kan, voor zover dit noodzakelijk en redelijk is, versies in andere talen of nieuwe versies van deze licentie of geactualiseerde versies van dit aanhangsel publiceren, zonder de draagwijdte van de uit hoofde van de licentie verleende rechten te beperken. Nieuwe versies van de licentie zullen worden gepubliceerd met een uniek versienummer. Alle door de Europese Commissie goedgekeurde taalversies van deze licentie hebben dezelfde waarde. De partijen kunnen zich beroepen op de taalversie van hun keuze.
|
||||||
|
|
||||||
|
14.Bevoegd gerecht
|
||||||
|
Onverminderd specifieke overeenkomsten tussen de partijen,
|
||||||
|
— vallen alle geschillen tussen de instellingen, organen en instanties van de Europese Unie, als licentiegeefster, en een licentiehouder in verband met de uitlegging van deze licentie onder de bevoegdheid van het Hof van Justitie van de Europese Unie, conform artikel 272 van het Verdrag betreffende de werking van de Europese Unie,
|
||||||
|
— vallen alle geschillen tussen andere partijen in verband met de uitlegging van deze licentie onder de uitsluitende bevoegdheid van het bevoegde gerecht van de plaats waar de licentiegever is gevestigd of zijn voornaamste activiteit uitoefent.
|
||||||
|
|
||||||
|
15.Toepasselijk recht
|
||||||
|
Onverminderd specifieke overeenkomsten tussen de partijen,
|
||||||
|
— wordt deze licentie beheerst door het recht van de lidstaat van de Europese Unie waar de licentiegever zijn statutaire zetel, verblijfplaats of hoofdkantoor heeft,
|
||||||
|
— wordt deze licentie beheerst door het Belgische recht indien de licentiegever geen statutaire zetel, verblijfplaats of hoofdkantoor heeft in een lidstaat van de Europese Unie.
|
||||||
|
|
||||||
|
|
||||||
|
Aanhangsel
|
||||||
|
„Verenigbare licenties” in de zin van artikel 5 EUPL zijn:
|
||||||
|
— GNU General Public License (GPL) v. 2, v. 3
|
||||||
|
— GNU Affero General Public License (AGPL) v. 3
|
||||||
|
— Open Software License (OSL) v. 2.1, v. 3.0
|
||||||
|
— Eclipse Public License (EPL) v. 1.0
|
||||||
|
— CeCILL v. 2.0, v. 2.1
|
||||||
|
— Mozilla Public Licence (MPL) v. 2
|
||||||
|
— GNU Lesser General Public Licence (LGPL) v. 2.1, v. 3
|
||||||
|
— Creative Commons Attribution-ShareAlike v. 3.0 Unported (CC BY-SA 3.0) voor andere werken dan software
|
||||||
|
— European Union Public Licence (EUPL) v. 1.1, v. 1.2
|
||||||
|
— Québec Free and Open-Source Licence — Reciprocity (LiLiQ-R) of Strong Reciprocity (LiLiQ-R+).
|
||||||
|
De Europese Commissie kan dit aanhangsel actualiseren in geval van latere versies van de bovengenoemde licenties zonder dat er een nieuwe EUPL-versie wordt ontwikkeld, zolang die versies de uit hoofde van artikel 2 van deze licentie verleende rechten verlenen en ze de betrokken broncode beschermen tegen exclusieve toe-eigening.
|
||||||
|
Voor alle andere wijzigingen van of aanvullingen op dit aanhangsel is de ontwikkeling van een nieuwe EUPL-versie vereist.
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
# convert
|
# convert
|
||||||
|
|
||||||
Makes unit conversions
|
Makes unit conversions
|
||||||
|
|
||||||
|
#need to make an index to fetch the helper functions properly without destroying all the links.
|
||||||
157
datasets/assetData/assetData.json
Normal file
157
datasets/assetData/assetData.json
Normal file
@@ -0,0 +1,157 @@
|
|||||||
|
{
|
||||||
|
"suppliers": [
|
||||||
|
{
|
||||||
|
"name": "Vega",
|
||||||
|
"categories": [
|
||||||
|
{
|
||||||
|
"name": "Sensor",
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"name": "Temperature",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaTemp 10",
|
||||||
|
"units": ["°C", "°F"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VegaTemp 20",
|
||||||
|
"units": ["°C", "°F"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Pressure",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaPressure 10",
|
||||||
|
"units": ["bar", "mbar", "psi"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VegaPressure 20",
|
||||||
|
"units": ["bar", "mbar", "psi"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Flow",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaFlow 10",
|
||||||
|
"units": ["m³/h", "gpm", "l/min"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VegaFlow 20",
|
||||||
|
"units": ["m³/h", "gpm", "l/min"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Level",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaLevel 10",
|
||||||
|
"units": ["m", "ft", "mm"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "VegaLevel 20",
|
||||||
|
"units": ["m", "ft", "mm"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Quantity (oxygen)",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaOxySense 10",
|
||||||
|
"units": ["g/m³", "mol/m³"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Quantity (Ammonium)",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaAmmoniaSense 10",
|
||||||
|
"units": ["g/m³", "mol/m³"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Quantity (NOx)",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaNOxSense 10",
|
||||||
|
"units": ["g/m³", "mol/m³"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Quantity (TSS)",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "VegaSolidsProbe",
|
||||||
|
"units": ["g/m³"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Hidrostal",
|
||||||
|
"categories": [
|
||||||
|
{
|
||||||
|
"name": "Pumps",
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"name": "Centrifugal",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"id": "hidrostal-pump-001",
|
||||||
|
"name": "hidrostal-H05K-S03R",
|
||||||
|
"units": ["l/s"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "hidrostal-pump-002",
|
||||||
|
"name": "hidrostal-C5-D03R-SHN1",
|
||||||
|
"units": ["l/s"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Binder Engineering",
|
||||||
|
"categories": [
|
||||||
|
{
|
||||||
|
"name": "Valves",
|
||||||
|
"types": [
|
||||||
|
{
|
||||||
|
"name": "Gate",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"id": "binder-valve-001",
|
||||||
|
"name": "ECDV",
|
||||||
|
"units": ["m³/h", "gpm", "l/min"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Jet",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"id": "binder-valve-002",
|
||||||
|
"name": "JCV",
|
||||||
|
"units": ["m³/h", "gpm", "l/min"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
16
datasets/assetData/curves/ECDV.json
Normal file
16
datasets/assetData/curves/ECDV.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"1.204": {
|
||||||
|
"125": {
|
||||||
|
"x": [0,10,20,30,40,50,60,70,80,90,100],
|
||||||
|
"y": [0,18,50,95,150,216,337,564,882,1398,1870]
|
||||||
|
},
|
||||||
|
"150": {
|
||||||
|
"x": [0,10,20,30,40,50,60,70,80,90,100],
|
||||||
|
"y": [0,25,73,138,217,314,490,818,1281,2029,2715]
|
||||||
|
},
|
||||||
|
"400": {
|
||||||
|
"x": [0,10,20,30,40,50,60,70,80,90,100],
|
||||||
|
"y": [0,155,443,839,1322,1911,2982,4980,7795,12349,16524]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
838
datasets/assetData/curves/hidrostal-C5-D03R-SHN1.json
Normal file
838
datasets/assetData/curves/hidrostal-C5-D03R-SHN1.json
Normal file
@@ -0,0 +1,838 @@
|
|||||||
|
{
|
||||||
|
"np": {
|
||||||
|
"400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5953611390998625,
|
||||||
|
1.6935085477165994,
|
||||||
|
3.801139124304824,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.8497068236812997,
|
||||||
|
3.801139124304824,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.7497197821018213,
|
||||||
|
3.801139124304824,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.788320579602724,
|
||||||
|
3.9982668237045984,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.7824519364844427,
|
||||||
|
3.9885060367793064,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6934482683506376,
|
||||||
|
3.9879559558537054,
|
||||||
|
7.367829525776738,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6954385513069579,
|
||||||
|
4.0743508382926795,
|
||||||
|
7.422392692482345,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.160745720731654,
|
||||||
|
7.596626714476177,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.302551231007837,
|
||||||
|
7.637247864947884,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.37557913990704,
|
||||||
|
7.773442147000839,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.334434337766139,
|
||||||
|
7.940911352646818,
|
||||||
|
12.081735423116616
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.2327206586037995,
|
||||||
|
8.005238800611183,
|
||||||
|
12.254836577088351
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
4.195405588464695,
|
||||||
|
7.991827302945298,
|
||||||
|
12.423663269044452
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
14.255458319309813,
|
||||||
|
8.096768422220196,
|
||||||
|
12.584668380908582
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
31.54620347513727,
|
||||||
|
12.637080520201405
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.148423429611098,
|
||||||
|
12.74916725120127
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.146439484120116,
|
||||||
|
12.905178964345618
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.149576025637684,
|
||||||
|
13.006940917309247
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.126246430368305,
|
||||||
|
13.107503837410825
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.104379361635342,
|
||||||
|
13.223235973280122
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
8.135190080423746,
|
||||||
|
13.36128347785936
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.981219508598527,
|
||||||
|
13.473697427231842
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.863899404441271,
|
||||||
|
13.50303289156837
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.658860522528131,
|
||||||
|
13.485230880073107
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.44407948309266,
|
||||||
|
13.446135725634615
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
0.5522732775894703,
|
||||||
|
1.6920721090317592,
|
||||||
|
3.8742719210788685,
|
||||||
|
7.44407948309266,
|
||||||
|
13.413693596332184
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nq": {
|
||||||
|
"400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
7.6803204433986965,
|
||||||
|
25.506609120436963,
|
||||||
|
35.4,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
22.622804921188227,
|
||||||
|
35.4,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
19.966301579194372,
|
||||||
|
35.4,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
17.430763940163832,
|
||||||
|
33.79508340848005,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
14.752921911234477,
|
||||||
|
31.71885034449889,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
11.854693031181021,
|
||||||
|
29.923046639543475,
|
||||||
|
44.4,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.549433913822687,
|
||||||
|
26.734189128096668,
|
||||||
|
43.96760750800311,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
26.26933164936586,
|
||||||
|
42.23523193272671,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
24.443114637042832,
|
||||||
|
40.57167959798151,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
22.41596168949836,
|
||||||
|
39.04561852479495,
|
||||||
|
52.5
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
20.276864821170303,
|
||||||
|
37.557663261443224,
|
||||||
|
52.252852231224054
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
18.252772588147742,
|
||||||
|
35.9974418607538,
|
||||||
|
50.68604059588987
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
16.31441663648616,
|
||||||
|
34.51170378091407,
|
||||||
|
49.20153034100798
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
14.255458319309813,
|
||||||
|
33.043410795291045,
|
||||||
|
47.820213744181245
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
31.54620347513727,
|
||||||
|
46.51705619739449
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"1900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
29.986013742375484,
|
||||||
|
45.29506741639918
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2000": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
28.432646044605782,
|
||||||
|
44.107822395271945
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2100": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
26.892634464336055,
|
||||||
|
42.758175515158776
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2200": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
25.270679127870263,
|
||||||
|
41.467063889795895
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2300": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
23.531132157718837,
|
||||||
|
40.293041104955826
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2400": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
21.815645106750623,
|
||||||
|
39.03109248860755
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2500": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
20.34997949463564,
|
||||||
|
37.71320701654063
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2600": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
18.81710568651804,
|
||||||
|
36.35563657017404
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2700": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
17.259072160217805,
|
||||||
|
35.02979557646653
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2800": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
16,
|
||||||
|
33.74372254979665
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"2900": {
|
||||||
|
"x": [
|
||||||
|
0,
|
||||||
|
25.510204081632654,
|
||||||
|
51.020408163265309,
|
||||||
|
76.530612244897952,
|
||||||
|
100
|
||||||
|
],
|
||||||
|
"y": [
|
||||||
|
6.4,
|
||||||
|
9.500000000000002,
|
||||||
|
12.7,
|
||||||
|
16,
|
||||||
|
32.54934541379723
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1062
datasets/assetData/curves/hidrostal-H05K-S03R.json
Normal file
1062
datasets/assetData/curves/hidrostal-H05K-S03R.json
Normal file
File diff suppressed because it is too large
Load Diff
124
datasets/assetData/curves/index.js
Normal file
124
datasets/assetData/curves/index.js
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
class AssetLoader {
|
||||||
|
constructor() {
|
||||||
|
this.relPath = './'
|
||||||
|
this.baseDir = path.resolve(__dirname, this.relPath);
|
||||||
|
this.cache = new Map(); // Cache loaded JSON files for better performance
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load a specific curve by type
|
||||||
|
* @param {string} curveType - The curve identifier (e.g., 'hidrostal-H05K-S03R')
|
||||||
|
* @returns {Object|null} The curve data object or null if not found
|
||||||
|
*/
|
||||||
|
loadCurve(curveType) {
|
||||||
|
return this.loadAsset('curves', curveType);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load any asset from a specific dataset folder
|
||||||
|
* @param {string} datasetType - The dataset folder name (e.g., 'curves', 'assetData')
|
||||||
|
* @param {string} assetId - The specific asset identifier
|
||||||
|
* @returns {Object|null} The asset data object or null if not found
|
||||||
|
*/
|
||||||
|
loadAsset(datasetType, assetId) {
|
||||||
|
//const cacheKey = `${datasetType}/${assetId}`;
|
||||||
|
const cacheKey = `${assetId}`;
|
||||||
|
|
||||||
|
|
||||||
|
// Check cache first
|
||||||
|
if (this.cache.has(cacheKey)) {
|
||||||
|
return this.cache.get(cacheKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const filePath = path.join(this.baseDir, `${assetId}.json`);
|
||||||
|
|
||||||
|
// Check if file exists
|
||||||
|
if (!fs.existsSync(filePath)) {
|
||||||
|
console.warn(`Asset not found: ${filePath}`);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load and parse JSON
|
||||||
|
const rawData = fs.readFileSync(filePath, 'utf8');
|
||||||
|
const assetData = JSON.parse(rawData);
|
||||||
|
|
||||||
|
// Cache the result
|
||||||
|
this.cache.set(cacheKey, assetData);
|
||||||
|
|
||||||
|
return assetData;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error loading asset ${cacheKey}:`, error.message);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all available assets in a dataset
|
||||||
|
* @param {string} datasetType - The dataset folder name
|
||||||
|
* @returns {string[]} Array of available asset IDs
|
||||||
|
*/
|
||||||
|
getAvailableAssets(datasetType) {
|
||||||
|
try {
|
||||||
|
const datasetPath = path.join(this.baseDir, datasetType);
|
||||||
|
|
||||||
|
if (!fs.existsSync(datasetPath)) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
return fs.readdirSync(datasetPath)
|
||||||
|
.filter(file => file.endsWith('.json'))
|
||||||
|
.map(file => file.replace('.json', ''));
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error reading dataset ${datasetType}:`, error.message);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the cache (useful for development/testing)
|
||||||
|
*/
|
||||||
|
clearCache() {
|
||||||
|
this.cache.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create and export a singleton instance
|
||||||
|
const assetLoader = new AssetLoader();
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
AssetLoader,
|
||||||
|
assetLoader,
|
||||||
|
// Convenience methods for backward compatibility
|
||||||
|
loadCurve: (curveType) => assetLoader.loadCurve(curveType),
|
||||||
|
loadAsset: (datasetType, assetId) => assetLoader.loadAsset(datasetType, assetId),
|
||||||
|
getAvailableAssets: (datasetType) => assetLoader.getAvailableAssets(datasetType)
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Example usage in your scripts
|
||||||
|
const loader = new AssetLoader();
|
||||||
|
|
||||||
|
// Load a specific curve
|
||||||
|
const curve = loader.loadCurve('hidrostal-H05K-S03R');
|
||||||
|
if (curve) {
|
||||||
|
console.log('Curve loaded:', curve);
|
||||||
|
} else {
|
||||||
|
console.log('Curve not found');
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
// Load any asset from any dataset
|
||||||
|
const someAsset = loadAsset('assetData', 'some-asset-id');
|
||||||
|
|
||||||
|
// Get list of available curves
|
||||||
|
const availableCurves = getAvailableAssets('curves');
|
||||||
|
console.log('Available curves:', availableCurves);
|
||||||
|
|
||||||
|
// Using the class directly for more control
|
||||||
|
const { AssetLoader } = require('./index.js');
|
||||||
|
const customLoader = new AssetLoader();
|
||||||
|
const data = customLoader.loadCurve('hidrostal-H05K-S03R');
|
||||||
|
*/
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"name": "DAB Evosta 2 20-75",
|
|
||||||
"description": "N/A",
|
|
||||||
"machineCurve": {
|
|
||||||
"np": {
|
|
||||||
"200": {
|
|
||||||
"x": [0, 20, 40, 60, 80, 100],
|
|
||||||
"y": [5, 8, 12, 15, 17, 18]
|
|
||||||
},
|
|
||||||
"300": {
|
|
||||||
"x": [0, 20, 40, 60, 80, 100],
|
|
||||||
"y": [20, 28, 32, 34, 35, 35]
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"x": [0, 20, 40, 60, 80, 100],
|
|
||||||
"y": [35, 38, 42, 45, 47, 48]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nq": {
|
|
||||||
"200": {
|
|
||||||
"x": [0, 20, 40, 60, 80, 100],
|
|
||||||
"y": [0, 0.4, 0.8, 1.2, 1.6, 2.0]
|
|
||||||
},
|
|
||||||
"300": {
|
|
||||||
"x": [0, 20, 40, 60, 80, 100],
|
|
||||||
"y": [0, 0.72, 1.44, 2.16, 2.88, 3.6]
|
|
||||||
},
|
|
||||||
"400": {
|
|
||||||
"x": [0, 20, 40, 60, 80, 100],
|
|
||||||
"y": [0, 0.8, 1.6, 2.4, 3.2, 4.0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "centrifugal pumps"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,6 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "centrifugal pumps"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "hydrostal"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "2",
|
|
||||||
"name": "DAB"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "SDM120MODBUS",
|
|
||||||
"description": "De SDM120MODBUS kWh meter is een kWh meter die geschikt is voor het meten van zowel verbruik als teruglevering van stroom. Dat maakt deze meter ook zeer geschikt in combinatie met zonnepanelen."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "power"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "Proline Promag W 400",
|
|
||||||
"description": "A flow meter used for measuring the flow of liquids in various industrial applications."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "flow"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "vega"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "2",
|
|
||||||
"name": "eh"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "3",
|
|
||||||
"name": "eastron"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"name": "Vegabar 14",
|
|
||||||
"description": "N/A"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"name": "pressure"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "2",
|
|
||||||
"name": "flow"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "3",
|
|
||||||
"name": "temperature"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"name": "VegaTemp 10",
|
|
||||||
"description": "Low cost sensor for general purpose applications."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "VegaTemp 20",
|
|
||||||
"description": "High accuracy sensor for laboratory applications."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "VegaTemp 30",
|
|
||||||
"description": "High accuracy sensor for industrial applications."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "VegaTemp 40",
|
|
||||||
"description": "High accuracy sensor for environmental monitoring."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "VegaTemp 50",
|
|
||||||
"description": "High accuracy temperature sensor for industrial applications."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "VegaTherm 22",
|
|
||||||
"description": "Compact sensor ideal for environmental monitoring."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "VegaTemp 100",
|
|
||||||
"description": "Robust sensor designed for high temperature ranges."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
1
datasets/get_all_assets.php
Normal file
1
datasets/get_all_assets.php
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Database connection failed: SQLSTATE[28000] [1045] Access denied for user 'pimmoe1q_rdlab'@'localhost' (using password: YES)
|
||||||
@@ -1,200 +0,0 @@
|
|||||||
const MeasurementBuilder = require('./MeasurementBuilder');
|
|
||||||
|
|
||||||
class MeasurementContainer {
|
|
||||||
constructor(options = {}, logger) {
|
|
||||||
this.logger = logger;
|
|
||||||
this.measurements = {};
|
|
||||||
this.windowSize = options.windowSize || 10; // Default window size
|
|
||||||
|
|
||||||
// For chaining context
|
|
||||||
this._currentType = null;
|
|
||||||
this._currentVariant = null;
|
|
||||||
this._currentPosition = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Chainable methods
|
|
||||||
type(typeName) {
|
|
||||||
this._currentType = typeName;
|
|
||||||
this._currentVariant = null;
|
|
||||||
this._currentPosition = null;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
variant(variantName) {
|
|
||||||
if (!this._currentType) {
|
|
||||||
throw new Error('Type must be specified before variant');
|
|
||||||
}
|
|
||||||
this._currentVariant = variantName;
|
|
||||||
this._currentPosition = null;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
position(positionName) {
|
|
||||||
if (!this._currentVariant) {
|
|
||||||
throw new Error('Variant must be specified before position');
|
|
||||||
}
|
|
||||||
this._currentPosition = positionName;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Core methods that complete the chain
|
|
||||||
value(val, timestamp = Date.now()) {
|
|
||||||
if (!this._ensureChainIsValid()) return this;
|
|
||||||
|
|
||||||
const measurement = this._getOrCreateMeasurement();
|
|
||||||
measurement.setValue(val, timestamp);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
unit(unitName) {
|
|
||||||
if (!this._ensureChainIsValid()) return this;
|
|
||||||
|
|
||||||
const measurement = this._getOrCreateMeasurement();
|
|
||||||
measurement.setUnit(unitName);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Terminal operations - get data out
|
|
||||||
get() {
|
|
||||||
if (!this._ensureChainIsValid()) return null;
|
|
||||||
return this._getOrCreateMeasurement();
|
|
||||||
}
|
|
||||||
|
|
||||||
getCurrentValue() {
|
|
||||||
const measurement = this.get();
|
|
||||||
return measurement ? measurement.getCurrentValue() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
getAverage() {
|
|
||||||
const measurement = this.get();
|
|
||||||
return measurement ? measurement.getAverage() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
getMin() {
|
|
||||||
const measurement = this.get();
|
|
||||||
return measurement ? measurement.getMin() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
getMax() {
|
|
||||||
const measurement = this.get();
|
|
||||||
return measurement ? measurement.getMax() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
getAllValues() {
|
|
||||||
const measurement = this.get();
|
|
||||||
return measurement ? measurement.getAllValues() : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Difference calculations between positions
|
|
||||||
difference() {
|
|
||||||
if (!this._currentType || !this._currentVariant) {
|
|
||||||
throw new Error('Type and variant must be specified for difference calculation');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Save position to restore chain state after operation
|
|
||||||
const savedPosition = this._currentPosition;
|
|
||||||
|
|
||||||
// Get upstream measurement
|
|
||||||
this._currentPosition = 'upstream';
|
|
||||||
const upstream = this.get();
|
|
||||||
|
|
||||||
// Get downstream measurement
|
|
||||||
this._currentPosition = 'downstream';
|
|
||||||
const downstream = this.get();
|
|
||||||
|
|
||||||
// Restore chain state
|
|
||||||
this._currentPosition = savedPosition;
|
|
||||||
|
|
||||||
if (!upstream || !downstream || upstream.values.length === 0 || downstream.values.length === 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ensure units match
|
|
||||||
let downstreamForCalc = downstream;
|
|
||||||
if (upstream.unit && downstream.unit && upstream.unit !== downstream.unit) {
|
|
||||||
try {
|
|
||||||
downstreamForCalc = downstream.convertTo(upstream.unit);
|
|
||||||
} catch (error) {
|
|
||||||
if (this.logger) {
|
|
||||||
this.logger.error(`Unit conversion failed: ${error.message}`);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
value: downstreamForCalc.getCurrentValue() - upstream.getCurrentValue() ,
|
|
||||||
avgDiff: downstreamForCalc.getAverage() - upstream.getAverage() ,
|
|
||||||
unit: upstream.unit
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helper methods
|
|
||||||
_ensureChainIsValid() {
|
|
||||||
if (!this._currentType || !this._currentVariant || !this._currentPosition) {
|
|
||||||
if (this.logger) {
|
|
||||||
this.logger.error('Incomplete measurement chain, required: type, variant, and position');
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_getOrCreateMeasurement() {
|
|
||||||
// Initialize nested structure if needed
|
|
||||||
if (!this.measurements[this._currentType]) {
|
|
||||||
this.measurements[this._currentType] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.measurements[this._currentType][this._currentVariant]) {
|
|
||||||
this.measurements[this._currentType][this._currentVariant] = {};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.measurements[this._currentType][this._currentVariant][this._currentPosition]) {
|
|
||||||
this.measurements[this._currentType][this._currentVariant][this._currentPosition] =
|
|
||||||
new MeasurementBuilder()
|
|
||||||
.setType(this._currentType)
|
|
||||||
.setVariant(this._currentVariant)
|
|
||||||
.setPosition(this._currentPosition)
|
|
||||||
.setWindowSize(this.windowSize)
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.measurements[this._currentType][this._currentVariant][this._currentPosition];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Additional utility methods
|
|
||||||
getTypes() {
|
|
||||||
return Object.keys(this.measurements);
|
|
||||||
}
|
|
||||||
|
|
||||||
getVariants() {
|
|
||||||
if (!this._currentType) {
|
|
||||||
throw new Error('Type must be specified before listing variants');
|
|
||||||
}
|
|
||||||
return this.measurements[this._currentType] ?
|
|
||||||
Object.keys(this.measurements[this._currentType]) : [];
|
|
||||||
}
|
|
||||||
|
|
||||||
getPositions() {
|
|
||||||
if (!this._currentType || !this._currentVariant) {
|
|
||||||
throw new Error('Type and variant must be specified before listing positions');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.measurements[this._currentType] ||
|
|
||||||
!this.measurements[this._currentType][this._currentVariant]) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
return Object.keys(this.measurements[this._currentType][this._currentVariant]);
|
|
||||||
}
|
|
||||||
|
|
||||||
clear() {
|
|
||||||
this.measurements = {};
|
|
||||||
this._currentType = null;
|
|
||||||
this._currentVariant = null;
|
|
||||||
this._currentPosition = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = MeasurementContainer;
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
const { MeasurementContainer } = require('./index');
|
|
||||||
|
|
||||||
// Create a container
|
|
||||||
const container = new MeasurementContainer({ windowSize: 20 });
|
|
||||||
|
|
||||||
// Example 1: Setting values with chaining
|
|
||||||
console.log('--- Example 1: Setting values ---');
|
|
||||||
container.type('pressure').variant('measured').position('upstream').value(100).unit('psi');
|
|
||||||
container.type('pressure').variant('measured').position('downstream').value(95).unit('psi');
|
|
||||||
container.type('pressure').variant('measured').position('downstream').value(80);
|
|
||||||
|
|
||||||
// Example 2: Getting values with chaining
|
|
||||||
console.log('--- Example 2: Getting values ---');
|
|
||||||
const upstreamValue = container.type('pressure').variant('measured').position('upstream').getCurrentValue();
|
|
||||||
const upstreamUnit = container.type('pressure').variant('measured').position('upstream').get().unit;
|
|
||||||
console.log(`Upstream pressure: ${upstreamValue} ${upstreamUnit}`);
|
|
||||||
const downstreamValue = container.type('pressure').variant('measured').position('downstream').getCurrentValue();
|
|
||||||
const downstreamUnit = container.type('pressure').variant('measured').position('downstream').get().unit;
|
|
||||||
console.log(`Downstream pressure: ${downstreamValue} ${downstreamUnit}`);
|
|
||||||
|
|
||||||
// Example 3: Calculations using chained methods
|
|
||||||
console.log('--- Example 3: Calculations ---');
|
|
||||||
container.type('flow').variant('predicted').position('upstream').value(200).unit('gpm');
|
|
||||||
container.type('flow').variant('predicted').position('downstream').value(195).unit('gpm');
|
|
||||||
|
|
||||||
const flowAvg = container.type('flow').variant('predicted').position('upstream').getAverage();
|
|
||||||
console.log(`Average upstream flow: ${flowAvg} gpm`);
|
|
||||||
|
|
||||||
// Example 4: Getting pressure difference
|
|
||||||
console.log('--- Example 4: Difference calculations ---');
|
|
||||||
const pressureDiff = container.type('pressure').variant('measured').difference();
|
|
||||||
console.log(`Pressure difference: ${pressureDiff.value} ${pressureDiff.unit}`);
|
|
||||||
|
|
||||||
// Example 5: Adding multiple values to track history
|
|
||||||
console.log('--- Example 5: Multiple values ---');
|
|
||||||
// Add several values to upstream flow
|
|
||||||
container.type('flow').variant('measured').position('upstream')
|
|
||||||
.value(210).value(215).value(205).unit('gpm');
|
|
||||||
|
|
||||||
// Then get statistics
|
|
||||||
console.log('Flow statistics:');
|
|
||||||
console.log(`- Current: ${container.type('flow').variant('measured').position('upstream').getCurrentValue()} gpm`);
|
|
||||||
console.log(`- Average: ${container.type('flow').variant('measured').position('upstream').getAverage()} gpm`);
|
|
||||||
console.log(`- Min: ${container.type('flow').variant('measured').position('upstream').getMin()} gpm`);
|
|
||||||
console.log(`- Max: ${container.type('flow').variant('measured').position('upstream').getMax()} gpm`);
|
|
||||||
console.log(`Show all values : ${JSON.stringify(container.type('flow').variant('measured').position('upstream').getAllValues())}`);
|
|
||||||
|
|
||||||
// Example 6: Listing available data
|
|
||||||
console.log('--- Example 6: Listing available data ---');
|
|
||||||
console.log('Types:', container.getTypes());
|
|
||||||
console.log('Pressure variants:', container.type('pressure').getVariants());
|
|
||||||
console.log('Measured pressure positions:', container.type('pressure').variant('measured').getPositions());
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
runExamples: () => {
|
|
||||||
console.log('Examples of the measurement chainable API');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
48
index.js
Normal file
48
index.js
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* generalFunctions/index.js
|
||||||
|
* -----------------------------------------------------------
|
||||||
|
* Central barrel file for re-exporting helpers and configurations.
|
||||||
|
* Provides both namespace exports and dynamic loading capabilities.
|
||||||
|
* now we can load modules like this:
|
||||||
|
* const { menuUtils, outputUtils } = require('generalFunctions');
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Core helper modules
|
||||||
|
const outputUtils = require('./src/helper/outputUtils.js');
|
||||||
|
const logger = require('./src/helper/logger.js');
|
||||||
|
const validation = require('./src/helper/validationUtils.js');
|
||||||
|
const configUtils = require('./src/helper/configUtils.js');
|
||||||
|
const assertions = require('./src/helper/assertionUtils.js')
|
||||||
|
const coolprop = require('./src/coolprop-node/src/index.js');
|
||||||
|
|
||||||
|
// Domain-specific modules
|
||||||
|
const { MeasurementContainer } = require('./src/measurements/index.js');
|
||||||
|
const configManager = require('./src/configs/index.js');
|
||||||
|
const nrmse = require('./src/nrmse/errorMetrics.js');
|
||||||
|
const state = require('./src/state/state.js');
|
||||||
|
const convert = require('./src/convert/index.js');
|
||||||
|
const MenuManager = require('./src/menu/index.js');
|
||||||
|
const predict = require('./src/predict/predict_class.js');
|
||||||
|
const interpolation = require('./src/predict/interpolation.js');
|
||||||
|
const childRegistrationUtils = require('./src/helper/childRegistrationUtils.js');
|
||||||
|
const { loadCurve } = require('./datasets/assetData/curves/index.js');
|
||||||
|
|
||||||
|
// Export everything
|
||||||
|
module.exports = {
|
||||||
|
predict,
|
||||||
|
interpolation,
|
||||||
|
configManager,
|
||||||
|
outputUtils,
|
||||||
|
configUtils,
|
||||||
|
logger,
|
||||||
|
validation,
|
||||||
|
assertions,
|
||||||
|
MeasurementContainer,
|
||||||
|
nrmse,
|
||||||
|
state,
|
||||||
|
coolprop,
|
||||||
|
convert,
|
||||||
|
MenuManager,
|
||||||
|
childRegistrationUtils,
|
||||||
|
loadCurve
|
||||||
|
};
|
||||||
29
package.json
Normal file
29
package.json
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"name": "generalFunctions",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "General utility functions used across multiple Node-RED modules",
|
||||||
|
"main": "./index.js",
|
||||||
|
|
||||||
|
"exports": {
|
||||||
|
".": "./index.js",
|
||||||
|
"./menuUtils": "./src/helper/menuUtils.js",
|
||||||
|
"./mathUtils": "./src/helper/mathUtils.js",
|
||||||
|
"./assetUtils": "./src/helper/assetUtils.js",
|
||||||
|
"./outputUtils": "./src/helper/outputUtils.js"
|
||||||
|
},
|
||||||
|
|
||||||
|
"scripts": {
|
||||||
|
"test": "node test.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://gitea.centraal.wbd-rd.nl/RnD/generalFunctions.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"utilities",
|
||||||
|
"common",
|
||||||
|
"node-red"
|
||||||
|
],
|
||||||
|
"author": "Rene de Ren",
|
||||||
|
"license": "SEE LICENSE"
|
||||||
|
}
|
||||||
76
src/configs/index.js
Normal file
76
src/configs/index.js
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
const fs = require('fs');
|
||||||
|
const path = require('path');
|
||||||
|
|
||||||
|
class ConfigManager {
|
||||||
|
constructor(relPath = '.') {
|
||||||
|
this.configDir = path.resolve(__dirname, relPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load a configuration file by name
|
||||||
|
* @param {string} configName - Name of the config file (without .json extension)
|
||||||
|
* @returns {Object} Parsed configuration object
|
||||||
|
*/
|
||||||
|
getConfig(configName) {
|
||||||
|
try {
|
||||||
|
const configPath = path.resolve(this.configDir, `${configName}.json`);
|
||||||
|
const configData = fs.readFileSync(configPath, 'utf8');
|
||||||
|
return JSON.parse(configData);
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`Failed to load config '${configName}': ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get list of available configuration files
|
||||||
|
* @returns {Array<string>} Array of config names (without .json extension)
|
||||||
|
*/
|
||||||
|
getAvailableConfigs() {
|
||||||
|
try {
|
||||||
|
const resolvedDir = path.resolve(this.configDir);
|
||||||
|
const files = fs.readdirSync(resolvedDir);
|
||||||
|
return files
|
||||||
|
.filter(file => file.endsWith('.json'))
|
||||||
|
.map(file => path.basename(file, '.json'));
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`Failed to read config directory: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a specific config exists
|
||||||
|
* @param {string} configName - Name of the config file
|
||||||
|
* @returns {boolean} True if config exists
|
||||||
|
*/
|
||||||
|
hasConfig(configName) {
|
||||||
|
const configPath = path.resolve(this.configDir, `${configName}.json`);
|
||||||
|
return fs.existsSync(configPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
createEndpoint(nodeName) {
|
||||||
|
try {
|
||||||
|
// Load the config for this node
|
||||||
|
const config = this.getConfig(nodeName);
|
||||||
|
|
||||||
|
// Convert config to JSON
|
||||||
|
const configJSON = JSON.stringify(config, null, 2);
|
||||||
|
|
||||||
|
// Assemble the complete script
|
||||||
|
return `
|
||||||
|
// Create the namespace structure
|
||||||
|
window.EVOLV = window.EVOLV || {};
|
||||||
|
window.EVOLV.nodes = window.EVOLV.nodes || {};
|
||||||
|
window.EVOLV.nodes.${nodeName} = window.EVOLV.nodes.${nodeName} || {};
|
||||||
|
|
||||||
|
// Inject the pre-loaded config data directly into the namespace
|
||||||
|
window.EVOLV.nodes.${nodeName}.config = ${configJSON};
|
||||||
|
|
||||||
|
console.log('${nodeName} config loaded and endpoint created');
|
||||||
|
`;
|
||||||
|
} catch (error) {
|
||||||
|
throw new Error(`Failed to create endpoint for '${nodeName}': ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = ConfigManager;
|
||||||
216
src/configs/machineGroupControl.json
Normal file
216
src/configs/machineGroupControl.json
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
{
|
||||||
|
"general": {
|
||||||
|
"name": {
|
||||||
|
"default": "Machine Group Configuration",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A human-readable name or label for this machine group configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "A unique identifier for this configuration. If not provided, defaults to null."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"default": "m3/h",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The default measurement unit for this configuration (e.g., 'meters', 'seconds', 'unitless')."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"logging": {
|
||||||
|
"logLevel": {
|
||||||
|
"default": "info",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "debug",
|
||||||
|
"description": "Log messages are printed for debugging purposes."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "info",
|
||||||
|
"description": "Informational messages are printed."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "warn",
|
||||||
|
"description": "Warning messages are printed."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "error",
|
||||||
|
"description": "Error messages are printed."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Indicates whether logging is active. If true, log messages will be generated."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"functionality": {
|
||||||
|
"softwareType": {
|
||||||
|
"default": "machineGroup",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Logical name identifying the software type."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
"default": "GroupController",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Controls a group of machines within the system."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"positionVsParent":{
|
||||||
|
"default":"atEquipment",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "atEquipment",
|
||||||
|
"description": "The node is connected at the equipment level and is responsible for controlling or monitoring the equipment as a whole."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "upstream",
|
||||||
|
"description": "The node is connected in a downstream position, indicating it is responsible for monitoring or controlling processes that occur after the equipment's operation, such as product flow or output."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "downstream",
|
||||||
|
"description": "The node is connected in an upstream position, indicating it is responsible for monitoring or controlling processes that occur before the equipment's operation, such as input flow or supply."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Defines the position of the measurement relative to its parent equipment or system."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"current": {
|
||||||
|
"default": "optimalControl",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "optimalControl",
|
||||||
|
"description": "The group controller selects the most optimal combination of machines based on their real-time performance curves."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "priorityControl",
|
||||||
|
"description": "Machines are controlled sequentially from minimum to maximum output until each is maxed out, then additional machines are added."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "prioritypercentagecontrol",
|
||||||
|
"description": "Machines are controlled sequentially from minimum to maximum output until each is maxed out, then additional machines are added based on a percentage of the total demand."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "maintenance",
|
||||||
|
"description": "The group is in maintenance mode with limited actions (monitoring only)."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The operational mode of the machine group controller."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allowedActions": {
|
||||||
|
"default": {},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema": {
|
||||||
|
"optimalControl": {
|
||||||
|
"default": ["statusCheck", "execOptimalCombination", "balanceLoad", "emergencyStop"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in optimalControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"priorityControl": {
|
||||||
|
"default": ["statusCheck", "execSequentialControl", "balanceLoad", "emergencyStop"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in priorityControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"prioritypercentagecontrol": {
|
||||||
|
"default": ["statusCheck", "execSequentialControl", "balanceLoad", "emergencyStop"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in manualOverride mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"maintenance": {
|
||||||
|
"default": ["statusCheck"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in maintenance mode."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Defines the actions available for each operational mode of the machine group controller."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allowedSources": {
|
||||||
|
"default": {},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema": {
|
||||||
|
"optimalcontrol": {
|
||||||
|
"default": ["parent", "GUI", "physical", "API"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Command sources allowed in optimalControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"prioritycontrol": {
|
||||||
|
"default": ["parent", "GUI", "physical", "API"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Command sources allowed in priorityControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"prioritypercentagecontrol": {
|
||||||
|
"default": ["parent", "GUI", "physical", "API"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Command sources allowed "
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Specifies the valid command sources recognized by the machine group controller for each mode."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scaling": {
|
||||||
|
"current": {
|
||||||
|
"default": "normalized",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "normalized",
|
||||||
|
"description": "Scales the demand between 0–100% of the total flow capacity, interpolating to calculate the effective demand."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "absolute",
|
||||||
|
"description": "Uses the absolute demand value directly, capped between the min and max machine flow capacities."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The scaling mode for demand calculations."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"general": {
|
"general": {
|
||||||
"name": {
|
"name": {
|
||||||
"default": "Measurement Configuration",
|
"default": "Sensor",
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A human-readable name or label for this measurement configuration."
|
"description": "A human-readable name or label for this measurement configuration."
|
||||||
@@ -70,6 +70,34 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Indicates the role this configuration plays (e.g., sensor, controller, etc.)."
|
"description": "Indicates the role this configuration plays (e.g., sensor, controller, etc.)."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"positionVsParent":{
|
||||||
|
"default":"atEquipment",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "atEquipment",
|
||||||
|
"description": "The measurement is taken at the equipment level, typically representing the overall state or performance of the equipment."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "upstream",
|
||||||
|
"description": "The measurement is taken upstream, meaning it is related to inputs or conditions that affect the equipment's operation, such as supply conditions or environmental factors."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "downstream",
|
||||||
|
"description": "The measurement is taken downstream, indicating it relates to outputs or results of the equipment's operation, such as product quality or performance metrics."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Defines the position of the measurement relative to its parent equipment or system."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"distance":{
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Defines the position of the measurement relative to its parent equipment or system."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"asset": {
|
"asset": {
|
||||||
@@ -81,6 +109,14 @@
|
|||||||
"description": "Asset tag number which is a universally unique identifier for this asset. May be null if not assigned."
|
"description": "Asset tag number which is a universally unique identifier for this asset. May be null if not assigned."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"tagCode":{
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "Asset tag code which is a unique identifier for this asset. May be null if not assigned."
|
||||||
|
}
|
||||||
|
},
|
||||||
"geoLocation": {
|
"geoLocation": {
|
||||||
"default": {
|
"default": {
|
||||||
"x": 0,
|
"x": 0,
|
||||||
@@ -122,7 +158,7 @@
|
|||||||
"description": "The supplier or manufacturer of the asset."
|
"description": "The supplier or manufacturer of the asset."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": {
|
"category": {
|
||||||
"default": "sensor",
|
"default": "sensor",
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "enum",
|
"type": "enum",
|
||||||
@@ -134,7 +170,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"subType": {
|
"type": {
|
||||||
"default": "pressure",
|
"default": "pressure",
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -148,6 +184,13 @@
|
|||||||
"description": "A user-defined or manufacturer-defined model identifier for the asset."
|
"description": "A user-defined or manufacturer-defined model identifier for the asset."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"unit": {
|
||||||
|
"default": "unitless",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The unit of measurement for this asset (e.g., 'meters', 'seconds', 'unitless')."
|
||||||
|
}
|
||||||
|
},
|
||||||
"accuracy": {
|
"accuracy": {
|
||||||
"default": null,
|
"default": null,
|
||||||
"rules": {
|
"rules": {
|
||||||
694
src/configs/pumpingStation.json
Normal file
694
src/configs/pumpingStation.json
Normal file
@@ -0,0 +1,694 @@
|
|||||||
|
{
|
||||||
|
"general": {
|
||||||
|
"name": {
|
||||||
|
"default": "Pumping Station",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A human-readable name or label for this pumping station configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "A unique identifier for this pumping station configuration. If not provided, defaults to null."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"default": "m3/h",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The default flow unit used for reporting station throughput."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"logging": {
|
||||||
|
"logLevel": {
|
||||||
|
"default": "info",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "debug",
|
||||||
|
"description": "Log verbose diagnostic messages that aid in troubleshooting the station."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "info",
|
||||||
|
"description": "Log general informational messages about station behavior."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "warn",
|
||||||
|
"description": "Log warnings when station behavior deviates from expected ranges."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "error",
|
||||||
|
"description": "Log only error level messages for critical failures."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Defines the minimum severity that will be written to the log."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "If true, logging is active for the pumping station node."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"functionality": {
|
||||||
|
"softwareType": {
|
||||||
|
"default": "pumpingStation",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Specified software type used to locate the proper default configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
"default": "StationController",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Describes the station's function within the EVOLV ecosystem."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"positionVsParent": {
|
||||||
|
"default": "atEquipment",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"description": "Defines how the station is positioned relative to its parent process or site.",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "atEquipment",
|
||||||
|
"description": "The station is controlled at the equipment level and represents the primary pumping asset."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "upstream",
|
||||||
|
"description": "The station governs flows entering upstream of the parent asset."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "downstream",
|
||||||
|
"description": "The station influences conditions downstream of the parent asset, such as discharge or transfer."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tickIntervalMs": {
|
||||||
|
"default": 1000,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 100,
|
||||||
|
"description": "Interval in milliseconds between internal evaluation cycles and output refreshes."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supportsSimulation": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Indicates whether the station can operate using simulated inflow and level data."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supportedChildSoftwareTypes": {
|
||||||
|
"default": [
|
||||||
|
"measurement"
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "List of child node software types that may register with the station."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"uuid": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "Asset tag number which is a universally unique identifier for this pumping station."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tagCode": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "Asset tag code which uniquely identifies the pumping station. May be null if not assigned."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"category": {
|
||||||
|
"default": "station",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "station",
|
||||||
|
"description": "Represents a dedicated pumping station asset."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "High level classification for asset reporting."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"default": "pumpingStation",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Specific asset type used to identify this configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"model": {
|
||||||
|
"default": "Unknown",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Manufacturer or integrator model designation for the station."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supplier": {
|
||||||
|
"default": "Unknown",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Primary supplier or maintainer responsible for the station."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"geoLocation": {
|
||||||
|
"default": {
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"z": 0
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Coordinate reference for locating the pumping station.",
|
||||||
|
"schema": {
|
||||||
|
"x": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "X coordinate in meters or site units."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Y coordinate in meters or site units."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Z coordinate in meters or site units."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"basin": {
|
||||||
|
"volume": {
|
||||||
|
"default": "1",
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Total volume of empty basin in m3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"height": {
|
||||||
|
"default": "1",
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Total height of basin in m"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"levelUnit": {
|
||||||
|
"default": "m",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Unit used for level related setpoints and thresholds."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"heightInlet": {
|
||||||
|
"default": 2,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Height of the inlet pipe measured from the basin floor (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"heightOutlet": {
|
||||||
|
"default": 0.2,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Height of the outlet pipe measured from the basin floor (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"heightOverflow": {
|
||||||
|
"default": 2.5,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Height of the overflow point measured from the basin floor (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inletPipeDiameter": {
|
||||||
|
"default": 0.4,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Nominal inlet pipe diameter (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"outletPipeDiameter": {
|
||||||
|
"default": 0.4,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Nominal outlet pipe diameter (m)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hydraulics": {
|
||||||
|
"maxInflowRate": {
|
||||||
|
"default": 200,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Maximum expected inflow during peak events (m3/h)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"refHeight": {
|
||||||
|
"default": "NAP",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "NAP",
|
||||||
|
"description": "NAP (Normaal Amsterdams Peil)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "EVRF",
|
||||||
|
"description": "EVRF (European Vertical Reference Frame)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "EGM2008",
|
||||||
|
"description": "EGM2008 / EGM96 (satellietmetingen) Geopotentieel model earth "
|
||||||
|
}
|
||||||
|
|
||||||
|
],
|
||||||
|
"description": "Reference height to use to identify the height vs other basins with. This will say something more about the expected pressure loss in m head"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"staticHead": {
|
||||||
|
"default": 12,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Static head between station suction and discharge point (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"maxDischargeHead": {
|
||||||
|
"default": 24,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Maximum allowable discharge head before calling for alarms (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pipelineLength": {
|
||||||
|
"default": 80,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Length of the discharge pipeline considered in calculations (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"defaultFluid": {
|
||||||
|
"default": "wastewater",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "wastewater",
|
||||||
|
"description": "The wet well is primarily cylindrical."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "water",
|
||||||
|
"description": "The wet well is rectangular or box shaped."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"temperatureReferenceDegC": {
|
||||||
|
"default": 15,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Reference fluid temperature for property lookups (degC)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"control": {
|
||||||
|
"controlStrategy": {
|
||||||
|
"default": "levelBased",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "levelBased",
|
||||||
|
"description": "Lead and lag pumps are controlled by basin level thresholds."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "pressureBased",
|
||||||
|
"description": "Pumps target a discharge pressure setpoint."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "flowTracking",
|
||||||
|
"description": "Pumps modulate to match measured inflow or downstream demand."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "manual",
|
||||||
|
"description": "Pumps are operated manually or by an external controller."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Primary control philosophy for pump actuation."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"levelSetpoints": {
|
||||||
|
"default": {
|
||||||
|
"startLeadPump": 1.2,
|
||||||
|
"stopLeadPump": 0.8,
|
||||||
|
"startLagPump": 1.8,
|
||||||
|
"stopLagPump": 1.4,
|
||||||
|
"alarmHigh": 2.3,
|
||||||
|
"alarmLow": 0.3
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Level thresholds that govern pump staging and alarms (m).",
|
||||||
|
"schema": {
|
||||||
|
"startLeadPump": {
|
||||||
|
"default": 1.2,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Level that starts the lead pump."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"stopLeadPump": {
|
||||||
|
"default": 0.8,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Level that stops the lead pump."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"startLagPump": {
|
||||||
|
"default": 1.8,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Level that starts the lag pump."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"stopLagPump": {
|
||||||
|
"default": 1.4,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Level that stops the lag pump."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"alarmHigh": {
|
||||||
|
"default": 2.3,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "High level alarm threshold."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"alarmLow": {
|
||||||
|
"default": 0.3,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Low level alarm threshold."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"pressureSetpoint": {
|
||||||
|
"default": 250,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Target discharge pressure when operating in pressure control (kPa)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"alarmDebounceSeconds": {
|
||||||
|
"default": 10,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Time a condition must persist before raising an alarm (seconds)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"equalizationTargetPercent": {
|
||||||
|
"default": 60,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"description": "Target fill percentage of the basin when operating in equalization mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoRestartAfterPowerLoss": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "If true, pumps resume based on last known state after power restoration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"manualOverrideTimeoutMinutes": {
|
||||||
|
"default": 30,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Duration after which a manual override expires automatically (minutes)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flowBalanceTolerance": {
|
||||||
|
"default": 5,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Allowable error between inflow and outflow before adjustments are triggered (m3/h)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"alarms": {
|
||||||
|
"default": {
|
||||||
|
"highLevel": {
|
||||||
|
"enabled": true,
|
||||||
|
"threshold": 2.3,
|
||||||
|
"delaySeconds": 30,
|
||||||
|
"severity": "critical",
|
||||||
|
"acknowledgmentRequired": true
|
||||||
|
},
|
||||||
|
"lowLevel": {
|
||||||
|
"enabled": true,
|
||||||
|
"threshold": 0.2,
|
||||||
|
"delaySeconds": 15,
|
||||||
|
"severity": "warning",
|
||||||
|
"acknowledgmentRequired": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "Alarm configuration for the pumping station.",
|
||||||
|
"schema": {
|
||||||
|
"highLevel": {
|
||||||
|
"default": {
|
||||||
|
"enabled": true,
|
||||||
|
"threshold": 2.3,
|
||||||
|
"delaySeconds": 30,
|
||||||
|
"severity": "critical",
|
||||||
|
"acknowledgmentRequired": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema": {
|
||||||
|
"enabled": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Enable or disable the high level alarm."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"threshold": {
|
||||||
|
"default": 2.3,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Level threshold that triggers the high level alarm (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delaySeconds": {
|
||||||
|
"default": 30,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Delay before issuing the high level alarm (seconds)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"severity": {
|
||||||
|
"default": "critical",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "info",
|
||||||
|
"description": "Informational notification."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "warning",
|
||||||
|
"description": "Warning condition requiring attention."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "critical",
|
||||||
|
"description": "Critical alarm requiring immediate intervention."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Severity associated with the high level alarm."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"acknowledgmentRequired": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "If true, this alarm must be acknowledged by an operator."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lowLevel": {
|
||||||
|
"default": {
|
||||||
|
"enabled": true,
|
||||||
|
"threshold": 0.2,
|
||||||
|
"delaySeconds": 15,
|
||||||
|
"severity": "warning",
|
||||||
|
"acknowledgmentRequired": false
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema": {
|
||||||
|
"enabled": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Enable or disable the low level alarm."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"threshold": {
|
||||||
|
"default": 0.2,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Level threshold that triggers the low level alarm (m)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"delaySeconds": {
|
||||||
|
"default": 15,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"min": 0,
|
||||||
|
"description": "Delay before issuing the low level alarm (seconds)."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"severity": {
|
||||||
|
"default": "warning",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "info",
|
||||||
|
"description": "Informational notification."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "warning",
|
||||||
|
"description": "Warning condition requiring attention."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "critical",
|
||||||
|
"description": "Critical alarm requiring immediate intervention."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Severity associated with the low level alarm."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"acknowledgmentRequired": {
|
||||||
|
"default": false,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "If true, this alarm must be acknowledged by an operator."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"simulation": {
|
||||||
|
"enabled": {
|
||||||
|
"default": false,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "If true, the station operates in simulation mode using generated inflow and level data."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"default": "diurnal",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "static",
|
||||||
|
"description": "Use constant inflow and level conditions."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "diurnal",
|
||||||
|
"description": "Use a typical diurnal inflow curve to drive simulation."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "storm",
|
||||||
|
"description": "Use an elevated inflow profile representing a storm event."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Defines which synthetic profile drives the simulation."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"seed": {
|
||||||
|
"default": 42,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Seed used for pseudo-random components in simulation."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"applyRandomNoise": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "If true, adds small noise to simulated measurements."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inflowProfile": {
|
||||||
|
"default": [
|
||||||
|
80,
|
||||||
|
110,
|
||||||
|
160,
|
||||||
|
120,
|
||||||
|
90
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"type": "array",
|
||||||
|
"itemType": "number",
|
||||||
|
"minLength": 1,
|
||||||
|
"description": "Relative inflow profile used when mode is set to diurnal or storm (percentage of design inflow)."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -70,6 +70,27 @@
|
|||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Indicates the role this configuration plays within the system."
|
"description": "Indicates the role this configuration plays within the system."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"positionVsParent":{
|
||||||
|
"default":"atEquipment",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "atEquipment",
|
||||||
|
"description": "The node is connected at the equipment level and is responsible for controlling or monitoring the equipment as a whole."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "upstream",
|
||||||
|
"description": "The node is connected in a downstream position, indicating it is responsible for monitoring or controlling processes that occur after the equipment's operation, such as product flow or output."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "downstream",
|
||||||
|
"description": "The node is connected in an upstream position, indicating it is responsible for monitoring or controlling processes that occur before the equipment's operation, such as input flow or supply."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Defines the position of the measurement relative to its parent equipment or system."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"asset": {
|
"asset": {
|
||||||
@@ -81,6 +102,14 @@
|
|||||||
"description": "A universally unique identifier for this asset. May be null if not assigned."
|
"description": "A universally unique identifier for this asset. May be null if not assigned."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"tagCode":{
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "Asset tag code which is a unique identifier for this asset. May be null if not assigned."
|
||||||
|
}
|
||||||
|
},
|
||||||
"geoLocation": {
|
"geoLocation": {
|
||||||
"default": {},
|
"default": {},
|
||||||
"rules": {
|
"rules": {
|
||||||
@@ -118,14 +147,14 @@
|
|||||||
"description": "The supplier or manufacturer of the asset."
|
"description": "The supplier or manufacturer of the asset."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"type": {
|
"category": {
|
||||||
"default": "pump",
|
"default": "pump",
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "A general classification of the asset tied to the specific software. This is not chosen from the asset dropdown menu."
|
"description": "A general classification of the asset tied to the specific software. This is not chosen from the asset dropdown menu."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"subType": {
|
"type": {
|
||||||
"default": "Centrifugal",
|
"default": "Centrifugal",
|
||||||
"rules": {
|
"rules": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -139,6 +168,13 @@
|
|||||||
"description": "A user-defined or manufacturer-defined model identifier for the asset."
|
"description": "A user-defined or manufacturer-defined model identifier for the asset."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"unit": {
|
||||||
|
"default": "unitless",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The unit of measurement for this asset (e.g., 'meters', 'seconds', 'unitless')."
|
||||||
|
}
|
||||||
|
},
|
||||||
"accuracy": {
|
"accuracy": {
|
||||||
"default": null,
|
"default": null,
|
||||||
"rules": {
|
"rules": {
|
||||||
@@ -314,31 +350,6 @@
|
|||||||
"description": "Information about valid command sources recognized by the machine."
|
"description": "Information about valid command sources recognized by the machine."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"action": {
|
|
||||||
"default": "statusCheck",
|
|
||||||
"rules": {
|
|
||||||
"type": "enum",
|
|
||||||
"values": [
|
|
||||||
{
|
|
||||||
"value": "statusCheck",
|
|
||||||
"description": "Checks the machine's state (mode, submode, operational status)."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": "execMovement",
|
|
||||||
"description": "Allows control through auto or GUI setpoints."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": "execSequence",
|
|
||||||
"description": "Allows execution of sequences through auto or GUI controls."
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"value": "emergencyStop",
|
|
||||||
"description": "Overrides all commands and stops the machine immediately (safety scenarios)."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Defines the possible actions that can be performed on the machine."
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sequences":{
|
"sequences":{
|
||||||
"default":{},
|
"default":{},
|
||||||
"rules": {
|
"rules": {
|
||||||
@@ -401,6 +412,14 @@
|
|||||||
],
|
],
|
||||||
"description": "The frequency at which calculations are performed."
|
"description": "The frequency at which calculations are performed."
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"flowNumber": {
|
||||||
|
"default": 1,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"nullable": false,
|
||||||
|
"description": "Defines which effluent flow of the parent node to handle."
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
387
src/configs/valve.json
Normal file
387
src/configs/valve.json
Normal file
@@ -0,0 +1,387 @@
|
|||||||
|
{
|
||||||
|
"general": {
|
||||||
|
"name": {
|
||||||
|
"default": "valve",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A human-readable name or label for this machine configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "A unique identifier for this configuration. If not provided, defaults to null."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"default": "m3/h",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The default measurement unit for this configuration (e.g., 'meters', 'seconds', 'unitless')."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"logging": {
|
||||||
|
"logLevel": {
|
||||||
|
"default": "info",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "debug",
|
||||||
|
"description": "Log messages are printed for debugging purposes."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "info",
|
||||||
|
"description": "Informational messages are printed."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "warn",
|
||||||
|
"description": "Warning messages are printed."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "error",
|
||||||
|
"description": "Error messages are printed."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Indicates whether logging is active. If true, log messages will be generated."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"functionality": {
|
||||||
|
"softwareType": {
|
||||||
|
"default": "valve",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Specified software type for this configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
"default": "controller",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Indicates the role this configuration plays within the system."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"positionVsParent":{
|
||||||
|
"default":"atEquipment",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "atEquipment",
|
||||||
|
"description": "The node is connected at the equipment level and is responsible for controlling or monitoring the equipment as a whole."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "upstream",
|
||||||
|
"description": "The node is connected in a downstream position, indicating it is responsible for monitoring or controlling processes that occur after the equipment's operation, such as product flow or output."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "downstream",
|
||||||
|
"description": "The node is connected in an upstream position, indicating it is responsible for monitoring or controlling processes that occur before the equipment's operation, such as input flow or supply."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Defines the position of the measurement relative to its parent equipment or system."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"uuid": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "A universally unique identifier for this asset. May be null if not assigned."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tagCode":{
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "Asset tag code which is a unique identifier for this asset. May be null if not assigned."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"geoLocation": {
|
||||||
|
"default": {},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "An object representing the asset's physical coordinates or location.",
|
||||||
|
"schema": {
|
||||||
|
"x": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "X coordinate of the asset's location."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Y coordinate of the asset's location."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Z coordinate of the asset's location."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supplier": {
|
||||||
|
"default": "Unknown",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The supplier or manufacturer of the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"category": {
|
||||||
|
"default": "valve",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A general classification of the asset tied to the specific software. This is not chosen from the asset dropdown menu."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"default": "gate",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A more specific classification within 'type'. For example, 'centrifugal' for a centrifugal pump."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"model": {
|
||||||
|
"default": "Unknown",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A user-defined or manufacturer-defined model identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"default": "unitless",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The unit of measurement for this asset (e.g., 'meters', 'seconds', 'unitless')."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "The accuracy of the machine or sensor, typically as a percentage or absolute value."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"valveCurve": {
|
||||||
|
"default": {
|
||||||
|
"1.204": {
|
||||||
|
"1": {
|
||||||
|
"x": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
|
||||||
|
"y": [0, 18, 50, 95, 150, 216, 337, 564, 882, 1398, 1870]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"type": "valveCurve",
|
||||||
|
"description": "the first parameter is kg (usually according to 1 normal cubic meter per hour acc. to din norm ) and the second parameter is the diameter in mm. The x values are the opening of the valve in percent and the y values are the KV values in m3/h. The KV value is the flow rate of water at a temperature of 20 degrees Celsius through the valve when it is fully open."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"current": {
|
||||||
|
"default": "auto",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "auto",
|
||||||
|
"description": "Machine accepts setpoints from a parent controller and runs autonomously."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "virtualControl",
|
||||||
|
"description": "Controlled via GUI setpoints; ignores parent commands."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "fysicalControl",
|
||||||
|
"description": "Controlled via physical buttons or switches; ignores external automated commands."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "maintenance",
|
||||||
|
"description": "No active control from auto, virtual, or fysical sources."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The operational mode of the machine."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allowedActions":{
|
||||||
|
"default":{},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema":{
|
||||||
|
"auto": {
|
||||||
|
"default": ["statusCheck", "execMovement", "execSequence", "emergencyStop"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in auto mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"virtualControl": {
|
||||||
|
"default": ["statusCheck", "execMovement", "execSequence", "emergencyStop"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in virtualControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fysicalControl": {
|
||||||
|
"default": ["statusCheck", "emergencyStop"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in fysicalControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"maintenance": {
|
||||||
|
"default": ["statusCheck"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in maintenance mode."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Information about valid command sources recognized by the machine."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allowedSources":{
|
||||||
|
"default": {},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema":{
|
||||||
|
"auto": {
|
||||||
|
"default": ["parent", "GUI", "fysical"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sources allowed in auto mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"virtualControl": {
|
||||||
|
"default": ["GUI", "fysical"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sources allowed in virtualControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fysicalControl": {
|
||||||
|
"default": ["fysical"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sources allowed in fysicalControl mode."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Information about valid command sources recognized by the machine."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"default": "parent",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "parent",
|
||||||
|
"description": "Commands are received from a parent controller."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "GUI",
|
||||||
|
"description": "Commands are received from a graphical user interface."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "fysical",
|
||||||
|
"description": "Commands are received from physical buttons or switches."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Information about valid command sources recognized by the machine."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sequences":{
|
||||||
|
"default":{},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema": {
|
||||||
|
"startup": {
|
||||||
|
"default": ["starting","warmingup","operational"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for starting up the machine."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"shutdown": {
|
||||||
|
"default": ["stopping","coolingdown","idle"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for shutting down the machine."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"emergencystop": {
|
||||||
|
"default": ["emergencystop","off"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for an emergency stop."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"boot": {
|
||||||
|
"default": ["idle","starting","warmingup","operational"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for booting up the machine."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Predefined sequences of states for the machine."
|
||||||
|
|
||||||
|
},
|
||||||
|
"calculationMode": {
|
||||||
|
"default": "medium",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "low",
|
||||||
|
"description": "Calculations run at fixed intervals (time-based)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "medium",
|
||||||
|
"description": "Calculations run when new setpoints arrive or measured changes occur (event-driven)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "high",
|
||||||
|
"description": "Calculations run on all event-driven info, including every movement."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The frequency at which calculations are performed."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
371
src/configs/valveGroupControl.json
Normal file
371
src/configs/valveGroupControl.json
Normal file
@@ -0,0 +1,371 @@
|
|||||||
|
{
|
||||||
|
"general": {
|
||||||
|
"name": {
|
||||||
|
"default": "ValveGroupControl",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A human-readable name or label for this valveGroupControl configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"id": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "A unique identifier for this configuration. If not provided, defaults to null."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"default": "unitless",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The default measurement unit for this configuration (e.g., 'meters', 'seconds', 'unitless')."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
"logging": {
|
||||||
|
"logLevel": {
|
||||||
|
"default": "info",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "debug",
|
||||||
|
"description": "Log messages are printed for debugging purposes."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "info",
|
||||||
|
"description": "Informational messages are printed."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "warn",
|
||||||
|
"description": "Warning messages are printed."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "error",
|
||||||
|
"description": "Error messages are printed."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"enabled": {
|
||||||
|
"default": true,
|
||||||
|
"rules": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Indicates whether logging is active. If true, log messages will be generated."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"functionality": {
|
||||||
|
"softwareType": {
|
||||||
|
"default": "valveGroupControl",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Specified software type for this configuration."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"role": {
|
||||||
|
"default": "ValveGroupController",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Indicates the role this configuration plays within the system."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"uuid": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "A universally unique identifier for this asset. May be null if not assigned."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"geoLocation": {
|
||||||
|
"default": {},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "An object representing the asset's physical coordinates or location.",
|
||||||
|
"schema": {
|
||||||
|
"x": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "X coordinate of the asset's location."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"y": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Y coordinate of the asset's location."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"z": {
|
||||||
|
"default": 0,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"description": "Z coordinate of the asset's location."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"supplier": {
|
||||||
|
"default": "Unknown",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "The supplier or manufacturer of the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"default": "valve",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A general classification of the asset tied to the specific software. This is not chosen from the asset dropdown menu."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"subType": {
|
||||||
|
"default": "Unknown",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A more specific classification within 'type'. For example, 'centrifugal' for a centrifugal pump."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"model": {
|
||||||
|
"default": "Unknown",
|
||||||
|
"rules": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "A user-defined or manufacturer-defined model identifier for the asset."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"default": null,
|
||||||
|
"rules": {
|
||||||
|
"type": "number",
|
||||||
|
"nullable": true,
|
||||||
|
"description": "The accuracy of the valve or sensor, typically as a percentage or absolute value."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"current": {
|
||||||
|
"default": "auto",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "auto",
|
||||||
|
"description": "ValveGroupController accepts inputs from a parents and childs and runs autonomously."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "virtualControl",
|
||||||
|
"description": "Controlled via GUI setpoints; ignores parent commands."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "fysicalControl",
|
||||||
|
"description": "Controlled via physical buttons or switches; ignores external automated commands."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "maintenance",
|
||||||
|
"description": "No active control from auto, virtual, or fysical sources."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The operational mode of the valveGroupControl."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allowedActions":{
|
||||||
|
"default":{},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema":{
|
||||||
|
"auto": {
|
||||||
|
"default": ["statusCheck", "execSequence", "emergencyStop", "valvePositionChange", "totalFlowChange", "valveDeltaPchange"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in auto mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"virtualControl": {
|
||||||
|
"default": ["statusCheck", "execSequence", "emergencyStop", "valvePositionChange", "totalFlowChange", "valveDeltaPchange"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in virtualControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fysicalControl": {
|
||||||
|
"default": ["statusCheck", "emergencyStop"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in fysicalControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"maintenance": {
|
||||||
|
"default": ["statusCheck"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Actions allowed in maintenance mode."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Information about valid command sources recognized by the valve."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"allowedSources":{
|
||||||
|
"default": {},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema":{
|
||||||
|
"auto": {
|
||||||
|
"default": ["parent", "GUI", "fysical"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sources allowed in auto mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"virtualControl": {
|
||||||
|
"default": ["GUI", "fysical"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sources allowed in virtualControl mode."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fysicalControl": {
|
||||||
|
"default": ["fysical"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sources allowed in fysicalControl mode."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Information about valid command sources recognized by the valveGroupControl."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"default": "parent",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "parent",
|
||||||
|
"description": "Commands are received from a parent controller."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "GUI",
|
||||||
|
"description": "Commands are received from a graphical user interface."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "fysical",
|
||||||
|
"description": "Commands are received from physical buttons or switches."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Information about valid command sources recognized by the valveGroupControl."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"action": {
|
||||||
|
"default": "statusCheck",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "statusCheck",
|
||||||
|
"description": "Checks the valveGroupControl's state (mode, submode, operational status)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "valvePositionChange",
|
||||||
|
"description": "If child valve position change, the new flow for each child valve is determined"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "execSequence",
|
||||||
|
"description": "Allows execution of sequences through auto or GUI controls."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "totalFlowChange",
|
||||||
|
"description": "If total flow change, the new flow for each child valve is determined"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "valveDeltaPchange",
|
||||||
|
"description": "If deltaP change, the deltaPmax is determined"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "emergencyStop",
|
||||||
|
"description": "Overrides all commands and stops the valveGroupControl immediately (safety scenarios)."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Defines the possible actions that can be performed on the valveGroupControl."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sequences":{
|
||||||
|
"default":{},
|
||||||
|
"rules": {
|
||||||
|
"type": "object",
|
||||||
|
"schema": {
|
||||||
|
"startup": {
|
||||||
|
"default": ["starting","warmingup","operational"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for starting up the valve."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"shutdown": {
|
||||||
|
"default": ["stopping","coolingdown","idle"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for shutting down the valveGroupControl."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"emergencystop": {
|
||||||
|
"default": ["emergencystop","off"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for an emergency stop."
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"boot": {
|
||||||
|
"default": ["idle","starting","warmingup","operational"],
|
||||||
|
"rules": {
|
||||||
|
"type": "set",
|
||||||
|
"itemType": "string",
|
||||||
|
"description": "Sequence of states for booting up the valveGroupControl."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": "Predefined sequences of states for the valveGroupControl."
|
||||||
|
|
||||||
|
},
|
||||||
|
"calculationMode": {
|
||||||
|
"default": "medium",
|
||||||
|
"rules": {
|
||||||
|
"type": "enum",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"value": "low",
|
||||||
|
"description": "Calculations run at fixed intervals (time-based)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "medium",
|
||||||
|
"description": "Calculations run when new setpoints arrive or measured changes occur (event-driven)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value": "high",
|
||||||
|
"description": "Calculations run on all event-driven info, including every movement."
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "The frequency at which calculations are performed."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
49
src/convert/definitions/angle.js
Normal file
49
src/convert/definitions/angle.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
var angle;
|
||||||
|
|
||||||
|
angle = {
|
||||||
|
rad: {
|
||||||
|
name: {
|
||||||
|
singular: 'radian'
|
||||||
|
, plural: 'radians'
|
||||||
|
}
|
||||||
|
, to_anchor: 180/Math.PI
|
||||||
|
}
|
||||||
|
, deg: {
|
||||||
|
name: {
|
||||||
|
singular: 'degree'
|
||||||
|
, plural: 'degrees'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, grad: {
|
||||||
|
name: {
|
||||||
|
singular: 'gradian'
|
||||||
|
, plural: 'gradians'
|
||||||
|
}
|
||||||
|
, to_anchor: 9/10
|
||||||
|
}
|
||||||
|
, arcmin: {
|
||||||
|
name: {
|
||||||
|
singular: 'arcminute'
|
||||||
|
, plural: 'arcminutes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/60
|
||||||
|
}
|
||||||
|
, arcsec: {
|
||||||
|
name: {
|
||||||
|
singular: 'arcsecond'
|
||||||
|
, plural: 'arcseconds'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/3600
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: angle
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'deg'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
49
src/convert/definitions/apparentPower.js
Normal file
49
src/convert/definitions/apparentPower.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
var apparentPower;
|
||||||
|
|
||||||
|
apparentPower = {
|
||||||
|
VA: {
|
||||||
|
name: {
|
||||||
|
singular: 'Volt-Ampere'
|
||||||
|
, plural: 'Volt-Amperes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, mVA: {
|
||||||
|
name: {
|
||||||
|
singular: 'Millivolt-Ampere'
|
||||||
|
, plural: 'Millivolt-Amperes'
|
||||||
|
}
|
||||||
|
, to_anchor: .001
|
||||||
|
}
|
||||||
|
, kVA: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilovolt-Ampere'
|
||||||
|
, plural: 'Kilovolt-Amperes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, MVA: {
|
||||||
|
name: {
|
||||||
|
singular: 'Megavolt-Ampere'
|
||||||
|
, plural: 'Megavolt-Amperes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000
|
||||||
|
}
|
||||||
|
, GVA: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gigavolt-Ampere'
|
||||||
|
, plural: 'Gigavolt-Amperes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: apparentPower
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'VA'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
93
src/convert/definitions/area.js
Normal file
93
src/convert/definitions/area.js
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
mm2: {
|
||||||
|
name: {
|
||||||
|
singular: 'Square Millimeter'
|
||||||
|
, plural: 'Square Millimeters'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000000
|
||||||
|
}
|
||||||
|
, cm2: {
|
||||||
|
name: {
|
||||||
|
singular: 'Centimeter'
|
||||||
|
, plural: 'Centimeters'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/10000
|
||||||
|
}
|
||||||
|
, m2: {
|
||||||
|
name: {
|
||||||
|
singular: 'Square Meter'
|
||||||
|
, plural: 'Square Meters'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, ha: {
|
||||||
|
name: {
|
||||||
|
singular: 'Hectare'
|
||||||
|
, plural: 'Hectares'
|
||||||
|
}
|
||||||
|
, to_anchor: 10000
|
||||||
|
}
|
||||||
|
, km2: {
|
||||||
|
name: {
|
||||||
|
singular: 'Square Kilometer'
|
||||||
|
, plural: 'Square Kilometers'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
'in2': {
|
||||||
|
name: {
|
||||||
|
singular: 'Square Inch'
|
||||||
|
, plural: 'Square Inches'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/144
|
||||||
|
}
|
||||||
|
, yd2: {
|
||||||
|
name: {
|
||||||
|
singular: 'Square Yard'
|
||||||
|
, plural: 'Square Yards'
|
||||||
|
}
|
||||||
|
, to_anchor: 9
|
||||||
|
}
|
||||||
|
, ft2: {
|
||||||
|
name: {
|
||||||
|
singular: 'Square Foot'
|
||||||
|
, plural: 'Square Feet'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, ac: {
|
||||||
|
name: {
|
||||||
|
singular: 'Acre'
|
||||||
|
, plural: 'Acres'
|
||||||
|
}
|
||||||
|
, to_anchor: 43560
|
||||||
|
}
|
||||||
|
, mi2: {
|
||||||
|
name: {
|
||||||
|
singular: 'Square Mile'
|
||||||
|
, plural: 'Square Miles'
|
||||||
|
}
|
||||||
|
, to_anchor: 27878400
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'm2'
|
||||||
|
, ratio: 10.7639
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 'ft2'
|
||||||
|
, ratio: 1/10.7639
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
35
src/convert/definitions/current.js
Normal file
35
src/convert/definitions/current.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
var current;
|
||||||
|
|
||||||
|
current = {
|
||||||
|
A: {
|
||||||
|
name: {
|
||||||
|
singular: 'Ampere'
|
||||||
|
, plural: 'Amperes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, mA: {
|
||||||
|
name: {
|
||||||
|
singular: 'Milliampere'
|
||||||
|
, plural: 'Milliamperes'
|
||||||
|
}
|
||||||
|
, to_anchor: .001
|
||||||
|
}
|
||||||
|
, kA: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kiloampere'
|
||||||
|
, plural: 'Kiloamperes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: current
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'A'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
93
src/convert/definitions/digital.js
Normal file
93
src/convert/definitions/digital.js
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
var bits
|
||||||
|
, bytes;
|
||||||
|
|
||||||
|
bits = {
|
||||||
|
b: {
|
||||||
|
name: {
|
||||||
|
singular: 'Bit'
|
||||||
|
, plural: 'Bits'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, Kb: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilobit'
|
||||||
|
, plural: 'Kilobits'
|
||||||
|
}
|
||||||
|
, to_anchor: 1024
|
||||||
|
}
|
||||||
|
, Mb: {
|
||||||
|
name: {
|
||||||
|
singular: 'Megabit'
|
||||||
|
, plural: 'Megabits'
|
||||||
|
}
|
||||||
|
, to_anchor: 1048576
|
||||||
|
}
|
||||||
|
, Gb: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gigabit'
|
||||||
|
, plural: 'Gigabits'
|
||||||
|
}
|
||||||
|
, to_anchor: 1073741824
|
||||||
|
}
|
||||||
|
, Tb: {
|
||||||
|
name: {
|
||||||
|
singular: 'Terabit'
|
||||||
|
, plural: 'Terabits'
|
||||||
|
}
|
||||||
|
, to_anchor: 1099511627776
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
bytes = {
|
||||||
|
B: {
|
||||||
|
name: {
|
||||||
|
singular: 'Byte'
|
||||||
|
, plural: 'Bytes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, KB: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilobyte'
|
||||||
|
, plural: 'Kilobytes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1024
|
||||||
|
}
|
||||||
|
, MB: {
|
||||||
|
name: {
|
||||||
|
singular: 'Megabyte'
|
||||||
|
, plural: 'Megabytes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1048576
|
||||||
|
}
|
||||||
|
, GB: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gigabyte'
|
||||||
|
, plural: 'Gigabytes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1073741824
|
||||||
|
}
|
||||||
|
, TB: {
|
||||||
|
name: {
|
||||||
|
singular: 'Terabyte'
|
||||||
|
, plural: 'Terabytes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1099511627776
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
bits: bits
|
||||||
|
, bytes: bytes
|
||||||
|
, _anchors: {
|
||||||
|
bits: {
|
||||||
|
unit: 'b'
|
||||||
|
, ratio: 1/8
|
||||||
|
}
|
||||||
|
, bytes: {
|
||||||
|
unit: 'B'
|
||||||
|
, ratio: 8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
30
src/convert/definitions/each.js
Normal file
30
src/convert/definitions/each.js
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
ea: {
|
||||||
|
name: {
|
||||||
|
singular: 'Each'
|
||||||
|
, plural: 'Each'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
},
|
||||||
|
dz: {
|
||||||
|
name: {
|
||||||
|
singular: 'Dozen'
|
||||||
|
, plural: 'Dozens'
|
||||||
|
}
|
||||||
|
, to_anchor: 12
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: {}
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'ea'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
63
src/convert/definitions/energy.js
Normal file
63
src/convert/definitions/energy.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
var energy;
|
||||||
|
|
||||||
|
energy = {
|
||||||
|
Wh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Watt-hour'
|
||||||
|
, plural: 'Watt-hours'
|
||||||
|
}
|
||||||
|
, to_anchor: 3600
|
||||||
|
}
|
||||||
|
, mWh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Milliwatt-hour'
|
||||||
|
, plural: 'Milliwatt-hours'
|
||||||
|
}
|
||||||
|
, to_anchor: 3.6
|
||||||
|
}
|
||||||
|
, kWh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilowatt-hour'
|
||||||
|
, plural: 'Kilowatt-hours'
|
||||||
|
}
|
||||||
|
, to_anchor: 3600000
|
||||||
|
}
|
||||||
|
, MWh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Megawatt-hour'
|
||||||
|
, plural: 'Megawatt-hours'
|
||||||
|
}
|
||||||
|
, to_anchor: 3600000000
|
||||||
|
}
|
||||||
|
, GWh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gigawatt-hour'
|
||||||
|
, plural: 'Gigawatt-hours'
|
||||||
|
}
|
||||||
|
, to_anchor: 3600000000000
|
||||||
|
}
|
||||||
|
, J: {
|
||||||
|
name: {
|
||||||
|
singular: 'Joule'
|
||||||
|
, plural: 'Joules'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, kJ: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilojoule'
|
||||||
|
, plural: 'Kilojoules'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: energy
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'J'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
78
src/convert/definitions/frequency.js
Normal file
78
src/convert/definitions/frequency.js
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
var frequency;
|
||||||
|
|
||||||
|
frequency = {
|
||||||
|
mHz: {
|
||||||
|
name: {
|
||||||
|
singular: 'millihertz'
|
||||||
|
, plural: 'millihertz'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, Hz: {
|
||||||
|
name: {
|
||||||
|
singular: 'hertz'
|
||||||
|
, plural: 'hertz'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, kHz: {
|
||||||
|
name: {
|
||||||
|
singular: 'kilohertz'
|
||||||
|
, plural: 'kilohertz'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, MHz: {
|
||||||
|
name: {
|
||||||
|
singular: 'megahertz'
|
||||||
|
, plural: 'megahertz'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000 * 1000
|
||||||
|
}
|
||||||
|
, GHz: {
|
||||||
|
name: {
|
||||||
|
singular: 'gigahertz'
|
||||||
|
, plural: 'gigahertz'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000 * 1000 * 1000
|
||||||
|
}
|
||||||
|
, THz: {
|
||||||
|
name: {
|
||||||
|
singular: 'terahertz'
|
||||||
|
, plural: 'terahertz'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000 * 1000 * 1000 * 1000
|
||||||
|
}
|
||||||
|
, rpm: {
|
||||||
|
name: {
|
||||||
|
singular: 'rotation per minute'
|
||||||
|
, plural: 'rotations per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/60
|
||||||
|
}
|
||||||
|
, "deg/s": {
|
||||||
|
name: {
|
||||||
|
singular: 'degree per second'
|
||||||
|
, plural: 'degrees per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/360
|
||||||
|
}
|
||||||
|
, "rad/s": {
|
||||||
|
name: {
|
||||||
|
singular: 'radian per second'
|
||||||
|
, plural: 'radians per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/(Math.PI * 2)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: frequency
|
||||||
|
, _anchors: {
|
||||||
|
frequency: {
|
||||||
|
unit: 'hz'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
37
src/convert/definitions/illuminance.js
Normal file
37
src/convert/definitions/illuminance.js
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
var metric,
|
||||||
|
imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
'lx': {
|
||||||
|
name: {
|
||||||
|
singular: 'Lux',
|
||||||
|
plural: 'Lux'
|
||||||
|
},
|
||||||
|
to_anchor: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
'ft-cd': {
|
||||||
|
name: {
|
||||||
|
singular: 'Foot-candle',
|
||||||
|
plural: 'Foot-candles'
|
||||||
|
},
|
||||||
|
to_anchor: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric,
|
||||||
|
imperial: imperial,
|
||||||
|
_anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'lx',
|
||||||
|
ratio: 1/10.76391
|
||||||
|
},
|
||||||
|
imperial: {
|
||||||
|
unit: 'ft-cd',
|
||||||
|
ratio: 10.76391
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
86
src/convert/definitions/length.js
Normal file
86
src/convert/definitions/length.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
var metric,
|
||||||
|
imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
mm: {
|
||||||
|
name: {
|
||||||
|
singular: 'Millimeter',
|
||||||
|
plural: 'Millimeters'
|
||||||
|
},
|
||||||
|
to_anchor: 1/1000
|
||||||
|
},
|
||||||
|
cm: {
|
||||||
|
name: {
|
||||||
|
singular: 'Centimeter',
|
||||||
|
plural: 'Centimeters'
|
||||||
|
},
|
||||||
|
to_anchor: 1/100
|
||||||
|
},
|
||||||
|
m: {
|
||||||
|
name: {
|
||||||
|
singular: 'Meter',
|
||||||
|
plural: 'Meters'
|
||||||
|
},
|
||||||
|
to_anchor: 1
|
||||||
|
},
|
||||||
|
km: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilometer',
|
||||||
|
plural: 'Kilometers'
|
||||||
|
},
|
||||||
|
to_anchor: 1000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
'in': {
|
||||||
|
name: {
|
||||||
|
singular: 'Inch',
|
||||||
|
plural: 'Inches'
|
||||||
|
},
|
||||||
|
to_anchor: 1/12
|
||||||
|
},
|
||||||
|
yd: {
|
||||||
|
name: {
|
||||||
|
singular: 'Yard',
|
||||||
|
plural: 'Yards'
|
||||||
|
},
|
||||||
|
to_anchor: 3
|
||||||
|
},
|
||||||
|
'ft-us': {
|
||||||
|
name: {
|
||||||
|
singular: 'US Survey Foot',
|
||||||
|
plural: 'US Survey Feet'
|
||||||
|
},
|
||||||
|
to_anchor: 1.000002
|
||||||
|
},
|
||||||
|
ft: {
|
||||||
|
name: {
|
||||||
|
singular: 'Foot',
|
||||||
|
plural: 'Feet'
|
||||||
|
},
|
||||||
|
to_anchor: 1
|
||||||
|
},
|
||||||
|
mi: {
|
||||||
|
name: {
|
||||||
|
singular: 'Mile',
|
||||||
|
plural: 'Miles'
|
||||||
|
},
|
||||||
|
to_anchor: 5280
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric,
|
||||||
|
imperial: imperial,
|
||||||
|
_anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'm',
|
||||||
|
ratio: 3.28084
|
||||||
|
},
|
||||||
|
imperial: {
|
||||||
|
unit: 'ft',
|
||||||
|
ratio: 1/3.28084
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
78
src/convert/definitions/mass.js
Normal file
78
src/convert/definitions/mass.js
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
mcg: {
|
||||||
|
name: {
|
||||||
|
singular: 'Microgram'
|
||||||
|
, plural: 'Micrograms'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000000
|
||||||
|
}
|
||||||
|
, mg: {
|
||||||
|
name: {
|
||||||
|
singular: 'Milligram'
|
||||||
|
, plural: 'Milligrams'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, g: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gram'
|
||||||
|
, plural: 'Grams'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, kg: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilogram'
|
||||||
|
, plural: 'Kilograms'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, mt: {
|
||||||
|
name: {
|
||||||
|
singular: 'Metric Tonne'
|
||||||
|
, plural: 'Metric Tonnes'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
oz: {
|
||||||
|
name: {
|
||||||
|
singular: 'Ounce'
|
||||||
|
, plural: 'Ounces'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/16
|
||||||
|
}
|
||||||
|
, lb: {
|
||||||
|
name: {
|
||||||
|
singular: 'Pound'
|
||||||
|
, plural: 'Pounds'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}, t: {
|
||||||
|
name: {
|
||||||
|
singular: 'Ton',
|
||||||
|
plural: 'Tons',
|
||||||
|
},
|
||||||
|
to_anchor: 2000,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'g'
|
||||||
|
, ratio: 1/453.592
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 'lb'
|
||||||
|
, ratio: 453.592
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
51
src/convert/definitions/pace.js
Normal file
51
src/convert/definitions/pace.js
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
'min/km': {
|
||||||
|
name: {
|
||||||
|
singular: 'Minute per kilometre'
|
||||||
|
, plural: 'Minutes per kilometre'
|
||||||
|
}
|
||||||
|
, to_anchor: 0.06
|
||||||
|
}
|
||||||
|
,'s/m': {
|
||||||
|
name: {
|
||||||
|
singular: 'Second per metre'
|
||||||
|
, plural: 'Seconds per metre'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
'min/mi': {
|
||||||
|
name: {
|
||||||
|
singular: 'Minute per mile'
|
||||||
|
, plural: 'Minutes per mile'
|
||||||
|
}
|
||||||
|
, to_anchor: 0.0113636
|
||||||
|
}
|
||||||
|
, 's/ft': {
|
||||||
|
name: {
|
||||||
|
singular: 'Second per foot'
|
||||||
|
, plural: 'Seconds per foot'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 's/m'
|
||||||
|
, ratio: 0.3048
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 's/ft'
|
||||||
|
, ratio: 1/0.3048
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
44
src/convert/definitions/partsPer.js
Normal file
44
src/convert/definitions/partsPer.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
ppm: {
|
||||||
|
name: {
|
||||||
|
singular: 'Part-per Million'
|
||||||
|
, plural: 'Parts-per Million'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, ppb: {
|
||||||
|
name: {
|
||||||
|
singular: 'Part-per Billion'
|
||||||
|
, plural: 'Parts-per Billion'
|
||||||
|
}
|
||||||
|
, to_anchor: .001
|
||||||
|
}
|
||||||
|
, ppt: {
|
||||||
|
name: {
|
||||||
|
singular: 'Part-per Trillion'
|
||||||
|
, plural: 'Parts-per Trillion'
|
||||||
|
}
|
||||||
|
, to_anchor: .000001
|
||||||
|
}
|
||||||
|
, ppq: {
|
||||||
|
name: {
|
||||||
|
singular: 'Part-per Quadrillion'
|
||||||
|
, plural: 'Parts-per Quadrillion'
|
||||||
|
}
|
||||||
|
, to_anchor: .000000001
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: {}
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'ppm'
|
||||||
|
, ratio: .000001
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
49
src/convert/definitions/power.js
Normal file
49
src/convert/definitions/power.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
var power;
|
||||||
|
|
||||||
|
power = {
|
||||||
|
W: {
|
||||||
|
name: {
|
||||||
|
singular: 'Watt'
|
||||||
|
, plural: 'Watts'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, mW: {
|
||||||
|
name: {
|
||||||
|
singular: 'Milliwatt'
|
||||||
|
, plural: 'Milliwatts'
|
||||||
|
}
|
||||||
|
, to_anchor: .001
|
||||||
|
}
|
||||||
|
, kW: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilowatt'
|
||||||
|
, plural: 'Kilowatts'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, MW: {
|
||||||
|
name: {
|
||||||
|
singular: 'Megawatt'
|
||||||
|
, plural: 'Megawatts'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000
|
||||||
|
}
|
||||||
|
, GW: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gigawatt'
|
||||||
|
, plural: 'Gigawatts'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: power
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'W'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
86
src/convert/definitions/pressure.js
Normal file
86
src/convert/definitions/pressure.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
Pa: {
|
||||||
|
name: {
|
||||||
|
singular: 'pascal'
|
||||||
|
, plural: 'pascals'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, kPa: {
|
||||||
|
name: {
|
||||||
|
singular: 'kilopascal'
|
||||||
|
, plural: 'kilopascals'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, MPa: {
|
||||||
|
name: {
|
||||||
|
singular: 'megapascal'
|
||||||
|
, plural: 'megapascals'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, hPa: {
|
||||||
|
name: {
|
||||||
|
singular: 'hectopascal'
|
||||||
|
, plural: 'hectopascals'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/10
|
||||||
|
}
|
||||||
|
, bar: {
|
||||||
|
name: {
|
||||||
|
singular: 'bar'
|
||||||
|
, plural: 'bar'
|
||||||
|
}
|
||||||
|
, to_anchor: 100
|
||||||
|
}
|
||||||
|
, mbar: {
|
||||||
|
name: {
|
||||||
|
singular: 'mbar'
|
||||||
|
, plural: 'mbar'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/10
|
||||||
|
}
|
||||||
|
, torr: {
|
||||||
|
name: {
|
||||||
|
singular: 'torr'
|
||||||
|
, plural: 'torr'
|
||||||
|
}
|
||||||
|
, to_anchor: 101325/760000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
psi: {
|
||||||
|
name: {
|
||||||
|
singular: 'pound per square inch'
|
||||||
|
, plural: 'pounds per square inch'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, ksi: {
|
||||||
|
name: {
|
||||||
|
singular: 'kilopound per square inch'
|
||||||
|
, plural: 'kilopound per square inch'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'kPa'
|
||||||
|
, ratio: 0.00014503768078
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 'psi'
|
||||||
|
, ratio: 1/0.00014503768078
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
49
src/convert/definitions/reactiveEnergy.js
Normal file
49
src/convert/definitions/reactiveEnergy.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
var reactiveEnergy;
|
||||||
|
|
||||||
|
reactiveEnergy = {
|
||||||
|
VARh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Volt-Ampere Reactive Hour'
|
||||||
|
, plural: 'Volt-Amperes Reactive Hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, mVARh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Millivolt-Ampere Reactive Hour'
|
||||||
|
, plural: 'Millivolt-Amperes Reactive Hour'
|
||||||
|
}
|
||||||
|
, to_anchor: .001
|
||||||
|
}
|
||||||
|
, kVARh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilovolt-Ampere Reactive Hour'
|
||||||
|
, plural: 'Kilovolt-Amperes Reactive Hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, MVARh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Megavolt-Ampere Reactive Hour'
|
||||||
|
, plural: 'Megavolt-Amperes Reactive Hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000
|
||||||
|
}
|
||||||
|
, GVARh: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gigavolt-Ampere Reactive Hour'
|
||||||
|
, plural: 'Gigavolt-Amperes Reactive Hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: reactiveEnergy
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'VARh'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
49
src/convert/definitions/reactivePower.js
Normal file
49
src/convert/definitions/reactivePower.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
var reactivePower;
|
||||||
|
|
||||||
|
reactivePower = {
|
||||||
|
VAR: {
|
||||||
|
name: {
|
||||||
|
singular: 'Volt-Ampere Reactive'
|
||||||
|
, plural: 'Volt-Amperes Reactive'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, mVAR: {
|
||||||
|
name: {
|
||||||
|
singular: 'Millivolt-Ampere Reactive'
|
||||||
|
, plural: 'Millivolt-Amperes Reactive'
|
||||||
|
}
|
||||||
|
, to_anchor: .001
|
||||||
|
}
|
||||||
|
, kVAR: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilovolt-Ampere Reactive'
|
||||||
|
, plural: 'Kilovolt-Amperes Reactive'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, MVAR: {
|
||||||
|
name: {
|
||||||
|
singular: 'Megavolt-Ampere Reactive'
|
||||||
|
, plural: 'Megavolt-Amperes Reactive'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000
|
||||||
|
}
|
||||||
|
, GVAR: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gigavolt-Ampere Reactive'
|
||||||
|
, plural: 'Gigavolt-Amperes Reactive'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: reactivePower
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'VAR'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
58
src/convert/definitions/speed.js
Normal file
58
src/convert/definitions/speed.js
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
'm/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Metre per second'
|
||||||
|
, plural: 'Metres per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 3.6
|
||||||
|
}
|
||||||
|
, 'km/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilometre per hour'
|
||||||
|
, plural: 'Kilometres per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
'm/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Mile per hour'
|
||||||
|
, plural: 'Miles per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, knot: {
|
||||||
|
name: {
|
||||||
|
singular: 'Knot'
|
||||||
|
, plural: 'Knots'
|
||||||
|
}
|
||||||
|
, to_anchor: 1.150779
|
||||||
|
}
|
||||||
|
, 'ft/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Foot per second'
|
||||||
|
, plural: 'Feet per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 0.681818
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'km/h'
|
||||||
|
, ratio: 1/1.609344
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 'm/h'
|
||||||
|
, ratio: 1.609344
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
55
src/convert/definitions/temperature.js
Normal file
55
src/convert/definitions/temperature.js
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
C: {
|
||||||
|
name: {
|
||||||
|
singular: 'degree Celsius'
|
||||||
|
, plural: 'degrees Celsius'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
, anchor_shift: 0
|
||||||
|
},
|
||||||
|
K: {
|
||||||
|
name: {
|
||||||
|
singular: 'degree Kelvin'
|
||||||
|
, plural: 'degrees Kelvin'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
, anchor_shift: 273.15
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
F: {
|
||||||
|
name: {
|
||||||
|
singular: 'degree Fahrenheit'
|
||||||
|
, plural: 'degrees Fahrenheit'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
},
|
||||||
|
R: {
|
||||||
|
name: {
|
||||||
|
singular: 'degree Rankine'
|
||||||
|
, plural: 'degrees Rankine'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
, anchor_shift: 459.67
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'C'
|
||||||
|
, transform: function (C) { return C / (5/9) + 32 }
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 'F'
|
||||||
|
, transform: function (F) { return (F - 32) * (5/9) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
86
src/convert/definitions/time.js
Normal file
86
src/convert/definitions/time.js
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
var time;
|
||||||
|
var daysInYear = 365.25;
|
||||||
|
|
||||||
|
time = {
|
||||||
|
ns: {
|
||||||
|
name: {
|
||||||
|
singular: 'Nanosecond'
|
||||||
|
, plural: 'Nanoseconds'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000000000
|
||||||
|
}
|
||||||
|
, mu: {
|
||||||
|
name: {
|
||||||
|
singular: 'Microsecond'
|
||||||
|
, plural: 'Microseconds'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000000
|
||||||
|
}
|
||||||
|
, ms: {
|
||||||
|
name: {
|
||||||
|
singular: 'Millisecond'
|
||||||
|
, plural: 'Milliseconds'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, s: {
|
||||||
|
name: {
|
||||||
|
singular: 'Second'
|
||||||
|
, plural: 'Seconds'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, min: {
|
||||||
|
name: {
|
||||||
|
singular: 'Minute'
|
||||||
|
, plural: 'Minutes'
|
||||||
|
}
|
||||||
|
, to_anchor: 60
|
||||||
|
}
|
||||||
|
, h: {
|
||||||
|
name: {
|
||||||
|
singular: 'Hour'
|
||||||
|
, plural: 'Hours'
|
||||||
|
}
|
||||||
|
, to_anchor: 60 * 60
|
||||||
|
}
|
||||||
|
, d: {
|
||||||
|
name: {
|
||||||
|
singular: 'Day'
|
||||||
|
, plural: 'Days'
|
||||||
|
}
|
||||||
|
, to_anchor: 60 * 60 * 24
|
||||||
|
}
|
||||||
|
, week: {
|
||||||
|
name: {
|
||||||
|
singular: 'Week'
|
||||||
|
, plural: 'Weeks'
|
||||||
|
}
|
||||||
|
, to_anchor: 60 * 60 * 24 * 7
|
||||||
|
}
|
||||||
|
, month: {
|
||||||
|
name: {
|
||||||
|
singular: 'Month'
|
||||||
|
, plural: 'Months'
|
||||||
|
}
|
||||||
|
, to_anchor: 60 * 60 * 24 * daysInYear / 12
|
||||||
|
}
|
||||||
|
, year: {
|
||||||
|
name: {
|
||||||
|
singular: 'Year'
|
||||||
|
, plural: 'Years'
|
||||||
|
}
|
||||||
|
, to_anchor: 60 * 60 * 24 * daysInYear
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: time
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 's'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
35
src/convert/definitions/voltage.js
Normal file
35
src/convert/definitions/voltage.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
var voltage;
|
||||||
|
|
||||||
|
voltage = {
|
||||||
|
V: {
|
||||||
|
name: {
|
||||||
|
singular: 'Volt'
|
||||||
|
, plural: 'Volts'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, mV: {
|
||||||
|
name: {
|
||||||
|
singular: 'Millivolt'
|
||||||
|
, plural: 'Millivolts'
|
||||||
|
}
|
||||||
|
, to_anchor: .001
|
||||||
|
}
|
||||||
|
, kV: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilovolt'
|
||||||
|
, plural: 'Kilovolts'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: voltage
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'V'
|
||||||
|
, ratio: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
200
src/convert/definitions/volume.js
Normal file
200
src/convert/definitions/volume.js
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
mm3: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic Millimeter'
|
||||||
|
, plural: 'Cubic Millimeters'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000000
|
||||||
|
}
|
||||||
|
, cm3: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic Centimeter'
|
||||||
|
, plural: 'Cubic Centimeters'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, ml: {
|
||||||
|
name: {
|
||||||
|
singular: 'Millilitre'
|
||||||
|
, plural: 'Millilitres'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, cl: {
|
||||||
|
name: {
|
||||||
|
singular: 'Centilitre'
|
||||||
|
, plural: 'Centilitres'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/100
|
||||||
|
}
|
||||||
|
, dl: {
|
||||||
|
name: {
|
||||||
|
singular: 'Decilitre'
|
||||||
|
, plural: 'Decilitres'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/10
|
||||||
|
}
|
||||||
|
, l: {
|
||||||
|
name: {
|
||||||
|
singular: 'Litre'
|
||||||
|
, plural: 'Litres'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, kl: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilolitre'
|
||||||
|
, plural: 'Kilolitres'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, m3: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic meter'
|
||||||
|
, plural: 'Cubic meters'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, km3: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic kilometer'
|
||||||
|
, plural: 'Cubic kilometers'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000000000
|
||||||
|
}
|
||||||
|
|
||||||
|
// Swedish units
|
||||||
|
, krm: {
|
||||||
|
name: {
|
||||||
|
singular: 'Matsked'
|
||||||
|
, plural: 'Matskedar'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, tsk: {
|
||||||
|
name: {
|
||||||
|
singular: 'Tesked'
|
||||||
|
, plural: 'Teskedar'
|
||||||
|
}
|
||||||
|
, to_anchor: 5/1000
|
||||||
|
}
|
||||||
|
, msk: {
|
||||||
|
name: {
|
||||||
|
singular: 'Matsked'
|
||||||
|
, plural: 'Matskedar'
|
||||||
|
}
|
||||||
|
, to_anchor: 15/1000
|
||||||
|
}
|
||||||
|
, kkp: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kaffekopp'
|
||||||
|
, plural: 'Kaffekoppar'
|
||||||
|
}
|
||||||
|
, to_anchor: 150/1000
|
||||||
|
}
|
||||||
|
, glas: {
|
||||||
|
name: {
|
||||||
|
singular: 'Glas'
|
||||||
|
, plural: 'Glas'
|
||||||
|
}
|
||||||
|
, to_anchor: 200/1000
|
||||||
|
}
|
||||||
|
, kanna: {
|
||||||
|
name: {
|
||||||
|
singular: 'Kanna'
|
||||||
|
, plural: 'Kannor'
|
||||||
|
}
|
||||||
|
, to_anchor: 2.617
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
tsp: {
|
||||||
|
name: {
|
||||||
|
singular: 'Teaspoon'
|
||||||
|
, plural: 'Teaspoons'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/6
|
||||||
|
}
|
||||||
|
, Tbs: {
|
||||||
|
name: {
|
||||||
|
singular: 'Tablespoon'
|
||||||
|
, plural: 'Tablespoons'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/2
|
||||||
|
}
|
||||||
|
, in3: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic inch'
|
||||||
|
, plural: 'Cubic inches'
|
||||||
|
}
|
||||||
|
, to_anchor: 0.55411
|
||||||
|
}
|
||||||
|
, 'fl-oz': {
|
||||||
|
name: {
|
||||||
|
singular: 'Fluid Ounce'
|
||||||
|
, plural: 'Fluid Ounces'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, cup: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cup'
|
||||||
|
, plural: 'Cups'
|
||||||
|
}
|
||||||
|
, to_anchor: 8
|
||||||
|
}
|
||||||
|
, pnt: {
|
||||||
|
name: {
|
||||||
|
singular: 'Pint'
|
||||||
|
, plural: 'Pints'
|
||||||
|
}
|
||||||
|
, to_anchor: 16
|
||||||
|
}
|
||||||
|
, qt: {
|
||||||
|
name: {
|
||||||
|
singular: 'Quart'
|
||||||
|
, plural: 'Quarts'
|
||||||
|
}
|
||||||
|
, to_anchor: 32
|
||||||
|
}
|
||||||
|
, gal: {
|
||||||
|
name: {
|
||||||
|
singular: 'Gallon'
|
||||||
|
, plural: 'Gallons'
|
||||||
|
}
|
||||||
|
, to_anchor: 128
|
||||||
|
}
|
||||||
|
, ft3: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic foot'
|
||||||
|
, plural: 'Cubic feet'
|
||||||
|
}
|
||||||
|
, to_anchor: 957.506
|
||||||
|
}
|
||||||
|
, yd3: {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic yard'
|
||||||
|
, plural: 'Cubic yards'
|
||||||
|
}
|
||||||
|
, to_anchor: 25852.7
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'l'
|
||||||
|
, ratio: 33.8140226
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 'fl-oz'
|
||||||
|
, ratio: 1/33.8140226
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
282
src/convert/definitions/volumeFlowRate.js
Normal file
282
src/convert/definitions/volumeFlowRate.js
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
var metric
|
||||||
|
, imperial;
|
||||||
|
|
||||||
|
metric = {
|
||||||
|
'mm3/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic Millimeter per second'
|
||||||
|
, plural: 'Cubic Millimeters per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000000
|
||||||
|
}
|
||||||
|
, 'cm3/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic Centimeter per second'
|
||||||
|
, plural: 'Cubic Centimeters per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, 'ml/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Millilitre per second'
|
||||||
|
, plural: 'Millilitres per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/1000
|
||||||
|
}
|
||||||
|
, 'cl/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Centilitre per second'
|
||||||
|
, plural: 'Centilitres per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/100
|
||||||
|
}
|
||||||
|
, 'dl/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Decilitre per second'
|
||||||
|
, plural: 'Decilitres per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/10
|
||||||
|
}
|
||||||
|
, 'l/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Litre per second'
|
||||||
|
, plural: 'Litres per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, 'l/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Litre per minute'
|
||||||
|
, plural: 'Litres per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/60
|
||||||
|
}
|
||||||
|
, 'l/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Litre per hour'
|
||||||
|
, plural: 'Litres per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/3600
|
||||||
|
}
|
||||||
|
, 'kl/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilolitre per second'
|
||||||
|
, plural: 'Kilolitres per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, 'kl/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilolitre per minute'
|
||||||
|
, plural: 'Kilolitres per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 50/3
|
||||||
|
}
|
||||||
|
, 'kl/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Kilolitre per hour'
|
||||||
|
, plural: 'Kilolitres per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 5/18
|
||||||
|
}
|
||||||
|
, 'm3/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic meter per second'
|
||||||
|
, plural: 'Cubic meters per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000
|
||||||
|
}
|
||||||
|
, 'm3/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic meter per minute'
|
||||||
|
, plural: 'Cubic meters per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 50/3
|
||||||
|
}
|
||||||
|
, 'm3/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic meter per hour'
|
||||||
|
, plural: 'Cubic meters per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 5/18
|
||||||
|
}
|
||||||
|
, 'km3/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic kilometer per second'
|
||||||
|
, plural: 'Cubic kilometers per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1000000000000
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
imperial = {
|
||||||
|
'tsp/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Teaspoon per second'
|
||||||
|
, plural: 'Teaspoons per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/6
|
||||||
|
}
|
||||||
|
, 'Tbs/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Tablespoon per second'
|
||||||
|
, plural: 'Tablespoons per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/2
|
||||||
|
}
|
||||||
|
, 'in3/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic inch per second'
|
||||||
|
, plural: 'Cubic inches per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 0.55411
|
||||||
|
}
|
||||||
|
, 'in3/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic inch per minute'
|
||||||
|
, plural: 'Cubic inches per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 0.55411/60
|
||||||
|
}
|
||||||
|
, 'in3/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic inch per hour'
|
||||||
|
, plural: 'Cubic inches per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 0.55411/3600
|
||||||
|
}
|
||||||
|
, 'fl-oz/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Fluid Ounce per second'
|
||||||
|
, plural: 'Fluid Ounces per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 1
|
||||||
|
}
|
||||||
|
, 'fl-oz/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Fluid Ounce per minute'
|
||||||
|
, plural: 'Fluid Ounces per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/60
|
||||||
|
}
|
||||||
|
, 'fl-oz/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Fluid Ounce per hour'
|
||||||
|
, plural: 'Fluid Ounces per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/3600
|
||||||
|
}
|
||||||
|
, 'cup/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cup per second'
|
||||||
|
, plural: 'Cups per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 8
|
||||||
|
}
|
||||||
|
, 'pnt/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Pint per second'
|
||||||
|
, plural: 'Pints per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 16
|
||||||
|
}
|
||||||
|
, 'pnt/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Pint per minute'
|
||||||
|
, plural: 'Pints per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 4/15
|
||||||
|
}
|
||||||
|
, 'pnt/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Pint per hour'
|
||||||
|
, plural: 'Pints per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 1/225
|
||||||
|
}
|
||||||
|
, 'qt/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Quart per second'
|
||||||
|
, plural: 'Quarts per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 32
|
||||||
|
}
|
||||||
|
, 'gal/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Gallon per second'
|
||||||
|
, plural: 'Gallons per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 128
|
||||||
|
}
|
||||||
|
, 'gal/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Gallon per minute'
|
||||||
|
, plural: 'Gallons per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 32/15
|
||||||
|
}
|
||||||
|
, 'gal/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Gallon per hour'
|
||||||
|
, plural: 'Gallons per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 8/225
|
||||||
|
}
|
||||||
|
, 'ft3/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic foot per second'
|
||||||
|
, plural: 'Cubic feet per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 957.506
|
||||||
|
}
|
||||||
|
, 'ft3/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic foot per minute'
|
||||||
|
, plural: 'Cubic feet per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 957.506/60
|
||||||
|
}
|
||||||
|
, 'ft3/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic foot per hour'
|
||||||
|
, plural: 'Cubic feet per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 957.506/3600
|
||||||
|
}
|
||||||
|
, 'yd3/s': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic yard per second'
|
||||||
|
, plural: 'Cubic yards per second'
|
||||||
|
}
|
||||||
|
, to_anchor: 25852.7
|
||||||
|
}
|
||||||
|
, 'yd3/min': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic yard per minute'
|
||||||
|
, plural: 'Cubic yards per minute'
|
||||||
|
}
|
||||||
|
, to_anchor: 25852.7/60
|
||||||
|
}
|
||||||
|
, 'yd3/h': {
|
||||||
|
name: {
|
||||||
|
singular: 'Cubic yard per hour'
|
||||||
|
, plural: 'Cubic yards per hour'
|
||||||
|
}
|
||||||
|
, to_anchor: 25852.7/3600
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
metric: metric
|
||||||
|
, imperial: imperial
|
||||||
|
, _anchors: {
|
||||||
|
metric: {
|
||||||
|
unit: 'l/s'
|
||||||
|
, ratio: 33.8140227
|
||||||
|
}
|
||||||
|
, imperial: {
|
||||||
|
unit: 'fl-oz/s'
|
||||||
|
, ratio: 1/33.8140227
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
160
src/convert/fysics.js
Normal file
160
src/convert/fysics.js
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
/*
|
||||||
|
Copyright:
|
||||||
|
Year : (c) 2023
|
||||||
|
Author : Rene De Ren
|
||||||
|
Contact details : zn375ix3@gmail.com
|
||||||
|
Location : The Netherlands
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
|
||||||
|
(the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
|
||||||
|
merge, publish, distribute, sublicense, and/or sell copies of the Software,
|
||||||
|
and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
The author shall be notified of any and all improvements or adaptations this software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
||||||
|
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
class Fysics{
|
||||||
|
|
||||||
|
constructor(){
|
||||||
|
|
||||||
|
//gasses
|
||||||
|
this.air_density = 0; // weight of air
|
||||||
|
this.atm_pressure = 1.01325 ; //atm pressure at sea level
|
||||||
|
this.earth_gravity = 9.80665 ; // acceleration of standard gravity on earth in m/s2
|
||||||
|
this.water_molar_mass = 18.01528 // g/mol
|
||||||
|
this.num_moles_water = 6.022 * 1023; // number of moles in water
|
||||||
|
this.water_density = 997 ; // this.water_molar_mass * this.num_moles_water // water density in kg/m3;
|
||||||
|
|
||||||
|
//load converter
|
||||||
|
this.convert = require('./index');
|
||||||
|
|
||||||
|
// o2 solubility curve based on pressure and temp
|
||||||
|
this.o2Solubility = {
|
||||||
|
1: // abs bar
|
||||||
|
{
|
||||||
|
x:[0,5,10,15,20,25,30,35,40,45,50], // temp in degrees celcius
|
||||||
|
y:[14.6,12.8,11.3,10.1,9.1,8.3,7.6,7,6.5,6,5.6], // mg/l
|
||||||
|
},
|
||||||
|
2: // abs bar
|
||||||
|
{
|
||||||
|
x:[0,5,10,15,20,25,30,35,40,45,50], // temp in degrees celcius
|
||||||
|
y:[29.2,25.5,22.6,20.2,18.2,16.5,15.2,14,12.9,12,11.3], // mg/l
|
||||||
|
},
|
||||||
|
4: // abs bar
|
||||||
|
{
|
||||||
|
x:[0,5,10,15,20,25,30,35,40,45,50], // temp in degrees celcius
|
||||||
|
y:[58.4,51.1,45.1,40.3,36.4,33.1,30.3,27.9,25.9,24,22.7], // mg/l
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*------------------- functions -------------------*/
|
||||||
|
//use input to calculate air density in kg/m3 is valid up to 100 degrees
|
||||||
|
//pressure in bar RH in % and temp in degrees celcius
|
||||||
|
// Antoine Equation is, Log P = A - B / ( T + C )
|
||||||
|
// D8 = temp , d7 = RH , pressure in mbar = d6
|
||||||
|
//=1.2923*(273.15/(273.15+temp))*(((pressure*100000)-0.3783*((((MACHT(10,(8.07-(1730.63/(233.43+temp)))))*1000/760)*RH)*100))/(1.01325*100000))
|
||||||
|
/*
|
||||||
|
calc_air_dens(pressure,RH,temp){
|
||||||
|
|
||||||
|
let air_density =
|
||||||
|
1.2923 *
|
||||||
|
(
|
||||||
|
273.15 / ( 273.15 + temp )
|
||||||
|
)
|
||||||
|
*
|
||||||
|
(
|
||||||
|
(
|
||||||
|
(
|
||||||
|
pressure * 100000
|
||||||
|
)
|
||||||
|
- 0.3783 *
|
||||||
|
(
|
||||||
|
(
|
||||||
|
(
|
||||||
|
(
|
||||||
|
Math.pow( 10, ( 8.07 - ( 1730.63 / ( 233.43 + temp) ) ) )
|
||||||
|
)
|
||||||
|
*1000/760
|
||||||
|
)
|
||||||
|
*RH
|
||||||
|
)
|
||||||
|
*100
|
||||||
|
)
|
||||||
|
)
|
||||||
|
/ (this.atm_pressure * 100000 )
|
||||||
|
);
|
||||||
|
|
||||||
|
return air_density ;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
calc_air_dens(pressure, RH, temp) {
|
||||||
|
const Rd = 287.05; // Specific gas constant for dry air in J/(kg·K)
|
||||||
|
const Rv = 461.495; // Specific gas constant for water vapor in J/(kg·K)
|
||||||
|
|
||||||
|
// Convert temperature to Kelvin
|
||||||
|
const T = temp + 273.15;
|
||||||
|
|
||||||
|
// Antoine constants for water vapor
|
||||||
|
const A = 8.07131;
|
||||||
|
const B = 1730.63;
|
||||||
|
const C = 233.426;
|
||||||
|
|
||||||
|
// Calculate saturation vapor pressure (e_s) using the Antoine equation (in hPa)
|
||||||
|
const e_s = Math.pow(10, (A - (B / (C + temp))));
|
||||||
|
|
||||||
|
// Actual vapor pressure (e) in hPa
|
||||||
|
const e = RH * e_s / 100;
|
||||||
|
|
||||||
|
// Convert pressure to Pascals
|
||||||
|
const pressurePa = this.convert(pressure).from('mbar').to('Pa');
|
||||||
|
|
||||||
|
// Partial pressure of dry air (Pa)
|
||||||
|
const p_d = pressurePa - (e * 100);
|
||||||
|
|
||||||
|
// Air density (kg/m³)
|
||||||
|
const air_density = (p_d / (Rd * T)) + ((e * 100) / (Rv * T));
|
||||||
|
|
||||||
|
return air_density;
|
||||||
|
}
|
||||||
|
|
||||||
|
//convert height to pressure ( density => kg/m3 , height => meter) output is in bar
|
||||||
|
heigth_to_pressure(density,height){
|
||||||
|
|
||||||
|
//calc pressure
|
||||||
|
let pressure = density * this.earth_gravity * height;
|
||||||
|
//convert Pa to bar
|
||||||
|
pressure = this.convert(pressure).from('Pa').to('mbar');
|
||||||
|
|
||||||
|
return pressure;
|
||||||
|
}
|
||||||
|
|
||||||
|
//input is in meters !
|
||||||
|
calc_volume(height,width,length){
|
||||||
|
let result = 0;
|
||||||
|
result = height * width * length;
|
||||||
|
return result ;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
let fysics = new Fysics();
|
||||||
|
console.log("converted pressure : " + fysics.heigth_to_pressure(fysics.water_density,10) + " mbar ");
|
||||||
|
console.log( "air density : " + fysics.calc_air_dens(1.012,0,0) + " kg / m3" );
|
||||||
|
|
||||||
|
//*/
|
||||||
|
|
||||||
|
module.exports = Fysics;
|
||||||
304
src/convert/index.js
Normal file
304
src/convert/index.js
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
var convert
|
||||||
|
, keys = require('./lodash/lodash.keys')
|
||||||
|
, each = require('./lodash/lodash.foreach')
|
||||||
|
, measures = {
|
||||||
|
length: require('./definitions/length')
|
||||||
|
, area: require('./definitions/area')
|
||||||
|
, mass: require('./definitions/mass')
|
||||||
|
, volume: require('./definitions/volume')
|
||||||
|
, each: require('./definitions/each')
|
||||||
|
, temperature: require('./definitions/temperature')
|
||||||
|
, time: require('./definitions/time')
|
||||||
|
, digital: require('./definitions/digital')
|
||||||
|
, partsPer: require('./definitions/partsPer')
|
||||||
|
, speed: require('./definitions/speed')
|
||||||
|
, pace: require('./definitions/pace')
|
||||||
|
, pressure: require('./definitions/pressure')
|
||||||
|
, current: require('./definitions/current')
|
||||||
|
, voltage: require('./definitions/voltage')
|
||||||
|
, power: require('./definitions/power')
|
||||||
|
, reactivePower: require('./definitions/reactivePower')
|
||||||
|
, apparentPower: require('./definitions/apparentPower')
|
||||||
|
, energy: require('./definitions/energy')
|
||||||
|
, reactiveEnergy: require('./definitions/reactiveEnergy')
|
||||||
|
, volumeFlowRate: require('./definitions/volumeFlowRate')
|
||||||
|
, illuminance: require('./definitions/illuminance')
|
||||||
|
, frequency: require('./definitions/frequency')
|
||||||
|
, angle : require('./definitions/angle')
|
||||||
|
}
|
||||||
|
, Converter;
|
||||||
|
|
||||||
|
Converter = function (numerator, denominator) {
|
||||||
|
if(denominator)
|
||||||
|
this.val = numerator / denominator;
|
||||||
|
else
|
||||||
|
this.val = numerator;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lets the converter know the source unit abbreviation
|
||||||
|
*/
|
||||||
|
Converter.prototype.from = function (from) {
|
||||||
|
if(this.destination)
|
||||||
|
throw new Error('.from must be called before .to');
|
||||||
|
|
||||||
|
this.origin = this.getUnit(from);
|
||||||
|
|
||||||
|
if(!this.origin) {
|
||||||
|
this.throwUnsupportedUnitError(from);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts the unit and returns the value
|
||||||
|
*/
|
||||||
|
Converter.prototype.to = function (to) {
|
||||||
|
if(!this.origin)
|
||||||
|
throw new Error('.to must be called after .from');
|
||||||
|
|
||||||
|
this.destination = this.getUnit(to);
|
||||||
|
|
||||||
|
var result
|
||||||
|
, transform;
|
||||||
|
|
||||||
|
if(!this.destination) {
|
||||||
|
this.throwUnsupportedUnitError(to);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't change the value if origin and destination are the same
|
||||||
|
if (this.origin.abbr === this.destination.abbr) {
|
||||||
|
return this.val;
|
||||||
|
}
|
||||||
|
|
||||||
|
// You can't go from liquid to mass, for example
|
||||||
|
if(this.destination.measure != this.origin.measure) {
|
||||||
|
throw new Error('Cannot convert incompatible measures of '
|
||||||
|
+ this.destination.measure + ' and ' + this.origin.measure);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert from the source value to its anchor inside the system
|
||||||
|
*/
|
||||||
|
result = this.val * this.origin.unit.to_anchor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* For some changes it's a simple shift (C to K)
|
||||||
|
* So we'll add it when convering into the unit (later)
|
||||||
|
* and subtract it when converting from the unit
|
||||||
|
*/
|
||||||
|
if (this.origin.unit.anchor_shift) {
|
||||||
|
result -= this.origin.unit.anchor_shift
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert from one system to another through the anchor ratio. Some conversions
|
||||||
|
* aren't ratio based or require more than a simple shift. We can provide a custom
|
||||||
|
* transform here to provide the direct result
|
||||||
|
*/
|
||||||
|
if(this.origin.system != this.destination.system) {
|
||||||
|
transform = measures[this.origin.measure]._anchors[this.origin.system].transform;
|
||||||
|
if (typeof transform === 'function') {
|
||||||
|
result = transform(result)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
result *= measures[this.origin.measure]._anchors[this.origin.system].ratio;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This shift has to be done after the system conversion business
|
||||||
|
*/
|
||||||
|
if (this.destination.unit.anchor_shift) {
|
||||||
|
result += this.destination.unit.anchor_shift;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert to another unit inside the destination system
|
||||||
|
*/
|
||||||
|
return result / this.destination.unit.to_anchor;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts the unit to the best available unit.
|
||||||
|
*/
|
||||||
|
Converter.prototype.toBest = function(options) {
|
||||||
|
if(!this.origin)
|
||||||
|
throw new Error('.toBest must be called after .from');
|
||||||
|
|
||||||
|
var options = Object.assign({
|
||||||
|
exclude: [],
|
||||||
|
cutOffNumber: 1,
|
||||||
|
}, options)
|
||||||
|
|
||||||
|
var best;
|
||||||
|
/**
|
||||||
|
Looks through every possibility for the 'best' available unit.
|
||||||
|
i.e. Where the value has the fewest numbers before the decimal point,
|
||||||
|
but is still higher than 1.
|
||||||
|
*/
|
||||||
|
each(this.possibilities(), function(possibility) {
|
||||||
|
var unit = this.describe(possibility);
|
||||||
|
var isIncluded = options.exclude.indexOf(possibility) === -1;
|
||||||
|
|
||||||
|
if (isIncluded && unit.system === this.origin.system) {
|
||||||
|
var result = this.to(possibility);
|
||||||
|
if (!best || (result >= options.cutOffNumber && result < best.val)) {
|
||||||
|
best = {
|
||||||
|
val: result,
|
||||||
|
unit: possibility,
|
||||||
|
singular: unit.singular,
|
||||||
|
plural: unit.plural
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
|
||||||
|
return best;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the unit
|
||||||
|
*/
|
||||||
|
Converter.prototype.getUnit = function (abbr) {
|
||||||
|
var found;
|
||||||
|
|
||||||
|
each(measures, function (systems, measure) {
|
||||||
|
each(systems, function (units, system) {
|
||||||
|
if(system == '_anchors')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
each(units, function (unit, testAbbr) {
|
||||||
|
if(testAbbr == abbr) {
|
||||||
|
found = {
|
||||||
|
abbr: abbr
|
||||||
|
, measure: measure
|
||||||
|
, system: system
|
||||||
|
, unit: unit
|
||||||
|
};
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if(found)
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
if(found)
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
return found;
|
||||||
|
};
|
||||||
|
|
||||||
|
var describe = function(resp) {
|
||||||
|
return {
|
||||||
|
abbr: resp.abbr
|
||||||
|
, measure: resp.measure
|
||||||
|
, system: resp.system
|
||||||
|
, singular: resp.unit.name.singular
|
||||||
|
, plural: resp.unit.name.plural
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An alias for getUnit
|
||||||
|
*/
|
||||||
|
Converter.prototype.describe = function (abbr) {
|
||||||
|
var resp = Converter.prototype.getUnit(abbr);
|
||||||
|
var desc = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
desc = describe(resp);
|
||||||
|
} catch(err) {
|
||||||
|
this.throwUnsupportedUnitError(abbr);
|
||||||
|
}
|
||||||
|
|
||||||
|
return desc;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detailed list of all supported units
|
||||||
|
*/
|
||||||
|
Converter.prototype.list = function (measure) {
|
||||||
|
var list = [];
|
||||||
|
|
||||||
|
each(measures, function (systems, testMeasure) {
|
||||||
|
if(measure && measure !== testMeasure)
|
||||||
|
return;
|
||||||
|
|
||||||
|
each(systems, function (units, system) {
|
||||||
|
if(system == '_anchors')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
each(units, function (unit, abbr) {
|
||||||
|
list = list.concat(describe({
|
||||||
|
abbr: abbr,
|
||||||
|
measure: testMeasure
|
||||||
|
, system: system
|
||||||
|
, unit: unit
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
return list;
|
||||||
|
};
|
||||||
|
|
||||||
|
Converter.prototype.throwUnsupportedUnitError = function (what) {
|
||||||
|
var validUnits = [];
|
||||||
|
|
||||||
|
each(measures, function (systems, measure) {
|
||||||
|
each(systems, function (units, system) {
|
||||||
|
if(system == '_anchors')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
validUnits = validUnits.concat(keys(units));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
throw new Error('Unsupported unit ' + what + ', use one of: ' + validUnits.join(', '));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the abbreviated measures that the value can be
|
||||||
|
* converted to.
|
||||||
|
*/
|
||||||
|
Converter.prototype.possibilities = function (measure) {
|
||||||
|
var possibilities = [];
|
||||||
|
if(!this.origin && !measure) {
|
||||||
|
each(keys(measures), function (measure){
|
||||||
|
each(measures[measure], function (units, system) {
|
||||||
|
if(system == '_anchors')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
possibilities = possibilities.concat(keys(units));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
measure = measure || this.origin.measure;
|
||||||
|
each(measures[measure], function (units, system) {
|
||||||
|
if(system == '_anchors')
|
||||||
|
return false;
|
||||||
|
|
||||||
|
possibilities = possibilities.concat(keys(units));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return possibilities;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the abbreviated measures that the value can be
|
||||||
|
* converted to.
|
||||||
|
*/
|
||||||
|
Converter.prototype.measures = function () {
|
||||||
|
return keys(measures);
|
||||||
|
};
|
||||||
|
|
||||||
|
convert = function (value) {
|
||||||
|
return new Converter(value);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = convert;
|
||||||
22
src/convert/lodash/lodash._basebind/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._basebind/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._basebind/README.md
Normal file
15
src/convert/lodash/lodash._basebind/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._basebind v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `baseBind` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
58
src/convert/lodash/lodash._basebind/index.js
Normal file
58
src/convert/lodash/lodash._basebind/index.js
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var baseCreate = require('./../lodash._basecreate'),
|
||||||
|
isObject = require('./../lodash.isobject'),
|
||||||
|
setBindData = require('./../lodash._setbinddata');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for `Array` method references.
|
||||||
|
*
|
||||||
|
* Normally `Array.prototype` would suffice, however, using an array literal
|
||||||
|
* avoids issues in Narwhal.
|
||||||
|
*/
|
||||||
|
var arrayRef = [];
|
||||||
|
|
||||||
|
/** Native method shortcuts */
|
||||||
|
var push = arrayRef.push;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.bind` that creates the bound function and
|
||||||
|
* sets its meta data.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} bindData The bind data array.
|
||||||
|
* @returns {Function} Returns the new bound function.
|
||||||
|
*/
|
||||||
|
function baseBind(bindData) {
|
||||||
|
var func = bindData[0],
|
||||||
|
partialArgs = bindData[2],
|
||||||
|
thisArg = bindData[4];
|
||||||
|
|
||||||
|
function bound() {
|
||||||
|
// `Function#bind` spec
|
||||||
|
// http://es5.github.io/#x15.3.4.5
|
||||||
|
if (partialArgs) {
|
||||||
|
var args = partialArgs.slice();
|
||||||
|
push.apply(args, arguments);
|
||||||
|
}
|
||||||
|
// mimic the constructor's `return` behavior
|
||||||
|
// http://es5.github.io/#x13.2.2
|
||||||
|
if (this instanceof bound) {
|
||||||
|
// ensure `new bound` is an instance of `func`
|
||||||
|
var thisBinding = baseCreate(func.prototype),
|
||||||
|
result = func.apply(thisBinding, args || arguments);
|
||||||
|
return isObject(result) ? result : thisBinding;
|
||||||
|
}
|
||||||
|
return func.apply(thisArg, args || arguments);
|
||||||
|
}
|
||||||
|
setBindData(bound, bindData);
|
||||||
|
return bound;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = baseBind;
|
||||||
21
src/convert/lodash/lodash._basebind/package.json
Normal file
21
src/convert/lodash/lodash._basebind/package.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._basebind",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `baseBind` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||||
|
"dependencies": {
|
||||||
|
"lodash._basecreate": "~2.3.0",
|
||||||
|
"lodash.isobject": "~2.3.0",
|
||||||
|
"lodash._setbinddata": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._basecreate/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._basecreate/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._basecreate/README.md
Normal file
15
src/convert/lodash/lodash._basecreate/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._basecreate v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `baseCreate` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
42
src/convert/lodash/lodash._basecreate/index.js
Normal file
42
src/convert/lodash/lodash._basecreate/index.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var isObject = require('./../lodash.isobject'),
|
||||||
|
noop = require('./../lodash.noop'),
|
||||||
|
reNative = require('./../lodash._renative');
|
||||||
|
|
||||||
|
/* Native method shortcuts for methods with the same name as other `lodash` methods */
|
||||||
|
var nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.create` without support for assigning
|
||||||
|
* properties to the created object.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Object} prototype The object to inherit from.
|
||||||
|
* @returns {Object} Returns the new object.
|
||||||
|
*/
|
||||||
|
function baseCreate(prototype, properties) {
|
||||||
|
return isObject(prototype) ? nativeCreate(prototype) : {};
|
||||||
|
}
|
||||||
|
// fallback for browsers without `Object.create`
|
||||||
|
if (!nativeCreate) {
|
||||||
|
baseCreate = (function() {
|
||||||
|
function Object() {}
|
||||||
|
return function(prototype) {
|
||||||
|
if (isObject(prototype)) {
|
||||||
|
Object.prototype = prototype;
|
||||||
|
var result = new Object;
|
||||||
|
Object.prototype = null;
|
||||||
|
}
|
||||||
|
return result || global.Object();
|
||||||
|
};
|
||||||
|
}());
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = baseCreate;
|
||||||
21
src/convert/lodash/lodash._basecreate/package.json
Normal file
21
src/convert/lodash/lodash._basecreate/package.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._basecreate",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `baseCreate` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||||
|
"dependencies": {
|
||||||
|
"lodash.isobject": "~2.3.0",
|
||||||
|
"lodash.noop": "~2.3.0",
|
||||||
|
"lodash._renative": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._basecreatecallback/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._basecreatecallback/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._basecreatecallback/README.md
Normal file
15
src/convert/lodash/lodash._basecreatecallback/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._basecreatecallback v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `baseCreateCallback` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
80
src/convert/lodash/lodash._basecreatecallback/index.js
Normal file
80
src/convert/lodash/lodash._basecreatecallback/index.js
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var bind = require('./../lodash.bind'),
|
||||||
|
identity = require('./../lodash.identity'),
|
||||||
|
setBindData = require('./../lodash._setbinddata'),
|
||||||
|
support = require('./../lodash.support');
|
||||||
|
|
||||||
|
/** Used to detected named functions */
|
||||||
|
var reFuncName = /^\s*function[ \n\r\t]+\w/;
|
||||||
|
|
||||||
|
/** Used to detect functions containing a `this` reference */
|
||||||
|
var reThis = /\bthis\b/;
|
||||||
|
|
||||||
|
/** Native method shortcuts */
|
||||||
|
var fnToString = Function.prototype.toString;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `_.createCallback` without support for creating
|
||||||
|
* "_.pluck" or "_.where" style callbacks.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {*} [func=identity] The value to convert to a callback.
|
||||||
|
* @param {*} [thisArg] The `this` binding of the created callback.
|
||||||
|
* @param {number} [argCount] The number of arguments the callback accepts.
|
||||||
|
* @returns {Function} Returns a callback function.
|
||||||
|
*/
|
||||||
|
function baseCreateCallback(func, thisArg, argCount) {
|
||||||
|
if (typeof func != 'function') {
|
||||||
|
return identity;
|
||||||
|
}
|
||||||
|
// exit early for no `thisArg` or already bound by `Function#bind`
|
||||||
|
if (typeof thisArg == 'undefined' || !('prototype' in func)) {
|
||||||
|
return func;
|
||||||
|
}
|
||||||
|
var bindData = func.__bindData__;
|
||||||
|
if (typeof bindData == 'undefined') {
|
||||||
|
if (support.funcNames) {
|
||||||
|
bindData = !func.name;
|
||||||
|
}
|
||||||
|
bindData = bindData || !support.funcDecomp;
|
||||||
|
if (!bindData) {
|
||||||
|
var source = fnToString.call(func);
|
||||||
|
if (!support.funcNames) {
|
||||||
|
bindData = !reFuncName.test(source);
|
||||||
|
}
|
||||||
|
if (!bindData) {
|
||||||
|
// checks if `func` references the `this` keyword and stores the result
|
||||||
|
bindData = reThis.test(source);
|
||||||
|
setBindData(func, bindData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// exit early if there are no `this` references or `func` is bound
|
||||||
|
if (bindData === false || (bindData !== true && bindData[1] & 1)) {
|
||||||
|
return func;
|
||||||
|
}
|
||||||
|
switch (argCount) {
|
||||||
|
case 1: return function(value) {
|
||||||
|
return func.call(thisArg, value);
|
||||||
|
};
|
||||||
|
case 2: return function(a, b) {
|
||||||
|
return func.call(thisArg, a, b);
|
||||||
|
};
|
||||||
|
case 3: return function(value, index, collection) {
|
||||||
|
return func.call(thisArg, value, index, collection);
|
||||||
|
};
|
||||||
|
case 4: return function(accumulator, value, index, collection) {
|
||||||
|
return func.call(thisArg, accumulator, value, index, collection);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return bind(func, thisArg);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = baseCreateCallback;
|
||||||
22
src/convert/lodash/lodash._basecreatecallback/package.json
Normal file
22
src/convert/lodash/lodash._basecreatecallback/package.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._basecreatecallback",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `baseCreateCallback` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||||
|
"dependencies": {
|
||||||
|
"lodash.bind": "~2.3.0",
|
||||||
|
"lodash.identity": "~2.3.0",
|
||||||
|
"lodash._setbinddata": "~2.3.0",
|
||||||
|
"lodash.support": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._basecreatewrapper/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._basecreatewrapper/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._basecreatewrapper/README.md
Normal file
15
src/convert/lodash/lodash._basecreatewrapper/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._basecreatewrapper v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `baseCreateWrapper` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
78
src/convert/lodash/lodash._basecreatewrapper/index.js
Normal file
78
src/convert/lodash/lodash._basecreatewrapper/index.js
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var baseCreate = require('./../lodash._basecreate'),
|
||||||
|
isObject = require('./../lodash.isobject'),
|
||||||
|
setBindData = require('./../lodash._setbinddata'),
|
||||||
|
slice = require('./../lodash._slice');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for `Array` method references.
|
||||||
|
*
|
||||||
|
* Normally `Array.prototype` would suffice, however, using an array literal
|
||||||
|
* avoids issues in Narwhal.
|
||||||
|
*/
|
||||||
|
var arrayRef = [];
|
||||||
|
|
||||||
|
/** Native method shortcuts */
|
||||||
|
var push = arrayRef.push;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base implementation of `createWrapper` that creates the wrapper and
|
||||||
|
* sets its meta data.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array} bindData The bind data array.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function baseCreateWrapper(bindData) {
|
||||||
|
var func = bindData[0],
|
||||||
|
bitmask = bindData[1],
|
||||||
|
partialArgs = bindData[2],
|
||||||
|
partialRightArgs = bindData[3],
|
||||||
|
thisArg = bindData[4],
|
||||||
|
arity = bindData[5];
|
||||||
|
|
||||||
|
var isBind = bitmask & 1,
|
||||||
|
isBindKey = bitmask & 2,
|
||||||
|
isCurry = bitmask & 4,
|
||||||
|
isCurryBound = bitmask & 8,
|
||||||
|
key = func;
|
||||||
|
|
||||||
|
function bound() {
|
||||||
|
var thisBinding = isBind ? thisArg : this;
|
||||||
|
if (partialArgs) {
|
||||||
|
var args = partialArgs.slice();
|
||||||
|
push.apply(args, arguments);
|
||||||
|
}
|
||||||
|
if (partialRightArgs || isCurry) {
|
||||||
|
args || (args = slice(arguments));
|
||||||
|
if (partialRightArgs) {
|
||||||
|
push.apply(args, partialRightArgs);
|
||||||
|
}
|
||||||
|
if (isCurry && args.length < arity) {
|
||||||
|
bitmask |= 16 & ~32;
|
||||||
|
return baseCreateWrapper([func, (isCurryBound ? bitmask : bitmask & ~3), args, null, thisArg, arity]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
args || (args = arguments);
|
||||||
|
if (isBindKey) {
|
||||||
|
func = thisBinding[key];
|
||||||
|
}
|
||||||
|
if (this instanceof bound) {
|
||||||
|
thisBinding = baseCreate(func.prototype);
|
||||||
|
var result = func.apply(thisBinding, args);
|
||||||
|
return isObject(result) ? result : thisBinding;
|
||||||
|
}
|
||||||
|
return func.apply(thisBinding, args);
|
||||||
|
}
|
||||||
|
setBindData(bound, bindData);
|
||||||
|
return bound;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = baseCreateWrapper;
|
||||||
22
src/convert/lodash/lodash._basecreatewrapper/package.json
Normal file
22
src/convert/lodash/lodash._basecreatewrapper/package.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._basecreatewrapper",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `baseCreateWrapper` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||||
|
"dependencies": {
|
||||||
|
"lodash._basecreate": "~2.3.0",
|
||||||
|
"lodash.isobject": "~2.3.0",
|
||||||
|
"lodash._setbinddata": "~2.3.0",
|
||||||
|
"lodash._slice": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._createwrapper/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._createwrapper/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._createwrapper/README.md
Normal file
15
src/convert/lodash/lodash._createwrapper/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._createwrapper v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `createWrapper` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
98
src/convert/lodash/lodash._createwrapper/index.js
Normal file
98
src/convert/lodash/lodash._createwrapper/index.js
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var baseBind = require('./../lodash._basebind'),
|
||||||
|
baseCreateWrapper = require('./../lodash._basecreatewrapper'),
|
||||||
|
isFunction = require('./../lodash.isfunction');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used for `Array` method references.
|
||||||
|
*
|
||||||
|
* Normally `Array.prototype` would suffice, however, using an array literal
|
||||||
|
* avoids issues in Narwhal.
|
||||||
|
*/
|
||||||
|
var arrayRef = [];
|
||||||
|
|
||||||
|
/** Native method shortcuts */
|
||||||
|
var push = arrayRef.push;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a function that, when called, either curries or invokes `func`
|
||||||
|
* with an optional `this` binding and partially applied arguments.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function|string} func The function or method name to reference.
|
||||||
|
* @param {number} bitmask The bitmask of method flags to compose.
|
||||||
|
* The bitmask may be composed of the following flags:
|
||||||
|
* 1 - `_.bind`
|
||||||
|
* 2 - `_.bindKey`
|
||||||
|
* 4 - `_.curry`
|
||||||
|
* 8 - `_.curry` (bound)
|
||||||
|
* 16 - `_.partial`
|
||||||
|
* 32 - `_.partialRight`
|
||||||
|
* @param {Array} [partialArgs] An array of arguments to prepend to those
|
||||||
|
* provided to the new function.
|
||||||
|
* @param {Array} [partialRightArgs] An array of arguments to append to those
|
||||||
|
* provided to the new function.
|
||||||
|
* @param {*} [thisArg] The `this` binding of `func`.
|
||||||
|
* @param {number} [arity] The arity of `func`.
|
||||||
|
* @returns {Function} Returns the new function.
|
||||||
|
*/
|
||||||
|
function createWrapper(func, bitmask, partialArgs, partialRightArgs, thisArg, arity) {
|
||||||
|
var isBind = bitmask & 1,
|
||||||
|
isBindKey = bitmask & 2,
|
||||||
|
isCurry = bitmask & 4,
|
||||||
|
isCurryBound = bitmask & 8,
|
||||||
|
isPartial = bitmask & 16,
|
||||||
|
isPartialRight = bitmask & 32;
|
||||||
|
|
||||||
|
if (!isBindKey && !isFunction(func)) {
|
||||||
|
throw new TypeError;
|
||||||
|
}
|
||||||
|
if (isPartial && !partialArgs.length) {
|
||||||
|
bitmask &= ~16;
|
||||||
|
isPartial = partialArgs = false;
|
||||||
|
}
|
||||||
|
if (isPartialRight && !partialRightArgs.length) {
|
||||||
|
bitmask &= ~32;
|
||||||
|
isPartialRight = partialRightArgs = false;
|
||||||
|
}
|
||||||
|
var bindData = func && func.__bindData__;
|
||||||
|
if (bindData && bindData !== true) {
|
||||||
|
bindData = bindData.slice();
|
||||||
|
|
||||||
|
// set `thisBinding` is not previously bound
|
||||||
|
if (isBind && !(bindData[1] & 1)) {
|
||||||
|
bindData[4] = thisArg;
|
||||||
|
}
|
||||||
|
// set if previously bound but not currently (subsequent curried functions)
|
||||||
|
if (!isBind && bindData[1] & 1) {
|
||||||
|
bitmask |= 8;
|
||||||
|
}
|
||||||
|
// set curried arity if not yet set
|
||||||
|
if (isCurry && !(bindData[1] & 4)) {
|
||||||
|
bindData[5] = arity;
|
||||||
|
}
|
||||||
|
// append partial left arguments
|
||||||
|
if (isPartial) {
|
||||||
|
push.apply(bindData[2] || (bindData[2] = []), partialArgs);
|
||||||
|
}
|
||||||
|
// append partial right arguments
|
||||||
|
if (isPartialRight) {
|
||||||
|
push.apply(bindData[3] || (bindData[3] = []), partialRightArgs);
|
||||||
|
}
|
||||||
|
// merge flags
|
||||||
|
bindData[1] |= bitmask;
|
||||||
|
return createWrapper.apply(null, bindData);
|
||||||
|
}
|
||||||
|
// fast path for `_.bind`
|
||||||
|
var creater = (bitmask == 1 || bitmask === 17) ? baseBind : baseCreateWrapper;
|
||||||
|
return creater([func, bitmask, partialArgs, partialRightArgs, thisArg, arity]);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = createWrapper;
|
||||||
21
src/convert/lodash/lodash._createwrapper/package.json
Normal file
21
src/convert/lodash/lodash._createwrapper/package.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._createwrapper",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `createWrapper` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||||
|
"dependencies": {
|
||||||
|
"lodash._basebind": "~2.3.0",
|
||||||
|
"lodash._basecreatewrapper": "~2.3.0",
|
||||||
|
"lodash.isfunction": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._objecttypes/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._objecttypes/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._objecttypes/README.md
Normal file
15
src/convert/lodash/lodash._objecttypes/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._objecttypes v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) variable `objectTypes` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
20
src/convert/lodash/lodash._objecttypes/index.js
Normal file
20
src/convert/lodash/lodash._objecttypes/index.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Used to determine if values are of the language type Object */
|
||||||
|
var objectTypes = {
|
||||||
|
'boolean': false,
|
||||||
|
'function': true,
|
||||||
|
'object': true,
|
||||||
|
'number': false,
|
||||||
|
'string': false,
|
||||||
|
'undefined': false
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = objectTypes;
|
||||||
16
src/convert/lodash/lodash._objecttypes/package.json
Normal file
16
src/convert/lodash/lodash._objecttypes/package.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._objecttypes",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash variable `objectTypes` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" }
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._renative/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._renative/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._renative/README.md
Normal file
15
src/convert/lodash/lodash._renative/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._renative v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) variable `reNative` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
23
src/convert/lodash/lodash._renative/index.js
Normal file
23
src/convert/lodash/lodash._renative/index.js
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Used for native method references */
|
||||||
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/** Used to resolve the internal [[Class]] of values */
|
||||||
|
var toString = objectProto.toString;
|
||||||
|
|
||||||
|
/** Used to detect if a method is native */
|
||||||
|
var reNative = RegExp('^' +
|
||||||
|
String(toString)
|
||||||
|
.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
|
||||||
|
.replace(/toString| for [^\]]+/g, '.*?') + '$'
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = reNative;
|
||||||
16
src/convert/lodash/lodash._renative/package.json
Normal file
16
src/convert/lodash/lodash._renative/package.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._renative",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash variable `reNative` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" }
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._setbinddata/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._setbinddata/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._setbinddata/README.md
Normal file
15
src/convert/lodash/lodash._setbinddata/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._setbinddata v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `setBindData` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
43
src/convert/lodash/lodash._setbinddata/index.js
Normal file
43
src/convert/lodash/lodash._setbinddata/index.js
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var noop = require('./../lodash.noop'),
|
||||||
|
reNative = require('./../lodash._renative');
|
||||||
|
|
||||||
|
/** Used as the property descriptor for `__bindData__` */
|
||||||
|
var descriptor = {
|
||||||
|
'configurable': false,
|
||||||
|
'enumerable': false,
|
||||||
|
'value': null,
|
||||||
|
'writable': false
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Used to set meta data on functions */
|
||||||
|
var defineProperty = (function() {
|
||||||
|
// IE 8 only accepts DOM elements
|
||||||
|
try {
|
||||||
|
var o = {},
|
||||||
|
func = reNative.test(func = Object.defineProperty) && func,
|
||||||
|
result = func(o, o, o) && func;
|
||||||
|
} catch(e) { }
|
||||||
|
return result;
|
||||||
|
}());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets `this` binding data on a given function.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Function} func The function to set data on.
|
||||||
|
* @param {Array} value The data array to set.
|
||||||
|
*/
|
||||||
|
var setBindData = !defineProperty ? noop : function(func, value) {
|
||||||
|
descriptor.value = value;
|
||||||
|
defineProperty(func, '__bindData__', descriptor);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = setBindData;
|
||||||
20
src/convert/lodash/lodash._setbinddata/package.json
Normal file
20
src/convert/lodash/lodash._setbinddata/package.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._setbinddata",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `setBindData` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||||
|
"dependencies": {
|
||||||
|
"lodash.noop": "~2.3.0",
|
||||||
|
"lodash._renative": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._shimkeys/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._shimkeys/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._shimkeys/README.md
Normal file
15
src/convert/lodash/lodash._shimkeys/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._shimkeys v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `shimKeys` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
38
src/convert/lodash/lodash._shimkeys/index.js
Normal file
38
src/convert/lodash/lodash._shimkeys/index.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
var objectTypes = require('./../lodash._objecttypes');
|
||||||
|
|
||||||
|
/** Used for native method references */
|
||||||
|
var objectProto = Object.prototype;
|
||||||
|
|
||||||
|
/** Native method shortcuts */
|
||||||
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A fallback implementation of `Object.keys` which produces an array of the
|
||||||
|
* given object's own enumerable property names.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @type Function
|
||||||
|
* @param {Object} object The object to inspect.
|
||||||
|
* @returns {Array} Returns an array of property names.
|
||||||
|
*/
|
||||||
|
var shimKeys = function(object) {
|
||||||
|
var index, iterable = object, result = [];
|
||||||
|
if (!iterable) return result;
|
||||||
|
if (!(objectTypes[typeof object])) return result;
|
||||||
|
for (index in iterable) {
|
||||||
|
if (hasOwnProperty.call(iterable, index)) {
|
||||||
|
result.push(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = shimKeys;
|
||||||
19
src/convert/lodash/lodash._shimkeys/package.json
Normal file
19
src/convert/lodash/lodash._shimkeys/package.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._shimkeys",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `shimKeys` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" },
|
||||||
|
"dependencies": {
|
||||||
|
"lodash._objecttypes": "~2.3.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash._slice/LICENSE.txt
Normal file
22
src/convert/lodash/lodash._slice/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash._slice/README.md
Normal file
15
src/convert/lodash/lodash._slice/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash._slice v2.3.0
|
||||||
|
|
||||||
|
The internal [Lo-Dash](http://lodash.com/) function `slice` as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
38
src/convert/lodash/lodash._slice/index.js
Normal file
38
src/convert/lodash/lodash._slice/index.js
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
/**
|
||||||
|
* Lo-Dash 2.3.0 (Custom Build) <http://lodash.com/>
|
||||||
|
* Build: `lodash modularize modern exports="npm" -o ./npm/`
|
||||||
|
* Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
* Based on Underscore.js 1.5.2 <http://underscorejs.org/LICENSE>
|
||||||
|
* Copyright 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
||||||
|
* Available under MIT license <http://lodash.com/license>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Slices the `collection` from the `start` index up to, but not including,
|
||||||
|
* the `end` index.
|
||||||
|
*
|
||||||
|
* Note: This function is used instead of `Array#slice` to support node lists
|
||||||
|
* in IE < 9 and to ensure dense arrays are returned.
|
||||||
|
*
|
||||||
|
* @private
|
||||||
|
* @param {Array|Object|string} collection The collection to slice.
|
||||||
|
* @param {number} start The start index.
|
||||||
|
* @param {number} end The end index.
|
||||||
|
* @returns {Array} Returns the new array.
|
||||||
|
*/
|
||||||
|
function slice(array, start, end) {
|
||||||
|
start || (start = 0);
|
||||||
|
if (typeof end == 'undefined') {
|
||||||
|
end = array ? array.length : 0;
|
||||||
|
}
|
||||||
|
var index = -1,
|
||||||
|
length = end - start || 0,
|
||||||
|
result = Array(length < 0 ? 0 : length);
|
||||||
|
|
||||||
|
while (++index < length) {
|
||||||
|
result[index] = array[start + index];
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = slice;
|
||||||
16
src/convert/lodash/lodash._slice/package.json
Normal file
16
src/convert/lodash/lodash._slice/package.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"name": "lodash._slice",
|
||||||
|
"version": "2.3.0",
|
||||||
|
"description": "The internal Lo-Dash function `slice` as a Node.js module generated by lodash-cli.",
|
||||||
|
"homepage": "http://lodash.com/custom-builds",
|
||||||
|
"license": "MIT",
|
||||||
|
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"contributors": [
|
||||||
|
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
|
||||||
|
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
|
||||||
|
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
|
||||||
|
"Mathias Bynens <mathias@qiwi.be> (http://mathiasbynens.be/)"
|
||||||
|
],
|
||||||
|
"bugs": "https://github.com/lodash/lodash-cli/issues",
|
||||||
|
"repository": { "type": "git", "url": "https://github.com/lodash/lodash-cli.git" }
|
||||||
|
}
|
||||||
22
src/convert/lodash/lodash.bind/LICENSE.txt
Normal file
22
src/convert/lodash/lodash.bind/LICENSE.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
|
||||||
|
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
|
||||||
|
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
15
src/convert/lodash/lodash.bind/README.md
Normal file
15
src/convert/lodash/lodash.bind/README.md
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# lodash.bind v2.3.0
|
||||||
|
|
||||||
|
The [Lo-Dash](http://lodash.com/) function [`_.bind`](http://lodash.com/docs#bind) as a [Node.js](http://nodejs.org/) module generated by [lodash-cli](https://npmjs.org/package/lodash-cli).
|
||||||
|
|
||||||
|
## Author
|
||||||
|
|
||||||
|
| [](https://twitter.com/jdalton "Follow @jdalton on Twitter") |
|
||||||
|
|---|
|
||||||
|
| [John-David Dalton](http://allyoucanleet.com/) |
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
| [](https://twitter.com/blainebublitz "Follow @BlaineBublitz on Twitter") | [](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter") | [](https://twitter.com/mathias "Follow @mathias on Twitter") |
|
||||||
|
|---|---|---|
|
||||||
|
| [Blaine Bublitz](http://www.iceddev.com/) | [Kit Cambridge](http://kitcambridge.be/) | [Mathias Bynens](http://mathiasbynens.be/) |
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user