乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 49|回复: 4

[编程交流] 加载反应器

[复制链接]

4

主题

78

帖子

74

银币

初来乍到

Rank: 1

铜币
20
发表于 2022-7-6 09:44:11 | 显示全部楼层 |阅读模式
我有一个问题,关于反应堆程序的加载。我对正确的程序有点困惑,因为我知道多次加载反应堆可能会导致问题。情况是这样的:我们在民用应用程序中使用第三方软件Eagle Point。经过数小时的挫折和实验,我发现Eagle Point似乎与我们运行的许多基于反应堆的fire程序不太合拍。然而,有一些程序,我希望不会引起问题,这对我们的生产力至关重要(链接注释,因此当一个注释被更改时,其他链接的注释被更改;以及在启动某些命令时自动切换层;都是大程序)。在装载反应堆时,我目前正在使用:
 
  1. [font=Arial](if (not Command_Ending_Reactor)[/font]
  2. [font=Arial]  (setq    Command_Ending_Reactor[/font]
  3. [font=Arial]     (vlr-command-reactor[/font]
  4. [font=Arial]       nil[/font]
  5. [font=Arial]       '((:vlr-commandended[/font]
  6. [font=Arial]          .[/font]
  7. [font=Arial]          Command_Ended_Command[/font]
  8. [font=Arial]         )[/font]
  9. [font=Arial]        )[/font]
  10. [font=Arial]     ) ;_ end of vlr-command-reactor[/font]
  11. [font=Arial]  ) ;_ end of setq[/font]
  12. [font=Arial]  () ;_ the reactor is already loaded[/font]
  13. [font=Arial]) ;_ end of if[/font]
  14. [font=Arial] [/font]

当提到“多次未加载反应堆”时,它是指:vlr commandended还是指Command\u Ending\u reactor?换句话说,我是否可以运行以下操作而不产生问题:
 
  1. [font=Arial](cond[/font]
  2. [font=Arial]((and (not Command_Ending_Reactor) (not (member "egpt.exe" (dos_processes))))[/font]
  3. [font=Arial]  (setq    Command_Ending_Reactor_EP[/font]
  4. [font=Arial]     (vlr-command-reactor[/font]
  5. [font=Arial]       nil[/font]
  6. [font=Arial]       '((:vlr-commandended[/font]
  7. [font=Arial]          .[/font]
  8. [font=Arial]          Command_Ended_Command_EP[/font]
  9. [font=Arial]         )[/font]
  10. [font=Arial]        )[/font]
  11. [font=Arial]     ) ;_ end of vlr-command-reactor[/font]
  12. [font=Arial]  ) ;_ end of setq[/font]
  13. [font=Arial] (setq    Command_Ending_Reactor_NOEP[/font]
  14. [font=Arial]      (vlr-command-reactor[/font]
  15. [font=Arial]        nil[/font]
  16. [font=Arial]        '((:vlr-commandended[/font]
  17. [font=Arial]           .[/font]
  18. [font=Arial]           Command_Ended_Command_NOEP[/font]
  19. [font=Arial]          )[/font]
  20. [font=Arial]         )[/font]
  21. [font=Arial]      ) ;_ end of vlr-command-reactor[/font]
  22. [font=Arial]   ) ;_ end of setq[/font]
  23. [font=Arial]) ;_ end of cond1[/font]
  24. [font=Arial]((and (not Command_Ending_Reactor) (member "egpt.exe" (dos_processes)))[/font]
  25. [font=Arial]   (setq    Command_Ending_Reactor_EP[/font]
  26. [font=Arial]      (vlr-command-reactor[/font]
  27. [font=Arial]        nil[/font]
  28. [font=Arial]        '((:vlr-commandended[/font]
  29. [font=Arial]           .[/font]
  30. [font=Arial]           Command_Ended_Command_EP[/font]
  31. [font=Arial]          )[/font]
  32. [font=Arial]         )[/font]
  33. [font=Arial]      ) ;_ end of vlr-command-reactor[/font]
  34. [font=Arial]   ) ;_ end of setq[/font]
  35. [font=Arial] ) ;_ end of cond2[/font]
  36. [font=Arial]) ;_ end cond[/font]
  37. [font=Arial] [/font]

