синие символ нагнетательных скважин

This commit is contained in:
djerom 2022-04-13 10:45:26 +05:00
parent 9e13e9ec1a
commit 0d72ce921e
4 changed files with 38 additions and 21 deletions

View File

@ -33,7 +33,7 @@ let styles = JSON.parse(fs.readFileSync("./moc/styles.json").toString());
const all_settings = {
pt: {
tons_in_cm2: 10000,
tons_in_cm2: 20000,
ppu: 100, // 100
styles,
// Масштаб 1мм карты / 1мм реальный (1000мм в 1м)
@ -49,7 +49,7 @@ const all_settings = {
},
pr: {
tons_in_cm2: 5,
tons_in_cm2: 50,
ppu: 100,
styles,
// Масштаб 1мм карты / 1мм реальный (1000мм в 1м)
@ -305,8 +305,8 @@ async function build_map_pr(devobj) {
console.log("build_map_pr", devobj);
const md = await query(sql_pi.max_date(devobj)).then((x) => x[0].date);
let wells = await query(sql_pi.totals(devobj, md))
wells = wells.filter((x) => x.wopt > 0);
let wells = await query(sql_pi.rates(devobj, md))
wells = wells.filter((x) => x.wopr > 0);
if (!wells.length) return
let bbox = build_bbox(wells.map(w => ({ x: w.whx, y: w.why })));
@ -314,10 +314,10 @@ async function build_map_pr(devobj) {
let mapped_wells = wells.map((x) => ({
...x,
wopt: x.wopt / x.days,
wwpt: x.wwpt / x.days,
wlpt: (x.wopt + x.wwpt) / x.days,
wlf: x.wwpt / (x.wopt + x.wwpt),
wopt: x.wopr, //x.wopt / x.days,
wwpt: x.wwpr, // x.wwpt / x.days,
wlpt: x.wopr+x.wwpr, // (x.wopt + x.wwpt) / x.days,
// wlf: x.wwpt / (x.wopt + x.wwpt),
lx: saver.tr.trx(x.whx),
ly: saver.tr.try(x.why),
}));
@ -333,8 +333,8 @@ async function build_map_ir(devobj) {
// const DATE = '2023-01-01'
const md = await query(sql_pi.max_date(devobj)).then((x) => x[0].date);
let wells = await query(sql_pi.totals(devobj, md))
wells = wells.filter((x) => x.wwit > 0);
let wells = await query(sql_pi.rates(devobj, md))
wells = wells.filter((x) => x.wwir > 0);
if (!wells.length) return
let bbox = build_bbox(wells.map(w => ({ x: w.whx, y: w.why })));
@ -342,7 +342,7 @@ async function build_map_ir(devobj) {
let mapped_wells = wells.map((x) => ({
...x,
wwit: x.wwit / x.days,
wwit: x.wwir, //x.wwit / x.days,
lx: saver.tr.trx(x.whx),
ly: saver.tr.try(x.why),
}));

View File

@ -1,4 +1,9 @@
{
"_units": {
"1pt":"1pt",
"1mm":"1mm"
},
"black-line": {
"stroke-width": "1pt",
"stroke": "#000",

View File

@ -16,7 +16,7 @@ export default {
return parseFloat(v.substring(0, v.length - 2) * ppu * 100) / 69;
}
if (v.endsWith("pt")) {
return (parseFloat(v.slice(0, v.length - 2)) * ppu * 100) / 283.46;
return parseFloat(v.slice(0, v.length - 2)) * ppu * 100 / 283.46;
}
},
@ -27,7 +27,7 @@ export default {
*/
update_style(style, ppu) {
let s = Object.assign({}, style);
const convertable = ["font-size", "stroke-width"];
const convertable = ["font-size", "stroke-width", "1pt", "1mm"];
Object.keys(s).forEach((k) => {
if (convertable.includes(k)) s[k] = this.fontsize2ppu(s[k], ppu);
});

View File

@ -32,17 +32,29 @@ export default {
* @returns
*/
inj(ppu, styles) {
const style_spike = {
"stroke-width": "0",
fill: '#00f'
}
const style_blue = {
"stroke-width": Math.round(styles._units["1pt"]),
stroke: '#00f',
}
return SvgNodes.group([
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 0).move(2 * ppu, 0),
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 90).move(0, -2 * ppu),
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 180).move(-2 * ppu, 0),
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 270).move(0, 2 * ppu),
new SvgNode("line", { x1: -2 * ppu, x2: 2 * ppu, y1: 0, y2: 0 }).add_style(styles["black-line"]),
new SvgNode("line", { y1: -2 * ppu, y2: 2 * ppu, x1: 0, x2: 0 }).add_style(styles["black-line"]),
SvgNodes.group([
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 0).move(2 * ppu, 0),
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 90).move(0, -2 * ppu),
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 180).move(-2 * ppu, 0),
SvgNodes.spike1(1.8 * ppu, 1.7 * ppu, 270).move(0, 2 * ppu),
]).add_style(style_spike),
new SvgNode("line", { x1: -2 * ppu, x2: 2 * ppu, y1: 0, y2: 0 }),
new SvgNode("line", { y1: -2 * ppu, y2: 2 * ppu, x1: 0, x2: 0 }),
SvgNodes.circle(1.5 * ppu)
.add_style(styles["black-line"])
.add_style(style_blue)
.add_style(styles["white-body"]),
]);
]).add_style(style_blue);
},
/**