--- /sessions/rcw-01levext1fchvolxd58yjvr4/mnt/KIOXIA/r2r2r-data/service_sim/unity/hospital/20261112_flow158/tools/pan158.py 2026-11-12 15:10:14.110000000 +0000 +++ /sessions/rcw-01levext1fchvolxd58yjvr4/mnt/KIOXIA/r2r2r-data/service_sim/unity/hospital/20261113_tags161/tools/pan161.py 2026-11-12 21:00:34.720000000 +0000 @@ -1,5 +1,6 @@ #!/usr/bin/env python3 -"""依頼158(pan157.py の写し:カメラは cams158(寄り4つを足す)、静止画は 18+4。呼ぶ場面と台の前の受け渡しを場面の印とパネルに出す(request_view。見た目だけ): +"""依頼161(pan158.py の写し:場面の札の枠(と下の三角)を緑(MINT_D)から黒(P.INK)にする。「受け取る人を待つ」の札の下の帯は今のまま(帯の枠 MINT_D・中 MINT)。 + tag() に帯の枠の色を別に渡せるようにした(bar=(割合, 色, 帯の枠の色))。静止画は still161_…。もとの説明:依頼158(pan157.py の写し:カメラは cams158(寄り4つを足す)、静止画は 18+4。呼ぶ場面と台の前の受け渡しを場面の印とパネルに出す(request_view。見た目だけ): 依頼の印=積む所の台の上の札(白地=ふつう・黒地=至急。数と、いちばん古い依頼の待っている秒)、積む・受け取る人の上の緑の札、 届け先で受け取る人を待っているロボットの上の札(待っている秒と、この便の pickup_wait_s の目安の帯)、人が運んでいる補助者の上の札。 パネルに「呼ぶ・荷物」(道ごとの待っている荷物の数・いちばん古い依頼の待っている秒、いま積んでいる・受け取りを待つ・受け取っている、運んでいる荷物の数)。 @@ -204,7 +205,7 @@ def tag(d, at, text, fill, ink, edge, fnt, bar=None): - """場面の札(at=画素の点の上に、下向きの三角を付けて置く)。bar=(割合, 色):札の下の帯""" + """場面の札(at=画素の点の上に、下向きの三角を付けて置く)。bar=(割合, 色, 帯の枠の色):札の下の帯(依頼161:帯の枠は札の枠と別の色)""" if at is None: return tw = d.textlength(text, font=fnt) x, y = at @@ -214,9 +215,9 @@ d.rounded_rectangle(box, radius=7, fill=fill, outline=edge, width=3) d.text((x, (box[1] + box[3]) / 2), text, font=fnt, fill=ink, anchor="mm") if bar is not None: - fr, col = bar + fr, col, bedge = bar bx = [box[0], box[3] + 3, box[2], box[3] + 11] - d.rectangle(bx, fill=(230, 228, 224), outline=edge, width=1) + d.rectangle(bx, fill=(230, 228, 224), outline=bedge, width=1) d.rectangle([bx[0], bx[1], bx[0] + (bx[2] - bx[0]) * max(0.0, min(1.0, fr)), bx[3]], fill=col) @@ -242,20 +243,20 @@ if row.get("hand_x"): hp = cam.px(float(row["hand_x"]), float(row["hand_z"]), 1.9) lab = {"積んでいる": "積んでいる", "積む人が台で待つ": "積む人(ロボットを待つ)", "受け取りを待つ": "受け取りに向かう", "受け取っている": "受け取っている"}.get(h, h) - if lab: tag(d, hp, lab, MINT, P.WHITE, MINT_D, fn) + if lab: tag(d, hp, lab, MINT, P.WHITE, P.INK, fn) # 依頼161:札の枠は黒 if h == "受け取りを待つ": rp = cam.px(float(row["robot_x"]), float(row["robot_z"]), 1.3) w_s, pw = float(row["hand_wait_s"]), float(row["hand_pw_s"]) - tag(d, rp, "受け取る人を待つ %d秒(目安 %d秒)" % (int(w_s), int(round(pw))), P.WHITE, P.INK, MINT_D, fn, bar=(w_s / max(pw, 1.0), MINT)) + tag(d, rp, "受け取る人を待つ %d秒(目安 %d秒)" % (int(w_s), int(round(pw))), P.WHITE, P.INK, P.INK, fn, bar=(w_s / max(pw, 1.0), MINT, MINT_D)) # 依頼161:札の枠は黒・帯は緑のまま elif h in ("積んでいる", "受け取っている"): rp = cam.px(float(row["robot_x"]), float(row["robot_z"]), 1.3) - tag(d, rp, "荷物 %s 個" % row.get("hand_items", "?"), P.WHITE, P.INK, MINT_D, fn) + tag(d, rp, "荷物 %s 個" % row.get("hand_items", "?"), P.WHITE, P.INK, P.INK, fn) elif row["leg_dir"] == "行き" and row["trip_no"] not in ("", "0"): rp = cam.px(float(row["robot_x"]), float(row["robot_z"]), 1.3) - tag(d, rp, "荷物 %s 個" % D["items"].get(row["trip_no"], "?"), P.WHITE, P.INK, MINT_D, fn) + tag(d, rp, "荷物 %s 個" % D["items"].get(row["trip_no"], "?"), P.WHITE, P.INK, P.INK, fn) if row.get("carry_x"): cp = cam.px(float(row["carry_x"]), float(row["carry_z"]), 1.9) - tag(d, cp, "人が運んでいる" if not row["carry_walk"].endswith("r") else "人が運ぶ(受け取りへ)", MINT, P.WHITE, MINT_D, fn) + tag(d, cp, "人が運んでいる" if not row["carry_walk"].endswith("r") else "人が運ぶ(受け取りへ)", MINT, P.WHITE, P.INK, fn) def stage(row, D, t, tn): @@ -399,7 +400,7 @@ legend_bottom(im) panel(im, r, D["ev"], t, 0.0, "7時30分からの1日の問題", CAMJA[cam], D["summ"], wide, D) P_banner(im, "%s %s" % (P.clock(t), CAMJA[cam].split("・")[0] + "・" + CAMJA[cam].split("・")[1] if "・" in CAMJA[cam] else CAMJA[cam]), what) - f = os.path.join(out, "still158_%s.png" % cam) + f = os.path.join(out, "still161_%s.png" % cam) im.save(f) return f, t @@ -441,7 +442,7 @@ dst = sys.argv[4] nproc = int(sys.argv[5]) if len(sys.argv) > 5 else 8 n = len(load(run, cam)["rows"]) - tmp = tempfile.mkdtemp(prefix="pan158_", dir=os.path.dirname(os.path.abspath(dst))) + tmp = tempfile.mkdtemp(prefix="pan161_", dir=os.path.dirname(os.path.abspath(dst))) k = max(1, math.ceil(n / (nproc * 4))) jobs = [(run, cam, lo, min(n, lo + k), os.path.join(tmp, "s%04d.mp4" % (lo // k))) for lo in range(0, n, k)] with Pool(nproc) as pool: