How to use the node-opcua-factory.getStandartDataTypeFactory function in node-opcua-factory

To help you get started, we’ve selected a few node-opcua-factory examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github node-opcua / node-opcua / packages / node-opcua-client-dynamic-extension-object / source / client_dynamic_extension_object.ts View on Github external
async function extractSchema(session: IBasicSession, nodeId: NodeId): Promise {
    const rawSchemaDataValue = await session.read({ nodeId, attributeId: AttributeIds.Value });
    const rawSchema = rawSchemaDataValue.value.value.toString();

    /* istanbul ignore next */
    if (doDebug) {
        debugLog("---------------------------------------------");
        debugLog(rawSchema.toString());
        debugLog("---------------------------------------------");
    }
    const typeDictionary = await promisify(parseBinaryXSD)(rawSchema, [getStandartDataTypeFactory()]);
    return typeDictionary;
}
github node-opcua / node-opcua / packages / node-opcua-generator / source / generate_extension_object_code.ts View on Github external
export async function generate(
    filename: string,
    generatedTypescriptFilename: string
) {

    try {

        const content = await readFile(filename, "ascii");

        const typeDictionary = await parseBinaryXSD2(content, [getStandartDataTypeFactory()]);

        for (const key in typeDictionary.structuredTypes) {

            if (!typeDictionary.structuredTypes.hasOwnProperty(key)) {
                continue;
            }
            const structuredType = typeDictionary.structuredTypes[key];

            /*
                        prepareStructureType(structuredType, typeDictionary);

                        const structuredTypeSchema: StructuredTypeSchema = buildStructuredType(structuredType);
                        typeDictionary.structuredTypes[key] = structuredTypeSchema;
            */
            // reapply recursive schema on field
            for (const field of structuredType.fields) {
github node-opcua / node-opcua / packages / node-opcua-client-dynamic-extension-object / source / extra_data_type_manager.ts View on Github external
public getDataTypeFactory(namespaceIndex: number): DataTypeFactory {
        if (namespaceIndex === 0) {
            return getStandartDataTypeFactory();
        }
        return this.typeDictionariesByNamespace[namespaceIndex];
    }