Ada:绘制二维图

发布于 2024-09-08 22:25:30 字数 1438 浏览 6 评论 0原文

能够在 Ada 代码中绘制 2D 图形而不是必须保存值(例如归档)并随后使用外部绘图软件,这将是很有趣的。在网上搜索后,我找到了两个软件包:Win_IO 和 JEWL。我已经能够使用 WIN_IO,但文档非常差,而且刚刚开始使用它,似乎无法调整画布的大小。我使用 GPS 编辑器,并且在运行 Win_IO 时收到抱怨,称某些字体在我的系统上不可用,并且输出会很难看。最后,情节本身并没有出现在屏幕上;而是出现在屏幕上。必须点击正在编译和链接的文件的exe文件才能得到图形。

我也看过 JEWL,但它似乎无法绘制图表。

是否有更多 Ada 软件包可用于绘制 2D 图形。

非常感谢...


我对 GNAVI 的体验:

安装说明位于

http://www.gnavi.org/index.php?Command=Class&ClassID=Start&CID=381

基本上安装包括: 要使用:

  1. 将此目录放在您的路径上
  2. cd 到 gnatcom 并运行:make install
  3. cd 到 gwindows 并运行:make UNICODE=1 all
  4. 运行:gnavi_ide 并享受:-)

但安装受到错误困扰:

C:\gnavi\gnatcom> ;安装 正在安装 GNATCOM...... MAKE 版本 5.2 版权所有 (c) 1987, 2000 Borland 错误 makefile 2:命令语法错误 * make 期间出现 1 个错误 * 安装完成

C:\gnavi\gwindows>make UNICODE=1 all MAKE 版本 5.2 版权所有 (c) 1987, 2000 Borland 错误 makefile 2:命令语法错误 * make 期间出现 1 个错误 *

虽然 C:GNAVI 在我的路径上,但 IDE 仍然抱怨 C:GNAVI 中找到的 icg.exe 不在路径上。`这是软件的问题尚未经过充分测试!我对人们写出不负责任和不完整的安装说明感到非常失望。开发者有没有发现普通用户是否可以安装他们的软件?

查看 AdaDesigner

我还尝试在 https://gna.org/projects/adadesigner处 , FireFox 抱怨:此连接不受信任

gna.org 使用无效的安全证书。

该证书不受信任,因为颁发者证书未知。

我决定不再访问这样的网站。

it would be interesting to be able to plot a 2D graph within an Ada code rather than having to save values say to file and use an external drawing software afterwards. A search on the web has taken me to two packages: Win_IO and JEWL. I have been able to use WIN_IO though but the documentation is quite poor and having just started using it, it seems that it is not possible to resize the size of the canvas. I use the GPS editor and I get complaint when running Win_IO that some fonts are not available on my system and that the output will be ugly. Finally the plot doesn't itself pop up on the screen; One has to click on the exe file of the file being compiled and linked so as to get the graph.

I have taken a look also at JEWL but it doesn't seem to be able to plot graphs.

Are there more Ada packages available out there for plotting 2D graphs.

Thanks a lot...


My experience with GNAVI:

The installation instructions are at

http://www.gnavi.org/index.php?Command=Class&ClassID=Start&CID=381

Basically the installation consists of:
To use:

  1. Place this directory on your path
  2. cd to gnatcom and run: make install
  3. cd to gwindows and run: make UNICODE=1 all
  4. run: gnavi_ide and enjoy :-)

But the installation is plagued with errors:

C:\gnavi\gnatcom>install
Installing GNATCOM.....
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
Error makefile 2: Command syntax error
* 1 errors during make *
Install Completed

C:\gnavi\gwindows>make UNICODE=1 all
MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
Error makefile 2: Command syntax error
* 1 errors during make *

And though C:GNAVI is on my path, the IDE still complains that icg.exe which is found in C:GNAVI is not on the path.`This is trouble with software which has not been fully tested!!! I was very disappointed that people can write irresponsible and incomplete installation instructions. Have the developers even found out that whether a normal user can install their software?

I have also try to look at AdaDesigner at https://gna.org/projects/adadesigner

Here, FireFox complains: This Connection is Untrusted

