GithubHelp home page GithubHelp logo

kj7lnw / xnec2c Goto Github PK

View Code? Open in Web Editor NEW
73.0 9.0 16.0 4 MB

Xnec2c is a high-performance multi-threaded electromagnetic simulation package to model antenna near- and far-field radiation patterns for Linux and UNIX operating systems.

Home Page: https://www.xnec2c.org/

License: GNU General Public License v3.0

Makefile 1.66% Shell 4.11% M4 1.98% C 92.25%
antenna antenna-analyzer antenna-simulation csv-export electromagnetic-simulation far-field gtk gtk3 gui multiprocessing

xnec2c's Introduction

  • 👋 Hi, I’m Eric, @KJ7LNW
  • 👀 I enjoy doing Amateur Radio stuff with my son Zeke, @KJ7NLL (https://www.youtube.com/@KJ7NLL)
  • 🌱 I’m currently learning EM simulation
  • 💞️ I’m looking to collaborate on xnec2c
  • 📫 How to reach me: www.linuxglobal.com

xnec2c's People

Contributors

asciiwolf avatar df7cb avatar dforsi avatar dianebruce avatar kj7lnw avatar ndim avatar neoklis avatar paper42 avatar scaramacai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

xnec2c's Issues

repo is corrupt

Hi,
I tried to clone your repo and got

'''
$ git clone https://github.com/KJ7LNW/xnec2c.git
Cloning into 'xnec2c'...
remote: Enumerating objects: 2151, done.
remote: Counting objects: 100% (2151/2151), done.
remote: Compressing objects: 100% (740/740), done.
remote: Total 2151 (delta 1748), reused 1804 (delta 1403), pack-reused 0
Receiving objects: 100% (2151/2151), 2.77 MiB | 3.98 MiB/s, done.
Resolving deltas: 100% (1748/1748), done.
error: invalid path 'examples/2m_1:4l-gp_on_pole.nec'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
'''

File system syncs can wipe out performance

xnec2c makes a blocking call to sync every time it closes a FILE. On certain file systems (notably ZFS), sync can take several seconds to execute, during which time xnec2c’s UI is completely unresponsive.

Git suggests the sync call got added in 3.9-beta. Do you know why it got put in originally? If the goal was crash-safety, there are more efficient ways to achieve that using fsync, fdatasync, etc.

Flatpak build

I have made a Flatpak build of Xnec2c that I am going to publish on Flathub. Feel free to let me know whether you are interested in co-maintaining the Flathub Flatpak and having push access to its Git repository. :-)

Ubuntu 22.04.4 “jammy”

I copied the install script for Xnec2c from the user manual I found at xnec2c.org. When I ran it, the first hiccough was at gettext. From there, lots of “no such file” errors.

So I installed the gnome libraries successfully (“sudo apt-get install build-essential gnome-devel libgtk-3-dev gettext autopoint”) and tried the original install script again.

Then I was told I need GNU Autoconf 2.52. I installed that.

Then the install script failed at ATLAS. With no other help immediately available, I gave up.

I'd like to build antennae. I need some help on this UNIX stuff. Is there a way to install the app without building it ground up? 73

New external optimizer

Hi ,

i have written an external optimizer for xnec2c. I would appreciate if you would list it on xnec2c.org.
It's alpha, but i guess when people start using it, i will keep up pushing it forward.

You may take a look at https://github.com/polyrod/xnec2c-gao/ .
Maybe you have suggestions.

thx & 73

Maurizio Di Pietro ,DC1MDP

brew: Settings schema 'org.gtk.Settings.FileChooser' does not contain a key named 'show-type-column'

I tried to build xnec2c under brew on Oracle Linux 8 with the formula below and got this error:

(gifcurry_gui:485782): GLib-GIO-ERROR **: 10:30:38.086: Settings schema 'org.gtk.Settings.FileChooser' does not contain a key named 'show-type-column'

I found a bunch of resources basically indicating that this is caused by a mismatch of the local schema and the brew schema. However, it does compile fine under brew in Ubuntu 20.04 so its more of a "brew on OL8" problem than an xnec2c problem. (Hence, if you run OL8/EL8 then run xnec2c directly, not under brew!)

