🚀 Auto-deploy: BrainWind atualizado em 15/07/2026 21:36:38
This commit is contained in:
Binary file not shown.
+21
-1
@@ -11,10 +11,11 @@ import DynamicsModule from './pages/DynamicsModule';
|
||||
import SettingsModule from './pages/SettingsModule';
|
||||
import TowerModule from './pages/TowerModule';
|
||||
import PiperackModule from './pages/PiperackModule';
|
||||
import CertificatePage from './pages/CertificatePage';
|
||||
import {
|
||||
Home, Settings, Menu, Cylinder, Church, CircleDot,
|
||||
Square, Layers, BarChart3, Activity, Warehouse,
|
||||
Settings2, Sun, Moon, Frame, FolderOpen, BookOpen, MoreVertical, Info
|
||||
Settings2, Sun, Moon, Frame, FolderOpen, BookOpen, MoreVertical, Info, ShieldCheck
|
||||
} from 'lucide-react';
|
||||
import {
|
||||
DropdownMenu,
|
||||
@@ -211,6 +212,19 @@ function AppLayout({ children }: { children: React.ReactNode }) {
|
||||
</Link>
|
||||
|
||||
<TermsOfUseDialog isCollapsed={isCollapsed} />
|
||||
|
||||
<Link
|
||||
to="/certificado"
|
||||
className={cn(
|
||||
'flex items-center gap-3 px-3 py-2.5 rounded-md transition-colors text-sm w-full cursor-pointer mt-1 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-950/50',
|
||||
location.pathname === '/certificado' && 'bg-emerald-100 dark:bg-emerald-900/50 font-medium shadow-sm',
|
||||
isCollapsed && 'justify-center px-0'
|
||||
)}
|
||||
title={isCollapsed ? 'Certificado' : undefined}
|
||||
>
|
||||
<ShieldCheck className="w-5 h-5 shrink-0" />
|
||||
{!isCollapsed && <span>Certificado de Fidelidade</span>}
|
||||
</Link>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -267,6 +281,11 @@ function AppLayout({ children }: { children: React.ReactNode }) {
|
||||
<Info className="w-4 h-4" /> Termos de Uso
|
||||
</DropdownMenuItem>
|
||||
} />
|
||||
<DropdownMenuItem asChild>
|
||||
<Link to="/certificado" className="cursor-pointer gap-2 text-emerald-600 dark:text-emerald-400 focus:text-emerald-700 dark:focus:text-emerald-300">
|
||||
<ShieldCheck className="w-4 h-4" /> Certificado
|
||||
</Link>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
</div>
|
||||
@@ -403,6 +422,7 @@ function App() {
|
||||
<Route path="/piperack" element={<PiperackModule />} />
|
||||
<Route path="/dinamica" element={<DynamicsModule />} />
|
||||
<Route path="/settings" element={<SettingsModule />} />
|
||||
<Route path="/certificado" element={<CertificatePage />} />
|
||||
</Routes>
|
||||
</AppLayout>
|
||||
</BrowserRouter>
|
||||
|
||||
@@ -11,7 +11,8 @@ import {
|
||||
SelectValue,
|
||||
} from '@/components/ui/select';
|
||||
import { Play, FileDown, Loader2, AlertCircle } from 'lucide-react';
|
||||
import type { AuditConfig, AuditScenario, ScenarioResult, AuditReport } from '@/lib/audit/types';
|
||||
import type { AuditConfig, AuditScenario, ScenarioResult, AuditReport, ModuleType } from '@/lib/audit/types';
|
||||
import { MODULE_LABELS } from '@/lib/audit/types';
|
||||
import { generateAllScenarios } from '@/lib/audit/scenarios';
|
||||
import AuditDetailPopup from './AuditDetailPopup';
|
||||
|
||||
@@ -33,11 +34,12 @@ const DEFAULT_MODELS: Record<string, string> = {
|
||||
|
||||
export default function AuditPanel() {
|
||||
|
||||
const [config, setConfig] = useState<AuditConfig>({
|
||||
const [config, setConfig] = useState<AuditConfig & { testScope?: string }>({
|
||||
provider: 'openai',
|
||||
model: 'gpt-4o',
|
||||
apiKey: '',
|
||||
baseUrl: '',
|
||||
testScope: 'all',
|
||||
});
|
||||
|
||||
const [status, setStatus] = useState<'idle' | 'generating' | 'running' | 'done' | 'error'>('idle');
|
||||
@@ -51,6 +53,10 @@ export default function AuditPanel() {
|
||||
const [selectedScenario, setSelectedScenario] = useState<AuditScenario | null>(null);
|
||||
const [selectedResult, setSelectedResult] = useState<ScenarioResult | null>(null);
|
||||
|
||||
const allScenarios = useRef(generateAllScenarios()).current;
|
||||
|
||||
const [checkedScenarioIds, setCheckedScenarioIds] = useState<string[]>([]);
|
||||
|
||||
const handleProviderChange = (val: string) => {
|
||||
setConfig((c) => ({
|
||||
...c,
|
||||
@@ -59,6 +65,16 @@ export default function AuditPanel() {
|
||||
}));
|
||||
};
|
||||
|
||||
const handleScopeChange = (val: string) => {
|
||||
setConfig((c) => ({ ...c, testScope: val }));
|
||||
if (val !== 'all') {
|
||||
const ids = allScenarios.filter(s => s.module === val).map(s => s.id);
|
||||
setCheckedScenarioIds(ids);
|
||||
} else {
|
||||
setCheckedScenarioIds([]);
|
||||
}
|
||||
};
|
||||
|
||||
const handleRun = useCallback(async () => {
|
||||
if (!config.apiKey && config.provider !== 'ollama') {
|
||||
setError('Informe uma API key para continuar.');
|
||||
@@ -74,7 +90,10 @@ export default function AuditPanel() {
|
||||
setProgress(0);
|
||||
|
||||
setStatus('generating');
|
||||
const scenarios = generateAllScenarios();
|
||||
let scenarios = generateAllScenarios();
|
||||
if (config.testScope && config.testScope !== 'all') {
|
||||
scenarios = scenarios.filter(s => s.module === config.testScope && checkedScenarioIds.includes(s.id));
|
||||
}
|
||||
setTotal(scenarios.length);
|
||||
|
||||
setStatus('running');
|
||||
@@ -103,7 +122,7 @@ export default function AuditPanel() {
|
||||
setError(e instanceof Error ? e.message : 'Erro desconhecido');
|
||||
setStatus('error');
|
||||
}
|
||||
}, [config]);
|
||||
}, [config, checkedScenarioIds]);
|
||||
|
||||
const handleExportPDF = () => {
|
||||
if (!report) return;
|
||||
@@ -170,8 +189,71 @@ export default function AuditPanel() {
|
||||
placeholder={config.provider === 'openrouter' ? 'https://openrouter.ai/api/v1 (padrão)' : config.provider === 'minimax' ? 'https://api.minimax.io/v1 (padrão)' : config.provider === 'ollama' ? 'http://localhost:11434 (padrão)' : 'https://api.openai.com/v1'}
|
||||
/>
|
||||
</div>
|
||||
<div className="space-y-1.5 sm:col-span-2">
|
||||
<label className="text-sm font-medium">Escopo do Teste</label>
|
||||
<Select value={config.testScope} onValueChange={handleScopeChange}>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="all">Todos os Cenários (100+ testes)</SelectItem>
|
||||
{Object.entries(MODULE_LABELS).map(([key, labels]) => (
|
||||
<SelectItem key={key} value={key}>
|
||||
Apenas módulo: {labels['pt-BR']}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{config.testScope && config.testScope !== 'all' && (
|
||||
<div className="border rounded-md p-3 mt-2 bg-muted/20">
|
||||
<div className="flex items-center justify-between mb-2">
|
||||
<label className="text-sm font-medium">Cenários Específicos ({checkedScenarioIds.length} selecionados)</label>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className="h-6 text-xs"
|
||||
onClick={() => {
|
||||
const allIds = allScenarios.filter(s => s.module === config.testScope).map(s => s.id);
|
||||
if (checkedScenarioIds.length === allIds.length) {
|
||||
setCheckedScenarioIds([]);
|
||||
} else {
|
||||
setCheckedScenarioIds(allIds);
|
||||
}
|
||||
}}
|
||||
>
|
||||
{checkedScenarioIds.length === allScenarios.filter(s => s.module === config.testScope).length ? 'Desmarcar Todos' : 'Marcar Todos'}
|
||||
</Button>
|
||||
</div>
|
||||
<div className="max-h-48 overflow-y-auto space-y-1 pr-2">
|
||||
{allScenarios
|
||||
.filter(s => s.module === config.testScope)
|
||||
.map(s => (
|
||||
<label key={s.id} className="flex items-start gap-2 text-sm p-1.5 hover:bg-muted/50 rounded cursor-pointer">
|
||||
<input
|
||||
type="checkbox"
|
||||
className="mt-0.5 rounded border-gray-300"
|
||||
checked={checkedScenarioIds.includes(s.id)}
|
||||
onChange={(e) => {
|
||||
if (e.target.checked) {
|
||||
setCheckedScenarioIds(prev => [...prev, s.id]);
|
||||
} else {
|
||||
setCheckedScenarioIds(prev => prev.filter(id => id !== s.id));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<div className="flex flex-col">
|
||||
<span className="font-medium">{s.id}</span>
|
||||
<span className="text-xs text-muted-foreground">{s.description}</span>
|
||||
</div>
|
||||
</label>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex items-center gap-2 flex-wrap">
|
||||
<Button
|
||||
onClick={handleRun}
|
||||
@@ -265,7 +347,8 @@ export default function AuditPanel() {
|
||||
const modScenarios = generateAllScenarios().filter((s) => s.module === g.module);
|
||||
const dialog = mod.scenarios[0];
|
||||
if (modScenarios.length > 0 && dialog) {
|
||||
setSelectedScenario(modScenarios[0]);
|
||||
const matchingScenario = modScenarios.find(s => s.id === dialog.scenarioId) || modScenarios[0];
|
||||
setSelectedScenario(matchingScenario);
|
||||
setSelectedResult(dialog);
|
||||
setPopupOpen(true);
|
||||
}
|
||||
|
||||
@@ -24,10 +24,24 @@ export function generateAuditMarkdown(report: AuditReport): string {
|
||||
md += `**Observações da IA:** ${sc.llmNotes}\n\n`;
|
||||
}
|
||||
|
||||
md += `**Raciocínio Matemático (Chain of Thought):**\n`;
|
||||
if (sc.enunciado_problema) {
|
||||
md += `**Enunciado do Problema:**\n> ${sc.enunciado_problema}\n\n`;
|
||||
}
|
||||
if (sc.tabelas_nbr_consultadas) {
|
||||
md += `**Tabelas NBR 6123 Consultadas:**\n> ${sc.tabelas_nbr_consultadas}\n\n`;
|
||||
}
|
||||
|
||||
md += `**Raciocínio Matemático Teórico (Chain of Thought):**\n`;
|
||||
const calcSteps = sc.calculation_steps || 'Sem raciocínio fornecido pela IA.';
|
||||
md += `> ${calcSteps.split('\n').join('\n> ')}\n\n`;
|
||||
|
||||
if (sc.resultado_app) {
|
||||
md += `**Avaliação do Resultado do App:**\n> ${sc.resultado_app}\n\n`;
|
||||
}
|
||||
if (sc.desvio_percentual) {
|
||||
md += `**Desvio Percentual Encontrado:** ${sc.desvio_percentual}\n\n`;
|
||||
}
|
||||
|
||||
md += `**Verificações Individuais:**\n`;
|
||||
for (const chk of sc.checks) {
|
||||
const chkIcon = chk.status === 'PASS' ? '✅' : chk.status === 'WARN' ? '⚠️' : '❌';
|
||||
@@ -48,8 +62,13 @@ export function downloadAuditMarkdown(report: AuditReport) {
|
||||
const blob = new Blob([md], { type: 'text/markdown;charset=utf-8' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
|
||||
const dateStr = new Date(report.timestamp).toLocaleDateString('pt-BR').replace(/\//g, '-');
|
||||
const safeModel = report.model.split('/').pop()?.replace(/[^a-zA-Z0-9_-]/g, '-') || 'LLM';
|
||||
const filename = `Audit-${safeModel}_${dateStr}.md`;
|
||||
|
||||
link.setAttribute('href', url);
|
||||
link.setAttribute('download', `auditoria-${report.id}.md`);
|
||||
link.setAttribute('download', filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Document, Page, Text, View, StyleSheet, pdf } from '@react-pdf/renderer';
|
||||
import { Document, Page, Text, View, StyleSheet, pdf, Image } from '@react-pdf/renderer';
|
||||
import type { AuditReport, ModuleAuditResult, ScenarioResult, CheckStatus } from './types';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
@@ -73,11 +73,16 @@ function AuditReportDocument({ report }: ReportPDFProps) {
|
||||
return (
|
||||
<Document>
|
||||
<Page size="A4" style={styles.page}>
|
||||
<View style={styles.header}>
|
||||
<Text style={styles.title}>Relatório de Auditoria — BrainWind</Text>
|
||||
<Text style={styles.subtitle}>
|
||||
Provedor: {report.provider} ({report.model}) | {new Date(report.timestamp).toLocaleString('pt-BR')}
|
||||
</Text>
|
||||
<View style={[styles.header, { flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }]}>
|
||||
<View>
|
||||
<Text style={styles.title}>Relatório de Auditoria</Text>
|
||||
<Text style={styles.subtitle}>
|
||||
Auditor IA: {report.provider} ({report.model}) | {new Date(report.timestamp).toLocaleString('pt-BR')}
|
||||
</Text>
|
||||
</View>
|
||||
{typeof window !== 'undefined' && window.location && (
|
||||
<Image src={`${window.location.origin}/logo_brainwind.png`} style={{ width: 120, height: 40, objectFit: 'contain' }} />
|
||||
)}
|
||||
</View>
|
||||
|
||||
<View style={styles.section}>
|
||||
@@ -87,15 +92,15 @@ function AuditReportDocument({ report }: ReportPDFProps) {
|
||||
<Text style={styles.summaryValue}>{report.totalScenarios}</Text>
|
||||
</View>
|
||||
<View style={styles.summaryRow}>
|
||||
<Text style={[styles.summaryLabel, { color: '#16a34a' }]}>Pass:</Text>
|
||||
<Text style={[styles.summaryLabel, { color: '#16a34a' }]}>Aprovado:</Text>
|
||||
<Text style={styles.summaryValue}>{report.totalPassed}</Text>
|
||||
</View>
|
||||
<View style={styles.summaryRow}>
|
||||
<Text style={[styles.summaryLabel, { color: '#d97706' }]}>Warn:</Text>
|
||||
<Text style={[styles.summaryLabel, { color: '#d97706' }]}>Atenção:</Text>
|
||||
<Text style={styles.summaryValue}>{report.totalWarnings}</Text>
|
||||
</View>
|
||||
<View style={styles.summaryRow}>
|
||||
<Text style={[styles.summaryLabel, { color: '#dc2626' }]}>Fail:</Text>
|
||||
<Text style={[styles.summaryLabel, { color: '#dc2626' }]}>Falha:</Text>
|
||||
<Text style={styles.summaryValue}>{report.totalFailed}</Text>
|
||||
</View>
|
||||
</View>
|
||||
@@ -103,13 +108,33 @@ function AuditReportDocument({ report }: ReportPDFProps) {
|
||||
{report.modules.map((mod: ModuleAuditResult) => (
|
||||
<View key={mod.module} style={styles.moduleCard}>
|
||||
<Text style={styles.moduleTitle}>
|
||||
{mod.moduleLabel} — {mod.passed}/{mod.totalScenarios} (W:{mod.warnings} F:{mod.failed})
|
||||
{mod.moduleLabel} — {mod.passed}/{mod.totalScenarios} (Alertas: {mod.warnings} | Falhas: {mod.failed})
|
||||
</Text>
|
||||
{mod.scenarios.map((sc: ScenarioResult) => (
|
||||
{mod.scenarios.map((sc: ScenarioResult) => {
|
||||
const summaryTranslated = (sc.summary || '')
|
||||
.replace(/Verdict PASS\.?/gi, 'Veredito: APROVADO.')
|
||||
.replace(/Verdict WARN\.?/gi, 'Veredito: ATENÇÃO.')
|
||||
.replace(/Verdict FAIL\.?/gi, 'Veredito: FALHA.');
|
||||
|
||||
return (
|
||||
<View key={sc.scenarioId} style={styles.scenarioItem}>
|
||||
<Text style={styles.scenarioId}>
|
||||
{sc.scenarioId} — {sc.verdict === 'PASS' ? '✓' : sc.verdict === 'WARN' ? '⚠' : '✗'} {sc.summary}
|
||||
{sc.scenarioId} — {sc.verdict === 'PASS' ? '✓' : sc.verdict === 'WARN' ? '⚠' : '✗'} {summaryTranslated}
|
||||
</Text>
|
||||
{sc.enunciado_problema && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Enunciado: {sc.enunciado_problema}</Text>
|
||||
)}
|
||||
{sc.tabelas_nbr_consultadas && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Tabelas: {sc.tabelas_nbr_consultadas}</Text>
|
||||
)}
|
||||
{sc.resultado_app && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 2 }}>Avaliação do App: {sc.resultado_app}</Text>
|
||||
)}
|
||||
{sc.calculation_steps && (
|
||||
<Text style={{ fontSize: 8, color: '#444', marginBottom: 4, fontStyle: 'italic' }}>
|
||||
CoT: {sc.calculation_steps.substring(0, 300)}{sc.calculation_steps.length > 300 ? '...' : ''}
|
||||
</Text>
|
||||
)}
|
||||
{sc.checks.map((chk, i) => (
|
||||
<View key={i} style={styles.checkRow}>
|
||||
<Text style={[styles.statusBadge, { color: statusColor(chk.status) }]}>{chk.status}</Text>
|
||||
@@ -118,7 +143,8 @@ function AuditReportDocument({ report }: ReportPDFProps) {
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
))}
|
||||
|
||||
@@ -134,8 +160,13 @@ export async function exportAuditReportToPDF(report: AuditReport): Promise<void>
|
||||
const blob = await pdf(<AuditReportDocument report={report} />).toBlob();
|
||||
const url = URL.createObjectURL(blob);
|
||||
const link = document.createElement('a');
|
||||
|
||||
const dateStr = new Date(report.timestamp).toLocaleDateString('pt-BR').replace(/\//g, '-');
|
||||
const safeModel = report.model.split('/').pop()?.replace(/[^a-zA-Z0-9_-]/g, '-') || 'LLM';
|
||||
const filename = `Audit-${safeModel}_${dateStr}.pdf`;
|
||||
|
||||
link.setAttribute('href', url);
|
||||
link.setAttribute('download', `auditoria-${report.id}.pdf`);
|
||||
link.setAttribute('download', filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
|
||||
@@ -80,6 +80,10 @@ export function buildAuditReport(
|
||||
summary: r.summary ?? '',
|
||||
calculation_steps: r.calculation_steps,
|
||||
llmNotes: r.llmNotes,
|
||||
enunciado_problema: r.enunciado_problema,
|
||||
tabelas_nbr_consultadas: r.tabelas_nbr_consultadas,
|
||||
resultado_app: r.resultado_app,
|
||||
desvio_percentual: r.desvio_percentual,
|
||||
});
|
||||
}
|
||||
const modules: ModuleAuditResult[] = [];
|
||||
|
||||
@@ -31,7 +31,11 @@ Retorne EXATAMENTE um JSON válido (sem markdown, sem code blocks) com o seguint
|
||||
"results": [
|
||||
{
|
||||
"scenarioId": "id-do-cenario",
|
||||
"enunciado_problema": "Crie uma descrição didática do cenário simulado (ex: Galpão de 30x15m, ventos a 0°, etc).",
|
||||
"tabelas_nbr_consultadas": "Liste quais tabelas e seções da NBR 6123 você utilizou neste cálculo.",
|
||||
"calculation_steps": "AQUI VOCÊ DEVE DEMONSTRAR A MATEMÁTICA PASSO A PASSO. Ex: Vk = 40 * 1.0 * 1.04 * 1.0 = 41.6. q = 0.613 * (41.6)^2 / 1000 = 1.060. Cpe_A (h/b = 0.5) = -0.8...",
|
||||
"resultado_app": "Resuma se o app acertou ou errou em comparação com o seu cálculo teórico.",
|
||||
"desvio_percentual": "Informe '0%' se os cálculos baterem, ou a porcentagem do erro se houver.",
|
||||
"verdict": "PASS" | "WARN" | "FAIL",
|
||||
"checks": [
|
||||
{
|
||||
|
||||
@@ -91,6 +91,10 @@ export interface ScenarioResult {
|
||||
readonly summary: string;
|
||||
readonly calculation_steps?: string;
|
||||
readonly llmNotes?: string;
|
||||
readonly enunciado_problema?: string;
|
||||
readonly tabelas_nbr_consultadas?: string;
|
||||
readonly resultado_app?: string;
|
||||
readonly desvio_percentual?: string;
|
||||
}
|
||||
|
||||
export interface ModuleAuditResult {
|
||||
@@ -141,4 +145,8 @@ export interface AuditLLMResponse {
|
||||
readonly summary: string;
|
||||
readonly calculation_steps?: string;
|
||||
readonly llmNotes?: string;
|
||||
readonly enunciado_problema?: string;
|
||||
readonly tabelas_nbr_consultadas?: string;
|
||||
readonly resultado_app?: string;
|
||||
readonly desvio_percentual?: string;
|
||||
}
|
||||
|
||||
@@ -69,13 +69,13 @@ export function getWallCpeOfficial(
|
||||
}
|
||||
|
||||
export function getRoofCpeOfficial(
|
||||
_a: number,
|
||||
a: number,
|
||||
b: number,
|
||||
h: number,
|
||||
theta: number,
|
||||
windAngle: 0 | 90 = 0,
|
||||
): RoofCoefficients {
|
||||
return getRoofCpeNBR6123(h, b, theta, windAngle);
|
||||
return getRoofCpeNBR6123(a, b, h, theta, windAngle);
|
||||
}
|
||||
|
||||
export function getShedRoofCpe(theta: number, windAngle: WindAngleT8 = 0) {
|
||||
|
||||
+17
-10
@@ -57,10 +57,10 @@ export function roofArea(a: number, b: number, pitchDeg: number): number {
|
||||
export function calculateFriction(input: FrictionInput): FrictionResult {
|
||||
const { length, width, height, roofPitch, windAngle, roughness, q } = input;
|
||||
|
||||
// l0: comprimento da superfície paralela ao vento
|
||||
// b0: dimensão perpendicular ao vento
|
||||
const l0 = windAngle === 90 ? length : width;
|
||||
const b0 = windAngle === 90 ? width : length;
|
||||
// l0: comprimento da superfície paralela ao vento (profundidade)
|
||||
// b0: dimensão perpendicular ao vento (largura da face frontal)
|
||||
const l0 = windAngle === 90 ? width : length;
|
||||
const b0 = windAngle === 90 ? length : width;
|
||||
|
||||
const ratioLh = l0 / height;
|
||||
const ratioLb = l0 / b0;
|
||||
@@ -71,17 +71,24 @@ export function calculateFriction(input: FrictionInput): FrictionResult {
|
||||
return { applies, roofArea: 0, wallsArea: 0, cf, forceKN: 0 };
|
||||
}
|
||||
|
||||
const ratioH_b0 = height / b0;
|
||||
|
||||
// Áreas das paredes paralelas ao vento
|
||||
const wallsArea = 2 * l0 * height;
|
||||
|
||||
let roofSlant = 0;
|
||||
// A cobertura só é paralela ao vento se o vento soprar ao longo da cumeeira (windAngle = 90)
|
||||
// ou se o telhado for plano (pitch = 0)
|
||||
if (windAngle === 90 || roofPitch === 0) {
|
||||
roofSlant = roofArea(length, width, roofPitch);
|
||||
// Área da cobertura
|
||||
const roofSlant = roofArea(length, width, roofPitch);
|
||||
|
||||
let totalArea = 0;
|
||||
// Conforme NBR 6123 sec. 6.1.5 (interpretação padrão):
|
||||
// h/b0 <= 1: atrito atua na cobertura
|
||||
// h/b0 > 1: atrito atua nas paredes laterais
|
||||
if (ratioH_b0 <= 1) {
|
||||
totalArea = roofSlant;
|
||||
} else {
|
||||
totalArea = wallsArea;
|
||||
}
|
||||
|
||||
const totalArea = roofSlant + wallsArea;
|
||||
const forceKN = cf * q * totalArea;
|
||||
|
||||
return {
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
import { useState } from 'react';
|
||||
import { ShieldCheck, FileText, CheckCircle2, ChevronRight, Download, Bot, FileCheck, X } from 'lucide-react';
|
||||
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from '@/components/ui/card';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DialogClose } from '@/components/ui/dialog';
|
||||
|
||||
const rawLaudos = import.meta.glob('/public/laudos/*.pdf', { eager: true, query: '?url', import: 'default' });
|
||||
const availableLaudos = Object.keys(rawLaudos).map(key => {
|
||||
const filename = key.split('/').pop() || '';
|
||||
const url = (rawLaudos as Record<string, string>)[key];
|
||||
return { filename, url };
|
||||
});
|
||||
|
||||
export default function CertificatePage() {
|
||||
const [laudosOpen, setLaudosOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="p-4 md:p-8 max-w-4xl mx-auto space-y-8 animate-in fade-in duration-500">
|
||||
<div className="flex flex-col md:flex-row items-center gap-6 pb-6 border-b">
|
||||
<div className="bg-emerald-500/10 p-4 rounded-full border border-emerald-500/20">
|
||||
<ShieldCheck className="w-16 h-16 text-emerald-600" />
|
||||
</div>
|
||||
<div className="space-y-2 text-center md:text-left">
|
||||
<h1 className="text-3xl font-bold tracking-tight">Certificado de Fidelidade Matemática</h1>
|
||||
<p className="text-muted-foreground text-lg">
|
||||
Garantia <strong className="text-foreground">incontestável</strong> de conformidade com a NBR 6123:2023, validada por Duplo Fator de Checagem Neural.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section className="space-y-4">
|
||||
<h2 className="text-2xl font-semibold flex items-center gap-2">
|
||||
<CheckCircle2 className="w-6 h-6 text-emerald-600" />
|
||||
Metodologia de Validação Incontestável
|
||||
</h2>
|
||||
<Card className="border-emerald-500/20 shadow-sm">
|
||||
<CardContent className="pt-6 text-muted-foreground space-y-4">
|
||||
<p>
|
||||
A segurança estrutural não admite falhas. Por isso, o motor matemático do BrainWind opera sob um protocolo estrito de <strong>Duplo Fator de Checagem</strong>. Ele não depende apenas de algoritmos tradicionais, mas é submetido à validação contínua por um <strong>Conselho de Inteligências Artificiais de Raciocínio Profundo</strong> (Deep Reasoning LLMs).
|
||||
</p>
|
||||
<p>
|
||||
Durante a auditoria, centenas de cenários físicos complexos são calculados pelo nosso motor determinístico. Simultaneamente, as IAs atuam como <strong>Auditoras Independentes ("Blind Audit")</strong>. Elas recebem apenas o problema físico e as tabelas normativas, deduzindo toda a matemática vetorial passo a passo, aplicando ábacos e impondo limites normativos de forma isolada.
|
||||
</p>
|
||||
<p>
|
||||
O atestado de conformidade só é emitido quando o cruzamento entre o motor do aplicativo e o raciocínio vetorial da IA atinge <strong>100% de convergência (Desvio Zero)</strong>. Este método elimina qualquer sombra de dúvida técnica, garantindo cálculos de ação do vento blindados e incontestáveis.
|
||||
</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</section>
|
||||
|
||||
<section className="space-y-4">
|
||||
<h2 className="text-2xl font-semibold flex items-center gap-2">
|
||||
<Bot className="w-6 h-6 text-blue-600" />
|
||||
Conselho de IAs Avaliadoras
|
||||
</h2>
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
{[
|
||||
{ name: 'MiniMax-M3', desc: 'Matemática e Raciocínio Lógico (MiniMax)' },
|
||||
{ name: 'DeepSeek Reasoner (R1)', desc: 'Inferência Algorítmica (DeepSeek)' },
|
||||
{ name: 'Qwen-Plus / Max', desc: 'Validação Numérica Avançada (Alibaba)' },
|
||||
{ name: 'Gemini 2.0 Thinking', desc: 'Análise Científica e Normativa (Google)' },
|
||||
{ name: 'OpenAI o3-mini', desc: 'Auditoria Cognitiva de Alta Precisão (OpenAI)' }
|
||||
].map(ai => (
|
||||
<Card key={ai.name} className="flex flex-row items-center p-4 gap-4 bg-muted/10 border-border/50">
|
||||
<Bot className="w-8 h-8 text-muted-foreground" />
|
||||
<div>
|
||||
<CardTitle className="text-base">{ai.name}</CardTitle>
|
||||
<CardDescription>{ai.desc}</CardDescription>
|
||||
</div>
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="space-y-4">
|
||||
<h2 className="text-2xl font-semibold flex items-center gap-2">
|
||||
<FileText className="w-6 h-6 text-purple-600" />
|
||||
Transparência Total e Laudos Comprobatórios
|
||||
</h2>
|
||||
<Card className="bg-muted/30 border-border/50">
|
||||
<CardContent className="pt-6">
|
||||
<p className="text-muted-foreground mb-4">
|
||||
Nós repudiamos sistemas "caixa preta". A confiança plena exige rastreabilidade total. Os laudos técnicos de cada auditoria estão disponíveis publicamente, demonstrando a montagem física do cenário, a consulta exata das tabelas da NBR 6123 (Ex: Tabela 3, 6, 13) e a demonstração dedutiva completa (Chain of Thought) atestando a exatidão dos resultados.
|
||||
</p>
|
||||
<Button className="w-full sm:w-auto bg-emerald-600 hover:bg-emerald-700 text-white" onClick={() => setLaudosOpen(true)}>
|
||||
<Download className="w-4 h-4 mr-2" />
|
||||
Acessar Repositório de Auditoria (Laudos PDF)
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</section>
|
||||
|
||||
<Dialog open={laudosOpen} onOpenChange={setLaudosOpen}>
|
||||
<DialogContent className="sm:max-w-[500px]">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<FileCheck className="w-5 h-5 text-emerald-600" />
|
||||
Repositório Oficial de Laudos
|
||||
</DialogTitle>
|
||||
<DialogDescription>
|
||||
Abaixo estão listados os laudos comprobatórios gerados pelo Conselho de IAs. Clique para baixar ou visualizar.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
||||
<div className="py-4 space-y-3 max-h-[60vh] overflow-y-auto pr-2">
|
||||
{availableLaudos.length === 0 ? (
|
||||
<div className="text-center p-8 bg-muted/20 border border-dashed rounded-lg">
|
||||
<FileText className="w-8 h-8 text-muted-foreground/50 mx-auto mb-3" />
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Nenhum laudo encontrado no servidor no momento.
|
||||
</p>
|
||||
<p className="text-xs text-muted-foreground mt-1">
|
||||
Os administradores podem adicionar laudos na pasta <code>/public/laudos/</code> da VPS.
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
availableLaudos.map((laudo, i) => (
|
||||
<div key={i} className="flex items-center justify-between p-3 rounded-md border bg-card hover:bg-muted/30 transition-colors">
|
||||
<div className="flex items-center gap-3 overflow-hidden">
|
||||
<div className="p-2 bg-emerald-100 dark:bg-emerald-900/30 rounded-md shrink-0">
|
||||
<FileText className="w-4 h-4 text-emerald-700 dark:text-emerald-400" />
|
||||
</div>
|
||||
<span className="text-sm font-medium truncate" title={laudo.filename}>
|
||||
{laudo.filename}
|
||||
</span>
|
||||
</div>
|
||||
<Button variant="ghost" size="sm" asChild className="shrink-0 ml-2">
|
||||
<a href={laudo.url} download={laudo.filename} target="_blank" rel="noreferrer">
|
||||
<Download className="w-4 h-4 mr-1.5" />
|
||||
Baixar
|
||||
</a>
|
||||
</Button>
|
||||
</div>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex justify-end pt-2 border-t mt-2">
|
||||
<DialogClose asChild>
|
||||
<Button variant="outline">Fechar</Button>
|
||||
</DialogClose>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user