gna.org uses an invalid security certificate.

The certificate is not trusted because the issuer certificate is unknown.

I decided not to visit such a website.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

埖埖迣鎅 2024-09-15 22:25:30

PLplot 是一个用于创建科学绘图的跨平台包。它有一个详细记录的 Ada 绑定 。作为参考,此图库展示了各种图。单击缩略图可查看全尺寸图像。单击 Ada 选项卡(标准或传统)即可查看相应的源代码。

PLplot is a cross-platform package for creating scientific plots. It has a well-documented Ada binding. For reference, this gallery illustrates a variety of plots. Click a thumbnail to view a full-size image. Click either Ada tab (standard or traditional) to see the corresponding source code.

菩提树下叶撕阳。 2024-09-15 22:25:30

我会尝试GTKAda。我不完全确定这个子系统是否允许您制作 2​​D 图形,因为我从未将它用于此目的,但它可以使用 GTK+ (C/C++) 来完成。

还有一个指南 GTKAda 和参考手册,一些GTK 工具包本身的文档也可能会派上用场。

I'd give a try to GTKAda. I'm not completely sure this subsystem would allow you to do 2D graphs as I've never used it for that purpose, but it can be done with GTK+ (C/C++).

There is also a guide on GTKAda and a reference manual, some documentation on the GTK toolkit itself may also come handy.

俯瞰星空 2024-09-15 22:25:30

这完全取决于您想做什么。对于绘制基于节点的图表,我首先考虑使用的是 Graphviz。它有自己使用的特殊图形语言,但我倾向于在适当的时候使用领域特定语言。 Ada 具有很强的互操作性,因此将 DSL 与它一起使用可以真正使其变得强大。

我发现的一个例子是 AdaDesigner,生成 Graphviz DOT 文件以帮助可视化 Ada 代码的结构。

过去有一次我必须做简单的绘图,那是为了一个网络应用程序。我最终在服务器端动态生成 SVG 页面(尽管当时支持很差) )。现在支持更好了,所以我今天肯定会再次使用它。

如果直接在 Windows PC 显示屏上工作对您更有吸引力,则有多种 GUI 绑定选项,所有这些选项都应支持在画布上绘制线条和点。除了 GTK(功能强大且可移植)之外,还有一些 Win32 API。我认为其中一个是与 Gnat 一起出现的。另一个您可能不知道的是 GWindows。它是 GNAVI 的一部分,旨在成为 Delphi 的开源替代品。它不是最活跃的项目,但(据报道)非常有用,并且仍在开发和使用中。以下是一些屏幕截图 它被用于绘图。
替代文字
(来源:gnavi.org

It depends on exactly what you want to do. For graphing node-based diagrams, the first thing I'd look into using is Graphviz. It has its own special graphing language it uses, but I'm all about using Domain Specific Languages when appropriate. Ada has great interoperability, so using DSLs with it can really make it powerful.

An example I found is AdaDesigner, which generates Graphviz DOT files to help visualze the structure of Ada code.

The one time in the past I had to do simple plotting, it was for a web app. I ended up dynamically generating SVG pages on the server side (even though it was poorly supported then). Support is better now, so I'd definitely use it again today.

If working directly on a Windows PC display appeals more to you, there are several options for GUI bindings, all of which should support drawing lines and points on a canvas. In addtion to GTK (which is both powerful and portable), there are a few Win32 API's floating around. I think one comes with Gnat. Another you might not be aware of is GWindows. It is part of GNAVI, which aims to be sort of an OpenSource alternative to Delphi. It isn't the most active of projects, but is (reportedly) quite useable, and is still being worked on and used. Here are some screenshots of it being used for plotting.
alt text
(source: gnavi.org)

酒解孤独 2024-09-15 22:25:30

MathGL 是跨平台 GPL 绘图库。它有 C 接口,因此您也可以从您的代码中使用它。它还可以创建一个带有图形的窗口——即在最简单的情况下您不需要学习/使用其他小部件库。

MathGL is cross-platform GPL plotting library. It have C interface, so you can use it from yours code too. Also it can create a window with graphics -- i.e. you don't need to study/use other widget libraries in simplest case.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文