I'm writing this issue and closing the ticket in case someone else finds this with the same problem. Here are some references in case others find it useful:

class Xnec2c < Formula
  desc "Multi-threaded EM tool based on NEC2 to model antenna radiation patterns"
  homepage "https://www.xnec2c.org/"
  url "https://www.xnec2c.org/releases/xnec2c-v4.4.12.tar.gz"
  sha256 "e98af1e8b9098df9cc03f90950358b846cc6a2965e79c0114ab711fbe51272c5"
  license "GPL-3.0-or-later"

  depends_on "atk"
  depends_on "cairo"
  depends_on "gdk-pixbuf"
  depends_on "glib"
  depends_on "gtk+3"
  depends_on "librsvg"
  depends_on "pango"
  depends_on "autoconf"
  depends_on "automake"

  def install
    system "./autogen.sh"
    system "./configure", *std_configure_args
    system "make"
    system "make install"
    system "make desktop-install"
  end

  test do
    system "#{bin}/xnec2c", "-h"
  end
end

Trouble simulating a biquad for WiFi

Hi, thank you for this fascinating software! I'm new to nec in general, so please excuse my inexperience.

I'm trying to simulate a biquad antenna for wifi, so 2.4 - 2.5 GHz. With a lot of trial and error, I produced this nec file:

CM --- NEC2 Input File created or edited by xnec2c 4.4.12 ---
CE --- End Comments ---
GW     1     1  -1.50000E-03  0.00000E+00  1.90000E-02  1.50000E-03  0.00000E+00  1.90000E-02  2.50000E-04
GW     2    16  -1.50000E-03  0.00000E+00  1.90000E-02 -1.50000E-03  1.50000E-03  1.90000E-02  2.50000E-04
GW     3    16  -1.50000E-03  1.50000E-03  1.90000E-02 -2.22739E-02  2.22739E-02  1.90000E-02  2.50000E-04
GW     4    16  -2.22739E-02  2.22739E-02  1.90000E-02  0.00000E+00  4.45477E-02  1.90000E-02  2.50000E-04
GW     5    16   0.00000E+00  4.45477E-02  1.90000E-02  2.22739E-02  2.22739E-02  1.90000E-02  2.50000E-04
GW     6    16   2.22739E-02  2.22739E-02  1.90000E-02  1.50000E-03  1.50000E-03  1.90000E-02  2.50000E-04
GW     7    16   1.50000E-03  1.50000E-03  1.90000E-02  1.50000E-03  0.00000E+00  1.90000E-02  2.50000E-04
GW     8    16   1.50000E-03  0.00000E+00  1.90000E-02  1.50000E-03 -1.50000E-03  1.90000E-02  2.50000E-04
GW     9    16   1.50000E-03 -1.50000E-03  1.90000E-02  2.22739E-02 -2.22739E-02  1.90000E-02  2.50000E-04
GW    10    16   2.22739E-02 -2.22739E-02  1.90000E-02  0.00000E+00 -4.45477E-02  1.90000E-02  2.50000E-04
GW    11    16   0.00000E+00 -4.45477E-02  1.90000E-02 -2.22739E-02 -2.22739E-02  1.90000E-02  2.50000E-04
GW    12    16  -2.22739E-02 -2.22739E-02  1.90000E-02 -1.50000E-03 -1.50000E-03  1.90000E-02  2.50000E-04
GW    13    16  -1.50000E-03 -1.50000E-03  1.90000E-02 -1.50000E-03  0.00000E+00  1.90000E-02  2.50000E-04
GW    14    16  -1.50000E-03  0.00000E+00  1.90000E-02 -1.50000E-03  1.50000E-03  1.90000E-02  2.50000E-04
GE     0     0   0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
EX     0     0     1      0  1.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
FR     0    11     0      0  2.40000E+03  1.00000E+01  2.50000E+03  0.00000E+00  0.00000E+00  0.00000E+00
NH     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00
NE     0    10     1     10 -1.35000E+00  0.00000E+00 -1.35000E+00  3.00000E-01  0.00000E+00  3.00000E-01
RP     0    19    37   1000  0.00000E+00  0.00000E+00  1.00000E+01  1.00000E+01  0.00000E+00  0.00000E+00
EN     0     0     0      0  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00  0.00000E+00

