Remove all vertical (_v) symbol variants from codebase
Users can rotate any symbol manually — the pre-rotated _v variants were redundant. Removed from SYMBOLS array, PRIORITY_TYPES, SPACING_EXEMPT, RECT_CONVEYANCE, OVERLAY_IDS, OUTDATED_SIZES, and all type-check functions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
0f50ab27ae
commit
1f46c89479
@ -173,22 +173,10 @@ async function buildSvgString(): Promise<string> {
|
|||||||
|
|
||||||
// Overlay types render LAST (on top) so they're clickable in SCADA
|
// Overlay types render LAST (on top) so they're clickable in SCADA
|
||||||
const OVERLAY_IDS = new Set([
|
const OVERLAY_IDS = new Set([
|
||||||
'photoeye', 'photoeye_v',
|
'photoeye', 'fio_sio_fioh', 'dpm', 'pdp', 'mcm',
|
||||||
'fio_sio_fioh', 'fio_sio_fioh_v',
|
'beacon', 'solenoid', 'jam_reset', 'start', 'start_stop',
|
||||||
'dpm', 'dpm_v',
|
'chute_enable', 'package_release', 'pressure_sensor',
|
||||||
'pdp', 'pdp_v',
|
'ip_camera', 'diverter', 'epc',
|
||||||
'mcm', 'mcm_v',
|
|
||||||
'beacon', 'beacon_v',
|
|
||||||
'solenoid', 'solenoid_v',
|
|
||||||
'jam_reset', 'jam_reset_v',
|
|
||||||
'start', 'start_v',
|
|
||||||
'start_stop', 'start_stop_v',
|
|
||||||
'chute_enable', 'chute_enable_v',
|
|
||||||
'package_release', 'package_release_v',
|
|
||||||
'pressure_sensor', 'pressure_sensor_v',
|
|
||||||
'ip_camera', 'ip_camera_v',
|
|
||||||
'diverter', 'diverter_v',
|
|
||||||
'epc', 'epc_v',
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const visible = layout.symbols.filter(s => !s.hidden && !layout.hiddenGroups.has(getSymbolGroup(s.symbolId)));
|
const visible = layout.symbols.filter(s => !s.hidden && !layout.hiddenGroups.has(getSymbolGroup(s.symbolId)));
|
||||||
|
|||||||
@ -6,8 +6,7 @@ const DEFAULT_SIZES = new Map(SYMBOLS.map(s => [s.id, { w: s.w, h: s.h }]));
|
|||||||
|
|
||||||
/** Known outdated defaults: symbolId → [{oldW, oldH}] */
|
/** Known outdated defaults: symbolId → [{oldW, oldH}] */
|
||||||
const OUTDATED_SIZES: Record<string, { w: number; h: number }[]> = {
|
const OUTDATED_SIZES: Record<string, { w: number; h: number }[]> = {
|
||||||
photoeye: [{ w: 56, h: 20 }, { w: 30, h: 14 }],
|
photoeye: [{ w: 56, h: 20 }, { w: 30, h: 14 }],
|
||||||
photoeye_v: [{ w: 56, h: 20 }, { w: 30, h: 14 }],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** JSON shape stored in localStorage / exported JSON files */
|
/** JSON shape stored in localStorage / exported JSON files */
|
||||||
|
|||||||
@ -5,7 +5,6 @@ export { EPC_CONFIG, INDUCTION_CONFIG, CURVE_CONFIG, PHOTOEYE_CONFIG, EXTENDO_CO
|
|||||||
export const SYMBOLS: SymbolDef[] = [
|
export const SYMBOLS: SymbolDef[] = [
|
||||||
// --- Conveyance > Conveyor ---
|
// --- Conveyance > Conveyor ---
|
||||||
{ id: 'conveyor', name: 'Conveyor', file: '/symbols/conveyor.svg', w: 154, h: 30, group: 'Conveyance', subgroup: 'Conveyor' },
|
{ id: 'conveyor', name: 'Conveyor', file: '/symbols/conveyor.svg', w: 154, h: 30, group: 'Conveyance', subgroup: 'Conveyor' },
|
||||||
{ id: 'conveyor_v', name: 'Conveyor (V)', file: '/symbols/conveyor.svg', w: 154, h: 30, defaultRotation: 90, group: 'Conveyance', subgroup: 'Conveyor' },
|
|
||||||
{ id: 'curved_conv_30', name: 'Curve 30\u00B0', file: '/symbols/curved_conveyor_30.svg', w: 154, h: 154, group: 'Conveyance', subgroup: 'Conveyor', curveAngle: 30 },
|
{ id: 'curved_conv_30', name: 'Curve 30\u00B0', file: '/symbols/curved_conveyor_30.svg', w: 154, h: 154, group: 'Conveyance', subgroup: 'Conveyor', curveAngle: 30 },
|
||||||
{ id: 'curved_conv_45', name: 'Curve 45\u00B0', file: '/symbols/curved_conveyor_45.svg', w: 154, h: 154, group: 'Conveyance', subgroup: 'Conveyor', curveAngle: 45 },
|
{ id: 'curved_conv_45', name: 'Curve 45\u00B0', file: '/symbols/curved_conveyor_45.svg', w: 154, h: 154, group: 'Conveyance', subgroup: 'Conveyor', curveAngle: 45 },
|
||||||
{ id: 'curved_conv_60', name: 'Curve 60\u00B0', file: '/symbols/curved_conveyor_60.svg', w: 154, h: 154, group: 'Conveyance', subgroup: 'Conveyor', curveAngle: 60 },
|
{ id: 'curved_conv_60', name: 'Curve 60\u00B0', file: '/symbols/curved_conveyor_60.svg', w: 154, h: 154, group: 'Conveyance', subgroup: 'Conveyor', curveAngle: 60 },
|
||||||
@ -13,9 +12,7 @@ export const SYMBOLS: SymbolDef[] = [
|
|||||||
|
|
||||||
// --- Conveyance > Chute ---
|
// --- Conveyance > Chute ---
|
||||||
{ id: 'chute', name: 'Chute', file: '/symbols/chute.svg', w: 68, h: 30, group: 'Conveyance', subgroup: 'Chute' },
|
{ id: 'chute', name: 'Chute', file: '/symbols/chute.svg', w: 68, h: 30, group: 'Conveyance', subgroup: 'Chute' },
|
||||||
{ id: 'chute_v', name: 'Chute (V)', file: '/symbols/chute.svg', w: 68, h: 30, defaultRotation: 90, group: 'Conveyance', subgroup: 'Chute' },
|
|
||||||
{ id: 'tipper', name: 'Tipper', file: '/symbols/tipper.svg', w: 68, h: 30, group: 'Conveyance', subgroup: 'Chute' },
|
{ id: 'tipper', name: 'Tipper', file: '/symbols/tipper.svg', w: 68, h: 30, group: 'Conveyance', subgroup: 'Chute' },
|
||||||
{ id: 'tipper_v', name: 'Tipper (V)', file: '/symbols/tipper.svg', w: 68, h: 30, defaultRotation: 90, group: 'Conveyance', subgroup: 'Chute' },
|
|
||||||
{ id: 'curved_chute_30', name: 'C.Chute 30\u00B0', file: '/symbols/curved_chute_30.svg', w: 100, h: 100, group: 'Conveyance', subgroup: 'Chute', curveAngle: 30 },
|
{ id: 'curved_chute_30', name: 'C.Chute 30\u00B0', file: '/symbols/curved_chute_30.svg', w: 100, h: 100, group: 'Conveyance', subgroup: 'Chute', curveAngle: 30 },
|
||||||
{ id: 'curved_chute_45', name: 'C.Chute 45\u00B0', file: '/symbols/curved_chute_45.svg', w: 100, h: 100, group: 'Conveyance', subgroup: 'Chute', curveAngle: 45 },
|
{ id: 'curved_chute_45', name: 'C.Chute 45\u00B0', file: '/symbols/curved_chute_45.svg', w: 100, h: 100, group: 'Conveyance', subgroup: 'Chute', curveAngle: 45 },
|
||||||
{ id: 'curved_chute_60', name: 'C.Chute 60\u00B0', file: '/symbols/curved_chute_60.svg', w: 100, h: 100, group: 'Conveyance', subgroup: 'Chute', curveAngle: 60 },
|
{ id: 'curved_chute_60', name: 'C.Chute 60\u00B0', file: '/symbols/curved_chute_60.svg', w: 100, h: 100, group: 'Conveyance', subgroup: 'Chute', curveAngle: 60 },
|
||||||
@ -23,51 +20,32 @@ export const SYMBOLS: SymbolDef[] = [
|
|||||||
|
|
||||||
// --- Conveyance > Other ---
|
// --- Conveyance > Other ---
|
||||||
{ id: 'spur', name: 'Spur', file: '/symbols/spur.svg', w: 80, h: 30, w2: 40, group: 'Conveyance', subgroup: 'Other' },
|
{ id: 'spur', name: 'Spur', file: '/symbols/spur.svg', w: 80, h: 30, w2: 40, group: 'Conveyance', subgroup: 'Other' },
|
||||||
{ id: 'spur_v', name: 'Spur (V)', file: '/symbols/spur.svg', w: 80, h: 30, w2: 40, defaultRotation: 90, group: 'Conveyance', subgroup: 'Other' },
|
|
||||||
{ id: 'extendo', name: 'Extendo', file: '/symbols/extendo.svg', w: 73, h: 54, group: 'Conveyance', subgroup: 'Other' },
|
{ id: 'extendo', name: 'Extendo', file: '/symbols/extendo.svg', w: 73, h: 54, group: 'Conveyance', subgroup: 'Other' },
|
||||||
{ id: 'extendo_v', name: 'Extendo (V)', file: '/symbols/extendo.svg', w: 73, h: 54, defaultRotation: 90, group: 'Conveyance', subgroup: 'Other' },
|
|
||||||
{ id: 'induction', name: 'Induction', file: '/symbols/induction.svg', w: 154, h: 75, group: 'Conveyance', subgroup: 'Other' },
|
{ id: 'induction', name: 'Induction', file: '/symbols/induction.svg', w: 154, h: 75, group: 'Conveyance', subgroup: 'Other' },
|
||||||
{ id: 'induction_v', name: 'Induction (V)', file: '/symbols/induction.svg', w: 154, h: 75, defaultRotation: 90, group: 'Conveyance', subgroup: 'Other' },
|
|
||||||
{ id: 'diverter', name: 'Diverter', file: '/symbols/diverter.svg', w: 31, h: 20, group: 'Conveyance', subgroup: 'Other' },
|
{ id: 'diverter', name: 'Diverter', file: '/symbols/diverter.svg', w: 31, h: 20, group: 'Conveyance', subgroup: 'Other' },
|
||||||
{ id: 'diverter_v', name: 'Diverter (V)', file: '/symbols/diverter.svg', w: 31, h: 20, defaultRotation: 90, group: 'Conveyance', subgroup: 'Other' },
|
|
||||||
|
|
||||||
// --- I/O Modules ---
|
// --- I/O Modules ---
|
||||||
{ id: 'fio_sio_fioh', name: 'FIO/SIO/FIOH', file: '/symbols/fio_sio_fioh.svg', w: 14, h: 20, group: 'I/O Modules' },
|
{ id: 'fio_sio_fioh', name: 'FIO/SIO/FIOH', file: '/symbols/fio_sio_fioh.svg', w: 14, h: 20, group: 'I/O Modules' },
|
||||||
{ id: 'fio_sio_fioh_v', name: 'FIO/SIO/FIOH (V)', file: '/symbols/fio_sio_fioh.svg', w: 14, h: 20, defaultRotation: 90, group: 'I/O Modules' },
|
|
||||||
|
|
||||||
// --- Sensors ---
|
// --- Sensors ---
|
||||||
{ id: 'photoeye', name: 'Photoeye', file: '/symbols/photoeye.svg', w: 46, h: 14, group: 'Sensors' },
|
{ id: 'photoeye', name: 'Photoeye', file: '/symbols/photoeye.svg', w: 46, h: 14, group: 'Sensors' },
|
||||||
{ id: 'photoeye_v', name: 'Photoeye (V)', file: '/symbols/photoeye.svg', w: 46, h: 14, defaultRotation: 90, group: 'Sensors' },
|
|
||||||
{ id: 'pressure_sensor', name: 'Pressure Sensor', file: '/symbols/pressure_sensor.svg', w: 20, h: 20, group: 'Sensors' },
|
{ id: 'pressure_sensor', name: 'Pressure Sensor', file: '/symbols/pressure_sensor.svg', w: 20, h: 20, group: 'Sensors' },
|
||||||
{ id: 'pressure_sensor_v', name: 'Pressure Sensor (V)', file: '/symbols/pressure_sensor.svg', w: 20, h: 20, defaultRotation: 90, group: 'Sensors' },
|
|
||||||
|
|
||||||
// --- Controls ---
|
// --- Controls ---
|
||||||
{ id: 'jam_reset', name: 'Jam Reset (JR)', file: '/symbols/jam_reset.svg', w: 20, h: 20, group: 'Controls' },
|
{ id: 'jam_reset', name: 'Jam Reset (JR)', file: '/symbols/jam_reset.svg', w: 20, h: 20, group: 'Controls' },
|
||||||
{ id: 'jam_reset_v', name: 'Jam Reset (V)', file: '/symbols/jam_reset.svg', w: 20, h: 20, defaultRotation: 90, group: 'Controls' },
|
|
||||||
{ id: 'start', name: 'Start (S)', file: '/symbols/start.svg', w: 20, h: 20, group: 'Controls' },
|
{ id: 'start', name: 'Start (S)', file: '/symbols/start.svg', w: 20, h: 20, group: 'Controls' },
|
||||||
{ id: 'start_v', name: 'Start (V)', file: '/symbols/start.svg', w: 20, h: 20, defaultRotation: 90, group: 'Controls' },
|
|
||||||
{ id: 'start_stop', name: 'Start Stop (SS)', file: '/symbols/start_stop.svg', w: 40, h: 20, group: 'Controls' },
|
{ id: 'start_stop', name: 'Start Stop (SS)', file: '/symbols/start_stop.svg', w: 40, h: 20, group: 'Controls' },
|
||||||
{ id: 'start_stop_v', name: 'Start Stop (V)', file: '/symbols/start_stop.svg', w: 40, h: 20, defaultRotation: 90, group: 'Controls' },
|
|
||||||
{ id: 'chute_enable', name: 'Chute Enable', file: '/symbols/chute_enable.svg', w: 20, h: 20, group: 'Controls' },
|
{ id: 'chute_enable', name: 'Chute Enable', file: '/symbols/chute_enable.svg', w: 20, h: 20, group: 'Controls' },
|
||||||
{ id: 'chute_enable_v', name: 'Chute Enable (V)', file: '/symbols/chute_enable.svg', w: 20, h: 20, defaultRotation: 90, group: 'Controls' },
|
|
||||||
{ id: 'package_release', name: 'Package Release', file: '/symbols/package_release.svg', w: 20, h: 20, group: 'Controls' },
|
{ id: 'package_release', name: 'Package Release', file: '/symbols/package_release.svg', w: 20, h: 20, group: 'Controls' },
|
||||||
{ id: 'package_release_v', name: 'Package Release (V)', file: '/symbols/package_release.svg', w: 20, h: 20, defaultRotation: 90, group: 'Controls' },
|
|
||||||
{ id: 'beacon', name: 'Beacon', file: '/symbols/beacon.svg', w: 20, h: 20, group: 'Controls' },
|
{ id: 'beacon', name: 'Beacon', file: '/symbols/beacon.svg', w: 20, h: 20, group: 'Controls' },
|
||||||
{ id: 'beacon_v', name: 'Beacon (V)', file: '/symbols/beacon.svg', w: 20, h: 20, defaultRotation: 90, group: 'Controls' },
|
|
||||||
{ id: 'solenoid', name: '[SOL]', file: '/symbols/solenoid.svg', w: 20, h: 20, group: 'Controls' },
|
{ id: 'solenoid', name: '[SOL]', file: '/symbols/solenoid.svg', w: 20, h: 20, group: 'Controls' },
|
||||||
{ id: 'solenoid_v', name: '[SOL] (V)', file: '/symbols/solenoid.svg', w: 20, h: 20, defaultRotation: 90, group: 'Controls' },
|
|
||||||
|
|
||||||
// --- Other ---
|
// --- Other ---
|
||||||
{ id: 'pdp', name: 'PDP', file: '/symbols/pdp.svg', w: 20, h: 20, group: 'Other' },
|
{ id: 'pdp', name: 'PDP', file: '/symbols/pdp.svg', w: 20, h: 20, group: 'Other' },
|
||||||
{ id: 'pdp_v', name: 'PDP (V)', file: '/symbols/pdp.svg', w: 20, h: 20, defaultRotation: 90, group: 'Other' },
|
|
||||||
{ id: 'dpm', name: 'DPM', file: '/symbols/dpm.svg', w: 35, h: 20, group: 'Other' },
|
{ id: 'dpm', name: 'DPM', file: '/symbols/dpm.svg', w: 35, h: 20, group: 'Other' },
|
||||||
{ id: 'dpm_v', name: 'DPM (V)', file: '/symbols/dpm.svg', w: 35, h: 20, defaultRotation: 90, group: 'Other' },
|
|
||||||
{ id: 'mcm', name: 'MCM', file: '/symbols/mcm.svg', w: 60, h: 20, group: 'Other' },
|
{ id: 'mcm', name: 'MCM', file: '/symbols/mcm.svg', w: 60, h: 20, group: 'Other' },
|
||||||
{ id: 'mcm_v', name: 'MCM (V)', file: '/symbols/mcm.svg', w: 60, h: 20, defaultRotation: 90, group: 'Other' },
|
|
||||||
{ id: 'epc', name: 'EPC', file: '/symbols/epc.svg', w: 67, h: 20, group: 'Other' },
|
{ id: 'epc', name: 'EPC', file: '/symbols/epc.svg', w: 67, h: 20, group: 'Other' },
|
||||||
{ id: 'epc_v', name: 'EPC (V)', file: '/symbols/epc.svg', w: 67, h: 20, defaultRotation: 90, group: 'Other' },
|
|
||||||
{ id: 'ip_camera', name: 'IP Camera', file: '/symbols/ip_camera.svg', w: 20, h: 20, group: 'Other' },
|
{ id: 'ip_camera', name: 'IP Camera', file: '/symbols/ip_camera.svg', w: 20, h: 20, group: 'Other' },
|
||||||
{ id: 'ip_camera_v', name: 'IP Camera (V)', file: '/symbols/ip_camera.svg', w: 20, h: 20, defaultRotation: 90, group: 'Other' },
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const SYMBOL_GROUPS = [...new Set(SYMBOLS.map(s => s.group))];
|
export const SYMBOL_GROUPS = [...new Set(SYMBOLS.map(s => s.group))];
|
||||||
@ -78,19 +56,19 @@ export function getSymbolGroup(symbolId: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const PRIORITY_TYPES = new Set([
|
export const PRIORITY_TYPES = new Set([
|
||||||
'conveyor', 'conveyor_v', 'chute', 'chute_v',
|
'conveyor', 'chute',
|
||||||
'tipper', 'tipper_v', 'extendo', 'extendo_v',
|
'tipper', 'extendo',
|
||||||
'induction', 'induction_v',
|
'induction',
|
||||||
'curved_conv_30', 'curved_conv_45', 'curved_conv_60', 'curved_conv_90',
|
'curved_conv_30', 'curved_conv_45', 'curved_conv_60', 'curved_conv_90',
|
||||||
'curved_chute_30', 'curved_chute_45', 'curved_chute_60', 'curved_chute_90',
|
'curved_chute_30', 'curved_chute_45', 'curved_chute_60', 'curved_chute_90',
|
||||||
'spur', 'spur_v',
|
'spur',
|
||||||
'photoeye', 'photoeye_v',
|
'photoeye',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Overlay types: exempt from spacing — can be placed freely on top of anything
|
// Overlay types: exempt from spacing — can be placed freely on top of anything
|
||||||
export const SPACING_EXEMPT = new Set([
|
export const SPACING_EXEMPT = new Set([
|
||||||
'photoeye', 'photoeye_v',
|
'photoeye',
|
||||||
'fio_sio_fioh', 'fio_sio_fioh_v',
|
'fio_sio_fioh',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
@ -151,31 +129,31 @@ export function isCurvedType(symbolId: string): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isSpurType(symbolId: string): boolean {
|
export function isSpurType(symbolId: string): boolean {
|
||||||
return symbolId === 'spur' || symbolId === 'spur_v';
|
return symbolId === 'spur';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isEpcType(symbolId: string): boolean {
|
export function isEpcType(symbolId: string): boolean {
|
||||||
return symbolId === 'epc' || symbolId === 'epc_v';
|
return symbolId === 'epc';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isInductionType(symbolId: string): boolean {
|
export function isInductionType(symbolId: string): boolean {
|
||||||
return symbolId === 'induction' || symbolId === 'induction_v';
|
return symbolId === 'induction';
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPhotoeyeType(symbolId: string): boolean {
|
export function isPhotoeyeType(symbolId: string): boolean {
|
||||||
return symbolId === 'photoeye' || symbolId === 'photoeye_v';
|
return symbolId === 'photoeye';
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Simple rectangular conveyance types drawn programmatically for consistent stroke */
|
/** Simple rectangular conveyance types drawn programmatically for consistent stroke */
|
||||||
const RECT_CONVEYANCE = new Set([
|
const RECT_CONVEYANCE = new Set([
|
||||||
'conveyor', 'conveyor_v', 'chute', 'chute_v', 'tipper', 'tipper_v',
|
'conveyor', 'chute', 'tipper',
|
||||||
]);
|
]);
|
||||||
export function isRectConveyanceType(symbolId: string): boolean {
|
export function isRectConveyanceType(symbolId: string): boolean {
|
||||||
return RECT_CONVEYANCE.has(symbolId);
|
return RECT_CONVEYANCE.has(symbolId);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isExtendoType(symbolId: string): boolean {
|
export function isExtendoType(symbolId: string): boolean {
|
||||||
return symbolId === 'extendo' || symbolId === 'extendo_v';
|
return symbolId === 'extendo';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user