// // $Author: dmc $ $Revision: 2992 $ $Date: 2021-09-06 15:58:41 -0300 (Mon, 06 Sep 2021) $ // $Id: n-Canada-DCRA.tgt 2992 2021-09-06 18:58:41Z dmc $ var YARDSTOMETRES = 3 / 3.28; var INCHESTOMM = 25.4; var METRESTOFEET = 3.28; var MM_PER_MOA_PER_1Y = 1.047 * 25.4 / 100; // multiply this by the distance in yards var MM_PER_MOA_PER_1M = 1.047 * 25.4 / 100 * 39.37 / 36; // multiply this by the distance in metres var MM_4FT = 4 * 12 * INCHESTOMM; var MM_6FT = 6 * 12 * INCHESTOMM; var MM_8FT = 8 * 12 * INCHESTOMM; var v2options = { temp_unit_name: 'C', // units to report temperature; "F" causes C->F conversion // options used by v2.1 code: shot_format: '{1}.{2}V', // e.g. "49.8V" }; var targetboard_4x4 = { width: MM_4FT, height: MM_4FT, colour: "white", bordercolour: "black", borderwidth: 10 }; var targetboard_6x6 = { width: MM_6FT, height: MM_6FT, colour: "white", bordercolour: "black", borderwidth: 10 }; var targetboard_6x8 = { width: MM_8FT, height: MM_6FT, colour: "white", bordercolour: "black", borderwidth: 10 }; var dcra_4x4 = { distance: 300 * YARDSTOMETRES, // must override centrecoords: { x: 0, y: 0 }, targetboard: targetboard_4x4, options: v2options, // might want to set ghost_max // must set scoringzones // may setscoringzones_f }; var dcra_6x6 = { distance: 300 * YARDSTOMETRES, // must override centrecoords: { x: 0, y: 0 }, targetboard: targetboard_6x6, options: v2options, // might want to set ghost_max // must set scoringzones // may setscoringzones_f }; var LR_TR_scoringzones = [ // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 12.0 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 24 * INCHESTOMM } }, { name: "4", score: 4, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 48 * INCHESTOMM } }, { name: "3", score: 3, colour: "white", bordercolour: "black", type: { name: "ring", dia: 72 * INCHESTOMM } }, { name: "2", score: 2, type: { name: "and", members: [ { name: "2-ring", colour: "transparent", bordercolour: "black", type: { name: "ring", dia: 96 * INCHESTOMM } }, { name: "2-rect", colour: "transparent", bordercolour: "black", type: { name: "rect", width: MM_8FT, height: MM_6FT } }, ] } }, // "2" { name: "1", score: 1, colour: "transparent", type: { name: "rect", width: MM_8FT, height: MM_6FT } }, ]; var LR_F_scoringzones = [ // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 12.0 * INCHESTOMM / 2 } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 12.0 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 24 * INCHESTOMM } }, { name: "3", score: 3, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 48 * INCHESTOMM } }, { name: "2", score: 2, colour: "white", bordercolour: "black", type: { name: "ring", dia: 72 * INCHESTOMM } }, { name: "1", score: 1, type: { name: "and", members: [ { name: "2-ring", colour: "transparent", bordercolour: "black", type: { name: "ring", dia: 96 * INCHESTOMM } }, { name: "2-rect", colour: "transparent", bordercolour: "black", type: { name: "rect", width: MM_8FT, height: MM_6FT } }, ] } }, // "2" { name: "0", score: 0, colour: "transparent", type: { name: "rect", width: MM_8FT, height: MM_6FT } }, ]; var rings_100y_TR = [ { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.05 * INCHESTOMM, type: { name: "ring", dia: 0.875 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 1.75 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 3.5 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 5.25 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 8 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 10, type: { name: "rect", width: 46 * INCHESTOMM, height: 46 * INCHESTOMM } }, ]; var rings_200y_TR = [ { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.05 * INCHESTOMM, type: { name: "ring", dia: 1.75 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 3.5 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 7 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 10.5 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 16 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 10, type: { name: "rect", width: 46 * INCHESTOMM, height: 46 * INCHESTOMM } }, ]; var rings_300y_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.05 * INCHESTOMM, type: { name: "ring", dia: 2.75 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 5.5 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 11 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 16.5 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 22 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 10, type: { name: "rect", width: 46 * INCHESTOMM, height: 46 * INCHESTOMM } }, ]; var rings_300y_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.05 * INCHESTOMM, type: { name: "ring", dia: 2.75 * INCHESTOMM / 2 } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 2.75 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 5.5 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 11 * INCHESTOMM } }, { name: "2", score: 2, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 16.5 * INCHESTOMM } }, { name: "1", score: 1, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 22 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "black", borderwidth: 10, type: { name: "rect", width: 46 * INCHESTOMM, height: 46 * INCHESTOMM } }, ]; var rings_300m_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 3.125 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 6.25 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 11 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 16.5 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 22 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 5, type: { name: "rect", width: 46 * INCHESTOMM, height: 46 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "transparent", type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; var rings_300m_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, // F type: { name: "ring", dia: 3.125 * INCHESTOMM / 2 } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 3.125 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 6.25 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 11 * INCHESTOMM } }, { name: "2", score: 2, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 16.5 * INCHESTOMM } }, { name: "1", score: 1, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 22 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: 46 * INCHESTOMM, height: 46 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "transparent", type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; var rings_400m_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 4.125 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 8.25 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 15.25 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 22.25 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 30 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; var rings_400m_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 0.5 * 4.125 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 4.125 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 8.25 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 15.25 * INCHESTOMM } }, { name: "2", score: 2, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 22.25 * INCHESTOMM } }, { name: "1", score: 1, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 30 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; var rings_500m_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 5.875 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 11.75 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "3", score: 3, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "2", score: 2, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; var rings_500m_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 0.5 * 5.875 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 5.875 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 11.75 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "1", score: 1, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; var rings_600m_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 7.250 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 14.50 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "3", score: 3, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "2", score: 2, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; var rings_600m_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 0.5 * 7.250 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 7.250 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 14.50 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "1", score: 1, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: MM_6FT, height: MM_6FT } }, ]; // for future support of additional target details: var decoration_post_300y = [ // draw this in reverse order // vertical, horizontal and diagonal // alignment marks: // horizontal: { bordercolour: "white", borderwidth: 0.020 * INCHESTOMM, type: { name: "line", from: [-3000, 0], to: [3000, 0] } }, // vertical: { bordercolour: "white", borderwidth: 0.020 * INCHESTOMM, type: { name: "line", from: [0, -3000], to: [0, 3000] } }, // diagonal: { bordercolour: "white", borderwidth: 0.020 * INCHESTOMM, type: { name: "line", from: [-3000, -3000], to: [3000, 3000] } }, { bordercolour: "white", borderwidth: 0.020 * INCHESTOMM, type: { name: "line", from: [3000, -3000], to: [-3000, 3000] } }, { colour: "transparent", bordercolour: "white", borderwidth: 0.100 * INCHESTOMM, dashing: [.320 * INCHESTOMM, .275 * INCHESTOMM], type: { name: "ring", dia: 2.75 * INCHESTOMM - (0.100 / 2 + 0.025) * INCHESTOMM } }, ]; var rings_400y_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.05 * INCHESTOMM, type: { name: "ring", dia: 4 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 8 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 15.25 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 22.25 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 30 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 10, type: { name: "rect", width: 72 * INCHESTOMM, height: 72 * INCHESTOMM } }, ]; var rings_400y_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.05 * INCHESTOMM, type: { name: "ring", dia: 0.5 * 4 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.05 * INCHESTOMM, type: { name: "ring", dia: 4 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 8 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 15.25 * INCHESTOMM } }, { name: "2", score: 2, colour: "transparent", bordercolour: "white", borderwidth: 2 * 0.100 * INCHESTOMM, type: { name: "ring", dia: 22.25 * INCHESTOMM } }, { name: "1", score: 1, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 30 * INCHESTOMM } }, ]; var rings_500y_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 5.25 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 10.5 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "3", score: 3, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "2", score: 2, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: 72 * INCHESTOMM, height: 72 * INCHESTOMM } }, ]; var rings_500y_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 5.25 * INCHESTOMM / 2 } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 5.25 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 10.5 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "1", score: 1, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: 72 * INCHESTOMM, height: 72 * INCHESTOMM } }, ]; var rings_600y_TR = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 6.5 * INCHESTOMM } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 13 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "3", score: 3, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "2", score: 2, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "1", score: 1, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: 72 * INCHESTOMM, height: 72 * INCHESTOMM } }, ]; var rings_600y_F = [ // draw this in reverse order // search for a hit in forward order // default values: {x:0, y:0} { name: "V", score: [5, 1], colour: "transparent", bordercolour: "white", borderwidth: 2.3, type: { name: "ring", dia: 6.5 * INCHESTOMM / 2 } }, { name: "5", score: 5, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 6.5 * INCHESTOMM } }, { name: "4", score: 4, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 13 * INCHESTOMM } }, { name: "3", score: 3, colour: "transparent", bordercolour: "white", type: { name: "ring", dia: 26 * INCHESTOMM } }, { name: "2", score: 2, colour: "black", /* no border - aiming mark */ type: { name: "ring", dia: 39 * INCHESTOMM } }, { name: "1", score: 1, colour: "white", bordercolour: "black", borderwidth: 3, type: { name: "ring", dia: 52 * INCHESTOMM } }, { name: "0", score: 0, colour: "transparent", bordercolour: "black", borderwidth: 1, type: { name: "rect", width: 72 * INCHESTOMM, height: 72 * INCHESTOMM } }, ]; //var rings_300y_TR = ; //var rings_300y_F = ; function rescale_zones(zones_in,scale) { var zones_scale = JSON.parse(JSON.stringify(zones_in)); for (var i in zones_scale) { var zone = zones_scale[i]; if (zone && zone.type && zone.type.name == 'ring') { zone.type.dia *= scale; } if (zone && zone.type && zone.type.name == 'rect') { zone.type.width *= scale; zone.type.height *= scale; } if (zone && zone.type && zone.type.name == 'and' && zone.type.members) { zone.type.members = rescale_zones(zone.type.members,scale); console.log(i,zone); } //console.log(i,zone); } return zones_scale; // name: "and", members: [ } module.exports = { 'DCRA-100y': (t = JSON.parse(JSON.stringify(dcra_4x4)) , t.scoringzones = rings_100y_TR , t.distance = 100 * YARDSTOMETRES , t), 'DCRA-200y': (t = JSON.parse(JSON.stringify(dcra_4x4)) , t.scoringzones = rings_200y_TR , t.distance = 200 * YARDSTOMETRES , t), 'DCRA-300y-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_300y_F , t.distance = 300 * YARDSTOMETRES , t), 'DCRA-300y': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_300y_TR , t.scoringzones_f = rings_300y_F , t.distance = 300 * YARDSTOMETRES // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-300m-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_300m_F , t.distance = 300 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-300m': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_300m_TR , t.scoringzones_f = rings_300m_F , t.distance = 300 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-400y-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_400y_F , t.distance = 400 * YARDSTOMETRES // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-400y': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_400y_TR , t.scoringzones_f = rings_400y_F , t.distance = 400 * YARDSTOMETRES // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-400m-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_400m_F , t.distance = 400 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-400m': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_400m_TR , t.scoringzones_f = rings_400m_F , t.distance = 400 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-500y-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_500y_F , t.distance = 500 * YARDSTOMETRES // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-500y': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_500y_TR, t.scoringzones_f = rings_500y_F , t.distance = 500 * YARDSTOMETRES // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-500m-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_500m_F , t.distance = 500 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-500m': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_500m_TR, t.scoringzones_f = rings_500m_F , t.distance = 500 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-600y-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_600y_F , t.distance = 600 * YARDSTOMETRES // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-600y': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_600y_TR, t.scoringzones_f = rings_600y_F , t.distance = 600 * YARDSTOMETRES // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-600m-F': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_600m_F , t.distance = 600 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-600m': (t = JSON.parse(JSON.stringify(dcra_6x6)) , t.scoringzones = rings_600m_TR, t.scoringzones_f = rings_600m_F , t.distance = 600 // ,t.options.ghost_max=2300/METRESTOFEET , t), 'DCRA-LR': { distance: 1000 * YARDSTOMETRES, "distances": [ { "d": 700, "name": "700m", "unit": "m" }, { "d": 800, "name": "800m", "unit": "m" }, { "d": 900, "name": "900m", "unit": "m", "p": "true" }, // preferred distance { "d": 800 * YARDSTOMETRES, "name": "800y", "unit": "y" }, { "d": 900 * YARDSTOMETRES, "name": "900y", "unit": "y" }, { "d": 1000 * YARDSTOMETRES, "name": "1000y", "unit": "y" }, ], centrecoords: { x: 0, y: 0 }, targetboard: targetboard_6x8, options: (t = JSON.parse(JSON.stringify(v2options)), t.ghost_max=2200/METRESTOFEET, t), scoringzones: LR_TR_scoringzones, scoringzones_f: LR_F_scoringzones }, 'DCRA-LR-sim200': { distance: 200 * YARDSTOMETRES, "distances": [ { "d": 200, "name": "200y", "unit": "y", "p": "true" }, // preferred distance ], centrecoords: { x: 0, y: 0 }, targetboard: targetboard_6x8, options: (t = JSON.parse(JSON.stringify(v2options)), t.ghost_max=2200/METRESTOFEET, t), scoringzones: rescale_zones(LR_TR_scoringzones, 200/1000), scoringzones_f: rescale_zones(LR_F_scoringzones, 200/1000), }, }