Which results in this geometry:

image

However, when I run the simulation, the gain graph is a flat line:

image

Right clicking on the gain graph to see a specific frequency causes the program to freeze.


I'm compiling from source on Arch Linux, all the example antennas that I tested work just fine.

So I actually have multiple questions:

  • can xnec2c even simulate 2,45 GHz? All examples were a couple 100 MHz.
  • For the antenna construction, I assume all units are meters, is that correct?
  • The simulation is very fast, to the point I'm skeptical if it is even correct (For my use case). Can I set the calculation precision somewhere?
  • What could cause the software to freeze?

Thanks in advance!

Received `OS openbsd 7.3 not supported`. Is there any reason for this?

Before I attempt to see if I can troubleshoot the build process, I wanted to inquire as to if there were any incompatibility issues or known restrictions preventing a successful build.

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-unknown-openbsd7.3
checking host system type... x86_64-unknown-openbsd7.3
configure: error: "OS openbsd7.3 is not supported"

cheers.

Windows Support

There are alpha win32 commits in the win32 branch that compile under mingw.

This binary release is slow and choppy because fork() is missing, but does run under Windows 10!

If libltdl were implemented to replace dlopen in src/mathlib.c then OpenBLAS for Windows would probably be fast and multi-threaded.

If anyone is interested then comment here or open a PR. The current win32 branch was just a quick fix to get it building. A few necessary fixes before it can be merged:

  • configure.ac should be cleaned up
  • branch needs to be rebased on master
  • apparently I committed those first two changes as root so we need to do a filter-branch with my correct email address and contact details.

Documentation improvements

On the documentation website. It would be useful to define the input fields for each card. For example the FR card is not obvious what each field is. <aybe I look in the wrong place.

Jerry KF7RCC

Installation Issues

Hi Im new to Linux and was trying to install Xnec2c on WSL Ubuntu which I believe should have support. When I had followed the compilation notes I received the following error when inputting the final command
xnec2c
The error that followed said "Unable to open libtatlas.so.3 : libtatlas.so.3: cannot open a shared object file: No such file or directory skipping." followed by many errors w/ similar messaging but varying in lib_____ etc.
This puzzled me as I had already downloaded the package libatlas-base-dev, and searched to find if I was missing any additional packages put was unable to find any. Apologies if this is a rookie error but I would like to be able to use Xnec2c.

Ubuntu 22.4.04.1 LTS install fails

fails with
Fail_img_sshot
started install with:
image
CPU: Intel Core i7-10870H @ 2.2GHz x 16
OS Name Ubuntu 22.04.1 LTS
OS Type: 64 bit
Gnome Ver: 42.5
Windowing System: Wayland

necsy

I'm writing a python script (necsy) to preprocess nec files containing the SY directive.
The script is still disorganized and probably with bugs, but already works in many cases I tested.
If you are interested, find it at https://github.com/scaramacai/necsy

OpenGL Support

HELP WANTED

Would you like to volunteer to help with OpenGL support to xnec2c? Read on:

This first-pass implementation partially renders antenna patterns in OpenGL. Hurray! While the OpenGL work has been started, it needs some polish (ahem, quite a bit of polish)...plus, this is a feature that the original xnec2c author, Neoklis 5B4AZ, has always wanted.

-Eric, KJ7LNW

GOALS!

  • OpenGL for:
    • Radiation Pattern
    • E/H Field Pattern and animation
    • Physical Structure
  • Click to rotate the object
  • Mouse wheel to zoom
  • Middle click to pan
  • Shift+click to rotate light sources around the object
  • Transparency when clicking to rotate.
  • An optional transparent grid plane at (x,y)=0
  • Shaders
    • I'm open to any cool shader ideas you might have
    • It could be neat to have one or more light sources such that the light sources can rotate around the radiation pattern (or structure) with shift-click+drag.

Getting Started

git clone https://github.com/KJ7LNW/xnec2c.git
cd xnec2c
git checkout opengl
./autogen.sh
./configure
make
./src/xnec2c -j4 examples/airplane.nec