(前面是一个未经测试的代码,出于示例目的,它更多地是一个psuedo代码)
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 10:02:51 | 显示全部楼层
看看这个,克里斯:
 
  1. ;;;--------------------------------------------------------------------;
  2. ;;; Start reactor function:
  3. (defun Reactors:Command  ()
  4. ;; CommandCancelled reactor:
  5. (cond
  6.    (*Reactor_CommandCancelled*)
  7.    ((setq *Reactor_CommandCancelled*
  8.            (vlr-command-reactor
  9.              nil
  10.              '((:vlr-commandCancelled . Callback:CommandEnded))))))
  11. ;; CommandEnded reactor:
  12. (cond
  13.    (*Reactor_CommandEnded*)
  14.    ((setq *Reactor_CommandEnded*
  15.            (vlr-command-reactor
  16.              nil
  17.              '((:vlr-commandEnded . Callback:CommandEnded))))))
  18. ;; CommandFailed reactor:
  19. (cond
  20.    (*Reactor_CommandFailed*)
  21.    ((setq *Reactor_CommandFailed*
  22.            (vlr-command-reactor
  23.              nil
  24.              '((:vlr-commandFailed . Callback:CommandEnded))))))
  25. ;; CommandStarted reactor:
  26. (cond
  27.    (*Reactor_CommandStarted*)
  28.    ((setq *Reactor_CommandStarted*
  29.            (vlr-command-reactor
  30.              nil
  31.              '((:vlr-commandwillstart . Callback:CommandStarted))))))
  32. (prompt "\n \n  >>  Command Reactors Loaded ")
  33. (princ)) ;_end defun
  34. ;;;--------------------------------------------------------------------;
  35. ;; CommandStarted callback function:
  36. (defun Callback:CommandStarted  (Rea Cmd / layerName LayerItem)
  37. ;; <- Your code here
  38. (princ))
  39. ;;;--------------------------------------------------------------------;
  40. ;; CommandEnded callback function:
  41. (defun Callback:CommandEnded  (Rea Cmd)
  42. ;; <- Your code here
  43. (princ))
  44. ;;;--------------------------------------------------------------------;
  45. (cond
  46. ((or (vl-string-search "R17.2" *vrsn*)                                ; 2009 LDC
  47.       (vl-string-search "R18.1" *vrsn*))                               ; 2011 C3D
  48.   (Reactors:Command)))
  49. (princ)

 
我通常使用反应堆数据来跟踪反应堆,但是:
 
  1. (defun Reactors:Command nil
  2. (cond
  3.    ( *Reactor_Command* )
  4.    ( (setq *Reactor_Command*
  5.        (vlr-command-reactor nil
  6.         '(
  7.            (:vlr-commandcancelled . callback:commandended)
  8.            (:vlr-commandended     . callback:commandended)
  9.            (:vlr-commandfailed    . callback:commandended)
  10.            (:vlr-commandwillstart . callback:commandstarted)
  11.          )
  12.        )
  13.      )
  14.    )
  15. )
  16. (princ "\n--> Command Reactors Loaded.")
  17. (princ)
  18. )

 
这样,就不需要涉及全局变量
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 10:18:58 | 显示全部楼层
像往常一样,李,你有一个很好的建议,让我重新考虑去年发展起来的一些事情。。。一直以来,我都在努力为Civil 3D 2011建立支持结构和标准,并为我们从Land Desktop到Civil 3D的过渡进行反向规划。
 
谢谢你增加了工作量,伙计。笑死我了
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 2022-7-6 10:44:09 | 显示全部楼层
 
哈哈,我不觉得有必要实施它。。。
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-6 10:52:09 | 显示全部楼层
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-6 23:33 , Processed in 0.395482 second(s), 62 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表