feat: 补齐后排大仓和七座浅圆仓的编号及后台绑定
这个提交包含在:
25
ops/test_granary_screen.php
普通文件
25
ops/test_granary_screen.php
普通文件
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
require __DIR__ . '/../application/common/library/GranaryScreen.php';
|
||||
use app\common\library\GranaryScreen;
|
||||
|
||||
function check($condition, $message) {
|
||||
if (!$condition) throw new RuntimeException($message);
|
||||
}
|
||||
$positions = GranaryScreen::extraPositions();
|
||||
check(count($positions) === 11, 'All eleven configurable building positions must exist');
|
||||
$lastX = 0;
|
||||
for ($i = 1; $i <= 7; $i++) {
|
||||
$position = 'center_silo_' . $i;
|
||||
$item = ['id' => 200 + $i, 'num' => 46 + $i, 'content' => ['screenPosition' => $position]];
|
||||
$coord = GranaryScreen::resolve($item, []);
|
||||
check($coord['x'] > $lastX, 'Silos must run from left to right');
|
||||
check($coord['stemY'] > $coord['y'] && $coord['stemY'] < 32, 'Lead line must point to the silo roof');
|
||||
$item['num'] = 900 + $i;
|
||||
check(GranaryScreen::resolve($item, []) === $coord, 'Renumbering must preserve the building');
|
||||
$lastX = $coord['x'];
|
||||
}
|
||||
$middle = GranaryScreen::resolve(['id' => 46, 'num' => 43, 'content' => ['screenPosition' => 'center_middle']], []);
|
||||
$rear = GranaryScreen::resolve(['id' => 114, 'num' => 46, 'content' => ['screenPosition' => 'center_rear']], []);
|
||||
check($middle !== $rear, '43 and 46 must label two separate buildings');
|
||||
check(GranaryScreen::resolve(['id' => 43, 'num' => 14, 'content' => []], [14 => ['x' => 4.8, 'y' => 12.8]]) === ['x' => 4.8, 'y' => 12.8], 'Oil tank numbering must remain separate');
|
||||
echo "All building position checks passed\n";
|
||||
在新工单中引用
屏蔽一个用户