I would start working in the existing app to get some form of GUI - business code separation.
Then I would try to attach that business code to a new lazarus/LCL gui with TChart and the rest.
Only then, (and even ...Maybe), would I think about optimizing the structure of the business code.
The primary application is the fast paced, high tech world of beer bottle diameter measurement.
As a side remark I do also work with pascal on the microcontroller firmware side (MikroPascal dsPIC) and I also have been getting into electronic and mechanical CAD for hardware designs. I have been more than looking into Ethernet based communication on the hardware design side lately, but it will be a while until I have anything up and running including firmware, it is just one of the things I want to test out.
I'm having a bit of a crisis of confidence regarding certain types of modern electronics after the reports of the Tesla failures https://hackaday.com/2019/10/17/worn-out-emmc-chips-are-crippling-older-teslas/ (https://hackaday.com/2019/10/17/worn-out-emmc-chips-are-crippling-older-teslas/).
Unfortunately I've not had time to look at FPC's support of AVR yet, but I would like to say that while Eclipse's Arduino stuff works it makes Lazarus look ****ing good: the startup time is around 35 seconds and there's so much functionality that it obscures the basic purpose.
The primary application is the fast paced, high tech world of beer bottle diameter measurement.
Don't tell me: you've got one of those bottling carousels built on a Caterpillar bulldozer bearing :-)
It is an interesting thought to try to compile some of the code under Lazarus/FreePascal as is. None of the user interface would likely work, as menus are based on code that directly addresses video memory, and I would be very surprised if the Halo graphics library would be able to be linked. But I have had in mind to start out with an application that are able to load the files and perform the calculations and save data back to the files, to check if that aspect of the code works. Except that I would like to simplify the data structure (but perhaps that should be delayed), I suspect some Unicode work will be needed related to unit processing and headings in the files.Well, you could try to use the 16-bit MS-DOS (https://wiki.freepascal.org/DOS) target as a first step as that is even a bit more compatible with TP than the 32 or 64 bit variants. You could then try to rework your code step by step.
Good summing up. One change that you're likely to see is that you can't cast an integer to a pointer any more, you'll find places where there's ambiguity between pointer and integers to use ptrint or ptruint which are "pointer sized integers".
Where you know that you have mandatory data structures (e.g. to match the format of data blocks arriving from an internal device) it's worth putting an explicit size check in the declaring unit's startup code and making sure that the program halts rather than relying on an assertion (which can be disabled).
MarkMLl
QuoteUnfortunately I've not had time to look at FPC's support of AVR yet, but I would like to say that while Eclipse's Arduino stuff works it makes Lazarus look ****ing good: the startup time is around 35 seconds and there's so much functionality that it obscures the basic purpose.
Yup. But my electronics are, as said, dspic based, but that Java contraption is slow too (but Netbeans based)
QuoteUnfortunately I've not had time to look at FPC's support of AVR yet, but I would like to say that while Eclipse's Arduino stuff works it makes Lazarus look ****ing good: the startup time is around 35 seconds and there's so much functionality that it obscures the basic purpose.
Yup. But my electronics are, as said, dspic based, but that Java contraption is slow too (but Netbeans based)
Make that 65 seconds for Eclipse to fully initialise: is this really the best that the "mainstream developer community" can do?
I've had an interesting exchange in the Arduino forum about an itch I'd scratched and written up, and am told that the IDE developers are refactoring a whole lot of stuff to make it easier for an arbitrary IDE to call the compilers etc. https://github.com/arduino/arduino-cli (https://github.com/arduino/arduino-cli)
I've been eyeing up the deficiencies of the Arduino IDE for a long time, and it occurs to me that it's so easy to knock a UI together using Lazarus that a moderate amount of work could produce something vastly better than the opposition.
MarkMLl