- added "Signature strength" data to wormhole types, closed #623

- improved "importData()" and "importStaticData()" behavior
This commit is contained in:
Mark Friedrich
2018-05-06 15:52:45 +02:00
parent 948c9ca829
commit 0f46d15149
10 changed files with 6154 additions and 6017 deletions

View File

@@ -666,7 +666,7 @@ abstract class BasicModel extends \DB\Cortex {
// rtrim(); for arrays (removes empty values) from the end
$rtrim = function($array = []){
return array_slice($array, 0, key(array_reverse(array_diff($array, ['']), 1))+1);
return array_slice($array, 0, key(array_reverse($array, 1))+1);
};
if(static::$enableDataImport){
@@ -704,7 +704,7 @@ abstract class BasicModel extends \DB\Cortex {
*/
protected function importStaticData($tableData = []){
$rowIDs = [];
$columnNames = array_merge(['id'], array_keys($this->fieldConf));
$addedCount = 0;
$updatedCount = 0;
$deletedCount = 0;
@@ -717,7 +717,7 @@ abstract class BasicModel extends \DB\Cortex {
}else{
$updatedCount++;
}
$this->copyfrom($rowData);
$this->copyfrom($rowData, $columnNames);
$this->save();
$rowIDs[] = $this->id;
$this->reset();

View File

@@ -50,6 +50,11 @@ class WormholeModel extends BasicModel {
'nullable' => false,
'default' => 1,
'index' => true,
],
'signatureStrength' => [
'type' => Schema::DT_FLOAT,
'nullable' => true,
'default' => null
]
];
@@ -59,6 +64,18 @@ class WormholeModel extends BasicModel {
*/
protected $addStaticFields = false;
/**
* setter for "signatureStrength"
* @param $value
* @return mixed|null|string
* @throws \Exception
*/
public function set_signatureStrength($value){
$value = (float)$value ? $value : null;
return $value;
}
/**
* get wormhole data as object
* @return object
@@ -82,6 +99,11 @@ class WormholeModel extends BasicModel {
$systemStaticData->massRegeneration = $this->massRegeneration;
}
// signature strength as defined by http://wiki.eve-inspiracy.com/index.php?title=Wormhole_Signature_Strength_List
if($this->signatureStrength){
$systemStaticData->signatureStrength = $this->signatureStrength;
}
return $systemStaticData;
}

View File

@@ -1,81 +1,81 @@
"Id";"Name";"Security";"MassTotal";"MassIndividual";"MassRegeneration";"MaxStableTime";
"1";"A009";"L";"500000000";"20000000";;"16";
"2";"A239";"L";"2000000000";"300000000";;"24";
"3";"A641";"H";"2000000000";"1000000000";;"16";
"4";"A982";"C6";"3000000000";"300000000";;"24";
"5";"B041";"C6";"5000000000";"300000000";"500000000";"48";
"6";"B274";"H";"2000000000";"300000000";;"24";
"7";"B449";"H";"2000000000";"1000000000";;"16";
"8";"B520";"H";"5000000000";"300000000";"500000000";"24";
"9";"C008";"C5";;"5000000";"1";"16";
"10";"C125";"C2";"1000000000";"20000000";;"16";
"11";"C140";"L";"3000000000";"1350000000";;"24";
"12";"C247";"C3";"2000000000";"300000000";;"16";
"13";"C248";"0.0";"5000000000";"1800000000";"500000000";"24";
"14";"C391";"L";"5000000000";"1800000000";"500000000";"24";
"15";"D364";"C2";"1000000000";"300000000";;"16";
"16";"D382";"C2";"2000000000";"300000000";;"16";
"17";"D792";"H";"3000000000";"1000000000";;"24";
"18";"D845";"H";"5000000000";"300000000";"500000000";"24";
"19";"E004";"C1";;"5000000";"1";"16";
"20";"E175";"C4";"2000000000";"300000000";;"16";
"21";"E545";"0.0";"2000000000";"300000000";;"24";
"22";"G009";"C6";;"5000000";;"16";
"23";"G024";"C2";"2000000000";"300000000";;"16";
"24";"H121";"C1";"500000000";"20000000";;"16";
"25";"H296";"C5";"3000000000";"1350000000";;"24";
"26";"H900";"C5";"3000000000";"300000000";;"24";
"27";"I182";"C2";"2000000000";"300000000";;"16";
"28";"J244";"L";"1000000000";"20000000";;"24";
"29";"K329";"0.0";"5000000000";"1800000000";"500000000";"24";
"30";"K346";"0.0";"3000000000";"300000000";;"24";
"31";"L005";"C2";;"5000000";"1";"16";
"32";"L477";"C3";"2000000000";"300000000";;"16";
"33";"L614";"C5";"1000000000";"20000000";;"24";
"34";"M006";"C4";;"5000000";"1";"16";
"35";"M267";"C3";"1000000000";"300000000";;"16";
"36";"M555";"C5";"3000000000";"1000000000";;"24";
"37";"M609";"C4";"1000000000";"20000000";;"16";
"38";"N062";"C5";"3000000000";"300000000";;"24";
"39";"N110";"H";"1000000000";"20000000";;"24";
"40";"N290";"L";"5000000000";"1800000000";"500000000";"24";
"41";"N432";"C5";"3000000000";"1350000000";;"24";
"42";"N766";"C2";"2000000000";"300000000";;"16";
"43";"N770";"C5";"3000000000";"300000000";;"24";
"44";"N944";"L";"3000000000";"1350000000";;"24";
"45";"N968";"C3";"2000000000";"300000000";;"16";
"46";"O128";"C4";"1000000000";"300000000";"100000000";"24";
"47";"O477";"C3";"2000000000";"300000000";;"16";
"48";"O883";"C3";"1000000000";"20000000";;"16";
"49";"P060";"C1";"500000000";"20000000";;"16";
"50";"Q003";"0.0";;"5000000";"1";"16";
"51";"Q317";"C1";"500000000";"20000000";;"16";
"52";"R051";"L";"3000000000";"1000000000";;"16";
"53";"R474";"C6";"3000000000";"300000000";;"24";
"54";"R943";"C2";"750000000";"300000000";;"16";
"55";"S047";"H";"3000000000";"300000000";;"24";
"56";"S199";"0.0";"3000000000";"1350000000";;"24";
"57";"S804";"C6";"1000000000";"20000000";;"24";
"58";"T405";"C4";"2000000000";"300000000";;"16";
"59";"U210";"L";"3000000000";"300000000";;"24";
"60";"U319";"C6";"3000000000";"1800000000";"500000000";"48";
"61";"U574";"C6";"3000000000";"300000000";;"24";
"62";"V283";"0.0";"3000000000";"1000000000";;"24";
"63";"V301";"C1";"500000000";"20000000";;"16";
"64";"V753";"C6";"3000000000";"1350000000";;"24";
"65";"V911";"C5";"3000000000";"1350000000";;"24";
"66";"W237";"C6";"3000000000";"1350000000";;"24";
"67";"X702";"C3";"1000000000";"300000000";;"24";
"68";"X877";"C4";"2000000000";"300000000";;"16";
"69";"Y683";"C4";"2000000000";"300000000";;"16";
"70";"Y790";"C1";"500000000";"20000000";;"16";
"71";"Z006";"C3";;"5000000";"1";"16";
"72";"Z060";"0.0";"1000000000";"20000000";;"24";
"73";"Z142";"0.0";"3000000000";"1350000000";;"24";
"74";"Z457";"C4";"2000000000";"300000000";;"16";
"75";"Z647";"C1";"500000000";"20000000";;"16";
"76";"Z971";"C1";"100000000";"20000000";;"16";
"80";"M001";"C4";;"5000000";"1";"16";
"81";"E587";"0.0";"3000000000";"1000000000";;"16";
"82";"V898";"L";"2000000000";"300000000";;"16";
"83";"Q063";"H";"500000000";"20000000";;"16";
"Id";"Name";"Security";"MassTotal";"MassIndividual";"MassRegeneration";"MaxStableTime";"SignatureStrength";
"1";"A009";"L";"500000000";"20000000";;"16";;
"2";"A239";"L";"2000000000";"300000000";;"24";"5";
"3";"A641";"H";"2000000000";"1000000000";;"16";"10";
"4";"A982";"C6";"3000000000";"300000000";;"24";"2.22";
"5";"B041";"C6";"5000000000";"300000000";"500000000";"48";;
"6";"B274";"H";"2000000000";"300000000";;"24";"10";
"7";"B449";"H";"2000000000";"1000000000";;"16";2.5;
"8";"B520";"H";"5000000000";"300000000";"500000000";"24";;
"9";"C008";"C5";;"5000000";"1";"16";;
"10";"C125";"C2";"1000000000";"20000000";;"16";"6.67";
"11";"C140";"L";"3000000000";"1350000000";;"24";"5";
"12";"C247";"C3";"2000000000";"300000000";;"16";"10";
"13";"C248";"0.0";"5000000000";"1800000000";"500000000";"24";;
"14";"C391";"L";"5000000000";"1800000000";"500000000";"24";;
"15";"D364";"C2";"1000000000";"300000000";;"16";"1.25";
"16";"D382";"C2";"2000000000";"300000000";;"16";"6.67";
"17";"D792";"H";"3000000000";"1000000000";;"24";"2.5";
"18";"D845";"H";"5000000000";"300000000";"500000000";"24";"5";
"19";"E004";"C1";;"5000000";"1";"16";;
"20";"E175";"C4";"2000000000";"300000000";;"16";"5";
"21";"E545";"0.0";"2000000000";"300000000";;"24";"2.5";
"22";"G009";"C6";;"5000000";;"16";;
"23";"G024";"C2";"2000000000";"300000000";;"16";"1.25";
"24";"H121";"C1";"500000000";"20000000";;"16";"10";
"25";"H296";"C5";"3000000000";"1350000000";;"24";"10";
"26";"H900";"C5";"3000000000";"300000000";;"24";"2.5";
"27";"I182";"C2";"2000000000";"300000000";;"16";"4";
"28";"J244";"L";"1000000000";"20000000";;"24";"5";
"29";"K329";"0.0";"5000000000";"1800000000";"500000000";"24";;
"30";"K346";"0.0";"3000000000";"300000000";;"24";"2.5";
"31";"L005";"C2";;"5000000";"1";"16";;
"32";"L477";"C3";"2000000000";"300000000";;"16";"5";
"33";"L614";"C5";"1000000000";"20000000";;"24";"2.5";
"34";"M006";"C4";;"5000000";"1";"16";;
"35";"M267";"C3";"1000000000";"300000000";;"16";"1.25";
"36";"M555";"C5";"3000000000";"1000000000";;"24";"2.5";
"37";"M609";"C4";"1000000000";"20000000";;"16";"4";
"38";"N062";"C5";"3000000000";"300000000";;"24";"2.5";
"39";"N110";"H";"1000000000";"20000000";;"24";"10";
"40";"N290";"L";"3000000000";"1800000000";"500000000";"24";;
"41";"N432";"C5";"3000000000";"1350000000";;"24";"10";
"42";"N766";"C2";"2000000000";"300000000";;"16";"4";
"43";"N770";"C5";"3000000000";"300000000";;"24";"2.5";
"44";"N944";"L";"3000000000";"1350000000";;"24";"10";
"45";"N968";"C3";"2000000000";"300000000";;"16";"10";
"46";"O128";"C4";"1000000000";"300000000";"100000000";"24";;
"47";"O477";"C3";"2000000000";"300000000";;"16";"5";
"48";"O883";"C3";"1000000000";"20000000";;"16";"5";
"49";"P060";"C1";"500000000";"20000000";;"16";"5";
"50";"Q003";"0.0";;"5000000";"1";"16";;
"51";"Q317";"C1";"500000000";"20000000";;"16";"2.5";
"52";"R051";"L";"3000000000";"1000000000";;"16";"5";
"53";"R474";"C6";"3000000000";"300000000";;"24";"2.22";
"54";"R943";"C2";"750000000";"300000000";;"16";"6.67";
"55";"S047";"H";"3000000000";"300000000";;"24";;
"56";"S199";"0.0";"3000000000";"1350000000";;"24";10;
"57";"S804";"C6";"1000000000";"20000000";;"24";"1.25";
"58";"T405";"C4";"2000000000";"300000000";;"16";"6.67";
"59";"U210";"L";"3000000000";"300000000";;"24";"10";
"60";"U319";"C6";"3000000000";"1800000000";"500000000";"48";;
"61";"U574";"C6";"3000000000";"300000000";;"24";"1.25";
"62";"V283";"0.0";"3000000000";"1000000000";;"24";"2.5";
"63";"V301";"C1";"500000000";"20000000";;"16";"5";
"64";"V753";"C6";"3000000000";"1350000000";;"24";"6.67";
"65";"V911";"C5";"3000000000";"1350000000";;"24";"10";
"66";"W237";"C6";"3000000000";"1350000000";;"24";"6.67";
"67";"X702";"C3";"1000000000";"300000000";;"24";"10";
"68";"X877";"C4";"2000000000";"300000000";;"16";"6.67";
"69";"Y683";"C4";"2000000000";"300000000";;"16";"4";
"70";"Y790";"C1";"500000000";"20000000";;"16";"2.5";
"71";"Z006";"C3";;"5000000";"1";"16";;
"72";"Z060";"0.0";"1000000000";"20000000";;"24";"2.5";
"73";"Z142";"0.0";"3000000000";"1350000000";;"24";"10";
"74";"Z457";"C4";"2000000000";"300000000";;"16";"4";
"75";"Z647";"C1";"500000000";"20000000";;"16";"10";
"76";"Z971";"C1";"100000000";"20000000";;"16";"10";
"80";"M001";"C4";;"5000000";"1";"16";;
"81";"E587";"0.0";"3000000000";"1000000000";;"16";;
"82";"V898";"L";"2000000000";"300000000";;"16";;
"83";"Q063";"H";"500000000";"20000000";;"16";;
1 Id Name Security MassTotal MassIndividual MassRegeneration MaxStableTime SignatureStrength
2 1 A009 L 500000000 20000000 16
3 2 A239 L 2000000000 300000000 24 5
4 3 A641 H 2000000000 1000000000 16 10
5 4 A982 C6 3000000000 300000000 24 2.22
6 5 B041 C6 5000000000 300000000 500000000 48
7 6 B274 H 2000000000 300000000 24 10
8 7 B449 H 2000000000 1000000000 16 2.5
9 8 B520 H 5000000000 300000000 500000000 24
10 9 C008 C5 5000000 1 16
11 10 C125 C2 1000000000 20000000 16 6.67
12 11 C140 L 3000000000 1350000000 24 5
13 12 C247 C3 2000000000 300000000 16 10
14 13 C248 0.0 5000000000 1800000000 500000000 24
15 14 C391 L 5000000000 1800000000 500000000 24
16 15 D364 C2 1000000000 300000000 16 1.25
17 16 D382 C2 2000000000 300000000 16 6.67
18 17 D792 H 3000000000 1000000000 24 2.5
19 18 D845 H 5000000000 300000000 500000000 24 5
20 19 E004 C1 5000000 1 16
21 20 E175 C4 2000000000 300000000 16 5
22 21 E545 0.0 2000000000 300000000 24 2.5
23 22 G009 C6 5000000 16
24 23 G024 C2 2000000000 300000000 16 1.25
25 24 H121 C1 500000000 20000000 16 10
26 25 H296 C5 3000000000 1350000000 24 10
27 26 H900 C5 3000000000 300000000 24 2.5
28 27 I182 C2 2000000000 300000000 16 4
29 28 J244 L 1000000000 20000000 24 5
30 29 K329 0.0 5000000000 1800000000 500000000 24
31 30 K346 0.0 3000000000 300000000 24 2.5
32 31 L005 C2 5000000 1 16
33 32 L477 C3 2000000000 300000000 16 5
34 33 L614 C5 1000000000 20000000 24 2.5
35 34 M006 C4 5000000 1 16
36 35 M267 C3 1000000000 300000000 16 1.25
37 36 M555 C5 3000000000 1000000000 24 2.5
38 37 M609 C4 1000000000 20000000 16 4
39 38 N062 C5 3000000000 300000000 24 2.5
40 39 N110 H 1000000000 20000000 24 10
41 40 N290 L 5000000000 3000000000 1800000000 500000000 24
42 41 N432 C5 3000000000 1350000000 24 10
43 42 N766 C2 2000000000 300000000 16 4
44 43 N770 C5 3000000000 300000000 24 2.5
45 44 N944 L 3000000000 1350000000 24 10
46 45 N968 C3 2000000000 300000000 16 10
47 46 O128 C4 1000000000 300000000 100000000 24
48 47 O477 C3 2000000000 300000000 16 5
49 48 O883 C3 1000000000 20000000 16 5
50 49 P060 C1 500000000 20000000 16 5
51 50 Q003 0.0 5000000 1 16
52 51 Q317 C1 500000000 20000000 16 2.5
53 52 R051 L 3000000000 1000000000 16 5
54 53 R474 C6 3000000000 300000000 24 2.22
55 54 R943 C2 750000000 300000000 16 6.67
56 55 S047 H 3000000000 300000000 24
57 56 S199 0.0 3000000000 1350000000 24 10
58 57 S804 C6 1000000000 20000000 24 1.25
59 58 T405 C4 2000000000 300000000 16 6.67
60 59 U210 L 3000000000 300000000 24 10
61 60 U319 C6 3000000000 1800000000 500000000 48
62 61 U574 C6 3000000000 300000000 24 1.25
63 62 V283 0.0 3000000000 1000000000 24 2.5
64 63 V301 C1 500000000 20000000 16 5
65 64 V753 C6 3000000000 1350000000 24 6.67
66 65 V911 C5 3000000000 1350000000 24 10
67 66 W237 C6 3000000000 1350000000 24 6.67
68 67 X702 C3 1000000000 300000000 24 10
69 68 X877 C4 2000000000 300000000 16 6.67
70 69 Y683 C4 2000000000 300000000 16 4
71 70 Y790 C1 500000000 20000000 16 2.5
72 71 Z006 C3 5000000 1 16
73 72 Z060 0.0 1000000000 20000000 24 2.5
74 73 Z142 0.0 3000000000 1350000000 24 10
75 74 Z457 C4 2000000000 300000000 16 4
76 75 Z647 C1 500000000 20000000 16 10
77 76 Z971 C1 100000000 20000000 16 10
78 80 M001 C4 5000000 1 16
79 81 E587 0.0 3000000000 1000000000 16
80 82 V898 L 2000000000 300000000 16
81 83 Q063 H 500000000 20000000 16

File diff suppressed because it is too large Load Diff

View File

@@ -1014,6 +1014,11 @@ define([
if(tooltipData.maxStableTime){
data.maxStableTime = tooltipData.maxStableTime + ' h';
}
if(tooltipData.signatureStrength){
data.signatureStrength = parseFloat(tooltipData.signatureStrength).toLocaleString() + ' %';
}else{
data.signatureStrength = 'unknown';
}
let title = tooltipData.name +
'<span class="pull-right ' + tooltipData.class +'">' + tooltipData.security + '</span>';

View File

@@ -44,7 +44,13 @@ define([
}.bind(this);
}.bind({
Util: Util
})
}),
sigStrengthValue: function(){
return function(value, render){
let float = render(value);
return float.length ? parseFloat(float).toLocaleString() + '&nbsp;&#37;' : 'unknown';
};
}
};
let content = Mustache.render(template, data);

View File

@@ -1014,6 +1014,11 @@ define([
if(tooltipData.maxStableTime){
data.maxStableTime = tooltipData.maxStableTime + ' h';
}
if(tooltipData.signatureStrength){
data.signatureStrength = parseFloat(tooltipData.signatureStrength).toLocaleString() + '&nbsp;&#37;';
}else{
data.signatureStrength = 'unknown';
}
let title = tooltipData.name +
'<span class="pull-right ' + tooltipData.class +'">' + tooltipData.security + '</span>';

View File

@@ -44,7 +44,13 @@ define([
}.bind(this);
}.bind({
Util: Util
})
}),
sigStrengthValue: function(){
return function(value, render){
let float = render(value);
return float.length ? parseFloat(float).toLocaleString() + '&nbsp;&#37;' : 'unknown';
};
}
};
let content = Mustache.render(template, data);

View File

@@ -8,6 +8,7 @@
<th class="text-right">Mass individual</th>
<th class="text-right">Mass regeneration</th>
<th class="text-right">Lifetime</th>
<th class="text-right">Sig strength</th>
</tr>
</thead>
<tbody>
@@ -19,6 +20,9 @@
<td class="text-right">{{#massValue}}{{massIndividual}}{{/massValue}}</td>
<td class="text-right">{{#massValue}}{{massRegeneration}}{{/massValue}}</td>
<td class="text-right">{{maxStableTime}}&nbsp;h</td>
<td class="text-right txt-color {{^signatureStrength}}txt-color-grayLight{{/signatureStrength}}" data-order="{{signatureStrength}}">
{{#sigStrengthValue}}{{signatureStrength}}{{/sigStrengthValue}}
</td>
</tr>
{{/wormholes}}
</tbody>

View File

@@ -23,5 +23,11 @@
<td class="text-right">{{maxStableTime}}</td>
</tr>
{{/maxStableTime}}
{{#signatureStrength}}
<tr>
<td>Sig strength</td>
<td class="text-right">{{{signatureStrength}}}</td>
</tr>
{{/signatureStrength}}
</table>