@corva/ui 3.30.0-rc.0 → 3.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs-bundle/components/Drillstring/BHAComponentDetail/constants.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentDetail/constants.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentIcon.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentIcon.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
- package/cjs-bundle/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHASchematic.js +1 -1
- package/cjs-bundle/components/Drillstring/BHASchematic.js.map +1 -1
- package/cjs-bundle/components/Drillstring/BHATileIcon.js +1 -1
- package/cjs-bundle/components/Drillstring/BHATileIcon.js.map +1 -1
- package/cjs-bundle/constants/bha.js +1 -1
- package/cjs-bundle/constants/bha.js.map +1 -1
- package/cjs-bundle/constants/drillstring.js +1 -1
- package/cjs-bundle/constants/drillstring.js.map +1 -1
- package/cjs-bundle/utils/DrillstringUtils.js +1 -1
- package/cjs-bundle/utils/DrillstringUtils.js.map +1 -1
- package/cjs-bundle/utils/bha.js +1 -1
- package/cjs-bundle/utils/bha.js.map +1 -1
- package/cjs-bundle/utils/drillstring/conversion.js +1 -1
- package/cjs-bundle/utils/drillstring/conversion.js.map +1 -1
- package/cjs-bundle/utils/drillstring/schematic.js +1 -1
- package/cjs-bundle/utils/drillstring/schematic.js.map +1 -1
- package/cjs-bundle/utils/drillstring/validation.js +1 -1
- package/cjs-bundle/utils/drillstring/validation.js.map +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.js +1 -1
- package/components/Drillstring/BHAComponentDetail/constants.js.map +1 -1
- package/components/Drillstring/BHAComponentIcon.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentIcon.js +1 -1
- package/components/Drillstring/BHAComponentIcon.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/Component.js.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.d.ts.map +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js +1 -1
- package/components/Drillstring/BHAComponentsTable/components/EditComponentDialog.js.map +1 -1
- package/components/Drillstring/BHASchematic.d.ts.map +1 -1
- package/components/Drillstring/BHASchematic.js +1 -1
- package/components/Drillstring/BHASchematic.js.map +1 -1
- package/components/Drillstring/BHATileIcon.d.ts.map +1 -1
- package/components/Drillstring/BHATileIcon.js +1 -1
- package/components/Drillstring/BHATileIcon.js.map +1 -1
- package/constants/bha.d.ts +1 -0
- package/constants/bha.d.ts.map +1 -1
- package/constants/bha.js +1 -1
- package/constants/bha.js.map +1 -1
- package/constants/drillstring.d.ts.map +1 -1
- package/constants/drillstring.js +1 -1
- package/constants/drillstring.js.map +1 -1
- package/package.json +1 -1
- package/utils/DrillstringUtils.d.ts.map +1 -1
- package/utils/DrillstringUtils.js +1 -1
- package/utils/DrillstringUtils.js.map +1 -1
- package/utils/bha.js +1 -1
- package/utils/bha.js.map +1 -1
- package/utils/drillstring/conversion.d.ts.map +1 -1
- package/utils/drillstring/conversion.js +1 -1
- package/utils/drillstring/conversion.js.map +1 -1
- package/utils/drillstring/schematic.js +1 -1
- package/utils/drillstring/schematic.js.map +1 -1
- package/utils/drillstring/validation.d.ts.map +1 -1
- package/utils/drillstring/validation.js +1 -1
- package/utils/drillstring/validation.js.map +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("lodash"),r=require("../convert.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var i=r.convertValue(1,"shortLength","in"),l=r.convertValue(1,"shortLength",r.getUnitPreference("shortLength"),"in");function u(e){return{outer_diameter:r.convertValue(e.outer_diameter,"shortLength","in"),inner_diameter:r.convertValue(e.inner_diameter,"shortLength","in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength","lb-ft"),weight:r.convertValue(e.weight,"mass","lb"),component_length:r.convertValue(e.component_length,"length","ft"),length:r.convertValue(e.length,"length","ft"),outer_diameter_tooljoint:r.convertValue(e.outer_diameter_tooljoint,"shortLength","in"),inner_diameter_tooljoint:r.convertValue(e.inner_diameter_tooljoint,"shortLength","in"),length_tooljoint:r.convertValue(e.length_tooljoint,"length","ft")}}function c(e){return e?s(s({},e),{},{inner_diameter:r.convertValue(e.inner_diameter,"shortLength","in"),outer_diameter:r.convertValue(e.outer_diameter,"shortLength","in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength","lb-ft"),weight:r.convertValue(e.weight,"mass","lb"),length:r.convertValue(e.length,"length","ft"),gauge_od:r.convertValue(e.gauge_od,"shortLength","in"),gauge_length:r.convertValue(e.gauge_length,"shortLength","in"),blade_width:r.convertValue(e.blade_width,"shortLength","in"),stab_centerpoint_to_bit:r.convertValue(e.stab_centerpoint_to_bit,"length","ft")}):e}function g(e){return(e||[]).map((function(e){return{flow_rate:r.convertValue(e.flow_rate,"volumeFlowRate","gal/min"),pressure_loss:r.convertValue(e.pressure_loss,"pressure","psi")}}))}function _(e){return(e||[]).map((function(e){return s(s({},e),{},{size:1!==i?r.convertValue(e.size,"shortLength","in")/32:e.size})}))}function h(e){return(e||[]).map((function(e){return s(s({},e),{},{distance:r.convertValue(e.distance,"length","ft")})}))}function f(e){return s(s(s({},e),u(e)),{},{size:r.convertValue(e.size,"shortLength","in"),nozzle_sizes:_(e.nozzle_sizes),tfa:1!==i?e.tfa*(i*i):e.tfa})}function p(e){return s(s(s({},e),u(e)),{},{max_weight_on_bit:r.convertValue(e.max_weight_on_bit,"force","klbf"),min_standard_flowrate:r.convertValue(e.min_standard_flowrate,"volumeFlowRate","gal/min"),max_standard_flowrate:r.convertValue(e.max_standard_flowrate,"volumeFlowRate","gal/min"),max_operating_differential_pressure:r.convertValue(e.max_operating_differential_pressure,"pressure","psi"),torque_at_max_operating_differential_pressure:r.convertValue(e.torque_at_max_operating_differential_pressure,"torque","ft-klbf"),rpg:r.convertValue(e.rpg,"revolutionPerVolume","rpg"),off_bottom_pressure_loss:g(e.off_bottom_pressure_loss),stabilizer:c(e.stabilizer)})}function m(e){return s(s(s({},e),u(e)),{},{lwd_measurements:h(e.lwd_measurements)})}function d(e){return s(s(s({},e),u(e)),{},{gauge_od:r.convertValue(e.gauge_od,"shortLength","in"),gauge_length:r.convertValue(e.gauge_length,"shortLength","in"),blade_width:r.convertValue(e.blade_width,"shortLength","in")})}function v(e){return s(s(s({},e),u(e)),{},{pressure_loss:g(e.pressure_loss)})}function w(e){return s(s(s({},e),u(e)),{},{pressure_loss:g(e.pressure_loss)})}function P(e){return s(s(s({},e),u(e)),{},{pressure_loss:g(e.pressure_loss)})}function V(e){switch(e.family){case"dp":case"hwdp":case"dc":case"jar":case"sub":return s(s({},e),u(e));case"bit":return f(e);case"pdm":return p(e);case"lwd":return m(e);case"stabilizer":return d(e);case"mwd":return v(e);case"agitator":return P(e);case"rss":return w(e);default:return e}}function b(e){var r=t.cloneDeep((e||[]).map((function(e){return V(e)})));if(!r.length)return r;if("bit"===r[0].family){r[0].c_length=r[0].length||0;for(var n=1;n<r.length;n+=1)r[n].c_length=parseFloat(r[n-1].c_length)+parseFloat(r[n].length||0)}else{var o=r.length-1;r[o].c_length=r[o].length||0;for(var a=o-1;a>=0;a-=1)r[a].c_length=parseFloat(r[a+1].c_length)+parseFloat(r[a].length||0)}return r}function L(e){return{outer_diameter:r.convertValue(e.outer_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),inner_diameter:r.convertValue(e.inner_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength",r.getUnitPreference("massPerLength"),"lb-ft"),weight:r.convertValue(e.weight,"mass",r.getUnitPreference("mass"),"lb"),component_length:r.convertValue(e.component_length,"length",r.getUnitPreference("length"),"ft"),length:r.convertValue(e.length,"length",r.getUnitPreference("length"),"ft"),outer_diameter_tooljoint:r.convertValue(e.outer_diameter_tooljoint,"shortLength",r.getUnitPreference("shortLength"),"in"),inner_diameter_tooljoint:r.convertValue(e.inner_diameter_tooljoint,"shortLength",r.getUnitPreference("shortLength"),"in"),length_tooljoint:r.convertValue(e.length_tooljoint,"length",r.getUnitPreference("length"),"ft")}}function x(e){return e?s(s({},e),{},{inner_diameter:r.convertValue(e.inner_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),outer_diameter:r.convertValue(e.outer_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength",r.getUnitPreference("massPerLength"),"lb-ft"),weight:r.convertValue(e.weight,"mass",r.getUnitPreference("mass"),"lb"),length:r.convertValue(e.length,"length",r.getUnitPreference("length"),"ft"),gauge_od:r.convertValue(e.gauge_od,"shortLength",r.getUnitPreference("shortLength"),"in"),gauge_length:r.convertValue(e.gauge_length,"shortLength",r.getUnitPreference("shortLength"),"in"),blade_width:r.convertValue(e.blade_width,"shortLength",r.getUnitPreference("shortLength"),"in"),stab_centerpoint_to_bit:r.convertValue(e.stab_centerpoint_to_bit,"length",r.getUnitPreference("length"),"ft")}):e}function z(e){return(e||[]).map((function(e){return{flow_rate:r.convertValue(e.flow_rate,"volumeFlowRate",r.getUnitPreference("volumeFlowRate"),"gal/min"),pressure_loss:r.convertValue(e.pressure_loss,"pressure",r.getUnitPreference("pressure"),"psi")}}))}function U(e){return(e||[]).map((function(e){return s(s({},e),{},{distance:r.convertValue(e.distance,"length",r.getUnitPreference("length"),"ft")})}))}function T(e){return(e||[]).map((function(e){return s(s({},e),{},{size:1!==l?32*r.convertValue(e.size,"shortLength",r.getUnitPreference("shortLength"),"in"):e.size})}))}function j(e){return s(s(s({},e),L(e)),{},{size:r.convertValue(e.size,"shortLength",r.getUnitPreference("shortLength"),"in"),nozzle_sizes:T(e.nozzle_sizes),tfa:1!==l?e.tfa*(l*l):e.tfa})}function O(e){return s(s(s({},e),L(e)),{},{max_weight_on_bit:r.convertValue(e.max_weight_on_bit,"force",r.getUnitPreference("force"),"klbf"),min_standard_flowrate:r.convertValue(e.min_standard_flowrate,"volumeFlowRate",r.getUnitPreference("volumeFlowRate"),"gal/min"),max_standard_flowrate:r.convertValue(e.max_standard_flowrate,"volumeFlowRate",r.getUnitPreference("volumeFlowRate"),"gal/min"),max_operating_differential_pressure:r.convertValue(e.max_operating_differential_pressure,"pressure",r.getUnitPreference("pressure"),"psi"),torque_at_max_operating_differential_pressure:r.convertValue(e.torque_at_max_operating_differential_pressure,"torque",r.getUnitPreference("torque"),"ft-klbf"),rpg:r.convertValue(e.rpg,"revolutionPerVolume",r.getUnitPreference("revolutionPerVolume"),"rpg"),off_bottom_pressure_loss:z(e.off_bottom_pressure_loss),stabilizer:x(e.stabilizer)})}function y(e){return s(s(s({},e),L(e)),{},{lwd_measurements:U(e.lwd_measurements)})}function F(e){return s(s(s({},e),L(e)),{},{gauge_od:r.convertValue(e.gauge_od,"shortLength",r.getUnitPreference("shortLength"),"in"),gauge_length:r.convertValue(e.gauge_length,"shortLength",r.getUnitPreference("shortLength"),"in"),blade_width:r.convertValue(e.blade_width,"shortLength",r.getUnitPreference("shortLength"),"in")})}function I(e){return s(s(s({},e),L(e)),{},{pressure_loss:z(e.pressure_loss)})}function R(e){return s(s(s({},e),L(e)),{},{pressure_loss:z(e.pressure_loss)})}function q(e){return s(s(s({},e),L(e)),{},{pressure_loss:z(e.pressure_loss)})}function S(e){switch(e.family){case"dp":case"hwdp":case"dc":case"jar":case"sub":return s(s({},e),L(e));case"bit":return j(e);case"pdm":return O(e);case"lwd":return y(e);case"stabilizer":return F(e);case"mwd":return I(e);case"agitator":return q(e);case"rss":return R(e);default:return e}}exports.convertAgitatorToImperial=q,exports.convertAgitatorToPref=P,exports.convertBitToImperial=j,exports.convertBitToPref=f,exports.convertCommonFieldsToImperial=L,exports.convertCommonFieldsToPref=u,exports.convertComponentToImperial=S,exports.convertComponentToPref=V,exports.convertComponentsToImperial=function(e){return(e||[]).map((function(e){return S(e)}))},exports.convertComponentsToPref=b,exports.convertLwdMeasurementsToImperial=U,exports.convertLwdMeasurementsToPref=h,exports.convertLwdToImperial=y,exports.convertLwdToPref=m,exports.convertMwdToImperial=I,exports.convertMwdToPref=v,exports.convertNozzleSizeToImperial=T,exports.convertNozzleSizeToPref=_,exports.convertPdmStabilizerToImperial=x,exports.convertPdmStabilizerToPref=c,exports.convertPdmToImperial=O,exports.convertPdmToPref=p,exports.convertPressureLossToImperial=z,exports.convertPressureLossToPref=g,exports.convertRecordToPref=function(e){var t=e.data;return s(s({},e),{},{data:s(s({},t),{},{start_depth:r.convertValue(t.start_depth,"length","ft"),end_depth:r.convertValue(t.end_depth,"length","ft"),components:b(t.components)})})},exports.convertRssToImperial=R,exports.convertRssToPref=w,exports.convertStabilizerToImperial=F,exports.convertStabilizerToPref=d;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("lodash"),r=require("../convert.js");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){o.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var i=r.convertValue(1,"shortLength","in"),l=r.convertValue(1,"shortLength",r.getUnitPreference("shortLength"),"in");function u(e){return{outer_diameter:r.convertValue(e.outer_diameter,"shortLength","in"),inner_diameter:r.convertValue(e.inner_diameter,"shortLength","in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength","lb-ft"),weight:r.convertValue(e.weight,"mass","lb"),component_length:r.convertValue(e.component_length,"length","ft"),length:r.convertValue(e.length,"length","ft"),outer_diameter_tooljoint:r.convertValue(e.outer_diameter_tooljoint,"shortLength","in"),inner_diameter_tooljoint:r.convertValue(e.inner_diameter_tooljoint,"shortLength","in"),length_tooljoint:r.convertValue(e.length_tooljoint,"length","ft")}}function c(e){return e?s(s({},e),{},{inner_diameter:r.convertValue(e.inner_diameter,"shortLength","in"),outer_diameter:r.convertValue(e.outer_diameter,"shortLength","in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength","lb-ft"),weight:r.convertValue(e.weight,"mass","lb"),length:r.convertValue(e.length,"length","ft"),gauge_od:r.convertValue(e.gauge_od,"shortLength","in"),gauge_length:r.convertValue(e.gauge_length,"shortLength","in"),blade_width:r.convertValue(e.blade_width,"shortLength","in"),stab_centerpoint_to_bit:r.convertValue(e.stab_centerpoint_to_bit,"length","ft")}):e}function g(e){return(e||[]).map((function(e){return{flow_rate:r.convertValue(e.flow_rate,"volumeFlowRate","gal/min"),pressure_loss:r.convertValue(e.pressure_loss,"pressure","psi")}}))}function _(e){return(e||[]).map((function(e){return s(s({},e),{},{size:1!==i?r.convertValue(e.size,"shortLength","in")/32:e.size})}))}function h(e){return(e||[]).map((function(e){return s(s({},e),{},{distance:r.convertValue(e.distance,"length","ft")})}))}function f(e){return s(s(s({},e),u(e)),{},{size:r.convertValue(e.size,"shortLength","in"),nozzle_sizes:_(e.nozzle_sizes),tfa:1!==i?e.tfa*(i*i):e.tfa})}function p(e){return s(s(s({},e),u(e)),{},{max_weight_on_bit:r.convertValue(e.max_weight_on_bit,"force","klbf"),min_standard_flowrate:r.convertValue(e.min_standard_flowrate,"volumeFlowRate","gal/min"),max_standard_flowrate:r.convertValue(e.max_standard_flowrate,"volumeFlowRate","gal/min"),max_operating_differential_pressure:r.convertValue(e.max_operating_differential_pressure,"pressure","psi"),torque_at_max_operating_differential_pressure:r.convertValue(e.torque_at_max_operating_differential_pressure,"torque","ft-klbf"),rpg:r.convertValue(e.rpg,"revolutionPerVolume","rpg"),off_bottom_pressure_loss:g(e.off_bottom_pressure_loss),stabilizer:c(e.stabilizer)})}function m(e){return s(s(s({},e),u(e)),{},{lwd_measurements:h(e.lwd_measurements)})}function d(e){return s(s(s({},e),u(e)),{},{gauge_od:r.convertValue(e.gauge_od,"shortLength","in"),gauge_length:r.convertValue(e.gauge_length,"shortLength","in"),blade_width:r.convertValue(e.blade_width,"shortLength","in")})}function v(e){return s(s(s({},e),u(e)),{},{pressure_loss:g(e.pressure_loss)})}function w(e){return s(s(s({},e),u(e)),{},{pressure_loss:g(e.pressure_loss)})}function P(e){return s(s(s({},e),u(e)),{},{pressure_loss:g(e.pressure_loss)})}function V(e){switch(e.family){case"dp":case"hwdp":case"dc":case"jar":case"sub":return s(s({},e),u(e));case"bit":return f(e);case"pdm":return p(e);case"lwd":return m(e);case"stabilizer":case"ags":return d(e);case"mwd":return v(e);case"agitator":return P(e);case"rss":return w(e);default:return e}}function b(e){var r=t.cloneDeep((e||[]).map((function(e){return V(e)})));if(!r.length)return r;if("bit"===r[0].family){r[0].c_length=r[0].length||0;for(var n=1;n<r.length;n+=1)r[n].c_length=parseFloat(r[n-1].c_length)+parseFloat(r[n].length||0)}else{var o=r.length-1;r[o].c_length=r[o].length||0;for(var a=o-1;a>=0;a-=1)r[a].c_length=parseFloat(r[a+1].c_length)+parseFloat(r[a].length||0)}return r}function L(e){return{outer_diameter:r.convertValue(e.outer_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),inner_diameter:r.convertValue(e.inner_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength",r.getUnitPreference("massPerLength"),"lb-ft"),weight:r.convertValue(e.weight,"mass",r.getUnitPreference("mass"),"lb"),component_length:r.convertValue(e.component_length,"length",r.getUnitPreference("length"),"ft"),length:r.convertValue(e.length,"length",r.getUnitPreference("length"),"ft"),outer_diameter_tooljoint:r.convertValue(e.outer_diameter_tooljoint,"shortLength",r.getUnitPreference("shortLength"),"in"),inner_diameter_tooljoint:r.convertValue(e.inner_diameter_tooljoint,"shortLength",r.getUnitPreference("shortLength"),"in"),length_tooljoint:r.convertValue(e.length_tooljoint,"length",r.getUnitPreference("length"),"ft")}}function x(e){return e?s(s({},e),{},{inner_diameter:r.convertValue(e.inner_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),outer_diameter:r.convertValue(e.outer_diameter,"shortLength",r.getUnitPreference("shortLength"),"in"),linear_weight:r.convertValue(e.linear_weight,"massPerLength",r.getUnitPreference("massPerLength"),"lb-ft"),weight:r.convertValue(e.weight,"mass",r.getUnitPreference("mass"),"lb"),length:r.convertValue(e.length,"length",r.getUnitPreference("length"),"ft"),gauge_od:r.convertValue(e.gauge_od,"shortLength",r.getUnitPreference("shortLength"),"in"),gauge_length:r.convertValue(e.gauge_length,"shortLength",r.getUnitPreference("shortLength"),"in"),blade_width:r.convertValue(e.blade_width,"shortLength",r.getUnitPreference("shortLength"),"in"),stab_centerpoint_to_bit:r.convertValue(e.stab_centerpoint_to_bit,"length",r.getUnitPreference("length"),"ft")}):e}function z(e){return(e||[]).map((function(e){return{flow_rate:r.convertValue(e.flow_rate,"volumeFlowRate",r.getUnitPreference("volumeFlowRate"),"gal/min"),pressure_loss:r.convertValue(e.pressure_loss,"pressure",r.getUnitPreference("pressure"),"psi")}}))}function U(e){return(e||[]).map((function(e){return s(s({},e),{},{distance:r.convertValue(e.distance,"length",r.getUnitPreference("length"),"ft")})}))}function T(e){return(e||[]).map((function(e){return s(s({},e),{},{size:1!==l?32*r.convertValue(e.size,"shortLength",r.getUnitPreference("shortLength"),"in"):e.size})}))}function j(e){return s(s(s({},e),L(e)),{},{size:r.convertValue(e.size,"shortLength",r.getUnitPreference("shortLength"),"in"),nozzle_sizes:T(e.nozzle_sizes),tfa:1!==l?e.tfa*(l*l):e.tfa})}function O(e){return s(s(s({},e),L(e)),{},{max_weight_on_bit:r.convertValue(e.max_weight_on_bit,"force",r.getUnitPreference("force"),"klbf"),min_standard_flowrate:r.convertValue(e.min_standard_flowrate,"volumeFlowRate",r.getUnitPreference("volumeFlowRate"),"gal/min"),max_standard_flowrate:r.convertValue(e.max_standard_flowrate,"volumeFlowRate",r.getUnitPreference("volumeFlowRate"),"gal/min"),max_operating_differential_pressure:r.convertValue(e.max_operating_differential_pressure,"pressure",r.getUnitPreference("pressure"),"psi"),torque_at_max_operating_differential_pressure:r.convertValue(e.torque_at_max_operating_differential_pressure,"torque",r.getUnitPreference("torque"),"ft-klbf"),rpg:r.convertValue(e.rpg,"revolutionPerVolume",r.getUnitPreference("revolutionPerVolume"),"rpg"),off_bottom_pressure_loss:z(e.off_bottom_pressure_loss),stabilizer:x(e.stabilizer)})}function y(e){return s(s(s({},e),L(e)),{},{lwd_measurements:U(e.lwd_measurements)})}function F(e){return s(s(s({},e),L(e)),{},{gauge_od:r.convertValue(e.gauge_od,"shortLength",r.getUnitPreference("shortLength"),"in"),gauge_length:r.convertValue(e.gauge_length,"shortLength",r.getUnitPreference("shortLength"),"in"),blade_width:r.convertValue(e.blade_width,"shortLength",r.getUnitPreference("shortLength"),"in")})}function I(e){return s(s(s({},e),L(e)),{},{pressure_loss:z(e.pressure_loss)})}function R(e){return s(s(s({},e),L(e)),{},{pressure_loss:z(e.pressure_loss)})}function q(e){return s(s(s({},e),L(e)),{},{pressure_loss:z(e.pressure_loss)})}function S(e){switch(e.family){case"dp":case"hwdp":case"dc":case"jar":case"sub":return s(s({},e),L(e));case"bit":return j(e);case"pdm":return O(e);case"lwd":return y(e);case"stabilizer":case"ags":return F(e);case"mwd":return I(e);case"agitator":return q(e);case"rss":return R(e);default:return e}}exports.convertAgitatorToImperial=q,exports.convertAgitatorToPref=P,exports.convertBitToImperial=j,exports.convertBitToPref=f,exports.convertCommonFieldsToImperial=L,exports.convertCommonFieldsToPref=u,exports.convertComponentToImperial=S,exports.convertComponentToPref=V,exports.convertComponentsToImperial=function(e){return(e||[]).map((function(e){return S(e)}))},exports.convertComponentsToPref=b,exports.convertLwdMeasurementsToImperial=U,exports.convertLwdMeasurementsToPref=h,exports.convertLwdToImperial=y,exports.convertLwdToPref=m,exports.convertMwdToImperial=I,exports.convertMwdToPref=v,exports.convertNozzleSizeToImperial=T,exports.convertNozzleSizeToPref=_,exports.convertPdmStabilizerToImperial=x,exports.convertPdmStabilizerToPref=c,exports.convertPdmToImperial=O,exports.convertPdmToPref=p,exports.convertPressureLossToImperial=z,exports.convertPressureLossToPref=g,exports.convertRecordToPref=function(e){var t=e.data;return s(s({},e),{},{data:s(s({},t),{},{start_depth:r.convertValue(t.start_depth,"length","ft"),end_depth:r.convertValue(t.end_depth,"length","ft"),components:b(t.components)})})},exports.convertRssToImperial=R,exports.convertRssToPref=w,exports.convertStabilizerToImperial=F,exports.convertStabilizerToPref=d;
|
|
2
2
|
//# sourceMappingURL=conversion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversion.js","sources":["../../../../src/utils/drillstring/conversion.js"],"sourcesContent":["import { cloneDeep } from 'lodash';\n\nimport { getUnitPreference, convertValue } from '../convert';\n\nconst oneInch = convertValue(1, 'shortLength', 'in');\nconst oneInchI = convertValue(1, 'shortLength', getUnitPreference('shortLength'), 'in');\n\nexport function convertCommonFieldsToPref(component) {\n return {\n outer_diameter: convertValue(component.outer_diameter, 'shortLength', 'in'),\n inner_diameter: convertValue(component.inner_diameter, 'shortLength', 'in'),\n linear_weight: convertValue(component.linear_weight, 'massPerLength', 'lb-ft'),\n weight: convertValue(component.weight, 'mass', 'lb'),\n component_length: convertValue(component.component_length, 'length', 'ft'),\n length: convertValue(component.length, 'length', 'ft'),\n outer_diameter_tooljoint: convertValue(component.outer_diameter_tooljoint, 'shortLength', 'in'),\n inner_diameter_tooljoint: convertValue(component.inner_diameter_tooljoint, 'shortLength', 'in'),\n length_tooljoint: convertValue(component.length_tooljoint, 'length', 'ft'),\n };\n}\n\nexport function convertPdmStabilizerToPref(stabilizer) {\n if (!stabilizer) {\n return stabilizer;\n }\n\n return {\n ...stabilizer,\n inner_diameter: convertValue(stabilizer.inner_diameter, 'shortLength', 'in'),\n outer_diameter: convertValue(stabilizer.outer_diameter, 'shortLength', 'in'),\n linear_weight: convertValue(stabilizer.linear_weight, 'massPerLength', 'lb-ft'),\n weight: convertValue(stabilizer.weight, 'mass', 'lb'),\n length: convertValue(stabilizer.length, 'length', 'ft'),\n gauge_od: convertValue(stabilizer.gauge_od, 'shortLength', 'in'),\n gauge_length: convertValue(stabilizer.gauge_length, 'shortLength', 'in'),\n blade_width: convertValue(stabilizer.blade_width, 'shortLength', 'in'),\n stab_centerpoint_to_bit: convertValue(stabilizer.stab_centerpoint_to_bit, 'length', 'ft'),\n };\n}\n\nexport function convertPressureLossToPref(pressureLoss) {\n return (pressureLoss || []).map(item => {\n return {\n flow_rate: convertValue(item.flow_rate, 'volumeFlowRate', 'gal/min'),\n pressure_loss: convertValue(item.pressure_loss, 'pressure', 'psi'),\n };\n });\n}\n\nexport function convertNozzleSizeToPref(nozzleSizes) {\n return (nozzleSizes || []).map(item => {\n return {\n ...item,\n size: oneInch !== 1 ? convertValue(item.size, 'shortLength', 'in') / 32 : item.size,\n };\n });\n}\n\nexport function convertLwdMeasurementsToPref(measurements) {\n return (measurements || []).map(item => {\n return {\n ...item,\n distance: convertValue(item.distance, 'length', 'ft'),\n };\n });\n}\n\nexport function convertBitToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n size: convertValue(component.size, 'shortLength', 'in'),\n nozzle_sizes: convertNozzleSizeToPref(component.nozzle_sizes),\n tfa: oneInch !== 1 ? component.tfa * (oneInch * oneInch) : component.tfa,\n };\n}\n\nexport function convertPdmToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n max_weight_on_bit: convertValue(component.max_weight_on_bit, 'force', 'klbf'),\n min_standard_flowrate: convertValue(\n component.min_standard_flowrate,\n 'volumeFlowRate',\n 'gal/min'\n ),\n max_standard_flowrate: convertValue(\n component.max_standard_flowrate,\n 'volumeFlowRate',\n 'gal/min'\n ),\n max_operating_differential_pressure: convertValue(\n component.max_operating_differential_pressure,\n 'pressure',\n 'psi'\n ),\n torque_at_max_operating_differential_pressure: convertValue(\n component.torque_at_max_operating_differential_pressure,\n 'torque',\n 'ft-klbf'\n ),\n rpg: convertValue(component.rpg, 'revolutionPerVolume', 'rpg'),\n off_bottom_pressure_loss: convertPressureLossToPref(component.off_bottom_pressure_loss),\n stabilizer: convertPdmStabilizerToPref(component.stabilizer),\n };\n}\n\nexport function convertLwdToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n lwd_measurements: convertLwdMeasurementsToPref(component.lwd_measurements),\n };\n}\n\nexport function convertStabilizerToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n gauge_od: convertValue(component.gauge_od, 'shortLength', 'in'),\n gauge_length: convertValue(component.gauge_length, 'shortLength', 'in'),\n blade_width: convertValue(component.blade_width, 'shortLength', 'in'),\n };\n}\n\nexport function convertMwdToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n pressure_loss: convertPressureLossToPref(component.pressure_loss),\n };\n}\n\nexport function convertRssToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n pressure_loss: convertPressureLossToPref(component.pressure_loss),\n };\n}\n\nexport function convertAgitatorToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n pressure_loss: convertPressureLossToPref(component.pressure_loss),\n };\n}\n\nexport function convertComponentToPref(component) {\n switch (component.family) {\n case 'dp':\n case 'hwdp':\n case 'dc':\n case 'jar':\n case 'sub':\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n };\n case 'bit':\n return convertBitToPref(component);\n case 'pdm':\n return convertPdmToPref(component);\n case 'lwd':\n return convertLwdToPref(component);\n case 'stabilizer':\n return convertStabilizerToPref(component);\n case 'mwd':\n return convertMwdToPref(component);\n case 'agitator':\n return convertAgitatorToPref(component);\n case 'rss':\n return convertRssToPref(component);\n default:\n return component;\n }\n}\n\nexport function convertComponentsToPref(components) {\n const converted = cloneDeep(\n (components || []).map(component => convertComponentToPref(component))\n );\n\n if (!converted.length) {\n return converted;\n }\n\n if (converted[0].family === 'bit') {\n converted[0].c_length = converted[0].length || 0;\n for (let i = 1; i < converted.length; i += 1) {\n converted[i].c_length =\n parseFloat(converted[i - 1].c_length) + parseFloat(converted[i].length || 0);\n }\n } else {\n const lastIndex = converted.length - 1;\n converted[lastIndex].c_length = converted[lastIndex].length || 0;\n for (let i = lastIndex - 1; i >= 0; i -= 1) {\n converted[i].c_length =\n parseFloat(converted[i + 1].c_length) + parseFloat(converted[i].length || 0);\n }\n }\n\n return converted;\n}\n\nexport function convertRecordToPref(record) {\n const { data } = record;\n return {\n ...record,\n data: {\n ...data,\n start_depth: convertValue(data.start_depth, 'length', 'ft'),\n end_depth: convertValue(data.end_depth, 'length', 'ft'),\n components: convertComponentsToPref(data.components),\n },\n };\n}\n\nexport function convertCommonFieldsToImperial(component) {\n return {\n outer_diameter: convertValue(\n component.outer_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n inner_diameter: convertValue(\n component.inner_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n linear_weight: convertValue(\n component.linear_weight,\n 'massPerLength',\n getUnitPreference('massPerLength'),\n 'lb-ft'\n ),\n weight: convertValue(component.weight, 'mass', getUnitPreference('mass'), 'lb'),\n component_length: convertValue(\n component.component_length,\n 'length',\n getUnitPreference('length'),\n 'ft'\n ),\n length: convertValue(component.length, 'length', getUnitPreference('length'), 'ft'),\n outer_diameter_tooljoint: convertValue(\n component.outer_diameter_tooljoint,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n inner_diameter_tooljoint: convertValue(\n component.inner_diameter_tooljoint,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n length_tooljoint: convertValue(\n component.length_tooljoint,\n 'length',\n getUnitPreference('length'),\n 'ft'\n ),\n };\n}\n\nexport function convertPdmStabilizerToImperial(stabilizer) {\n if (!stabilizer) {\n return stabilizer;\n }\n\n return {\n ...stabilizer,\n inner_diameter: convertValue(\n stabilizer.inner_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n outer_diameter: convertValue(\n stabilizer.outer_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n linear_weight: convertValue(\n stabilizer.linear_weight,\n 'massPerLength',\n getUnitPreference('massPerLength'),\n 'lb-ft'\n ),\n weight: convertValue(stabilizer.weight, 'mass', getUnitPreference('mass'), 'lb'),\n length: convertValue(stabilizer.length, 'length', getUnitPreference('length'), 'ft'),\n gauge_od: convertValue(\n stabilizer.gauge_od,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n gauge_length: convertValue(\n stabilizer.gauge_length,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n blade_width: convertValue(\n stabilizer.blade_width,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n stab_centerpoint_to_bit: convertValue(\n stabilizer.stab_centerpoint_to_bit,\n 'length',\n getUnitPreference('length'),\n 'ft'\n ),\n };\n}\n\nexport function convertPressureLossToImperial(pressureLoss) {\n return (pressureLoss || []).map(item => {\n return {\n flow_rate: convertValue(\n item.flow_rate,\n 'volumeFlowRate',\n getUnitPreference('volumeFlowRate'),\n 'gal/min'\n ),\n pressure_loss: convertValue(\n item.pressure_loss,\n 'pressure',\n getUnitPreference('pressure'),\n 'psi'\n ),\n };\n });\n}\n\nexport function convertLwdMeasurementsToImperial(measurements) {\n return (measurements || []).map(item => {\n return {\n ...item,\n distance: convertValue(item.distance, 'length', getUnitPreference('length'), 'ft'),\n };\n });\n}\n\nexport function convertNozzleSizeToImperial(nozzleSizes) {\n return (nozzleSizes || []).map(item => {\n return {\n ...item,\n size:\n oneInchI !== 1\n ? convertValue(item.size, 'shortLength', getUnitPreference('shortLength'), 'in') * 32\n : item.size,\n };\n });\n}\n\nexport function convertBitToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n size: convertValue(component.size, 'shortLength', getUnitPreference('shortLength'), 'in'),\n nozzle_sizes: convertNozzleSizeToImperial(component.nozzle_sizes),\n tfa: oneInchI !== 1 ? component.tfa * (oneInchI * oneInchI) : component.tfa,\n };\n}\n\nexport function convertPdmToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n max_weight_on_bit: convertValue(\n component.max_weight_on_bit,\n 'force',\n getUnitPreference('force'),\n 'klbf'\n ),\n min_standard_flowrate: convertValue(\n component.min_standard_flowrate,\n 'volumeFlowRate',\n getUnitPreference('volumeFlowRate'),\n 'gal/min'\n ),\n max_standard_flowrate: convertValue(\n component.max_standard_flowrate,\n 'volumeFlowRate',\n getUnitPreference('volumeFlowRate'),\n 'gal/min'\n ),\n max_operating_differential_pressure: convertValue(\n component.max_operating_differential_pressure,\n 'pressure',\n getUnitPreference('pressure'),\n 'psi'\n ),\n torque_at_max_operating_differential_pressure: convertValue(\n component.torque_at_max_operating_differential_pressure,\n 'torque',\n getUnitPreference('torque'),\n 'ft-klbf'\n ),\n rpg: convertValue(\n component.rpg,\n 'revolutionPerVolume',\n getUnitPreference('revolutionPerVolume'),\n 'rpg'\n ),\n off_bottom_pressure_loss: convertPressureLossToImperial(component.off_bottom_pressure_loss),\n stabilizer: convertPdmStabilizerToImperial(component.stabilizer),\n };\n}\n\nexport function convertLwdToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n lwd_measurements: convertLwdMeasurementsToImperial(component.lwd_measurements),\n };\n}\n\nexport function convertStabilizerToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n gauge_od: convertValue(\n component.gauge_od,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n gauge_length: convertValue(\n component.gauge_length,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n blade_width: convertValue(\n component.blade_width,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n };\n}\n\nexport function convertMwdToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n pressure_loss: convertPressureLossToImperial(component.pressure_loss),\n };\n}\n\nexport function convertRssToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n pressure_loss: convertPressureLossToImperial(component.pressure_loss),\n };\n}\n\nexport function convertAgitatorToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n pressure_loss: convertPressureLossToImperial(component.pressure_loss),\n };\n}\n\nexport function convertComponentToImperial(component) {\n switch (component.family) {\n case 'dp':\n case 'hwdp':\n case 'dc':\n case 'jar':\n case 'sub':\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n };\n case 'bit':\n return convertBitToImperial(component);\n case 'pdm':\n return convertPdmToImperial(component);\n case 'lwd':\n return convertLwdToImperial(component);\n case 'stabilizer':\n return convertStabilizerToImperial(component);\n case 'mwd':\n return convertMwdToImperial(component);\n case 'agitator':\n return convertAgitatorToImperial(component);\n case 'rss':\n return convertRssToImperial(component);\n default:\n return component;\n }\n}\n\nexport function convertComponentsToImperial(components) {\n return (components || []).map(component => convertComponentToImperial(component));\n}\n"],"names":["oneInch","convertValue","oneInchI","getUnitPreference","convertCommonFieldsToPref","component","outer_diameter","inner_diameter","linear_weight","weight","component_length","length","outer_diameter_tooljoint","inner_diameter_tooljoint","length_tooljoint","convertPdmStabilizerToPref","stabilizer","_objectSpread","gauge_od","gauge_length","blade_width","stab_centerpoint_to_bit","convertPressureLossToPref","pressureLoss","map","item","flow_rate","pressure_loss","convertNozzleSizeToPref","nozzleSizes","size","convertLwdMeasurementsToPref","measurements","distance","convertBitToPref","nozzle_sizes","tfa","convertPdmToPref","max_weight_on_bit","min_standard_flowrate","max_standard_flowrate","max_operating_differential_pressure","torque_at_max_operating_differential_pressure","rpg","off_bottom_pressure_loss","convertLwdToPref","lwd_measurements","convertStabilizerToPref","convertMwdToPref","convertRssToPref","convertAgitatorToPref","convertComponentToPref","family","convertComponentsToPref","components","converted","cloneDeep","c_length","i","parseFloat","lastIndex","convertCommonFieldsToImperial","convertPdmStabilizerToImperial","convertPressureLossToImperial","convertLwdMeasurementsToImperial","convertNozzleSizeToImperial","convertBitToImperial","convertPdmToImperial","convertLwdToImperial","convertStabilizerToImperial","convertMwdToImperial","convertRssToImperial","convertAgitatorToImperial","convertComponentToImperial","record","data","start_depth","end_depth"],"mappings":"o0BAIA,IAAMA,EAAUC,EAAAA,aAAa,EAAG,cAAe,MACzCC,EAAWD,EAAYA,aAAC,EAAG,cAAeE,EAAAA,kBAAkB,eAAgB,MAE3E,SAASC,EAA0BC,GACxC,MAAO,CACLC,eAAgBL,EAAAA,aAAaI,EAAUC,eAAgB,cAAe,MACtEC,eAAgBN,EAAAA,aAAaI,EAAUE,eAAgB,cAAe,MACtEC,cAAeP,EAAAA,aAAaI,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vB,WAAYD,EAAwBsB,EAAKrB,eAG/C"}
|
|
1
|
+
{"version":3,"file":"conversion.js","sources":["../../../../src/utils/drillstring/conversion.js"],"sourcesContent":["import { cloneDeep } from 'lodash';\n\nimport { getUnitPreference, convertValue } from '../convert';\n\nconst oneInch = convertValue(1, 'shortLength', 'in');\nconst oneInchI = convertValue(1, 'shortLength', getUnitPreference('shortLength'), 'in');\n\nexport function convertCommonFieldsToPref(component) {\n return {\n outer_diameter: convertValue(component.outer_diameter, 'shortLength', 'in'),\n inner_diameter: convertValue(component.inner_diameter, 'shortLength', 'in'),\n linear_weight: convertValue(component.linear_weight, 'massPerLength', 'lb-ft'),\n weight: convertValue(component.weight, 'mass', 'lb'),\n component_length: convertValue(component.component_length, 'length', 'ft'),\n length: convertValue(component.length, 'length', 'ft'),\n outer_diameter_tooljoint: convertValue(component.outer_diameter_tooljoint, 'shortLength', 'in'),\n inner_diameter_tooljoint: convertValue(component.inner_diameter_tooljoint, 'shortLength', 'in'),\n length_tooljoint: convertValue(component.length_tooljoint, 'length', 'ft'),\n };\n}\n\nexport function convertPdmStabilizerToPref(stabilizer) {\n if (!stabilizer) {\n return stabilizer;\n }\n\n return {\n ...stabilizer,\n inner_diameter: convertValue(stabilizer.inner_diameter, 'shortLength', 'in'),\n outer_diameter: convertValue(stabilizer.outer_diameter, 'shortLength', 'in'),\n linear_weight: convertValue(stabilizer.linear_weight, 'massPerLength', 'lb-ft'),\n weight: convertValue(stabilizer.weight, 'mass', 'lb'),\n length: convertValue(stabilizer.length, 'length', 'ft'),\n gauge_od: convertValue(stabilizer.gauge_od, 'shortLength', 'in'),\n gauge_length: convertValue(stabilizer.gauge_length, 'shortLength', 'in'),\n blade_width: convertValue(stabilizer.blade_width, 'shortLength', 'in'),\n stab_centerpoint_to_bit: convertValue(stabilizer.stab_centerpoint_to_bit, 'length', 'ft'),\n };\n}\n\nexport function convertPressureLossToPref(pressureLoss) {\n return (pressureLoss || []).map(item => {\n return {\n flow_rate: convertValue(item.flow_rate, 'volumeFlowRate', 'gal/min'),\n pressure_loss: convertValue(item.pressure_loss, 'pressure', 'psi'),\n };\n });\n}\n\nexport function convertNozzleSizeToPref(nozzleSizes) {\n return (nozzleSizes || []).map(item => {\n return {\n ...item,\n size: oneInch !== 1 ? convertValue(item.size, 'shortLength', 'in') / 32 : item.size,\n };\n });\n}\n\nexport function convertLwdMeasurementsToPref(measurements) {\n return (measurements || []).map(item => {\n return {\n ...item,\n distance: convertValue(item.distance, 'length', 'ft'),\n };\n });\n}\n\nexport function convertBitToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n size: convertValue(component.size, 'shortLength', 'in'),\n nozzle_sizes: convertNozzleSizeToPref(component.nozzle_sizes),\n tfa: oneInch !== 1 ? component.tfa * (oneInch * oneInch) : component.tfa,\n };\n}\n\nexport function convertPdmToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n max_weight_on_bit: convertValue(component.max_weight_on_bit, 'force', 'klbf'),\n min_standard_flowrate: convertValue(\n component.min_standard_flowrate,\n 'volumeFlowRate',\n 'gal/min'\n ),\n max_standard_flowrate: convertValue(\n component.max_standard_flowrate,\n 'volumeFlowRate',\n 'gal/min'\n ),\n max_operating_differential_pressure: convertValue(\n component.max_operating_differential_pressure,\n 'pressure',\n 'psi'\n ),\n torque_at_max_operating_differential_pressure: convertValue(\n component.torque_at_max_operating_differential_pressure,\n 'torque',\n 'ft-klbf'\n ),\n rpg: convertValue(component.rpg, 'revolutionPerVolume', 'rpg'),\n off_bottom_pressure_loss: convertPressureLossToPref(component.off_bottom_pressure_loss),\n stabilizer: convertPdmStabilizerToPref(component.stabilizer),\n };\n}\n\nexport function convertLwdToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n lwd_measurements: convertLwdMeasurementsToPref(component.lwd_measurements),\n };\n}\n\nexport function convertStabilizerToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n gauge_od: convertValue(component.gauge_od, 'shortLength', 'in'),\n gauge_length: convertValue(component.gauge_length, 'shortLength', 'in'),\n blade_width: convertValue(component.blade_width, 'shortLength', 'in'),\n };\n}\n\nexport function convertMwdToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n pressure_loss: convertPressureLossToPref(component.pressure_loss),\n };\n}\n\nexport function convertRssToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n pressure_loss: convertPressureLossToPref(component.pressure_loss),\n };\n}\n\nexport function convertAgitatorToPref(component) {\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n pressure_loss: convertPressureLossToPref(component.pressure_loss),\n };\n}\n\nexport function convertComponentToPref(component) {\n switch (component.family) {\n case 'dp':\n case 'hwdp':\n case 'dc':\n case 'jar':\n case 'sub':\n return {\n ...component,\n ...convertCommonFieldsToPref(component),\n };\n case 'bit':\n return convertBitToPref(component);\n case 'pdm':\n return convertPdmToPref(component);\n case 'lwd':\n return convertLwdToPref(component);\n case 'stabilizer':\n case 'ags':\n return convertStabilizerToPref(component);\n case 'mwd':\n return convertMwdToPref(component);\n case 'agitator':\n return convertAgitatorToPref(component);\n case 'rss':\n return convertRssToPref(component);\n default:\n return component;\n }\n}\n\nexport function convertComponentsToPref(components) {\n const converted = cloneDeep(\n (components || []).map(component => convertComponentToPref(component))\n );\n\n if (!converted.length) {\n return converted;\n }\n\n if (converted[0].family === 'bit') {\n converted[0].c_length = converted[0].length || 0;\n for (let i = 1; i < converted.length; i += 1) {\n converted[i].c_length =\n parseFloat(converted[i - 1].c_length) + parseFloat(converted[i].length || 0);\n }\n } else {\n const lastIndex = converted.length - 1;\n converted[lastIndex].c_length = converted[lastIndex].length || 0;\n for (let i = lastIndex - 1; i >= 0; i -= 1) {\n converted[i].c_length =\n parseFloat(converted[i + 1].c_length) + parseFloat(converted[i].length || 0);\n }\n }\n\n return converted;\n}\n\nexport function convertRecordToPref(record) {\n const { data } = record;\n return {\n ...record,\n data: {\n ...data,\n start_depth: convertValue(data.start_depth, 'length', 'ft'),\n end_depth: convertValue(data.end_depth, 'length', 'ft'),\n components: convertComponentsToPref(data.components),\n },\n };\n}\n\nexport function convertCommonFieldsToImperial(component) {\n return {\n outer_diameter: convertValue(\n component.outer_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n inner_diameter: convertValue(\n component.inner_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n linear_weight: convertValue(\n component.linear_weight,\n 'massPerLength',\n getUnitPreference('massPerLength'),\n 'lb-ft'\n ),\n weight: convertValue(component.weight, 'mass', getUnitPreference('mass'), 'lb'),\n component_length: convertValue(\n component.component_length,\n 'length',\n getUnitPreference('length'),\n 'ft'\n ),\n length: convertValue(component.length, 'length', getUnitPreference('length'), 'ft'),\n outer_diameter_tooljoint: convertValue(\n component.outer_diameter_tooljoint,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n inner_diameter_tooljoint: convertValue(\n component.inner_diameter_tooljoint,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n length_tooljoint: convertValue(\n component.length_tooljoint,\n 'length',\n getUnitPreference('length'),\n 'ft'\n ),\n };\n}\n\nexport function convertPdmStabilizerToImperial(stabilizer) {\n if (!stabilizer) {\n return stabilizer;\n }\n\n return {\n ...stabilizer,\n inner_diameter: convertValue(\n stabilizer.inner_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n outer_diameter: convertValue(\n stabilizer.outer_diameter,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n linear_weight: convertValue(\n stabilizer.linear_weight,\n 'massPerLength',\n getUnitPreference('massPerLength'),\n 'lb-ft'\n ),\n weight: convertValue(stabilizer.weight, 'mass', getUnitPreference('mass'), 'lb'),\n length: convertValue(stabilizer.length, 'length', getUnitPreference('length'), 'ft'),\n gauge_od: convertValue(\n stabilizer.gauge_od,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n gauge_length: convertValue(\n stabilizer.gauge_length,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n blade_width: convertValue(\n stabilizer.blade_width,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n stab_centerpoint_to_bit: convertValue(\n stabilizer.stab_centerpoint_to_bit,\n 'length',\n getUnitPreference('length'),\n 'ft'\n ),\n };\n}\n\nexport function convertPressureLossToImperial(pressureLoss) {\n return (pressureLoss || []).map(item => {\n return {\n flow_rate: convertValue(\n item.flow_rate,\n 'volumeFlowRate',\n getUnitPreference('volumeFlowRate'),\n 'gal/min'\n ),\n pressure_loss: convertValue(\n item.pressure_loss,\n 'pressure',\n getUnitPreference('pressure'),\n 'psi'\n ),\n };\n });\n}\n\nexport function convertLwdMeasurementsToImperial(measurements) {\n return (measurements || []).map(item => {\n return {\n ...item,\n distance: convertValue(item.distance, 'length', getUnitPreference('length'), 'ft'),\n };\n });\n}\n\nexport function convertNozzleSizeToImperial(nozzleSizes) {\n return (nozzleSizes || []).map(item => {\n return {\n ...item,\n size:\n oneInchI !== 1\n ? convertValue(item.size, 'shortLength', getUnitPreference('shortLength'), 'in') * 32\n : item.size,\n };\n });\n}\n\nexport function convertBitToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n size: convertValue(component.size, 'shortLength', getUnitPreference('shortLength'), 'in'),\n nozzle_sizes: convertNozzleSizeToImperial(component.nozzle_sizes),\n tfa: oneInchI !== 1 ? component.tfa * (oneInchI * oneInchI) : component.tfa,\n };\n}\n\nexport function convertPdmToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n max_weight_on_bit: convertValue(\n component.max_weight_on_bit,\n 'force',\n getUnitPreference('force'),\n 'klbf'\n ),\n min_standard_flowrate: convertValue(\n component.min_standard_flowrate,\n 'volumeFlowRate',\n getUnitPreference('volumeFlowRate'),\n 'gal/min'\n ),\n max_standard_flowrate: convertValue(\n component.max_standard_flowrate,\n 'volumeFlowRate',\n getUnitPreference('volumeFlowRate'),\n 'gal/min'\n ),\n max_operating_differential_pressure: convertValue(\n component.max_operating_differential_pressure,\n 'pressure',\n getUnitPreference('pressure'),\n 'psi'\n ),\n torque_at_max_operating_differential_pressure: convertValue(\n component.torque_at_max_operating_differential_pressure,\n 'torque',\n getUnitPreference('torque'),\n 'ft-klbf'\n ),\n rpg: convertValue(\n component.rpg,\n 'revolutionPerVolume',\n getUnitPreference('revolutionPerVolume'),\n 'rpg'\n ),\n off_bottom_pressure_loss: convertPressureLossToImperial(component.off_bottom_pressure_loss),\n stabilizer: convertPdmStabilizerToImperial(component.stabilizer),\n };\n}\n\nexport function convertLwdToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n lwd_measurements: convertLwdMeasurementsToImperial(component.lwd_measurements),\n };\n}\n\nexport function convertStabilizerToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n gauge_od: convertValue(\n component.gauge_od,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n gauge_length: convertValue(\n component.gauge_length,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n blade_width: convertValue(\n component.blade_width,\n 'shortLength',\n getUnitPreference('shortLength'),\n 'in'\n ),\n };\n}\n\nexport function convertMwdToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n pressure_loss: convertPressureLossToImperial(component.pressure_loss),\n };\n}\n\nexport function convertRssToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n pressure_loss: convertPressureLossToImperial(component.pressure_loss),\n };\n}\n\nexport function convertAgitatorToImperial(component) {\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n pressure_loss: convertPressureLossToImperial(component.pressure_loss),\n };\n}\n\nexport function convertComponentToImperial(component) {\n switch (component.family) {\n case 'dp':\n case 'hwdp':\n case 'dc':\n case 'jar':\n case 'sub':\n return {\n ...component,\n ...convertCommonFieldsToImperial(component),\n };\n case 'bit':\n return convertBitToImperial(component);\n case 'pdm':\n return convertPdmToImperial(component);\n case 'lwd':\n return convertLwdToImperial(component);\n case 'stabilizer':\n case 'ags':\n return convertStabilizerToImperial(component);\n case 'mwd':\n return convertMwdToImperial(component);\n case 'agitator':\n return convertAgitatorToImperial(component);\n case 'rss':\n return convertRssToImperial(component);\n default:\n return component;\n }\n}\n\nexport function convertComponentsToImperial(components) {\n return (components || []).map(component => convertComponentToImperial(component));\n}\n"],"names":["oneInch","convertValue","oneInchI","getUnitPreference","convertCommonFieldsToPref","component","outer_diameter","inner_diameter","linear_weight","weight","component_length","length","outer_diameter_tooljoint","inner_diameter_tooljoint","length_tooljoint","convertPdmStabilizerToPref","stabilizer","_objectSpread","gauge_od","gauge_length","blade_width","stab_centerpoint_to_bit","convertPressureLossToPref","pressureLoss","map","item","flow_rate","pressure_loss","convertNozzleSizeToPref","nozzleSizes","size","convertLwdMeasurementsToPref","measurements","distance","convertBitToPref","nozzle_sizes","tfa","convertPdmToPref","max_weight_on_bit","min_standard_flowrate","max_standard_flowrate","max_operating_differential_pressure","torque_at_max_operating_differential_pressure","rpg","off_bottom_pressure_loss","convertLwdToPref","lwd_measurements","convertStabilizerToPref","convertMwdToPref","convertRssToPref","convertAgitatorToPref","convertComponentToPref","family","convertComponentsToPref","components","converted","cloneDeep","c_length","i","parseFloat","lastIndex","convertCommonFieldsToImperial","convertPdmStabilizerToImperial","convertPressureLossToImperial","convertLwdMeasurementsToImperial","convertNozzleSizeToImperial","convertBitToImperial","convertPdmToImperial","convertLwdToImperial","convertStabilizerToImperial","convertMwdToImperial","convertRssToImperial","convertAgitatorToImperial","convertComponentToImperial","record","data","start_depth","end_depth"],"mappings":"o0BAIA,IAAMA,EAAUC,EAAAA,aAAa,EAAG,cAAe,MACzCC,EAAWD,EAAYA,aAAC,EAAG,cAAeE,EAAAA,kBAAkB,eAAgB,MAE3E,SAASC,EAA0BC,GACxC,MAAO,CACLC,eAAgBL,EAAAA,aAAaI,EAAUC,eAAgB,cAAe,MACtEC,eAAgB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AAA,aAAa0E,EAAKC,YAAa,SAAU,MACtDC,UAAW5E,EAAAA,aAAa0E,EAAKE,UAAW,SAAU,MAClDvB,WAAYD,EAAwBsB,EAAKrB,eAG/C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getBHASchematic=function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=[];return e.forEach((function(e){var a=e.family,r=e.material,
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getBHASchematic=function(e){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=[];return e.forEach((function(e){var a=e.family,r=e.material,s=e.stabilizer;["bit","pdm","rss","stabilizer","ags","ur"].includes(a)?t.push({family:a,hasStabilizer:!!s,bitType:e.bit_type}):(i&&["dp","sub"].includes(a)||"Non Magnetic"===r&&(0===t.length||t.slice(-1)[0].material!==r))&&t.push({family:"other",material:r})})),t};
|
|
2
2
|
//# sourceMappingURL=schematic.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schematic.js","sources":["../../../../src/utils/drillstring/schematic.js"],"sourcesContent":["export function getBHASchematic(components, isDrillout = false) {\n const schematic = [];\n\n components.forEach(component => {\n const { family, material, stabilizer } = component;\n if (['bit', 'pdm', 'rss', 'stabilizer', 'ur'].includes(family)) {\n schematic.push({\n family,\n hasStabilizer: !!stabilizer,\n bitType: component.bit_type,\n });\n } else if (\n (isDrillout && ['dp', 'sub'].includes(family)) ||\n (material === 'Non Magnetic' &&\n (schematic.length === 0 || schematic.slice(-1)[0].material !== material))\n ) {\n schematic.push({\n family: 'other',\n material,\n });\n }\n });\n\n return schematic;\n}\n"],"names":["components","isDrillout","schematic","forEach","component","family","material","stabilizer","includes","push","hasStabilizer","bitType","bit_type","length","slice"],"mappings":"4FAAO,SAAyBA,GAAgC,IAApBC,0DACpCC,EAAY,GAsBlB,OApBAF,EAAWG,SAAQ,SAAAC,GACjB,IAAQC,EAAiCD,EAAjCC,OAAQC,EAAyBF,EAAzBE,SAAUC,EAAeH,EAAfG,WACtB,CAAC,MAAO,MAAO,MAAO,aAAc,MAAMC,SAASH,
|
|
1
|
+
{"version":3,"file":"schematic.js","sources":["../../../../src/utils/drillstring/schematic.js"],"sourcesContent":["export function getBHASchematic(components, isDrillout = false) {\n const schematic = [];\n\n components.forEach(component => {\n const { family, material, stabilizer } = component;\n if (['bit', 'pdm', 'rss', 'stabilizer', 'ags', 'ur'].includes(family)) {\n schematic.push({\n family,\n hasStabilizer: !!stabilizer,\n bitType: component.bit_type,\n });\n } else if (\n (isDrillout && ['dp', 'sub'].includes(family)) ||\n (material === 'Non Magnetic' &&\n (schematic.length === 0 || schematic.slice(-1)[0].material !== material))\n ) {\n schematic.push({\n family: 'other',\n material,\n });\n }\n });\n\n return schematic;\n}\n"],"names":["components","isDrillout","schematic","forEach","component","family","material","stabilizer","includes","push","hasStabilizer","bitType","bit_type","length","slice"],"mappings":"4FAAO,SAAyBA,GAAgC,IAApBC,0DACpCC,EAAY,GAsBlB,OApBAF,EAAWG,SAAQ,SAAAC,GACjB,IAAQC,EAAiCD,EAAjCC,OAAQC,EAAyBF,EAAzBE,SAAUC,EAAeH,EAAfG,WACtB,CAAC,MAAO,MAAO,MAAO,aAAc,MAAO,MAAMC,SAASH,GAC5DH,EAAUO,KAAK,CACbJ,OAAAA,EACAK,gBAAiBH,EACjBI,QAASP,EAAUQ,YAGpBX,GAAc,CAAC,KAAM,OAAOO,SAASH,IACxB,iBAAbC,IACuB,IAArBJ,EAAUW,QAAgBX,EAAUY,OAAO,GAAG,GAAGR,WAAaA,KAEjEJ,EAAUO,KAAK,CACbJ,OAAQ,QACRC,SAAAA,GAGN,IAEOJ,CACT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("moment"),n=require("lodash"),r=require("../convert.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),a=i(t);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u={general:{empty:"It should not be empty."}},_={general:{family:"Family should be matched."}};function d(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return 0===e||e?t&&n?r.convertValue(e,t,n,null,i):e:null}function c(e){return null==e||""===e}function m(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.isMinInclusive,o=void 0===i||i,a=parseFloat(e);return!Number.isNaN(a)&&(!(o&&a<t||!o&&a<=t)&&!(n&&a>n))}function h(e,t,n){var i=r.getUnitPreference("shortLength"),o=e,a=t;"in"!==i&&(o=r.convertValue(e,"shortLength",i,"in"),a=r.convertValue(t,"shortLength",i,"in"));var s=2.673*(a*a-o*o),l="in"!==i?r.convertValue(s,"massPerLength","lb-ft"):s;return n>=.5*l&&n<=1.5*l}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!t)return u;var i=t.min_id,o=t.min_od,a=t.max_id,s=t.max_od,l=t.min_length,_=t.min_tj_id,d=t.max_tj_id,h=t.min_tj_od,v=t.max_tj_od,g=t.min_pressure_loss,f=t.min_off_bottom_pressure_loss,p=r.getUnitDisplay("shortLength"),b={},x=!1;if(c(i)||c(o)||(m(e.inner_diameter,i,a)||(b.inner_diameter="".concat(i.toFixed(1),"~").concat(a.toFixed(1)," (").concat(p,")"),x=!0),m(e.outer_diameter,o,s)||(b.outer_diameter="".concat(o.toFixed(1),"~").concat(s.toFixed(1)," (").concat(p,")"),x=!0),m(e.inner_diameter,i,a)&&m(e.outer_diameter,o,s)&&!m(e.inner_diameter,i,e.outer_diameter)&&(b.outer_diameter="O.D > I.D",x=!0),!b.outer_diameter&&n&&+e.outer_diameter+r.convertValue(.1,"shortLength","in")>n&&(b.outer_diameter=" O.D + 0.1 < Bit Size",x=!0),m(e.linear_weight,0)||(b.linear_weight="Invalid value",x=!0)),c(_)||c(h)||(m(e.inner_diameter_tooljoint,_,d)||(b.inner_diameter_tooljoint="".concat(_.toFixed(1),"~").concat(d.toFixed(1)," (").concat(p,")"),x=!0),m(e.outer_diameter_tooljoint,h,v)||(b.outer_diameter_tooljoint="".concat(h.toFixed(1),"~").concat(v.toFixed(1)," (").concat(p,")"),x=!0),m(e.outer_diameter_tooljoint,e.outer_diameter,v)||(b.outer_diameter_tooljoint="Tool Joint O.D >= O.D",x=!0)),c(l)||m(e.length,l)||(b.length="Invalid value",x=!0),c(e.length_tooljoint)||c(e.component_length)||+e.length_tooljoint>+e.component_length&&(b.length_tooljoint="Tool Joint Length < Component Length",x=!0),e.off_bottom_pressure_loss&&e.off_bottom_pressure_loss.length>0){b.off_bottom_pressure_loss={};for(var V=0;V<e.off_bottom_pressure_loss.length;V+=1){var L=e.off_bottom_pressure_loss[V];b.off_bottom_pressure_loss[V]={},c(L.flow_rate)&&(b.off_bottom_pressure_loss[V].flow_rate="flow rate is required.",x=!0),c(L.pressure_loss)&&(b.off_bottom_pressure_loss[V].pressure_loss="pressure loss is required.",x=!0),c(f)||m(L.pressure_loss,f,null,{isMinInclusive:!1})||(b.off_bottom_pressure_loss[V].pressure_loss="Invalid range",x=!0)}}if(e.pressure_loss&&e.pressure_loss.length>0){b.pressure_loss={};for(var y=0;y<e.pressure_loss.length;y+=1){var w=e.pressure_loss[y];b.pressure_loss[y]={},c(w.flow_rate)&&(b.pressure_loss[y].flow_rate="flow rate is required.",x=!0),c(w.pressure_loss)&&(b.pressure_loss[y].pressure_loss="pressure loss is required.",x=!0),c(g)||m(w.pressure_loss,g,null,{isMinInclusive:!1})||(b.pressure_loss[y].pressure_loss="Invalid range",x=!0)}}if(e.has_stabilizer&&e.stabilizer){var F=r.convertValue(0,"shortLength","in"),j=r.convertValue(100,"shortLength","in"),I=r.convertValue(1,"shortLength","in"),E=r.convertValue(100,"shortLength","in"),z=r.convertValue(0,"length","ft");m(e.stabilizer.inner_diameter,F,j)&&m(e.stabilizer.outer_diameter,I,E)&&!m(e.stabilizer.inner_diameter,i,e.stabilizer.outer_diameter)&&(b.stabilizer_outer_diameter="O.D > I.D",x=!0),m(e.stabilizer.inner_diameter,F,j)||(b.stabilizer_inner_diameter="".concat(F.toFixed(1),"~").concat(j.toFixed(1)," (").concat(p,")"),x=!0),m(e.stabilizer.outer_diameter,I,E)||(b.stabilizer_outer_diameter="".concat(I.toFixed(1),"~").concat(E.toFixed(1)," (").concat(p,")"),x=!0),c(z)||m(e.stabilizer.length,z)||(b.stabilizer_length="Invalid value",x=!0),c(e.stabilizer.linear_weight)&&(b.stabilizer_linear_weight="Invalid value",x=!0),!b.stabilizer_outer_diameter&&n&&+e.stabilizer.outer_diameter+r.convertValue(.1,"shortLength","in")>n&&(b.stabilizer_outer_diameter=" O.D + 0.1 < Bit Size",x=!0)}return x?b:null}function g(e){if(!e)return u;var t=r.getUnitDisplay("length"),i={};if(c(e.id)&&(i.id="It should not be empty."),e.start_timestamp_str&&!a.default(new Date(e.start_timestamp_str)).isValid()&&(i.start_timestamp="Invalid Date."),Number.isFinite(e.start_depth)){var o=r.convertValue(0,"length","ft"),s=r.convertValue(55e3,"length","ft"),l=r.convertValue(1,"length","ft");(e.start_depth<=o||e.start_depth>s)&&(i.start_depth="Should be a positive number ".concat(o.toFixed(2),"~").concat(s.toFixed(2)," (").concat(t,")")),e.start_depth===l&&(i.start_depth="Should not be equal to ".concat(l," (").concat(t,")"))}else i.start_depth="It should not be empty.";return n.isEmpty(i)?null:i}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;var i={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(100,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(100,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{},l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("dp"!==e.family)return _;var i={min_id:r.convertValue(1,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(8,"shortLength","in"),min_tj_id:r.convertValue(1,"shortLength","in"),max_tj_id:r.convertValue(7,"shortLength","in"),min_tj_od:r.convertValue(2,"shortLength","in"),max_tj_od:r.convertValue(10,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{};s.inner_diameter||s.outer_diameter||s.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(s.linear_weight="Invalid range");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("hwdp"!==e.family)return _;var i={min_id:r.convertValue(1,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(8,"shortLength","in"),min_tj_id:r.convertValue(1,"shortLength","in"),max_tj_id:r.convertValue(7,"shortLength","in"),min_tj_od:r.convertValue(2,"shortLength","in"),max_tj_od:r.convertValue(10,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{};s.inner_diameter||s.outer_diameter||s.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(s.linear_weight="Invalid range");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("dc"!==e.family)return _;var i={min_id:r.convertValue(.5,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{};s.inner_diameter||s.outer_diameter||s.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(s.linear_weight="Invalid range");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e?"jar"!==e.family?_:f(e,t):u}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e?"sub"!==e.family?_:f(e,t):u}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("bit"!==e.family)return _;var i=e.size,a=v(e,{},i),s=a||{},l=d(1,"shortLength","in"),h=l*l*0,g=l*l*20;c(t)||c(i)||+t+r.convertValue(.1,"shortLength","in")>i&&(s.size=" max(O.D) + 0.1 < Bit Size"),m(e.tfa,h,g)||(s.tfa="TFA must be ".concat(h.toFixed(2),"~").concat(20..toFixed(2)));var f={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:f}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("pdm"!==e.family)return _;var i,a,s={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(15,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(4,"length","ft"),min_off_bottom_pressure_loss:0},l=v(e,s,t),d=l||{};m(e.number_rotor_lobes,1,10)||(d.number_rotor_lobes="It must be ".concat(1,"~").concat(10)),m(e.number_stator_lobes,2,10)||(d.number_stator_lobes="It must be ".concat(2,"~").concat(10)),m(e.rpg,0,10)||(d.rpg="It must be ".concat(0,"~").concat(10)),i=r.convertValue(0,"force","klbf"),a=r.convertValue(200,"force","klbf"),c(e.max_weight_on_bit)||m(e.max_weight_on_bit,i,a)||(d.max_weight_on_bit="It must be ".concat(a.toFixed(2),"~").concat(a.toFixed(2))),i=r.convertValue(0,"volumeFlowRate","gal/min"),a=r.convertValue(2500,"volumeFlowRate","gal/min"),m(e.min_standard_flowrate,i,a)||(d.min_standard_flowrate="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),m(e.max_standard_flowrate,i,a)||(d.max_standard_flowrate="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),i=r.convertValue(0,"pressure","psi"),a=r.convertValue(3e3,"pressure","psi"),m(e.max_operating_differential_pressure,i,a)||(d.max_operating_differential_pressure="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),i=r.convertValue(0,"torque","ft-klbf"),a=r.convertValue(40,"torque","ft-klbf"),m(e.torque_at_max_operating_differential_pressure,i,a)||(d.torque_at_max_operating_differential_pressure="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),m(e.flow_loss_percentage,0,20)||(d.flow_loss_percentage="It must be ".concat(0,"~").concat(20));var h={general:{},components:o.default({},e.id,d),specificErrors:{}};return n.isEmpty(d)?null:h}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("lwd"!==e.family)return _;var n={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(9.5,"shortLength","in"),min_id:r.convertValue(.1,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_length:r.convertValue(1,"length","ft")},i=v(e,n,t),a=i||{},s=!1;if(i&&(s=!0),e.lwd_measurements&&e.lwd_measurements.length>0){a.lwd_measurements={};for(var l=0;l<e.lwd_measurements.length;l+=1){var d=e.lwd_measurements[l];a.lwd_measurements[l]={},c(d.type)&&(a.lwd_measurements[l].type="measurement type is required.",s=!0),c(d.distance)&&(a.lwd_measurements[l].distance="measurement distance is required.",s=!0)}}var m={general:{},components:o.default({},e.id,a),specificErrors:{}};return e.lwd_measurements&&e.lwd_measurements.length||(m.general.lwd_measurements="LWD Tool requires at least one LWD measurement should be selected.",s=!0),s?m:null}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("stabilizer"!==e.family)return _;var i={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(100,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(100,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{},l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("mwd"!==e.family)return _;var i={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(1,"length","ft"),min_pressure_loss:0},a=v(e,i,t),s=a||{};e.has_gamma_sensor&&!Number.isFinite(e.gamma_sensor_to_bit_distance)&&(s.gamma_sensor_to_bit_distance="This field is required."),e.has_survey_sensor&&!Number.isFinite(e.bit_to_survey_distance)?s.bit_to_survey_distance="This field is required.":e.has_survey_sensor&&e.bit_to_survey_distance<=0?s.bit_to_survey_distance="Should be a positive number.":e.has_survey_sensor&&e.bit_to_survey_distance>150&&(s.bit_to_survey_distance="Should be less then 150."),e.has_directional_sensor&&!Number.isFinite(e.directional_sensor_to_bit_distance)?s.directional_sensor_to_bit_distance="This field is required.":e.has_directional_sensor&&e.directional_sensor_to_bit_distance<=0?s.directional_sensor_to_bit_distance="Should be a positive number.":e.has_directional_sensor&&e.directional_sensor_to_bit_distance>150&&(s.directional_sensor_to_bit_distance="Should be less then 150.");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("agitator"!==e.family)return _;var i={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(1,"length","ft"),min_pressure_loss:0},a=v(e,i,t),s=a||{},l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("rss"!==e.family)return _;var i={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(1,"length","ft"),min_pressure_loss:0},a=v(e,i,t),s=a||{};m(e.flow_loss_percentage,0,10)||(s.flow_loss_percentage="It must be ".concat(0,"~").concat(10));var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("ct"!==e.family)return _;var i=r.getUnitDisplay("shortLength"),a={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(100,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(100,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},s=r.convertValue(0,"shortLength","in"),l=r.convertValue(500,"shortLength","in"),d=v(e,a,t),c=d||{};c.inner_diameter||c.outer_diameter||c.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(c.linear_weight="Invalid range"),m(e.reel_diameter,s,l)||(c.reel_diameter="".concat(s.toFixed(1),"~").concat(l.toFixed(1)," (").concat(i,")"));var g={general:{},components:o.default({},e.id,c),specificErrors:{}};return n.isEmpty(c)?null:g}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("ur"!==e.family)return _;var i=r.getUnitDisplay("shortLength"),a={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(50,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(50,"shortLength","in")},s=r.convertValue(1,"shortLength","in"),l=r.convertValue(50,"shortLength","in"),c=v(e,a,t),g=c||{};g.inner_diameter||g.outer_diameter||g.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(g.linear_weight="Invalid range"),m(e.ur_opened_od,s,l)?e.ur_opened_od<t&&(g.ur_opened_od="Max O.D (Opened) >= Bit Size"):g.ur_opened_od="".concat(s.toFixed(1),"~").concat(l.toFixed(1)," (").concat(i,")"),Number.isFinite(e.flow_rate)||(g.flow_rate="This field is required."),"depth_activation"!==e.activation_logic||Number.isFinite(e.ur_opened_depth)||(g.ur_opened_depth="This field is required."),e.activation_logic||(g.activation_logic="This field is required.");var f=d(1,"shortLength","in"),p=f*f*0,b=f*f*20;m(e.tfa,p,b)||(g.tfa="TFA must be ".concat(p.toFixed(2),"~").concat(20..toFixed(2)));var x={general:{},components:o.default({},e.id,g),specificErrors:{}};return n.isEmpty(g)?null:x}function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return u;switch(e.family){case"dp":return p(e,t);case"hwdp":return b(e,t);case"dc":return x(e,t);case"jar":return V(e,t);case"sub":return L(e,t);case"bit":return y(e,n);case"pdm":return w(e,t);case"lwd":return F(e,t);case"stabilizer":return j(e,t);case"mwd":return I(e,t);case"agitator":return E(e,t);case"rss":return z(e,t);case"ct":return O(e,t);case"ur":return D(e,t);default:return f(e,t)}}function C(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;for(var i=e.filter((function(e){return"bit"===e.family})),o=i&&(i.length>0?i[0].size:null),a=null===(t=n.maxBy(e,"outer_diameter"))||void 0===t?void 0:t.outer_diameter,s=e.filter((function(e){return"mwd"===e.family&&e.has_gamma_sensor})),_=!1,d={general:{},components:{},specificErrors:{}},c=0;c<e.length;c+=1){var m=e[c];if(!r||m===r){var h=r?q(m,o,a):q(m,o);h&&(_=!0,d=l(l(l({},d),n.omit(h,["general","components"])),{},{general:l(l({},d.general),h.general),components:l(l({},d.components),h.components)})),"mwd"===m.family&&s.length>1&&(d.components[m.id].gamma_sensor_to_bit_distance="Only 1 gamma sensor allowed. Currently ".concat(s.length),_=!0)}}return i&&1===i.length?"bit"!==e[e.length-1].family&&"bit"!==e[0].family&&(d.general.bit_position='"BIT" category should be on the bottom of the list.',_=!0):(d.general.bit_count='Number of "BIT" components is invalid.',_=!0),_?d:null}exports.ctoi=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return null==e?null:t&&n?parseFloat(r.convertValue(e,t,r.getUnitPreference(t),n,i)):parseFloat(e)},exports.ctop=d,exports.isValidLinearWeight=h,exports.isValidNumber=m,exports.isValueEmpty=c,exports.validate=function(e){if(!e)return u;var t=e.data,n=t.id,r=t.start_timestamp_str,i=t.start_depth,o=t.components;if(!o)return u;var a=g({id:n,start_timestamp_str:r,start_depth:i}),s=C(o);return s&&(a=l(l({},a),s)),a},exports.validateCommon=v,exports.validateComponent=q,exports.validateComponentAgitator=E,exports.validateComponentBit=y,exports.validateComponentCt=O,exports.validateComponentDc=x,exports.validateComponentDefaullt=f,exports.validateComponentDp=p,exports.validateComponentHwdp=b,exports.validateComponentJar=V,exports.validateComponentLwd=F,exports.validateComponentMwd=I,exports.validateComponentPdm=w,exports.validateComponentRss=z,exports.validateComponentStabilizer=j,exports.validateComponentSub=L,exports.validateComponentUr=D,exports.validateComponents=C,exports.validateHeader=g;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("moment"),n=require("lodash"),r=require("../convert.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),a=i(t);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o.default(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u={general:{empty:"It should not be empty."}},_={general:{family:"Family should be matched."}};function c(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return 0===e||e?t&&n?r.convertValue(e,t,n,null,i):e:null}function d(e){return null==e||""===e}function m(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.isMinInclusive,o=void 0===i||i,a=parseFloat(e);return!Number.isNaN(a)&&(!(o&&a<t||!o&&a<=t)&&!(n&&a>n))}function h(e,t,n){var i=r.getUnitPreference("shortLength"),o=e,a=t;"in"!==i&&(o=r.convertValue(e,"shortLength",i,"in"),a=r.convertValue(t,"shortLength",i,"in"));var s=2.673*(a*a-o*o),l="in"!==i?r.convertValue(s,"massPerLength","lb-ft"):s;return n>=.5*l&&n<=1.5*l}function v(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!t)return u;var i=t.min_id,o=t.min_od,a=t.max_id,s=t.max_od,l=t.min_length,_=t.min_tj_id,c=t.max_tj_id,h=t.min_tj_od,v=t.max_tj_od,g=t.min_pressure_loss,f=t.min_off_bottom_pressure_loss,p=r.getUnitDisplay("shortLength"),b={},x=!1;if(d(i)||d(o)||(m(e.inner_diameter,i,a)||(b.inner_diameter="".concat(i.toFixed(1),"~").concat(a.toFixed(1)," (").concat(p,")"),x=!0),m(e.outer_diameter,o,s)||(b.outer_diameter="".concat(o.toFixed(1),"~").concat(s.toFixed(1)," (").concat(p,")"),x=!0),m(e.inner_diameter,i,a)&&m(e.outer_diameter,o,s)&&!m(e.inner_diameter,i,e.outer_diameter)&&(b.outer_diameter="O.D > I.D",x=!0),!b.outer_diameter&&n&&+e.outer_diameter+r.convertValue(.1,"shortLength","in")>n&&(b.outer_diameter=" O.D + 0.1 < Bit Size",x=!0),m(e.linear_weight,0)||(b.linear_weight="Invalid value",x=!0)),d(_)||d(h)||(m(e.inner_diameter_tooljoint,_,c)||(b.inner_diameter_tooljoint="".concat(_.toFixed(1),"~").concat(c.toFixed(1)," (").concat(p,")"),x=!0),m(e.outer_diameter_tooljoint,h,v)||(b.outer_diameter_tooljoint="".concat(h.toFixed(1),"~").concat(v.toFixed(1)," (").concat(p,")"),x=!0),m(e.outer_diameter_tooljoint,e.outer_diameter,v)||(b.outer_diameter_tooljoint="Tool Joint O.D >= O.D",x=!0)),d(l)||m(e.length,l)||(b.length="Invalid value",x=!0),d(e.length_tooljoint)||d(e.component_length)||+e.length_tooljoint>+e.component_length&&(b.length_tooljoint="Tool Joint Length < Component Length",x=!0),e.off_bottom_pressure_loss&&e.off_bottom_pressure_loss.length>0){b.off_bottom_pressure_loss={};for(var V=0;V<e.off_bottom_pressure_loss.length;V+=1){var L=e.off_bottom_pressure_loss[V];b.off_bottom_pressure_loss[V]={},d(L.flow_rate)&&(b.off_bottom_pressure_loss[V].flow_rate="flow rate is required.",x=!0),d(L.pressure_loss)&&(b.off_bottom_pressure_loss[V].pressure_loss="pressure loss is required.",x=!0),d(f)||m(L.pressure_loss,f,null,{isMinInclusive:!1})||(b.off_bottom_pressure_loss[V].pressure_loss="Invalid range",x=!0)}}if(e.pressure_loss&&e.pressure_loss.length>0){b.pressure_loss={};for(var y=0;y<e.pressure_loss.length;y+=1){var w=e.pressure_loss[y];b.pressure_loss[y]={},d(w.flow_rate)&&(b.pressure_loss[y].flow_rate="flow rate is required.",x=!0),d(w.pressure_loss)&&(b.pressure_loss[y].pressure_loss="pressure loss is required.",x=!0),d(g)||m(w.pressure_loss,g,null,{isMinInclusive:!1})||(b.pressure_loss[y].pressure_loss="Invalid range",x=!0)}}if(e.has_stabilizer&&e.stabilizer){var F=r.convertValue(0,"shortLength","in"),j=r.convertValue(100,"shortLength","in"),I=r.convertValue(1,"shortLength","in"),E=r.convertValue(100,"shortLength","in"),z=r.convertValue(0,"length","ft");m(e.stabilizer.inner_diameter,F,j)&&m(e.stabilizer.outer_diameter,I,E)&&!m(e.stabilizer.inner_diameter,i,e.stabilizer.outer_diameter)&&(b.stabilizer_outer_diameter="O.D > I.D",x=!0),m(e.stabilizer.inner_diameter,F,j)||(b.stabilizer_inner_diameter="".concat(F.toFixed(1),"~").concat(j.toFixed(1)," (").concat(p,")"),x=!0),m(e.stabilizer.outer_diameter,I,E)||(b.stabilizer_outer_diameter="".concat(I.toFixed(1),"~").concat(E.toFixed(1)," (").concat(p,")"),x=!0),d(z)||m(e.stabilizer.length,z)||(b.stabilizer_length="Invalid value",x=!0),d(e.stabilizer.linear_weight)&&(b.stabilizer_linear_weight="Invalid value",x=!0),!b.stabilizer_outer_diameter&&n&&+e.stabilizer.outer_diameter+r.convertValue(.1,"shortLength","in")>n&&(b.stabilizer_outer_diameter=" O.D + 0.1 < Bit Size",x=!0)}return x?b:null}function g(e){if(!e)return u;var t=r.getUnitDisplay("length"),i={};if(d(e.id)&&(i.id="It should not be empty."),e.start_timestamp_str&&!a.default(new Date(e.start_timestamp_str)).isValid()&&(i.start_timestamp="Invalid Date."),Number.isFinite(e.start_depth)){var o=r.convertValue(0,"length","ft"),s=r.convertValue(55e3,"length","ft"),l=r.convertValue(1,"length","ft");(e.start_depth<=o||e.start_depth>s)&&(i.start_depth="Should be a positive number ".concat(o.toFixed(2),"~").concat(s.toFixed(2)," (").concat(t,")")),e.start_depth===l&&(i.start_depth="Should not be equal to ".concat(l," (").concat(t,")"))}else i.start_depth="It should not be empty.";return n.isEmpty(i)?null:i}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;var i={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(100,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(100,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{},l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("dp"!==e.family)return _;var i={min_id:r.convertValue(1,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(8,"shortLength","in"),min_tj_id:r.convertValue(1,"shortLength","in"),max_tj_id:r.convertValue(7,"shortLength","in"),min_tj_od:r.convertValue(2,"shortLength","in"),max_tj_od:r.convertValue(10,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{};s.inner_diameter||s.outer_diameter||s.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(s.linear_weight="Invalid range");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("hwdp"!==e.family)return _;var i={min_id:r.convertValue(1,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(8,"shortLength","in"),min_tj_id:r.convertValue(1,"shortLength","in"),max_tj_id:r.convertValue(7,"shortLength","in"),min_tj_od:r.convertValue(2,"shortLength","in"),max_tj_od:r.convertValue(10,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{};s.inner_diameter||s.outer_diameter||s.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(s.linear_weight="Invalid range");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("dc"!==e.family)return _;var i={min_id:r.convertValue(.5,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{};s.inner_diameter||s.outer_diameter||s.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(s.linear_weight="Invalid range");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function V(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e?"jar"!==e.family?_:f(e,t):u}function L(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e?"sub"!==e.family?_:f(e,t):u}function y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("bit"!==e.family)return _;var i=e.size,a=v(e,{},i),s=a||{},l=c(1,"shortLength","in"),h=l*l*0,g=l*l*20;d(t)||d(i)||+t+r.convertValue(.1,"shortLength","in")>i&&(s.size=" max(O.D) + 0.1 < Bit Size"),m(e.tfa,h,g)||(s.tfa="TFA must be ".concat(h.toFixed(2),"~").concat(20..toFixed(2)));var f={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:f}function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("pdm"!==e.family)return _;var i,a,s={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(15,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(4,"length","ft"),min_off_bottom_pressure_loss:0},l=v(e,s,t),c=l||{};m(e.number_rotor_lobes,1,10)||(c.number_rotor_lobes="It must be ".concat(1,"~").concat(10)),m(e.number_stator_lobes,2,10)||(c.number_stator_lobes="It must be ".concat(2,"~").concat(10)),m(e.rpg,0,10)||(c.rpg="It must be ".concat(0,"~").concat(10)),i=r.convertValue(0,"force","klbf"),a=r.convertValue(200,"force","klbf"),d(e.max_weight_on_bit)||m(e.max_weight_on_bit,i,a)||(c.max_weight_on_bit="It must be ".concat(a.toFixed(2),"~").concat(a.toFixed(2))),i=r.convertValue(0,"volumeFlowRate","gal/min"),a=r.convertValue(2500,"volumeFlowRate","gal/min"),m(e.min_standard_flowrate,i,a)||(c.min_standard_flowrate="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),m(e.max_standard_flowrate,i,a)||(c.max_standard_flowrate="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),i=r.convertValue(0,"pressure","psi"),a=r.convertValue(3e3,"pressure","psi"),m(e.max_operating_differential_pressure,i,a)||(c.max_operating_differential_pressure="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),i=r.convertValue(0,"torque","ft-klbf"),a=r.convertValue(40,"torque","ft-klbf"),m(e.torque_at_max_operating_differential_pressure,i,a)||(c.torque_at_max_operating_differential_pressure="It must be ".concat(i.toFixed(2),"~").concat(a.toFixed(2))),m(e.flow_loss_percentage,0,20)||(c.flow_loss_percentage="It must be ".concat(0,"~").concat(20));var h={general:{},components:o.default({},e.id,c),specificErrors:{}};return n.isEmpty(c)?null:h}function F(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("lwd"!==e.family)return _;var n={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(9.5,"shortLength","in"),min_id:r.convertValue(.1,"shortLength","in"),max_id:r.convertValue(7,"shortLength","in"),min_length:r.convertValue(1,"length","ft")},i=v(e,n,t),a=i||{},s=!1;if(i&&(s=!0),e.lwd_measurements&&e.lwd_measurements.length>0){a.lwd_measurements={};for(var l=0;l<e.lwd_measurements.length;l+=1){var c=e.lwd_measurements[l];a.lwd_measurements[l]={},d(c.type)&&(a.lwd_measurements[l].type="measurement type is required.",s=!0),d(c.distance)&&(a.lwd_measurements[l].distance="measurement distance is required.",s=!0)}}var m={general:{},components:o.default({},e.id,a),specificErrors:{}};return e.lwd_measurements&&e.lwd_measurements.length||(m.general.lwd_measurements="LWD Tool requires at least one LWD measurement should be selected.",s=!0),s?m:null}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("stabilizer"!==e.family)return _;var i={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(100,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(100,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},a=v(e,i,t),s=a||{},l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("mwd"!==e.family)return _;var i={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(1,"length","ft"),min_pressure_loss:0},a=v(e,i,t),s=a||{};e.has_gamma_sensor&&!Number.isFinite(e.gamma_sensor_to_bit_distance)&&(s.gamma_sensor_to_bit_distance="This field is required."),e.has_survey_sensor&&!Number.isFinite(e.bit_to_survey_distance)?s.bit_to_survey_distance="This field is required.":e.has_survey_sensor&&e.bit_to_survey_distance<=0?s.bit_to_survey_distance="Should be a positive number.":e.has_survey_sensor&&e.bit_to_survey_distance>150&&(s.bit_to_survey_distance="Should be less then 150."),e.has_directional_sensor&&!Number.isFinite(e.directional_sensor_to_bit_distance)?s.directional_sensor_to_bit_distance="This field is required.":e.has_directional_sensor&&e.directional_sensor_to_bit_distance<=0?s.directional_sensor_to_bit_distance="Should be a positive number.":e.has_directional_sensor&&e.directional_sensor_to_bit_distance>150&&(s.directional_sensor_to_bit_distance="Should be less then 150.");var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function E(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("agitator"!==e.family)return _;var i={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(1,"length","ft"),min_pressure_loss:0},a=v(e,i,t),s=a||{},l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("rss"!==e.family)return _;var i={min_od:r.convertValue(2,"shortLength","in"),max_od:r.convertValue(13,"shortLength","in"),min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(12,"shortLength","in"),min_length:r.convertValue(1,"length","ft"),min_pressure_loss:0},a=v(e,i,t),s=a||{};m(e.flow_loss_percentage,0,10)||(s.flow_loss_percentage="It must be ".concat(0,"~").concat(10));var l={general:{},components:o.default({},e.id,s),specificErrors:{}};return n.isEmpty(s)?null:l}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("ct"!==e.family)return _;var i=r.getUnitDisplay("shortLength"),a={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(100,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(100,"shortLength","in"),min_length:r.convertValue(0,"length","ft")},s=r.convertValue(0,"shortLength","in"),l=r.convertValue(500,"shortLength","in"),c=v(e,a,t),d=c||{};d.inner_diameter||d.outer_diameter||d.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(d.linear_weight="Invalid range"),m(e.reel_diameter,s,l)||(d.reel_diameter="".concat(s.toFixed(1),"~").concat(l.toFixed(1)," (").concat(i,")"));var g={general:{},components:o.default({},e.id,d),specificErrors:{}};return n.isEmpty(d)?null:g}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;if("ur"!==e.family)return _;var i=r.getUnitDisplay("shortLength"),a={min_id:r.convertValue(0,"shortLength","in"),max_id:r.convertValue(50,"shortLength","in"),min_od:r.convertValue(1,"shortLength","in"),max_od:r.convertValue(50,"shortLength","in")},s=r.convertValue(1,"shortLength","in"),l=r.convertValue(50,"shortLength","in"),d=v(e,a,t),g=d||{};g.inner_diameter||g.outer_diameter||g.linear_weight||h(e.inner_diameter,e.outer_diameter,e.linear_weight)||(g.linear_weight="Invalid range"),m(e.ur_opened_od,s,l)?e.ur_opened_od<t&&(g.ur_opened_od="Max O.D (Opened) >= Bit Size"):g.ur_opened_od="".concat(s.toFixed(1),"~").concat(l.toFixed(1)," (").concat(i,")"),Number.isFinite(e.flow_rate)||(g.flow_rate="This field is required."),"depth_activation"!==e.activation_logic||Number.isFinite(e.ur_opened_depth)||(g.ur_opened_depth="This field is required."),e.activation_logic||(g.activation_logic="This field is required.");var f=c(1,"shortLength","in"),p=f*f*0,b=f*f*20;m(e.tfa,p,b)||(g.tfa="TFA must be ".concat(p.toFixed(2),"~").concat(20..toFixed(2)));var x={general:{},components:o.default({},e.id,g),specificErrors:{}};return n.isEmpty(g)?null:x}function q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e)return u;switch(e.family){case"dp":return p(e,t);case"hwdp":return b(e,t);case"dc":return x(e,t);case"jar":return V(e,t);case"sub":return L(e,t);case"bit":return y(e,n);case"pdm":return w(e,t);case"lwd":return F(e,t);case"stabilizer":case"ags":return j(e,t);case"mwd":return I(e,t);case"agitator":return E(e,t);case"rss":return z(e,t);case"ct":return O(e,t);case"ur":return D(e,t);default:return f(e,t)}}function C(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return u;for(var i=e.filter((function(e){return"bit"===e.family})),o=i&&(i.length>0?i[0].size:null),a=null===(t=n.maxBy(e,"outer_diameter"))||void 0===t?void 0:t.outer_diameter,s=e.filter((function(e){return"mwd"===e.family&&e.has_gamma_sensor})),_=!1,c={general:{},components:{},specificErrors:{}},d=0;d<e.length;d+=1){var m=e[d];if(!r||m===r){var h=r?q(m,o,a):q(m,o);h&&(_=!0,c=l(l(l({},c),n.omit(h,["general","components"])),{},{general:l(l({},c.general),h.general),components:l(l({},c.components),h.components)})),"mwd"===m.family&&s.length>1&&(c.components[m.id].gamma_sensor_to_bit_distance="Only 1 gamma sensor allowed. Currently ".concat(s.length),_=!0)}}return i&&1===i.length?"bit"!==e[e.length-1].family&&"bit"!==e[0].family&&(c.general.bit_position='"BIT" category should be on the bottom of the list.',_=!0):(c.general.bit_count='Number of "BIT" components is invalid.',_=!0),_?c:null}exports.ctoi=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2;return null==e?null:t&&n?parseFloat(r.convertValue(e,t,r.getUnitPreference(t),n,i)):parseFloat(e)},exports.ctop=c,exports.isValidLinearWeight=h,exports.isValidNumber=m,exports.isValueEmpty=d,exports.validate=function(e){if(!e)return u;var t=e.data,n=t.id,r=t.start_timestamp_str,i=t.start_depth,o=t.components;if(!o)return u;var a=g({id:n,start_timestamp_str:r,start_depth:i}),s=C(o);return s&&(a=l(l({},a),s)),a},exports.validateCommon=v,exports.validateComponent=q,exports.validateComponentAgitator=E,exports.validateComponentBit=y,exports.validateComponentCt=O,exports.validateComponentDc=x,exports.validateComponentDefaullt=f,exports.validateComponentDp=p,exports.validateComponentHwdp=b,exports.validateComponentJar=V,exports.validateComponentLwd=F,exports.validateComponentMwd=I,exports.validateComponentPdm=w,exports.validateComponentRss=z,exports.validateComponentStabilizer=j,exports.validateComponentSub=L,exports.validateComponentUr=D,exports.validateComponents=C,exports.validateHeader=g;
|
|
2
2
|
//# sourceMappingURL=validation.js.map
|