當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript node-opcua-debug.checkDebugFlag函數代碼示例

本文整理匯總了TypeScript中node-opcua-debug.checkDebugFlag函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript checkDebugFlag函數的具體用法?TypeScript checkDebugFlag怎麽用?TypeScript checkDebugFlag使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了checkDebugFlag函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: make_debugLog

import { ExtensionObject } from "node-opcua-extension-object";
import { EventFilter } from "node-opcua-service-filter";
import { ReadValueId, ReadValueIdOptions } from "node-opcua-service-read";
import {
    MonitoredItemCreateResult,
    MonitoringMode, MonitoringParameters, MonitoringParametersOptions
} from "node-opcua-service-subscription";
import { StatusCode, StatusCodes } from "node-opcua-status-code";
import { Variant } from "node-opcua-variant";

import { ClientMonitoredItemBase } from "../client_monitored_item_base";
import { ClientSubscription } from "../client_subscription";
import { ClientSubscriptionImpl } from "./client_subscription_impl";

const debugLog = make_debugLog(__filename);
const doDebug = checkDebugFlag(__filename);

export type PrepareForMonitoringResult  = { error: string } | {
    error?: null;
    itemToMonitor: ReadValueIdOptions;
    monitoringMode: MonitoringMode;
    requestedParameters: MonitoringParameters;
};

export class ClientMonitoredItemBaseImpl extends EventEmitter implements ClientMonitoredItemBase {

    public itemToMonitor: ReadValueId;
    public monitoringParameters: MonitoringParameters;
    public subscription: ClientSubscriptionImpl;
    public monitoringMode: MonitoringMode;
    public statusCode: StatusCode;
開發者ID:node-opcua,項目名稱:node-opcua,代碼行數:31,代碼來源:client_monitored_item_base_impl.ts

示例2: make_debugLog

import { StatusCodes } from "node-opcua-status-code";
import { CallMethodResultOptions } from "node-opcua-types";
import { DataType, Variant, VariantArrayType } from "node-opcua-variant";

import { ByteString, UAString } from "node-opcua-basic-types";
import { CreateSigningRequestResult, PushCertificateManager } from "./push_certificate_manager";
import {
    installCertificateExpirationAlarm
} from "./server/install_CertificateAlarm";
import {
    PushCertificateManagerServerImpl,
    PushCertificateManagerServerOptions
} from "./server/push_certificate_manager_server_impl";

const debugLog = make_debugLog("ServerConfiguration");
const doDebug = checkDebugFlag("ServerConfiguration");
const errorLog = debugLog;

function hasExpectedUserAccess(context: SessionContext) {
    if (!context ||
      !context.session ||
      !context.session.userIdentityToken) {
        return false;
    }
    const currentUserRole = context.getCurrentUserRole();
    return !!currentUserRole.match("SecurityAdmin");
}

function hasEncryptedChannel(context: SessionContext) {
    // todo
    return true;
開發者ID:node-opcua,項目名稱:node-opcua,代碼行數:31,代碼來源:push_certificate_manager_helpers.ts


注:本文中的node-opcua-debug.checkDebugFlag函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。