Once it loads:

  • Enable the "View->Radiation Pattern" checkbox and click "Gain Pattern" button on the "Radiation Patterns" window
  • When it loads there should be a small "GLArea Test" window. Resize the window to a reasonable size for your display.
  • The "GLArea Test" window will only update when "Radiation Patterns" is rotated.
  • To interact with the GLArea Test window, click and drag in the "Radiation Patterns" window (not the "GLArea Test" window) to change the OpenGL view.
  • To change the scale, use your mouse wheel to zoom over the "Radiation Patterns" window (not the "GLArea Test" window) and then rotate it so the GL window will redraw.

Development Considerations

There is a work-in-progress branch for OpenGL support using CGLM which you can see in this commit comparison: master...opengl . The branch is here: https://github.com/KJ7LNW/xnec2c/tree/opengl

If you would prefer to start fresh then I'm okay with that, the opengl branch is here as a reference in case it is useful. Ultimately your new branch would replace this current opengl branch and ultimately get merged into master.

  1. A new opengl.c and .h file should be created to store code for:
    • camera
    • arcball
    • vertex generation from NEC2 structures (from rad_pattern, see how rdpat_points or point_3d is created for colorization in Draw_Radiation_Pattern, but do it in a more "opengl-friendly way").
    • GTK UI hooks for pan/scale/rotate
    • other GL stuff
  2. A function from opengl.c for generating radition pattern vertexes should be hooked into src/draw_radiation.c:Draw_Radiation_Pattern().
    • Currently that logic is hard-coded into Draw_Radiation_Pattern() but that was just a convenient place to put it while testing. See the commits to understand what changed.
    • Right now the OpenGL data vertex structure is updated every time it is redrawn. This is unnecessary for OpenGL because the video card will handle it. The structure should be regenerated only when the frequency data is recalculated (like when the select frequency is changed).
  3. The current triangle creation logic isn't quite right and the radiation pattern isn't so clean. Note that theta is the azimuth and theta=0 is pointing in the direction of Z+! This is just how NEC2 was designed back in 1981...
  4. The configure.ac file should detect OpenGL libraries and link them as necessary. Some of this has been done already.
  5. CGLM should be a git submodule if it is not already
    • If you prefer a different vector/matrix math library vs CGLM then I'm open to it; it looked like CGLM was a good place to start since xnec2c is written in C, not in C++.
  6. Maintain shader version 1.20 support for older distributions, right now we don't need anything fancy.
  7. To the extent possible, widgets should be maintained as GTK Builder objects and expressed as XML in resources/xnec2c.glade. However, it might be easier to open-code as a first pass with gtk API calls and refactor into XML later.
  8. Rebase on the master branch
  9. Try to follow Linux Kernel commit practices and coding style for new code.

References

Installation fails

I tried to install on Ubuntu 22.04.3 LTS with the software manager. Does not work and no explanation.
I tried from git and I have an error message during the make process:
ake[3] : on quitte le répertoire « /home/alain/Bureau/install xnec2/xnec2c/po »
test ! -f ./xnec2c.pot ||
test -z "" || make
touch stamp-po
make[2] : on quitte le répertoire « /home/alain/Bureau/install xnec2/xnec2c/po »
make[2] : on entre dans le répertoire « /home/alain/Bureau/install xnec2/xnec2c »
/usr/bin/sed -e 's|[@]PACKAGE_NAME@|xnec2c|g' -e 's|[@]PACKAGE_STRING@|xnec2c 4.4.12|g' -e 's|[@]PACKAGE_TARNAME@|xnec2c|g' -e 's|[@]PACKAGE_VERSION@|4.4.12|g' < doc/xnec2c.1.in > doc/xnec2c.1
/usr/bin/sed -e 's|[@]PACKAGE_NAME@|xnec2c|g' -e 's|[@]PACKAGE_STRING@|xnec2c 4.4.12|g' -e 's|[@]PACKAGE_TARNAME@|xnec2c|g' -e 's|[@]PACKAGE_VERSION@|4.4.12|g' < xnec2c.spec.in > xnec2c.spec
make[2] : on quitte le répertoire « /home/alain/Bureau/install xnec2/xnec2c »
make[1] : on quitte le répertoire « /home/alain/Bureau/install xnec2/xnec2c »
Making install in src
make[1] : on entre dans le répertoire « /home/alain/Bureau/install xnec2/xnec2c/src »
make[2] : on entre dans le répertoire « /home/alain/Bureau/install xnec2/xnec2c/src »
/usr/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c xnec2c '/usr/local/bin'
/usr/bin/install: impossible de créer le fichier standard '/usr/local/bin/xnec2c': Permission non accordée
make[2]: *** [Makefile:469 : install-binPROGRAMS] Erreur 1
make[2] : on quitte le répertoire « /home/alain/Bureau/install xnec2/xnec2c/src »
make[1]: *** [Makefile:1106 : install-am] Erreur 2
make[1] : on quitte le répertoire « /home/alain/Bureau/install xnec2/xnec2c/src »
make: *** [Makefile:802 : install-recursive] Erreur 1

