mirror of https://github.com/rusefi/msqur.git
Working on #13, engine constants fixed, but still not working. 2D tables pretty much done.
This commit is contained in:
parent
60849eab9f
commit
ccf24cb4bc
|
@ -135,7 +135,7 @@ class INI
|
|||
break;
|
||||
|
||||
case "SettingContextHelp": //Any help text for our variable
|
||||
$values[$currentSection][$key] = INI::defaultSectionHandler($value);
|
||||
$values[$currentSection][$key] = INI::helpSectionHandler($value);
|
||||
break;
|
||||
|
||||
//Whenever I do menu recreation these two will be used
|
||||
|
@ -253,6 +253,11 @@ class INI
|
|||
return $values + $globals;
|
||||
}
|
||||
|
||||
public static function helpSectionHandler($value)
|
||||
{
|
||||
return trim($value);
|
||||
}
|
||||
|
||||
//function constantSectionHandler($value)
|
||||
public static function defaultSectionHandler($value)
|
||||
{
|
||||
|
|
26
src/msq.php
26
src/msq.php
|
@ -144,10 +144,12 @@ class MSQ
|
|||
* @param $value It's value
|
||||
* @returns String HTML \<div\>
|
||||
*/
|
||||
private function msqConstant($constant, $value)
|
||||
private function msqConstant($constant, $value, $help)
|
||||
{
|
||||
//var_export($constant);
|
||||
//var_export($value);
|
||||
return '<div class="constant">' . $constant . ': ' . $value . '</div>';
|
||||
//var_export($help);
|
||||
return '<div class="constant">' . $constant . ' (' . $help . '): ' . $value . '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -192,6 +194,7 @@ class MSQ
|
|||
|
||||
$constants = $msqMap['Constants'];
|
||||
$curves = $msqMap['CurveEditor'];
|
||||
$helpTexts = $msqMap['SettingContextHelp'];
|
||||
//$tables = $msqMap['TableEditor'];
|
||||
$engineSchema = getEngineSchema();
|
||||
|
||||
|
@ -296,14 +299,25 @@ class MSQ
|
|||
//}
|
||||
//}
|
||||
}
|
||||
|
||||
foreach ($constants as $key => $config)
|
||||
{
|
||||
$value = $this->findConstant($msq, $key);
|
||||
|
||||
//if (DEBUG) echo "<div class=\"debug\">Trying $key for engine data</div>";
|
||||
if (array_key_exists($key, $engineSchema))
|
||||
if ($value !== NULL)
|
||||
{
|
||||
if (DEBUG) echo "<div class=\"debug\">Found engine data: $key</div>";
|
||||
$constant = $this->findConstant($msq, $key);
|
||||
$engine[$key] = trim($constant, '"');
|
||||
$value = trim($value, '"');
|
||||
if (array_key_exists($key, $engineSchema))
|
||||
{
|
||||
if (DEBUG) echo "<div class=\"debug\">Found engine data: $key => $value</div>";
|
||||
$engine[$key] = $value;
|
||||
}
|
||||
|
||||
if (array_key_exists($key, $helpTexts))
|
||||
$help = $helpTexts[$key];
|
||||
|
||||
$this->msqConstant($key, $value, $help);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue