core package
Submodules
core.evaluation module
- class core.evaluation.Comparison(measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
基类:
object
core.executor module
执行器模块 这个模块是执行器模块,用于执行测试脚本和链接测试工具
- Classes:
TestExecutor: 测试执行器类
- class core.executor.TestExecutor(tools, tools_status, config, logger, Dev_Mode=False)[源代码]
基类:
object
测试执行器
- read_bus(signal_name: classmethod, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s') float [源代码]
读取指定总线信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_bus(signal_name: classmethod, value: float, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定总线信号
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。
- read_calibration(signal_name: classmethod, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定标定信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- INCA工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_calibration(signal_name: classmethod, value, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定标定量
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- INCA工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。
- read_measurement(signal_name: classmethod, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定测量信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- INCA工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_veristand(signal_name: str, value: float, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定VeriStand信号
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- VeriStand工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。
- read_veristand(signal_name: str, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定VeriStand信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- VeriStand工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- read_sys_var(var_name, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定系统变量的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_sys_var(var_name, var_value, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定系统变量
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。
core.signal_mapper module
Module contents
- class core.Comparison(measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
基类:
object
- class core.TestExecutor(tools, tools_status, config, logger, Dev_Mode=False)[源代码]
基类:
object
测试执行器
- read_bus(signal_name: classmethod, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s') float [源代码]
读取指定总线信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_bus(signal_name: classmethod, value: float, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定总线信号
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。
- read_calibration(signal_name: classmethod, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定标定信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- INCA工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_calibration(signal_name: classmethod, value, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定标定量
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- INCA工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。
- read_measurement(signal_name: classmethod, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定测量信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- INCA工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_veristand(signal_name: str, value: float, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定VeriStand信号
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- VeriStand工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。
- read_veristand(signal_name: str, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定VeriStand信号的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- VeriStand工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- read_sys_var(var_name, expected_value=None, measurement='==', type_of_tolerance='absolute', tolerance_value=0.0, custom_function=None, type_of_timeoption=None, timeout=0, timeout_unit='s', duration=0, duration_unit='s')[源代码]
读取指定系统变量的值,并进行评估。
- 参数:
signal_name (classmethod) -- 期望读取的信号名
expected_value (float, 可选) -- 期望读取的信号值。若为None,则不进行评估。 默认值为None。
measurement (str, 可选) -- 评估标准。支持以下参数:"==",">=",">","<=","<","!="。 默认值为"=="。
type_of_tolerance (str, 可选) -- 误差计算方式。支持以下参数:"absolute","percentage"。 默认值为"absolute"。 absolute: 绝对误差。 percentage: 百分比误差。
tolerance_value (float, 可选) -- 误差值。若type_of_tolerance为"absolute",则误差值范围为[0,+∞]。若type_of_tolerance为"percentage",则误差值范围为[0,100]。 默认值为0.0。
custom_function (callable, 可选) -- 自定义评估函数。 默认值为None。
type_of_timeoption (str, 可选) -- 时间评估方式。支持以下参数:"finallyTrueOption","generallyTrueOption","trueForWithinOption"。 默认值为None。 finallyTrueOption: 在超时时间内,若读取信号值满足期望,则认为评估成功。 generallyTrueOption: 在持续时间内,若读取信号值满足期望,则认为评估成功。 trueForWithinOption: 在超时时间内,若读取信号值满足期望,且持续时间满足期望,则认为评估成功。
timeout (int, 可选) -- 超时时间。默认值为0。
timeout_unit (str, 可选) -- 超时时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
duration (int, 可选) -- 持续时间。 默认值为0。
duration_unit (str, 可选) -- 持续时间单位。支持以下参数:"ms","s","min","h","d"。 默认值为"s"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 评估失败时,抛出异常。
- 返回:
读取的信号值。
- 返回类型:
float
- write_sys_var(var_name, var_value, timeout=5, tolerance_value=0.1, type_of_tolerance='absolute')[源代码]
写入指定系统变量
- 参数:
signal_name (classmethod) -- 期望写入的信号名
value (float) -- 期望写入的信号值
timeout (int, optional) -- 超时时间。默认值为5。
tolerance_value (float, optional) -- 误差值。默认值为0.1。
type_of_tolerance (str, optional) -- 误差计算方式。默认值为"absolute"。
- 抛出:
Exception -- 读写总线工具未配置时,抛出异常。
Exception -- 写入失败时,抛出异常。