I did not copy everything, but seems correct before.
As a reseult from th installation, I have the message included.
What shall I do?
Thank you
image

error building in Lubuntu 16.04

Hello

I'm trying to build xnec2c in Lubuntu 16.04. Could build on other flavor, but I've no indication that it is a flavor issue.
The issue is on ./configure
...
checking whether make sets $(MAKE)... (cached) yes
./configure: line 5353: syntax error near unexpected token PACKAGE,' ./configure: line 5353: PKG_CHECK_MODULES(PACKAGE, $pkg_modules)'

tried versions (from repository) 4.4.12, 4.4.11 and 4.3.5.

Also tried to clone the git but get a dependency problem on make:
/usr/lib/x86_64-linux-gnu/glib-2.0/glib-compile-resources --sourcedir=../resources --dependency-file=./.xnec2c-deps/xnec2c-resources.Pc --target=xnec2c-resources.c --generate-source ../resources/xnec2c.gresource.xml
Opção --dependency-file=./.xnec2c-deps/xnec2c-resources.Pc unknown
Makefile:1284: recipe for target 'xnec2c-resources.c' failed

Any advice? Thanks a lot

Optimization requires the frequency plots window to be open

From Finn, VK3FTA:

[ while using xnec2c-optimize ]
I found that xnec2c did not automatically re-run the frequency loop when
examples/yagi.nec was updated. I had to manually click the loop "play"
button to regenerate yagi.csv -- even though xnec2c is configured to
"Reload and write changes on .NEC file changes". Whereas,
xnec2c-optimize.pl does automatically detect .csv file changes.
I think I may have found the reason why. xnec2c's frequency loop only gets
re-run automatically when xnec2c's "Frequency Data Plots" window is open.

From an xnec2c perspective, there is only a single frequency selected unless the frequency plots window is open. If it is open then it sweeps, but if it is closed it only calculates the selected frequency.

TODO: Maybe xnec2c can be configured to sweep if freqplots is open, or maybe just have it open freqplots automatically and click "play" when optimization is selected.

sparc64: xnec2c fails to link with "relocation truncated to fit" errors

When building the Debian sparc64 package we get the following errors. I'm not sure how to fix this so if someone has a sparc64 system to test on then reply to this issue and maybe we can troubleshoot.

Maybe using -fPIC instead of -fpie will fix it, but i don't have a way to test. I'm guessing something like LDFLAGS=-fPIC or CFLAGS=-fPIC could fix the problem. If there is a solution then I would like to see a patch to configure.ac to detect when the flag is needed.

References:

Here is a snippet below, or the whole log is here:

