From 2c4078e187953a69e8443c30b74db4adb82b6377 Mon Sep 17 00:00:00 2001 From: umsangdon Date: Thu, 1 Oct 2026 16:08:28 +0900 Subject: [PATCH] =?UTF-8?q?fix(m02-cf):=20=EA=B2=AC=EB=B3=B8=20=EC=83=89?= =?UTF-8?q?=EC=9D=84=20Model=20=EA=B8=B0=EB=B3=B8=20=EC=83=89(BOX=5FCOLOR)?= =?UTF-8?q?=EA=B3=BC=20=EA=B0=99=EA=B2=8C=20=C2=B7=20=EC=8B=9C=ED=97=98?= =?UTF-8?q?=EC=9D=B4=20Model=20=EA=B0=92=EA=B3=BC=20=EB=8C=80=EC=A1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BU9gbNE3aWFUvE61pS2WGt --- .../CostFlow/_sample/masonry.json | 22 +++++++++---------- M02_MasterTemplete/CostFlow/_sample/rate.json | 6 ++--- .../CostFlow/_sample/value.json | 6 ++--- resources/tester/test_m02_cf_sample.py | 14 +++++++++++- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/M02_MasterTemplete/CostFlow/_sample/masonry.json b/M02_MasterTemplete/CostFlow/_sample/masonry.json index 687251cd9..a57860530 100644 --- a/M02_MasterTemplete/CostFlow/_sample/masonry.json +++ b/M02_MasterTemplete/CostFlow/_sample/masonry.json @@ -7,7 +7,7 @@ "id": "in-var", "kind": "input", "name": "쌓기 조건", - "color": "#3b82f6", + "color": "#2f80ed", "unit": "-", "x": 40, "y": 40, @@ -49,7 +49,7 @@ "id": "in-poom", "kind": "input", "name": "메쌓기 품표", - "color": "#3b82f6", + "color": "#2f80ed", "unit": "-", "x": 40, "y": 300, @@ -67,7 +67,7 @@ "id": "in-rate", "kind": "input", "name": "높이 증가율표", - "color": "#3b82f6", + "color": "#2f80ed", "unit": "-", "x": 40, "y": 460, @@ -85,7 +85,7 @@ "id": "in-labor", "kind": "input", "name": "인력", - "color": "#3b82f6", + "color": "#2f80ed", "unit": "-", "x": 40, "y": 620, @@ -113,7 +113,7 @@ "id": "fn-rate", "kind": "function", "name": "증가율 찾기", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "%", "x": 340, "y": 420, @@ -179,7 +179,7 @@ "id": "fn-poom0", "kind": "function", "name": "석공 품", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "인/㎡", "x": 640, "y": 80, @@ -275,7 +275,7 @@ "id": "fn-poom1", "kind": "function", "name": "보통인부 품", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "인/㎡", "x": 640, "y": 300, @@ -371,7 +371,7 @@ "id": "fn-pay0", "kind": "function", "name": "석공 노무비", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "원/㎡", "x": 940, "y": 80, @@ -434,7 +434,7 @@ "id": "fn-pay1", "kind": "function", "name": "보통인부 노무비", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "원/㎡", "x": 940, "y": 300, @@ -497,7 +497,7 @@ "id": "fn-sum", "kind": "function", "name": "노무비 합", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "원/㎡", "x": 1240, "y": 190, @@ -560,7 +560,7 @@ "id": "out-pay", "kind": "output", "name": "노무비", - "color": "#10b981", + "color": "#27ae60", "unit": "원/㎡", "x": 1520, "y": 190, diff --git a/M02_MasterTemplete/CostFlow/_sample/rate.json b/M02_MasterTemplete/CostFlow/_sample/rate.json index 5a1faa636..cf1ff8428 100644 --- a/M02_MasterTemplete/CostFlow/_sample/rate.json +++ b/M02_MasterTemplete/CostFlow/_sample/rate.json @@ -7,7 +7,7 @@ "id": "in-var", "kind": "input", "name": "바탕 값", - "color": "#3b82f6", + "color": "#2f80ed", "unit": "-", "x": 40, "y": 80, @@ -34,7 +34,7 @@ "id": "fn-rate", "kind": "function", "name": "공구손료", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "원", "x": 340, "y": 80, @@ -97,7 +97,7 @@ "id": "out-mat", "kind": "output", "name": "재료비", - "color": "#10b981", + "color": "#27ae60", "unit": "원", "x": 640, "y": 80, diff --git a/M02_MasterTemplete/CostFlow/_sample/value.json b/M02_MasterTemplete/CostFlow/_sample/value.json index a9f8e823b..c292ba947 100644 --- a/M02_MasterTemplete/CostFlow/_sample/value.json +++ b/M02_MasterTemplete/CostFlow/_sample/value.json @@ -7,7 +7,7 @@ "id": "in-var", "kind": "input", "name": "덤프트럭 조건", - "color": "#3b82f6", + "color": "#2f80ed", "unit": "-", "x": 40, "y": 80, @@ -46,7 +46,7 @@ "id": "fn-q", "kind": "function", "name": "시간당 작업량", - "color": "#f59e0b", + "color": "#7b4fd6", "unit": "㎥/시간", "x": 340, "y": 80, @@ -129,7 +129,7 @@ "id": "out-q", "kind": "output", "name": "시간당 작업량", - "color": "#10b981", + "color": "#27ae60", "unit": "㎥/시간", "x": 640, "y": 80, diff --git a/resources/tester/test_m02_cf_sample.py b/resources/tester/test_m02_cf_sample.py index da6c1e7c8..ec59c4ed4 100644 --- a/resources/tester/test_m02_cf_sample.py +++ b/resources/tester/test_m02_cf_sample.py @@ -10,6 +10,7 @@ from __future__ import annotations import json +import re import shutil import subprocess from decimal import Decimal @@ -89,6 +90,17 @@ def _order(lg: dict) -> list[dict]: return [boxes[i] for i in done] +# Model 기본 색(`M02_CF_Model.ts` BOX_COLOR) — 견본 색은 이것과 같아야 함 +BOX_COLOR = dict( + re.findall( + r'(\w+): "(#[0-9a-fA-F]{6})"', + re.search( + r"BOX_COLOR[^{]*\{([^}]*)\}", (FOLDER / "M02_CF_Model.ts").read_text(encoding="utf-8") + ).group(1), + ) +) + + @pytest.mark.parametrize("name", ["masonry", "rate", "value"]) def test_견본_모양(name: str) -> None: lg = SAMPLES[name] @@ -100,7 +112,7 @@ def test_견본_모양(name: str) -> None: for b in lg["boxes"]: assert b["kind"] in ("input", "function", "output") assert ( - b["color"].startswith("#") + b["color"] == BOX_COLOR[b["kind"]] and b["unit"] and isinstance(b["x"], int) and isinstance(b["y"], int)