Repository Public
1#!/usr/bin/env bash2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : Vrai-Prix iOS8# File : Scripts/frames.sh9# Description : planche du geste « d'aplomb » figé à plusieurs instants10# (arguments de lancement, aucun pilotage). usage :11# frames.sh <préfixe> <clair|sombre> <destination VPOpen>12# [arguments…] (TIMES="300 600 …")13# Module : Scripts14# Repository : https://git.spboucher.ai/vrai-prix-ios-v315# Project Website : https://www.vrai-prix.com16# Created : 2026-11-2617# Last Modified : 2026-11-2618#19# Author : Simon-Pierre Boucher20# Position : Professor of Finance21# Institution : Université du Québec en Outaouais (UQO)22# Organization : SP Boucher23# Website : https://spboucher.ai24# Git : https://git.spboucher.ai25#26# Preferred Contact: support@spboucher.ai27# Technical Contact: dev@spboucher.ai28# Security/Admin : admin@spboucher.ai29#30# Copyright (c) 202631# Simon-Pierre Boucher32# All rights reserved where applicable. This file is governed by the33# applicable project license, copyright notices and relevant law.34# Existing third-party rights and notices remain unaffected.35#36# License : None specified (no license file in this repository)37#38# Do not embed credentials, private keys, access tokens,39# certificates or confidential personal information.40#41# =============================================================================42# END OF SP BOUCHER SOURCE HEADER43# =============================================================================4445set -uo pipefail46cd "$(dirname "$0")/.."47P="$1"; MODE="$2"; OPEN="$3"; shift 348SIM="${VRAIPRIX_SIM:-VraiPrix v2 iPhone}"49U="$(xcrun simctl list devices | grep -F "$SIM (" | head -1 | sed -E 's/.*\(([0-9A-F-]{36})\).*/\1/')"50xcrun simctl ui "$U" appearance "$([ "$MODE" = clair ] && echo light || echo dark)"51FILES=()52for T in ${TIMES:-300 520 700 900 1100 1300 1500 1660 1760 1850}; do53 VRAIPRIX_SIM="$SIM" Scripts/build.sh run -VPInMemory YES -VPOpen "$OPEN" -VPPlumbT "$T" -appearance "$([ "$MODE" = clair ] && echo light || echo dark)" "$@" >/dev/null 2>&154 sleep "${WAIT:-6}"55 xcrun simctl io "$U" screenshot "build/shots/$P-$T.png" >/dev/null 2>&156 FILES+=("build/shots/$P-$T.png")57done58# planche : toutes les images côte à côte59python3 - "$P" "${FILES[@]}" <<'PY'60import sys61from PIL import Image, ImageDraw62p, files = sys.argv[1], sys.argv[2:]63ims = [Image.open(f).convert("RGB") for f in files]64w = 360; ims = [i.resize((w, int(i.height * w / i.width))) for i in ims]65cols = 5; rows = (len(ims) + cols - 1) // cols; h = ims[0].height66sheet = Image.new("RGB", (cols * (w + 8) + 8, rows * (h + 8) + 8), (128, 128, 128))67for k, im in enumerate(ims):68 x, y = 8 + (k % cols) * (w + 8), 8 + (k // cols) * (h + 8)69 sheet.paste(im, (x, y))70 d = ImageDraw.Draw(sheet); t = files[k].rsplit("-", 1)[1].replace(".png", " ms")71 d.rectangle([x, y, x + 78, y + 20], fill=(0, 0, 0)); d.text((x + 6, y + 4), t, fill=(255, 255, 255))72sheet.save(f"build/shots/{p}-planche.png"); print(f"build/shots/{p}-planche.png")73PY74