MapPoint Control - 计算优化路线
我想知道是否有可能显示正在计算的窗口(与 MapPoint 2010 应用程序中显示的窗口完全相同),并有可能取消此计算(因为优化路线的计算持续很长时间)?如果可以,我可以通过什么方式做到这一点?
I wonder if there is a possibility to display window that the way is calculating (exactly the same one that is display in MapPoint 2010 application), with possibility of cancel this calculation (as calculating of optimized route lasts very long)? If so, in which way I can do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以创建自己的在自己的线程上运行的进度表单。当我的 MapPoint 插件产品有大量工作需要处理时,我就是这样做的。
但是,您将无法取消优化功能。 MapPoint 的COM 接口不是多线程的。没有取消操作。要终止优化,您必须终止应用程序(几乎肯定是在操作系统级别),然后重新启动它。
如果有很多路点,优化将花费很长时间(正如预期的那样:经典的旅行商 NP 完全问题)。长距离似乎也会对运行时间产生重大影响。
You could create your own progress form that runs on its own thread. This is what I do with my MapPoint add-in products when they have a larger amount of work to process.
However, you are not going to be able to cancel the Optimize function. MapPoint's COM interface is not multi-threaded. There are no cancel operations. To kill an optimize, you are going to have to kill the application (almost certainly at the OS level) and then restart it.
Optimize is going to take a long time if there are a lot of waypoints (as expected: classic travelling salesman NP-complete problem). Long distances also appear to have a signifcant effect on runtimes.