feat: 补齐后排大仓和七座浅圆仓的编号及后台绑定

这个提交包含在:
wikiboss
2026-10-28 18:12:48 +08:00
父节点 87edf36b5b
当前提交 a06d23a632
共有 5 个文件被更改,包括 66 次插入 和 10 次删除

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";