News:

Precision Simulator update 10.173 (24 February 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Hello world?

Started by Will, Sat, 11 Jun 2022 16:59

Will

Hello team,

I think it might be fun to try making an add-on for PSX that lets pilots use ACARS to request a final loadsheet, and then have the loadsheet printed on a "Paper from the flight deck printer" window. I know that some of this functionality is already available through other add-ons, so it's more about the coding challenge and personalization than just getting access to the functionality.

What I'd like to do with this post is describe the specs, to ask if everything is theoretically possible, and then ask the community if there is anything like a simple "Hello world" app that I can use as a starting point to model from.

Proposed functionality:

1. Menu item like "<REQUEST LOADSHEET" available while the aircraft is on the ground.
2. When the loadsheet is requested, there's an uplink notification (like when ATIS is requested). The crew can print the loadsheet.
3. The loadsheet contains items from the Instructor Pages:

Time
Date
ZFW
CG

Very simple! I think I can learn from a model, but I also think it would take me forever to learn the basics of just how an app connects to PSX and reads and sends variables.

Therefore...

First question: Is any of the proposed functionality impossible or extraordinarily complicated?

Second question: Is there a simple open source "hello world" program out there? Maybe something that puts "hello world" on the CDU, or even more basic, just reads and writes any variable to PSX?

I'm starting from scratch here (and using a Windows 10 machine), so any coding environment is fine with me.

Thanks for considering!
Will /Chicago /USA

Hardy Heinlin

Hello Will,

I would recommend Java because it runs everywhere and it's free, and there's a simple sample code which puts <MILK and NOODLE> on your CDU. You'll find it in Aerowinx/Developers/AddonExample.jar. It already contains the code for the network connection and some examples on how to read and write PSX variables. Could that help as a start?


Regards,

|-|ardy

Jeroen Hoppenbrouwers

Next to the Java classes, which is as close to native PSX as you will get, there's also my Python for PSX lib.
http://www.hoppie.nl/psxpython/

In the end it does not matter much which programming language you choose. It's not the language, but the thinking behind engineering a program, and the support libraries, that make or break a project.


Hoppie

Will

Thanks guys.

How embarrassing, I've been with PSX since the beginning and yet missed AddonExample.jar until now.

Let's see how steep the learning curve is...
Will /Chicago /USA

Avi

CMC-PSX was born from the AddonExample.jar  :)
Avi Adin
LLBG

Will

Thank you, Avi, for the inspiration!

I think if I can compile a .java (text) file into a jar file, then I should be good for the next several weeks of tinkering.

Unfortunately, I'm not there yet.

I renamed AddonExample.java to WJC.java. It's now in ..\jdk-16.0.2\bin.

When I type jar cf EXAMPLE.jar WJC.java, I get java.nio.file.AccessDeniedException.

It looks like jar.exe is trying to write to a Temp directory, but doesn't have permissions. Right? Except that I'm running as administrator.

Sorry for the most basic question! Any tips? Google says I might want to disable my antivirus, but most Google discussions of java.nio.file.AccessDeniedException are regarding uses much more sophisticated than my lowly attempt at compiling my first jar file, so it isn't much help to me (yet).

Will /Chicago /USA

martin

Hello Will,

yesterday I tried to send you a Private Message via your forum profile. Did you see it?
(Im not entirely sure if/how PMs work on this forum.)

Cheers,
Martin

Will

Hi Martin,

I didn't get a PM. But I just sent myself one through Aerowinx and I received it, so you might want to try again. Start by clicking on the blue envelope icon underneath the username on the left side of the screen; that should bring up an email form for you to complete.

Thanks!

Will
Will /Chicago /USA

Jeroen Hoppenbrouwers

Usually you want to move all development files out of whatever your JDK has been installed into.
Typically somewhere in ...\documents.
Keep "installed" files far apart from "written" and "compiled" files.

Unfortunately I have zero experience with Java IDEs or other tools.

Hoppie

Will

Okay, I'm using an IDE now and not running from the command line.

Therefore I withdraw my last question. :-)

Working through some tutorials this morning...
Will /Chicago /USA

martin

Hello Will

Quote from: WillStart by clicking on the blue envelope icon underneath the username on the left side of the screen;

That's what I did and it "seemed" to work. Also sent a PM to myself, which did arrive.
But strangely there seems to be no way to check/review one's Sent messages in one's own profile, so it's all a bit confusing.

However, I did now receive your PM and have replied by direct email, so all good (I hope).

Cheers,
Martin

Hardy Heinlin

What you send is not PM (it's generally deactivated). What you send is email, and that goes via noreply(at)aerowinx, and that aerowinx name may end up in your spam folder, especially when you are on google mail.

martin

Quote from: HardyWhat you send is email
Ah ok, thanks. Wasn't aware of the semantic difference.
Quote from: Hardythat aerowinx name may end up in your spam folder
Nevvah! (Michael Caine voice)
My spam filter is trainable of sorts and has learnt first thing to respect Aerowinx!  ;D

Cheers,
Martin "Not PM" E.