feat(ground): N value per layer row (text, blow count or 타수/관입량 mm)
- StrataRow.nValue: text. "23" is a blow count (0–100), "50/5" a refusal (50 blows for 5 mm, 1–300 mm). Empty means not known yet. - G06 (warning): a malformed N value. Strict, because the values will feed the bearing-capacity and liquefaction checks. - The layer table has an N값 column; the project file checks that the rows are well formed. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7dd59dfc6c
commit
7b5517e312
6 files changed
+100
-5
No files matched your search
@@ -71,3 +71,44 @@ export function validatePileEmbedment(input: PierInput, model: PierModel, issues
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/** N값 as read from the text: a blow count, or a refusal "타수/관입량" with the penetration in mm. */
|
||||
export type NValue = { kind: 'empty' } | { kind: 'n'; n: number } | { kind: 'refusal'; blows: number; mm: number } | { kind: 'invalid' };
|
||||
|
||||
/** Largest blow count and penetration accepted (표준관입시험 의 일반 범위; 연타 한계 50 blows / 300 mm). */
|
||||
export const N_MAX = 100;
|
||||
export const PENETRATION_MAX_MM = 300;
|
||||
|
||||
/** Reads an N value. "" is empty; "23" is 23 blows; "50/5" is 50 blows for 5 mm (관입량 mm). */
|
||||
export function parseNValue(text: string | undefined): NValue {
|
||||
const v = (text ?? '').trim();
|
||||
if (v === '') return { kind: 'empty' };
|
||||
if (/^\d+$/.test(v)) {
|
||||
const n = Number(v);
|
||||
return n <= N_MAX ? { kind: 'n', n } : { kind: 'invalid' };
|
||||
}
|
||||
const m = /^(\d+)\/(\d+)$/.exec(v);
|
||||
if (m) {
|
||||
const blows = Number(m[1]);
|
||||
const mm = Number(m[2]);
|
||||
if (blows >= 1 && blows <= N_MAX && mm >= 1 && mm <= PENETRATION_MAX_MM) return { kind: 'refusal', blows, mm };
|
||||
}
|
||||
return { kind: 'invalid' };
|
||||
}
|
||||
|
||||
/**
|
||||
* G06 (경고): an N value that is not a blow count or a refusal in the accepted range. Empty is allowed.
|
||||
* The values are not used in the calculation yet; they will feed the 지지력 and 액상화 checks, so the format is strict.
|
||||
*/
|
||||
export function validateStrataNValues(input: PierInput, issues: Issue[]): void {
|
||||
(input.strataRows ?? []).forEach((row, i) => {
|
||||
if (parseNValue(row.nValue).kind === 'invalid') {
|
||||
issues.push({
|
||||
code: 'G06',
|
||||
level: 'W',
|
||||
pier: input.name,
|
||||
message: `지층 ${i + 1}행 (${row.name}) N값 "${row.nValue}"의 형식이 맞지 않습니다. 타수(0–${N_MAX}) 또는 "타수/관입량 mm"(예: 50/5)으로 적으세요.`,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user