43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import {
|
|
createDefaultExternalCsvConfiguration,
|
|
type ExternalCsvColumnMapping,
|
|
} from "../../src/external-model/csv/external-csv-contracts.js";
|
|
|
|
export const externalCsvTestColumns: ExternalCsvColumnMapping = {
|
|
ifcGuid: "IfcGUID",
|
|
roomNumber: "Raumnummer",
|
|
roomName: "Raumname",
|
|
familyAndType: "Familie und Typ",
|
|
selectionMarker: "CAx_Auswahlkenner",
|
|
circuitIdentifier: "Stromkreis",
|
|
power: "Elektrische Leistung",
|
|
quantity: "Anzahl",
|
|
};
|
|
|
|
export const externalCsvTestConfiguration =
|
|
createDefaultExternalCsvConfiguration(externalCsvTestColumns);
|
|
|
|
export const firstIfcGuid = "0AbCdEfGhIjKlMnOpQrStu";
|
|
export const secondIfcGuid = "1AbCdEfGhIjKlMnOpQrStu";
|
|
|
|
export const quotedRevitCsv = [
|
|
'"Projekt-Export";"";"";"";"";"";"";""',
|
|
'"Stromkreis";"Raumnummer";"Raumname";"Familie und Typ";"CAx_Auswahlkenner";"Elektrische Leistung";"Anzahl";"IfcGUID"',
|
|
'"";"";"";"";"";"";"";""',
|
|
`"UV_AV_01-2F1";"01/101";"Technik";"Steckdose: Doppelsteckdose";"Arbeitsplatz";"120,5";"2";"${firstIfcGuid}"`,
|
|
'"UV_AV_01-2F1: 2";"";"";"";"";"";"";""',
|
|
'"";"01/102";"Büro";"Steckdose: Standard";"Arbeitsplatz";"100";"1";""',
|
|
`"";"01/103";"Büro \"\"Nord\"\"";"Steckdose: Standard";"Arbeitsplatz";"100";"1";"${secondIfcGuid}"`,
|
|
].join("\r\n") + "\r\n";
|
|
|
|
export function utf8Bytes(value: string, withBom = false) {
|
|
const encoded = new TextEncoder().encode(value);
|
|
if (!withBom) {
|
|
return encoded;
|
|
}
|
|
const result = new Uint8Array(encoded.length + 3);
|
|
result.set([0xef, 0xbb, 0xbf]);
|
|
result.set(encoded, 3);
|
|
return result;
|
|
}
|