/usr/bin/ld: warning: xnec2c has a LOAD segment with RWX permissions
xnec2c-resources.o: in function `xnec2c_get_resource':
./src/xnec2c-resources.c:51279:(.text+0x10): relocation truncated to fit: R_SPARC_GOT13 against `static_resource'
xnec2c-resources.o: in function `xnec2cresource_constructor':
./src/xnec2c-resources.c:51458:(.text.startup+0x10): relocation truncated to fit: R_SPARC_GOT13 against `static_resource'
xnec2c-resources.o: in function `xnec2cresource_destructor':
./src/xnec2c-resources.c:51463:(.text.exit+0x10): relocation truncated to fit: R_SPARC_GOT13 against `static_resource'
main.o: in function `opt_start_optimizer_thread':
./src/main.c:94:(.text+0x68): relocation truncated to fit: R_SPARC_GOT13 against symbol `main_window_builder' defined in .bss section in shared.o
main.o: in function `sig_handler':
./src/main.c:724:(.text+0x18c): relocation truncated to fit: R_SPARC_GOT13 against symbol `FORKED' defined in .bss section in shared.o
./src/main.c:725:(.text+0x1b0): relocation truncated to fit: R_SPARC_GOT13 against symbol `num_child_procs' defined in .bss section in shared.o
./src/main.c:725:(.text+0x1c4): relocation truncated to fit: R_SPARC_GOT13 against symbol `forked_proc_data' defined in .bss section in shared.o
./src/main.c:731:(.text+0x1fc): relocation truncated to fit: R_SPARC_GOT13 against symbol `input_fp' defined in .bss section in shared.o
./src/main.c:724:(.text+0x244): relocation truncated to fit: R_SPARC_GOT13 against symbol `FORKED' defined in .bss section in shared.o
./src/main.c:701:(.text+0x294): relocation truncated to fit: R_SPARC_GOT13 against symbol `FORKED' defined in .bss section in shared.o
./src/main.c:708:(.text+0x2a8): additional relocation overflows omitted from the output

User experience: Window titles

Choose and use consistently two short names for the Xnec2c windows. "Main" and "Editor" are two possibilities. "Xnec2c Console" and "Xnec2c Editor" are also possibilities.

Display the file name or first line of comment (CM) in the window title bar for both windows. If the string is too long, devise a clever means to truncate it.

This will help the (new) user relate the documentation to the application.

isssues with single frequency FR

I have issues to visualize currents and frequency parameters when a single frequency is indicated in FR card.
nec2c instead works perfectly.
I'm adding an example but this is a general behavior.
file1.nec does not work
file2.nec works
example_files.zip

Bug in frequency display

Bug: Under certain conditions, the least significant digit of the max gain in the net gain min/max readout disappears.

Solution: on line 778 of plot_freqdata.c change
char s[20];
to
char s[23];

wishlist: improve gnuplot save for VSWR and S11

Hi,
first of all thank you for this great job. Having xnec2c improved and available on Github is a very good thing.
I have a suggestion that I marked as wishlist since it is probably not at high priority, but I'd like to have implemented.
I tried the S11 output by changing Frequency Plots Show S11 checkbutton state from 0 to 1.
While the S11 is plotted, the values are not saved on the related gnuplot file. Furthermore, in the same file, the reference impedance is missing, too.
I know that starting from the imput impedance and the reference one, all parameters can be evaluated, but, in my opinion, to help visualizing from different points of view, and to speed up using gnuplot, all the parameters related to the input impedance, that is real and imaginary part of Zin, VSWR, S11, and the reference impedance, should always be saved. Anyway, it would be nice to have at least the magnitude of S11 and the reference impedance saved.
Or maybe a box to select the parameters to output cold be implemented?
Thank you again.
Gigi.

Translation Framework

[ moving translation discussion from #16 to here ]

@ndim,

Regarding gettextize and intltoolize: I have been involved with libgphoto2's build system for about the last 20 years, so I am kind of familiar with the gettextize based buildsystem aspects.

I just found this article, perhaps modern gettext would be better than libtoolize:

See commit 5c4c07c for the minor intltoolize fixes I had to do at some point (for some reason I do not recall).

I could get that to work properly easily by basically mostly copying what libgphoto2 does, perhaps minus some special things I did for libgphoto2 specifically.

I think that would be great.

I just checked my branch for translations and I've not changed much in po/ that would matter in terms of merging. I'm new to translation considerations, so please add suggestions from your experience. Based on my current understanding these are the requirements that could be ideal for the po/ stack in xnec2c:

  1. xnec2c.pot is generated automagically just prior to version release and committed for any textual changes. What is the best practice for maintaining the .pot files in git over time?
  2. The .po files get automatically updated/merged with any .pot changes:
    • New strings should be blank
    • Missing/deleted strings: Do whatever is "normal" here, I'm not trying to reinvent the wheel, just curious about edge cases.
      • Should deleted strings in .po files be kept round in case the language comes back? I mean, someone put the work into translating...but that could end up being stale over time.
      • For example, what if a very long chunk of text was translated, and one or two words in the source material was changed? That could loose the translations that we might wish to keep.
  3. Translation strings must support interaction with Glade XML from resources/xnec2c.glade so that GTK3 UI widgets use the translated text from the appropriate .po file.
  4. Auto-generate .gmo files: At which stage should this happen?
    • ./autogen.sh ?
    • ./configure ?
  5. Install the .gmo files in the right place
    • Would be nice if the .gmo files are usable from the xnec2c source tree so ./src/xnec2c gets any new translations.
  6. Support gettext from CentOS 7 (gettext version 0.19.8.1)
  7. Other considerations?

xnec2c still beeps

Hi Eric,

First of all thank you for developing this great program! I finally found a modern NEC implementation that works on Linux.

I can see there is a commit from March 31 which fixes some of the beeps
7bba2b4

however I built Release v4.4.16, and it still keeps beeping when rotating the 3d views.

Is this some GTK "feature" or is it possible to disable it?

xnec2c exit with segfault

I'm attaching a zip (examples.zip) with files giving or not a segmentation fault. examples.zip
Moxon_900.nec works
Moxon_seg_fault.nec gives a segmentation fault
Moxon_XQ_and_0.nec gives a segmentation fault
Moxon_XQ_and_1.nec works
Moxon_without_RP_and_XQ.nec gives a segmentation fault

Segment tag number error

Update docs with troubleshooting hints for "Segment tag number error."

While the underlying user error may be common to all NEC2 applications, the error message appears to be unique. A sentence or two in the user manual is easy; a hint in the application error message might be more work.

In the mean time, the user is prevented from saving his or her work, which may be substantial.

Consider supporting Brew

here is a start:

class Xnec2c < Formula
  desc "Multi-threaded EM tool based on NEC2 to model antenna radiation patterns"
  homepage "https://www.xnec2c.org/"
  url "https://www.xnec2c.org/releases/xnec2c-v4.4.12.tar.gz"
  sha256 "e98af1e8b9098df9cc03f90950358b846cc6a2965e79c0114ab711fbe51272c5"
  license "GPL-3.0-or-later"

  depends_on "atk"
  depends_on "cairo"
  depends_on "gdk-pixbuf"
  depends_on "glib"
  depends_on "gtk+3"
  depends_on "librsvg"
  depends_on "pango"
  depends_on "autoconf"
  depends_on "automake"

  def install
    system "./autogen.sh"
    system "./configure", *std_configure_args
    system "make"
    system "make install"
    system "make desktop-install"
  end

  test do
    system "#{bin}/xnec2c", "-h"
  end
end

Cannot compile from sources

I tried with both the source from master and with the tar.gz of the 4.3.4 version and I got the following error:
Preparing the xnec2c build system...please wait

Found GNU Autoconf version 2.69
Found GNU Automake version 1.16.1
Found GNU Libtool version 2.4.6

Automatically preparing build ... Warning: autoreconf failed
Attempting to run the preparation steps individually

Preparing build ... configure.ac:79: error: required file './config.rpath' not found
configure.ac:79: error: required file './ABOUT-NLS' not found
ERROR: automake failed

I'm on Ubuntu 20.04

Thank you

Gigi

Cannot resize windows for the various views

Running the prepackaged Fedora 40 version here. On my laptop the views are fairly small and have a fixed size. Who would be helpful to be able to resize these, bit I can't grab the corners or borders. This may be related to the new Wayland windowing system.

KF7RCC

Save more simulation data (radiation pattern, currents etc.) to csv

It would be nice to be able to save radiation pattern, current data etc. to csv so that the data can be analyzed in an external program.

Motivation:
In some cases max gain and f/b ratio is not enough. For instance when evaluating a feeder for a dish reflector gain is integrated over the angle that covers the reflector. Or if you want to reduce side lobes etc.

Drawing of triangular surface patches

The drawing routine for surface patches is only good for rectangular patches and makes triangular patches look really weird and wrong. I'm actually not sure if the underlying nec2 engine handles triangular patches but if it does, I'd be happy to submit a pull request for better drawing of triangular patches.

Command-line interface "batch" option should start the frequency loop automatically

Hi, I'm using Python for automating tasks in the xnec2c workflow. I'm trying to automate the NEC files generation, simulations with xnec2c and optimizations.

During my research on how to perform these things, I found the "batch" option which closes the program after the frequency loop is done, and by adding proper options I can export the results in a Touchstone file. However, the frequency loop doesn't start automatically; I have to start it manually, so it can perform the calculations, write the results in the file, and close the program. That's a quite cumbersome and not practical behaviour.

It would be more relevant that the "batch" option would perform automatically all the stuff without needing a user's action, so it could be effectively used to perform batch simulations.

configure fails on macOS

I am trying to build on the current version of macOS. I think I have gtk3-devel and related packages in place, as I use them for other projects. When I run .configure I get this error output. Any suggestions? I had a look in the script but it is not obvious to me.

Many thanks,
Rafal EI6LA

checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether configure should try to set CFLAGS... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
./configure: line 4595: syntax error near unexpected token `PACKAGE,'
./configure: line 4595: `PKG_CHECK_MODULES(PACKAGE, $pkg_modules)'

FYI, autogen has generated this output:

Preparing the xnec2c build system...please wait

Found GNU Autoconf version 2.71
Found GNU Automake version 1.16.5

Warning:  libtoolize does not appear to be available.  This means that
the automatic build preparation via autoreconf will probably not work.
Preparing the build by running each step individually, however, should
work and will be done automatically for you if autoreconf fails.

Fortunately, glibtoolize was found which means that your system may simply
have a non-standard or incomplete GNU Autotools install.  If you have
sufficient system access, it may be possible to quell this warning by
running:

   sudo ln -s /opt/local/bin/glibtoolize /opt/local/bin/libtoolize

Found GNU Libtool version 2.4.7

Automatically preparing build ... done

The xnec2c build system is now prepared.  To build here, run:
  ./configure
  make

`--batch` option still doesn't work properly

Hi, here's an other issue about the --batch option. The last fix did not work for me and the last thread was tagged as closed (#44 ), so I open another one.

I noticed that opening the frequency plot window starts the frequency loop automatically if the batch option is activated. I decided to dig further into main.c and this piece of code confirms that this behavior is expected:

https://github.com/KJ7LNW/xnec2c/blob/master/src/main.c#L627-L637

As rc_config.main_loop_start had been set to 1 by the previously modified code.

A quick and dirty modification forces the frequency loop to run if rc_config.main_loop_start has been set to 1:

  // MODIFIED
  if( rc_config.main_loop_start )
    Start_Frequency_Loop();

  /* Re-initiate frequency plots if window open */
  if( isFlagSet(PLOT_ENABLED) )
  {
    GtkWidget *box = Builder_Get_Object( freqplots_window_builder, "freqplots_box" );
    gtk_widget_show( box );
    
    // MODIFIED
    if( rc_config.main_loop_start )
      Main_Freqplots_Activate();
  }

This now works as it should, so it's good enough for me. But it shows another flaw: it runs the frequency loop at startup even without the batch option, because the frequency loop start state is stuck to 1 in my xnec2c.conf file. That's a 2-bugs-in-1 issue.

I also previously thought about forcing the plot window to show up in --batch mode, just like it does in --optimize mode. I didn't manage to do that because my knowledge of xnec2c's source code is very limited, but it would be useful to have a real time preview of your results when doing batch simulations. In addition of that, the logic in the code portion I modified would remain unchanged.

Edit: well, a quick fix for the frequency loop start when neither --batch nor --optimize is on would be this little modification. I changed this:

https://github.com/KJ7LNW/xnec2c/blob/master/src/main.c#L383-L384

To this:

  if (rc_config.batch_mode)
	  rc_config.main_loop_start = 1;
  else
      rc_config.main_loop_start = 0;

Still no change in the conf file, but these flags seem to override what's written inside anyway.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.