mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Vinculado backend con frontend excepto rotativas
This commit is contained in:
@ -189,6 +189,7 @@ return [
|
||||
'previewGramaje' => 'Gramaje',
|
||||
'previewMano' => 'Mano',
|
||||
'previewLibro' => 'Libro',
|
||||
'previewForma' => 'Forma',
|
||||
'previewFormas' => 'Formas',
|
||||
'previewLomo' => 'Lomo',
|
||||
'previewSolapas' => 'Solapas',
|
||||
|
||||
@ -118,7 +118,6 @@
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_bn_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
@ -169,8 +168,11 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_bn_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_bn_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_bn_formas" class="col-6 text-left">TBD</dd>
|
||||
<dd id="pv_bn_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -178,7 +180,7 @@
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewPapelGenerico") ?></h6>
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_bn_shape" class="draw-shapes"></div>
|
||||
@ -194,7 +196,6 @@
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_bnhq_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
@ -245,8 +246,11 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_bnhq_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_bnhq_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_bnhq_formas" class="col-6 text-left">TBD</dd>
|
||||
<dd id="pv_bnhq_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -254,7 +258,7 @@
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewPapelGenerico") ?></h6>
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_bnhq_shape" class="draw-shapes"></div>
|
||||
@ -270,7 +274,6 @@
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_color_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
@ -321,8 +324,11 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_color_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_color_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_color_formas" class="col-6 text-left">TBD</dd>
|
||||
<dd id="pv_color_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -330,7 +336,7 @@
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewPapelGenerico") ?></h6>
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_color_shape" class="draw-shapes"></div>
|
||||
@ -346,8 +352,7 @@
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_colorhq_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
<div class="d-grid">
|
||||
@ -397,8 +402,11 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_colorhq_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_colorhq_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_colorhq_formas" class="col-6 text-left">TBD</dd>
|
||||
<dd id="pv_colorhq_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -406,7 +414,7 @@
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewPapelGenerico") ?></h6>
|
||||
<h6><?= lang("Presupuestos.previewMaquinaPlana") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_colorhq_shape" class="draw-shapes"></div>
|
||||
@ -422,7 +430,6 @@
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaRotativa") ?></h6>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_bn_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
@ -473,8 +480,11 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_rot_bn_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_rot_bn_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_rot_bn_formas" class="col-6 text-left">TBD</dd>
|
||||
<dd id="pv_rot_bn_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -482,7 +492,7 @@
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewPapelGenerico") ?></h6>
|
||||
<h6><?= lang("Presupuestos.previewMaquinaRotativa") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_rot_bn_shape" class="draw-rot-shapes"></div>
|
||||
@ -498,7 +508,6 @@
|
||||
<div class="col-3">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewMaquinaRotativa") ?></h6>
|
||||
<div class="row g-3 mb-3">
|
||||
<div class="col-12">
|
||||
<a id="pv_rot_color_pg" href="#" sk-url="<?= site_url('configuracion/papelesgenericos/edit/'); ?>" target="_blank">
|
||||
@ -550,8 +559,11 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_rot_color_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_rot_color_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_rot_color_formas" class="col-6 text-left">TBD</dd>
|
||||
<dd id="pv_rot_color_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -559,7 +571,7 @@
|
||||
<div class="col-9">
|
||||
<div class="p-4 mb-3 pb-3">
|
||||
<!-- Configuraciones -->
|
||||
<h6><?= lang("Presupuestos.previewPapelGenerico") ?></h6>
|
||||
<h6><?= lang("Presupuestos.previewMaquinaRotativa") ?></h6>
|
||||
|
||||
<div id="shape-container">
|
||||
<div id="pv_rot_color_shape" class="draw-rot-shapes"></div>
|
||||
@ -616,6 +628,9 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMano") ?></dt>
|
||||
<dd id="pv_cubierta_mano" class="col-sm-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold pv-solapas"><?= lang("Presupuestos.previewSolapas") ?></dt>
|
||||
<dd id="pv_cubierta_solapas" class="col-sm-6 text-left pv-solapas">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewMaquina") ?></dt>
|
||||
<dd id="pv_cubierta_maquina" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
@ -625,8 +640,11 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLibro") ?></dt>
|
||||
<dd id="pv_cubierta_libro" class="col-6 text-left">TBDxTBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewForma") ?></dt>
|
||||
<dd id="pv_cubierta_forma" class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewFormas") ?></dt>
|
||||
<dd id="pv_cubierta_formas" class="col-6 text-left">TBD</dd>
|
||||
<dd id="pv_cubierta_nFormas" class="col-6 text-left">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -691,8 +709,8 @@
|
||||
<dt class="col-6 fw-semibold"><?= lang("Presupuestos.previewLomo") ?></dt>
|
||||
<dd id='pv_ec_lomo' class="col-6 text-left">TBD</dd>
|
||||
|
||||
<dt class="col-6 fw-semibold pv-ec-solapas"><?= lang("Presupuestos.previewSolapas") ?></dt>
|
||||
<dd id='pv_ec_solapas' class="col-6 text-left pv-ec-solapas">TBD</dd>
|
||||
<dt class="col-6 fw-semibold pv-solapas"><?= lang("Presupuestos.previewSolapas") ?></dt>
|
||||
<dd id='pv_ec_solapas' class="col-6 text-left pv-solapas">TBD</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
@ -729,128 +747,33 @@ getVisibleTabs();
|
||||
|
||||
$('#tab-pv-bn').on( "click", function() {
|
||||
|
||||
let scV = 4;
|
||||
let scH = 2;
|
||||
|
||||
cubiertaObjeto = {
|
||||
idIndex: 'bn',
|
||||
anchoMaquina: 487,
|
||||
altoMaquina: 330,
|
||||
anchoImpresion: 475,
|
||||
altoImpresion: 310,
|
||||
anchoLibro: 170/scH,
|
||||
altoLibro: 240/scV,
|
||||
solapas:45,
|
||||
lomo:25,
|
||||
formas: scH * scV,
|
||||
formasH: scH,
|
||||
formasV: scV
|
||||
};
|
||||
|
||||
getObjetoLP('bn');
|
||||
previewInteriorPlana(cubiertaObjeto);
|
||||
previewInteriorPlana('bn');
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-bnhq').on( "click", function() {
|
||||
|
||||
let scV = 4;
|
||||
let scH = 2;
|
||||
|
||||
cubiertaObjeto = {
|
||||
idIndex: 'bnhq',
|
||||
anchoMaquina: 487,
|
||||
altoMaquina: 330,
|
||||
anchoImpresion: 475,
|
||||
altoImpresion: 310,
|
||||
anchoLibro: 170/scH,
|
||||
altoLibro: 240/scV,
|
||||
solapas:45,
|
||||
lomo:25,
|
||||
formas: scH * scV,
|
||||
formasH: scH,
|
||||
formasV: scV
|
||||
};
|
||||
|
||||
getObjetoLP('bnhq');
|
||||
previewInteriorPlana(cubiertaObjeto);
|
||||
previewInteriorPlana('bnhq');
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-color').on( "click", function() {
|
||||
|
||||
let scV = 2;
|
||||
let scH = 2;
|
||||
|
||||
cubiertaObjeto = {
|
||||
idIndex: 'color',
|
||||
anchoMaquina: 487,
|
||||
altoMaquina: 330,
|
||||
anchoImpresion: 475,
|
||||
altoImpresion: 310,
|
||||
anchoLibro: 170/scH,
|
||||
altoLibro: 240/scV,
|
||||
solapas:45,
|
||||
lomo:25,
|
||||
formas: scH * scV,
|
||||
formasH: scH,
|
||||
formasV: scV
|
||||
};
|
||||
|
||||
getObjetoLP('color');
|
||||
previewInteriorPlana(cubiertaObjeto);
|
||||
|
||||
previewInteriorPlana('color');
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-colorhq').on( "click", function() {
|
||||
|
||||
let scV = 4;
|
||||
let scH = 2;
|
||||
|
||||
cubiertaObjeto = {
|
||||
idIndex: 'colorhq',
|
||||
anchoMaquina: 487,
|
||||
altoMaquina: 330,
|
||||
anchoImpresion: 475,
|
||||
altoImpresion: 310,
|
||||
anchoLibro: 170/scH,
|
||||
altoLibro: 240/scV,
|
||||
solapas:45,
|
||||
lomo:25,
|
||||
formas: scH * scV,
|
||||
formasH: scH,
|
||||
formasV: scV
|
||||
};
|
||||
|
||||
getObjetoLP('colorhq');
|
||||
previewInteriorPlana(cubiertaObjeto);
|
||||
previewInteriorPlana('colorhq');
|
||||
|
||||
} );
|
||||
|
||||
$('#tab-pv-rot-bn').on( "click", function() {
|
||||
|
||||
let scV = 3;
|
||||
let scH = 1;
|
||||
|
||||
cubiertaObjeto = {
|
||||
idIndex: 'rot_bn',
|
||||
anchoMaquina: 520,
|
||||
altoMaquina: 800,
|
||||
anchoImpresion: 515,
|
||||
altoImpresion: 800,
|
||||
altoClick: 305,
|
||||
anchoLibro: 170,
|
||||
altoLibro: 240,
|
||||
solapas:45,
|
||||
lomo:25,
|
||||
formas: scH * scV,
|
||||
formasH: scH,
|
||||
formasV: scV
|
||||
};
|
||||
|
||||
getObjetoLP('rot_bn');
|
||||
previewRotativa(cubiertaObjeto);
|
||||
|
||||
} );
|
||||
|
||||
@ -862,24 +785,7 @@ $('#tab-pv-rot-color').on( "click", function() {
|
||||
|
||||
$('#tab-pv-cubierta').on( "click", function() {
|
||||
|
||||
getObjetoLP('cubierta');
|
||||
|
||||
cubiertaObjeto = {
|
||||
idIndex: 'bn',
|
||||
anchoMaquina: 487,
|
||||
altoMaquina: 330,
|
||||
anchoImpresion: 475,
|
||||
altoImpresion: 310,
|
||||
anchoLibro: 170,
|
||||
altoLibro: 240,
|
||||
solapas:45,
|
||||
lomo:25,
|
||||
formas: 1,
|
||||
formasH: 1,
|
||||
formasV: 1
|
||||
};
|
||||
|
||||
previewConfiguracionCubierta(cubiertaObjeto);
|
||||
previewInteriorPlana('cubierta');
|
||||
|
||||
} );
|
||||
|
||||
|
||||
@ -1,9 +1,12 @@
|
||||
// Global parameters
|
||||
var _isCosido = true;
|
||||
var _offsetSolapas = 2; // millimeters
|
||||
|
||||
|
||||
var objEC;
|
||||
|
||||
var pvObj;
|
||||
|
||||
|
||||
var styles = {
|
||||
size: 13,
|
||||
@ -15,34 +18,33 @@ var sangradoValor = parseFloat(5); // mm
|
||||
var offsetSolapaValor = parseFloat(3); // mm
|
||||
|
||||
|
||||
function previewInteriorPlana(cubiertaObj) {
|
||||
function previewInteriorPlana(lpTagName) {
|
||||
|
||||
// Local parameters
|
||||
let margenTop = 3;
|
||||
let guardaV = 0;
|
||||
guardaH = 0;
|
||||
let styleText = {size: 12, family: 'Public Sans'};
|
||||
|
||||
// Get the preview Object parameters
|
||||
getObjetoLP(lpTagName);
|
||||
|
||||
// Calculos
|
||||
// Configuracion de las guardas
|
||||
// Guarda vertical
|
||||
if (cubiertaObj.formasV > 1) {
|
||||
//guardaV = (cubiertaObj.altoImpresion - (2 * margenTop) - (cubiertaObj.altoLibro * cubiertaObj.formasV)) / (cubiertaObj.formasV - 1);
|
||||
if (pvObj.nFormasV > 1) {
|
||||
guardaV = 3;
|
||||
}
|
||||
// Guarda horizontal
|
||||
if (cubiertaObj.formasH > 1) {
|
||||
if (pvObj.nFormasH > 1) {
|
||||
guardaH = 3;
|
||||
}
|
||||
// Constantes relativas al libro
|
||||
let LVo = cubiertaObj.altoLibro / 2;
|
||||
let LHo = cubiertaObj.anchoLibro / 2;
|
||||
// Constantes relativas a las dimnesiones de la forma
|
||||
let LVo = pvObj.altoForma / 2;
|
||||
let LHo = pvObj.anchoForma / 2;
|
||||
|
||||
// Clear the canvas element
|
||||
|
||||
|
||||
$('#pv_' + cubiertaObj.idIndex + '_shape').empty();
|
||||
$('#pv_' + pvObj.idIndex + '_shape').empty();
|
||||
// Get the element for placing the graphical elements
|
||||
var divPlana = document.getElementById('pv_' + cubiertaObj.idIndex + '_shape');
|
||||
var divPlana = document.getElementById('pv_' + pvObj.idIndex + '_shape');
|
||||
var _pvPlana = new Two({fitted: true}).appendTo(divPlana);
|
||||
// Calculate the center of the canvas element
|
||||
var origenPlana = new Two.Vector(_pvPlana.width / 2, _pvPlana.height / 2);
|
||||
@ -50,8 +52,8 @@ function previewInteriorPlana(cubiertaObj) {
|
||||
var areaMaquinaPlana = _pvPlana.makeRectangle(
|
||||
origenPlana.x,
|
||||
origenPlana.y,
|
||||
cubiertaObj.anchoMaquina,
|
||||
cubiertaObj.altoMaquina);
|
||||
pvObj.anchoMaquina,
|
||||
pvObj.altoMaquina);
|
||||
areaMaquinaPlana.stroke = 'black';
|
||||
areaMaquinaPlana.fill = '#E69F6E';
|
||||
areaMaquinaPlana.linewidth = 1;
|
||||
@ -59,212 +61,39 @@ function previewInteriorPlana(cubiertaObj) {
|
||||
var areaImpresionPlana = _pvPlana.makeRectangle(
|
||||
origenPlana.x,
|
||||
origenPlana.y,
|
||||
cubiertaObj.anchoImpresion,
|
||||
cubiertaObj.altoImpresion);
|
||||
pvObj.anchoImpresion,
|
||||
pvObj.altoImpresion);
|
||||
areaImpresionPlana.stroke = 'red';
|
||||
areaImpresionPlana.fill = '#FCEAF1';
|
||||
areaImpresionPlana.linewidth = 1;
|
||||
|
||||
var formas = [];
|
||||
|
||||
for (let iV = 0; iV < cubiertaObj.formasV; iV++) {
|
||||
for (let iV = 0; iV < pvObj.nFormasV; iV++) {
|
||||
|
||||
for (let iH = 0; iH < cubiertaObj.formasH; iH++) {
|
||||
for (let iH = 0; iH < pvObj.nFormasH; iH++) {
|
||||
|
||||
let _offsetX = ((((pvObj.nFormasH - 1) - 2 * iH) * LHo) + (((pvObj.nFormasH - 1) / 2 - iH) * guardaH));
|
||||
let _offsetY = ((((pvObj.nFormasV - 1) - 2 * iV) * LVo) + (((pvObj.nFormasV - 1) / 2 - iV) * guardaV));
|
||||
|
||||
formas[iV + iH] = _pvPlana.makeRectangle(
|
||||
origenPlana.x + ((((cubiertaObj.formasH - 1) - 2 * iH) * LHo) + (((cubiertaObj.formasH - 1) / 2 - iH) * guardaH)),
|
||||
origenPlana.y + ((((cubiertaObj.formasV - 1) - 2 * iV) * LVo) + (((cubiertaObj.formasV - 1) / 2 - iV) * guardaV)),
|
||||
cubiertaObj.anchoLibro,
|
||||
cubiertaObj.altoLibro);
|
||||
origenPlana.x + _offsetX,
|
||||
origenPlana.y + _offsetY,
|
||||
pvObj.anchoForma,
|
||||
pvObj.altoForma);
|
||||
formas[iV + iH].stroke = 'grey';
|
||||
formas[iV + iH].fill = '#F4F8F2';
|
||||
formas[iV + iH].linewidth = 1;
|
||||
|
||||
// Texts
|
||||
_pvPlana.makeText(pvObj.altoForma, (origenPlana.x + _offsetX) + (pvObj.anchoForma / 2 - 25), (origenPlana.y + _offsetY), styleText);
|
||||
_pvPlana.makeText(pvObj.anchoForma, (origenPlana.x + _offsetX), (origenPlana.y + _offsetY) + (pvObj.altoForma / 2 - 15), styleText);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Texts
|
||||
//_pvPlana.makeText(cubiertaObj.altoLibro, origenPlana.x + (fullBookWith / 2 - 25), origenPlana.y, styles);
|
||||
//_pvPlana.makeText(fullBookWith, origenPlana.x, origenPlana.y + (cubiertaObj.altoLibro / 2 - 15), styles);
|
||||
|
||||
_pvPlana.update();
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
var arrowX = twoMaquina.makeArrow(origin.x -200, origin.y, origin.x+200, origin.y, 0);
|
||||
arrowX.stroke = 'green';
|
||||
arrowX.dashes = [5, 5];
|
||||
arrowX.linewidth = 1;
|
||||
|
||||
var arrowY = twoMaquina.makeArrow(origin.x, origin.y-200, origin.x, origin.y+200, 0);
|
||||
arrowY.stroke = 'pink';
|
||||
arrowY.dashes = [5, 5];
|
||||
arrowY.linewidth = 2;*/
|
||||
|
||||
}
|
||||
|
||||
function previewRotativa(cubiertaObj) {
|
||||
|
||||
// Local parameters
|
||||
let margenTop = 3;
|
||||
let guardaV = 0;
|
||||
guardaH = 0;
|
||||
|
||||
// Calculos
|
||||
// Configuracion de las guardas
|
||||
// Guarda vertical
|
||||
if (cubiertaObj.formasV > 1) {
|
||||
//guardaV = (cubiertaObj.altoImpresion - (2 * margenTop) - (cubiertaObj.altoLibro * cubiertaObj.formasV)) / (cubiertaObj.formasV - 1);
|
||||
guardaV = 3;
|
||||
}
|
||||
// Guarda horizontal
|
||||
if (cubiertaObj.formasH > 1) {
|
||||
guardaH = 3;
|
||||
}
|
||||
// Constantes relativas al libro
|
||||
let LVo = cubiertaObj.altoLibro / 2;
|
||||
let LHo = cubiertaObj.anchoLibro / 2;
|
||||
|
||||
// offset Y
|
||||
let nTopForms = (cubiertaObj.altoImpresion / 2.0 - margenTop) / (LVo + guardaV);
|
||||
let yOffset = LVo * getDecimalPart(nTopForms);
|
||||
|
||||
console.log(yOffset);
|
||||
|
||||
// Clear the canvas element
|
||||
$('#pv_' + cubiertaObj.idIndex + '_shape').empty();
|
||||
// Get the element for placing the graphical elements
|
||||
var divRotativa = document.getElementById('pv_' + cubiertaObj.idIndex + '_shape');
|
||||
var _pvRotativa = new Two({fitted: true}).appendTo(divRotativa);
|
||||
// Calculate the center of the canvas element
|
||||
var origenRotativa = new Two.Vector(_pvRotativa.width / 2, _pvRotativa.height / 2);
|
||||
|
||||
var areaMaquinaRotativa = _pvRotativa.makeRectangle(
|
||||
origenRotativa.x,
|
||||
origenRotativa.y,
|
||||
cubiertaObj.anchoMaquina,
|
||||
cubiertaObj.altoMaquina);
|
||||
areaMaquinaRotativa.stroke = 'black';
|
||||
areaMaquinaRotativa.fill = '#E69F6E';
|
||||
areaMaquinaRotativa.linewidth = 1;
|
||||
|
||||
var areaImpresionRotativa = _pvRotativa.makeRectangle(
|
||||
origenRotativa.x,
|
||||
origenRotativa.y,
|
||||
cubiertaObj.anchoImpresion,
|
||||
cubiertaObj.altoImpresion);
|
||||
areaImpresionRotativa.stroke = 'red';
|
||||
areaImpresionRotativa.fill = '#FCEAF1';
|
||||
areaImpresionRotativa.linewidth = 1;
|
||||
|
||||
var areaClickRotativa = _pvRotativa.makeRectangle(
|
||||
origenRotativa.x,
|
||||
origenRotativa.y - (cubiertaObj.altoImpresion / 2 - cubiertaObj.altoClick/2),
|
||||
cubiertaObj.anchoImpresion - 10,
|
||||
cubiertaObj.altoClick);
|
||||
areaClickRotativa.stroke = 'blue';
|
||||
//areaClickRotativa.fill = '#FCEAF1';
|
||||
areaClickRotativa.linewidth = 2;
|
||||
|
||||
var formas = [];
|
||||
|
||||
for (let iV = 0; iV < cubiertaObj.formasV; iV++) {
|
||||
|
||||
for (let iH = 0; iH < cubiertaObj.formasH; iH++) {
|
||||
|
||||
formas[iV + iH] = _pvRotativa.makeRectangle(
|
||||
origenRotativa.x + ((((cubiertaObj.formasH - 1) - 2 * iH) * LHo) + (((cubiertaObj.formasH - 1) / 2 - iH) * guardaH)),
|
||||
(origenRotativa.y - yOffset) + ((((cubiertaObj.formasV - 1) - 2 * iV) * LVo) + (((cubiertaObj.formasV - 1) / 2 - iV) * guardaV)),
|
||||
2 * cubiertaObj.anchoLibro, // Open book is 2x
|
||||
cubiertaObj.altoLibro);
|
||||
formas[iV + iH].stroke = 'grey';
|
||||
formas[iV + iH].fill = '#F4F8F2';
|
||||
formas[iV + iH].linewidth = 1;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Texts
|
||||
//_pvPlana.makeText(cubiertaObj.altoLibro, origenPlana.x + (fullBookWith / 2 - 25), origenPlana.y, styles);
|
||||
//_pvPlana.makeText(fullBookWith, origenPlana.x, origenPlana.y + (cubiertaObj.altoLibro / 2 - 15), styles);
|
||||
|
||||
_pvRotativa.update();
|
||||
|
||||
|
||||
/*
|
||||
|
||||
|
||||
var arrowX = twoMaquina.makeArrow(origin.x -200, origin.y, origin.x+200, origin.y, 0);
|
||||
arrowX.stroke = 'green';
|
||||
arrowX.dashes = [5, 5];
|
||||
arrowX.linewidth = 1;
|
||||
|
||||
var arrowY = twoMaquina.makeArrow(origin.x, origin.y-200, origin.x, origin.y+200, 0);
|
||||
arrowY.stroke = 'pink';
|
||||
arrowY.dashes = [5, 5];
|
||||
arrowY.linewidth = 2;*/
|
||||
|
||||
}
|
||||
|
||||
function getDecimalPart(floatNumber) {
|
||||
let int_part = Math.trunc(floatNumber); // returns 3
|
||||
let float_part = Number((floatNumber - int_part).toFixed(2)); // return 0.2
|
||||
return float_part;
|
||||
}
|
||||
|
||||
function previewConfiguracionCubierta(cubiertaObj) {
|
||||
|
||||
// Local parameters
|
||||
let fullBookWith = ((2 * cubiertaObj.anchoLibro) + (2 * (cubiertaObj.solapas + _offsetSolapas)) + cubiertaObj.lomo);
|
||||
|
||||
// Clear the canvas element
|
||||
$('#pv_cubierta_shape').empty();
|
||||
// Get the element for placing the graphical elements
|
||||
var divCubierta = document.getElementById('pv_cubierta_shape');
|
||||
var _previewConfiguracionCubierta = new Two({fitted: true}).appendTo(divCubierta);
|
||||
// Calculate the center of the canvas element
|
||||
var origenCubierta = new Two.Vector(_previewConfiguracionCubierta.width / 2, _previewConfiguracionCubierta.height / 2);
|
||||
|
||||
var areaMaquinaCubierta = _previewConfiguracionCubierta.makeRectangle(
|
||||
origenCubierta.x,
|
||||
origenCubierta.y,
|
||||
cubiertaObj.anchoMaquina,
|
||||
cubiertaObj.altoMaquina);
|
||||
areaMaquinaCubierta.stroke = 'black';
|
||||
areaMaquinaCubierta.linewidth = 1;
|
||||
|
||||
var areaImpresionCubierta = _previewConfiguracionCubierta.makeRectangle(
|
||||
origenCubierta.x,
|
||||
origenCubierta.y,
|
||||
cubiertaObj.anchoImpresion,
|
||||
cubiertaObj.altoImpresion);
|
||||
areaImpresionCubierta.stroke = 'red';
|
||||
areaImpresionCubierta.linewidth = 1;
|
||||
|
||||
var formaCubierta = _previewConfiguracionCubierta.makeRectangle(
|
||||
origenCubierta.x,
|
||||
origenCubierta.y,
|
||||
fullBookWith,
|
||||
cubiertaObj.altoLibro);
|
||||
formaCubierta.stroke = 'grey';
|
||||
formaCubierta.fill = '#F4F8F2';
|
||||
formaCubierta.linewidth = 1;
|
||||
|
||||
// Texts
|
||||
_previewConfiguracionCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith / 2 - 25), origenCubierta.y, styles);
|
||||
_previewConfiguracionCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro / 2 - 15), styles);
|
||||
|
||||
_previewConfiguracionCubierta.update();
|
||||
|
||||
// Update preview info fields
|
||||
$('#pv_ec_libro').text(cubiertaObj.anchoLibro + "X" + cubiertaObj.altoLibro);
|
||||
$('#pv_ec_lomo').text(cubiertaObj.lomo);
|
||||
$('#pv_ec_solapas').text(cubiertaObj.solapas);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -429,6 +258,15 @@ function previewEsquemaCubierta(objEC) {
|
||||
|
||||
}
|
||||
|
||||
function getLomoLibro() {
|
||||
let _anchoLomo = 0;
|
||||
$("#tableLineasPresupuesto tbody tr:visible td input[id*='_lomo']").each(function () {
|
||||
_anchoLomo += parseFloat($(this).val());
|
||||
});
|
||||
|
||||
return parseFloat(_anchoLomo.toFixed(2));
|
||||
}
|
||||
|
||||
function getObjetoEC() {
|
||||
let _anchoLomo = 0;
|
||||
$("#tableLineasPresupuesto tbody tr:visible td input[id*='_lomo']").each(function () {
|
||||
@ -456,30 +294,62 @@ function getObjetoEC() {
|
||||
|
||||
function getObjetoLP(lpName) {
|
||||
|
||||
objEC = {
|
||||
altoLibro: getDimensionLibro().alto,
|
||||
anchoLibro: getDimensionLibro().ancho,
|
||||
altoMaquina: $('#lp_' + lpName + '_maquina_alto').val(),
|
||||
anchoMaquina: $('#lp_' + lpName + '_maquina_ancho').val(),
|
||||
altoImpresion: $('#lp_' + lpName + '_maquina_impresion_alto').val(),
|
||||
anchoImpresion: $('#lp_' + lpName + '_maquina_impresion_ancho').val(),
|
||||
pvObj = {
|
||||
idIndex: lpName,
|
||||
gramajeLibro: parseFloat($('#lp_' + lpName + '_gramaje').val()),
|
||||
manoLP: parseFloat($('#lp_' + lpName + '_lomo').val()),
|
||||
lomoLibro: getLomoLibro(),
|
||||
anchoSolapa: parseFloat($('#solapas_ancho').val()),
|
||||
nFormas: $('#lp_' + lpName + '_formas').val(),
|
||||
//lomoLibro:parseFloat(_anchoLomo.toFixed(2))
|
||||
nFormas: parseInt($('#lp_' + lpName + '_formas').val()),
|
||||
nFormasH: parseInt($('#lp_' + lpName + '_formas_h').val()),
|
||||
nFormasV: parseInt($('#lp_' + lpName + '_formas_v').val()),
|
||||
orientacionFormas: $('#lp_' + lpName + '_formas_orientacion').val(),
|
||||
altoMaquina: parseFloat($('#lp_' + lpName + '_maquina_alto').val()),
|
||||
anchoMaquina: parseFloat($('#lp_' + lpName + '_maquina_ancho').val()),
|
||||
altoImpresion: parseFloat($('#lp_' + lpName + '_maquina_impresion_alto').val()),
|
||||
anchoImpresion: parseFloat($('#lp_' + lpName + '_maquina_impresion_ancho').val()),
|
||||
altoLibro: getDimensionLibro().alto,
|
||||
anchoLibro: getDimensionLibro().ancho
|
||||
};
|
||||
|
||||
// Printing shape definition
|
||||
pvObj.anchoForma = (_isCosido) ? 2 * pvObj.anchoLibro : pvObj.anchoLibro;
|
||||
pvObj.altoForma = pvObj.altoLibro;
|
||||
|
||||
// Conditional assignements depending on rotation of the printing shape
|
||||
if (pvObj.orientacionFormas == 'v') {
|
||||
let auxReg = pvObj.altoForma;
|
||||
pvObj.altoForma = pvObj.anchoForma;
|
||||
pvObj.anchoForma = auxReg;
|
||||
}
|
||||
|
||||
// Update preview info fields
|
||||
let pvName = '#pv_' + lpName;
|
||||
$(pvName + '_pg').attr("href", $(pvName + '_pg').attr('sk-url') + $('#lp_' + lpName + '_papel').val());
|
||||
$(pvName + '_pi').attr("href", $(pvName + '_pi').attr('sk-url') + $('#lp_' + lpName + '_papelImpresion').val());
|
||||
$(pvName + '_mi').attr("href", $(pvName + '_mi').attr('sk-url') + $('#lp_' + lpName + '_maquina').val());
|
||||
|
||||
$(pvName + '_gramaje').text(parseFloat($('#lp_' + lpName + '_gramaje').val()));
|
||||
$(pvName + '_mano').text(parseFloat($('#lp_' + lpName + '_lomo').val()));
|
||||
$(pvName + '_maquina').text(objEC.anchoMaquina + "x" + objEC.altoMaquina);
|
||||
$(pvName + '_maquina_impresion').text(objEC.anchoImpresion + "x" + objEC.altoImpresion);
|
||||
$(pvName + '_libro').text(objEC.anchoLibro + "x" + objEC.altoLibro);
|
||||
$(pvName + '_formas').text(objEC.nFormas);
|
||||
$(pvName + '_gramaje').text(pvObj.gramajeLibro);
|
||||
$(pvName + '_mano').text(pvObj.manoLP);
|
||||
$(pvName + '_solapas').text(pvObj.anchoSolapa);
|
||||
$(pvName + '_maquina').text(pvObj.anchoMaquina + "x" + pvObj.altoMaquina);
|
||||
$(pvName + '_maquina_impresion').text(pvObj.anchoImpresion + "x" + pvObj.altoImpresion);
|
||||
$(pvName + '_libro').text(pvObj.anchoLibro + "x" + pvObj.altoLibro);
|
||||
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
|
||||
$(pvName + '_nFormas').text(pvObj.nFormas);
|
||||
|
||||
(pvObj.anchoSolapa != 0) ? $('.pv-solapas').show() : $('.pv-solapas').hide();
|
||||
|
||||
// Custom overwrites
|
||||
switch (pvObj.idIndex){
|
||||
case 'cubierta':
|
||||
pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * (pvObj.anchoSolapa + _offsetSolapas)) + pvObj.lomoLibro);
|
||||
$(pvName + '_forma').text(pvObj.anchoForma + "x" + pvObj.altoForma);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -488,15 +358,16 @@ function getVisibleTabs() {
|
||||
|
||||
$("#tableLineasPresupuesto tbody tr:visible").each(function () {
|
||||
|
||||
//console.log($(this).attr('id'));
|
||||
console.log($(this).attr('id'));
|
||||
if ($(this).attr('id').indexOf('cubierta') > -1) {
|
||||
$("#" + $(this).attr('id').replace('lp_', 'tab-pv-')).show();
|
||||
$("#" + $(this).attr('id').replace('lp_', 'tab-pv-esquema-')).show();
|
||||
} else if ($(this).attr('id').indexOf('_data') > -1) {
|
||||
// Do nothing here
|
||||
} else if ($(this).attr('id').indexOf('_rot') > -1) {
|
||||
// Discard
|
||||
} else if ($(this).attr('id').indexOf('lp_rot_') > -1) {
|
||||
$("#" + $(this).attr('id').replace('lp_rot_', 'tab-pv-rot-')).show();
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$("#" + $(this).attr('id').replace('lp_', 'tab-pv-')).show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user