第九章 使用 ^%ZSTART 和 ^%ZSTOP 例程自定义启动和停止行为 - 启用 %ZSTART 和 %ZSTOP

第九章 使用 ^%ZSTART 和 ^%ZSTOP 例程自定义启动和停止行为 - 启用 %ZSTART 和 %ZSTOP

启用 %ZSTART%ZSTOP

一旦例程被设计、开发、编译并准备好进行测试,就可以通过管理门户启用各个入口点。通过依次选择“系统管理”、“配置”、“其他设置”和“启动设置”导航到“启动设置”页面,然后编辑相应的个人设置:

  • SystemStart, SystemHalt

  • ProcessStart, ProcessHalt

  • JobStart, JobHalt

  • CallinStart, CallinHalt

要停用一个或多个入口点,请使用相同的过程,但将值更改为 false

调试 ^%ZSTART^%ZSTOP

在最终环境中调试 ^%ZSTART^%ZSTOP 的机会非常有限。如果发生错误,错误将写入操作员消息日志,这是运行这些例程时的当前设备。该文件是 messages.log,位于 Manager 的目录中。

该消息指示失败的原因和检测到错误的位置。这可能与程序逻辑或流程中实际发生错误的地方不同。开发人员应该从提供的信息中推断出错误的性质和位置,或者修改例程以便将来的测试提供更多关于错误性质的证据。

删除 %ZSTART^%ZSTOP

强烈建议在删除例程之前通过管理门户禁用入口点选项。如果门户警告需要重启 IRIS 才能生效,请在继续之前执行此操作。这保证在删除入口点时不会执行任何入口点。

请记住,^%ZSTART^%ZSTOP(以及任何支持例程)是永久存储的。要删除它们的所有痕迹,请通过管理门户删除它们。

示例

以下示例演示了用于跟踪系统活动的简单日志。它显示了 ^%ZSTART^%ZSTOP 的示例,为方便起见,这两个示例都使用了第三个示例例程 ^%ZSSUtil 的子例程。

^%ZSSUtil 例子

该例程有两个公共入口点。将一行写入操作员消息日志文件。另一个将名称-值对列表写入本地日志文件。这两个文件都位于管理器的目录中,该目录由类中 %Library.FileManagerDirectory() 方法返回。

%ZSSUtil ;
    ; this routine packages a set of subroutines
    ; used by the %ZSTART and %ZSTOP entry points
    ;
    ; does not do anything if invoked directly
    quit

#define Empty ""
#define OprLog 1

WriteConsole(LineText) PUBLIC ;
    ; write the line to the messages log
    ; by default the file messages.log in the MGR directory
    new SaveIO

    ; save the current device and open the operator console
    ; set up error handling to cope with errors
    ; there is little to do if an error happens
    set SaveIO = $IO
    set $ZTRAP = "WriteConsoleExit"
    open $$$OprLog
    use $$$OprLog
    ; we do not need an "!" for line termination
    ; because each WRITE statement becomes its
    ; own console record (implicit end of line)
    write LineText
    ; restore the previous io device
    close $$$OprLog
    ; pick up here in case of an error
WriteConsoleExit ;
    set $ZTRAP = ""
    use SaveIO
    quit

WriteLog(rtnname, entryname, items) PUBLIC ;
    ; write entries into the log file
    ; the log is presumed to be open as
    ; the default output device
    ;
    ; rtnname: distinguishes between ZSTART & ZSTOP
    ; entryname: the name of the entry point we came from
    ; items: a $LIST of name-value pairs
    new ThisIO, ThisLog
    new i, DataString

    ; preserve the existing $IO device reference
    ; set up error handling to cope with errors
    ; there is little to do if an error happens
    set ThisIO = $IO
    set $ZTRAP = "WriteLogExit"

    ; construct the name of the file
    ; use the month and day as part of the name so that
    ; it will create a separate log file each day
    set ThisLog = "ZSS"
                _ "-"
                _ $EXTRACT($ZDATE($HOROLOG, 3), 6, 10)
                _".log"

    ; and change $IO to point to our file
    open ThisLog:"AWS":0
    use ThisLog

    ; now loop over the items writing one line per item pair
    for i = 1 : 2 : $LISTLENGTH(items)
    {
        set DataString = $LISTGET(items, i, "*MISSING*")
        if ($LISTGET(items, (i + 1), $$$Empty) '= $$$Empty)
        {
            set DataString = DataString
                           _ ": "
                           _ $LISTGET(items, (i + 1))
        }
        write $ZDATETIME($HOROLOG, 3, 1),
              ?21, rtnname,
              ?28, entryname,
              ?35, DataString, !
    }

    ; stop using the log file and switch $IO back
    ; to the value saved on entry
    close $IO
    ; pick up here in case of an error
WriteLogExit ;
    set $ZTRAP = ""
    use ThisIO
    quit
数据集介绍:神经元细胞核检测数据集 一、基础信息 数据集名称:神经元细胞核检测数据集 图片数量: - 训练集:16,353张 - 测试集:963张 分类类别: - Neuron(神经元细胞核):中枢神经系统的基本功能单位,检测其形态特征对神经科学研究具有重要意义。 标注格式: - YOLO格式,包含边界框坐标及类别标签,适用于目标检测任务 - 数据来源于显微镜成像,覆盖多种细胞分布形态成像条件 二、适用场景 神经科学研究: 支持构建神经元定位分析工具,助力脑科学研究神经系统疾病机理探索 医学影像分析: 适用于开发自动化细胞核检测系统,辅助病理诊断细胞计数任务 AI辅助诊断工具开发: 可用于训练检测神经元退行性病变的模型,支持阿尔茨海默症等神经疾病的早期筛查 生物教育及研究: 提供标准化的神经元检测数据,适用于高校生物学实验室科研机构的教学实验 三、数据集优势 大规模训练样本: 包含超1.6万张训练图像,充分覆盖细胞核的多样分布状态,支持模型深度学习 精准定位标注: 所有标注框均严格贴合细胞核边缘,确保目标检测模型的训练精度 任务适配性强: 原生YOLO格式可直接应用于主流检测框架(YOLOv5/v7/v8等),支持快速模型迭代 生物学特性突出: 专注神经元细胞核的形态特征,包含密集分布、重叠细胞等真实生物场景样本 跨领域应用潜力: 检测结果可延伸应用于细胞计数、病理分析、药物研发等多个生物医学领域
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yaoxin521123

谢谢您的支持!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值