Re: [fpc-pascal] Is Delphi7 on Windows to FPC on embedded Linux possible?

2010-09-25 Thread Henry Vermaak
On 24 September 2010 23:17, Bo Berglund  wrote:
> 
> 2) Display control screens in a GUI way with standard controls (buttons, text 
> boxes, radio buttons etc). This would be the new user interface for the 
> instrument.
>
> 3) Display data graphically (curves, pie charts etc). We need to improve on 
> the on-board datat display a lot

The amount of effort of these points depends on the configuration of
your operating system.  If you'd like to keep it fairly light weight,
you can try fpgui or mseide+msegui, which talk directly to the X
server (assuming you have an X server running, otherwise you'll have
to talk to the frame buffer or use sdl).  Lazarus targets the heavier
widgetsets, but I've seen posts about using it with embedded Qt, which
may suit you well.  I also don't know if anyone has tried the gtk
framebuffer port, which also looks interesting.

I can at least confirm that I've managed to cross compile and demo
fpgui on an embedded linux system with an lcd.

Henry
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is Delphi7 on Windows to FPC on embedded Linux possible?

2010-09-25 Thread Michael Van Canneyt



On Sat, 25 Sep 2010, Bo Berglund wrote:


This may be a stupid question, but I just discovered FPC so please bear with 
me...

I have been writing Delphi programs since 1996 or so (when Delphi 2 was 
released), so I am rather comfortable with that.
Now I need to write for the Linux platform because we are trying to make a 
Linux front end to a piece of equipment we make that only has a pitiful 
character based LCD screen (8 x 20 characters).

The front-end would consist of a small board with Embedded Linux and a 
graphical LCD screen (possibly with touch surface so the mouse can be dispensed 
with).

Since I was told that Java is the way to go to get stuff working on several 
platforms I started to read up on Java but it is taking forever to get 
anywhere. :-(

So then I found FPC and now I am looking for advice concerning if it would be 
possible to use FPC/Lazarus to program for an embedded Linux board with a 
graphics LCD screen. I want to be able to do the following:

1) Communicate via RS232 to the equipment core to control it and retrieve data. 
We already have a serial interface protocol for sending and retrieving data and 
commands, which would be the gateway into the core. So the first question is if 
there exists some class/component in FPC that can be used to communicate.


Yes, there are several classes.



2) Display control screens in a GUI way with standard controls (buttons, text 
boxes, radio buttons etc). This would be the new user interface for the 
instrument.


If you use Lazarus, this is possible, if you're running X11.



3) Display data graphically (curves, pie charts etc). We need to improve on the 
on-board datat display a lot


There are several charting components available.



4) Store data on a file system, either SSD or flash memory.


As long as it is mounted, this is not a problem.



Can this be done?

Is it possible to program on a standard Linux distribution but compile for the 
embedded linux?


Yes. That's how it is done traditionally: cross-compiling. There is a FAQ 
floating around.



Are there any traps to look out for?


Yes:
- Don't use Windowsisms.
  Use sysutils unit only. It is guaranteed cross-platform. 
- type all data strictly. 
- Avoid typecasting pointer to integer and vice versa.




What is the best way to get started?


1. Install lazarus.
2. Take your existing Delphi units and start converting them.
   Lazarus has a tool for it :-)



Can I even re-use my Delphi7 classes from the windows environment?


Yes, as long as they do not contain windows-specific code.
(in particular: the windows and ACtiveX units will not work on linux)

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is Delphi7 on Windows to FPC on embedded Linux possible?

2010-09-25 Thread Paul Breneman

This won't answer all of your questions but I hope it will help:
  http://www.turbocontrol.com/embeddedfreepascal.htm

I'd be glad to discuss this in more detail.

--
Regards,
Paul Breneman
www.dbReplication.com - VCL database replication components
www.TurboControl.com - Hardware and software development services
- Educational programming project for environment monitoring
- Information on using FreePascal for embedded systems
- Support information for the TurboPower open source libraries
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is Delphi7 on Windows to FPC on embedded Linux possible?

2010-09-25 Thread Graeme Geldenhuys
Hi,

On 25 September 2010 00:17, Bo Berglund  wrote:
> So then I found FPC and now I am looking for advice concerning if it
> would be possible to use FPC/Lazarus to program for an embedded
> Linux board with a graphics LCD screen. I want to be able to do the following:


Paul Breneman created a simply archive you can download which doesn't
require any extra setup. This allows you to build for Embedded Linux
or Windows CE devices. He also uses fpGUI Toolkit which produces much
smaller executables than Lazarus LCL.  With fpGUI you can use any IDE
you which - it's ide independent.


http://www.turbocontrol.com/helloworld.htm
http://www.turbocontrol.com/monitor.htm
http://www.turbocontrol.com/embeddedfreepascal.htm


I personally don't write software for embedded systems, so I can't
comment on the remainder of your queries. I'm pretty sure Paul
wouldn't mind answering some of your questions though. His email
address is at the bottom of each of the URL's I posted above.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net:8080/fpgui/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Is Delphi7 on Windows to FPC on embedded Linux possible?

2010-09-25 Thread Honza
2010/9/25 Bo Berglund :
> So then I found FPC and now I am looking for advice concerning if it would be 
> possible to use FPC/Lazarus to program for an embedded Linux board with a 
> graphics LCD screen. I want to be able to do the following:
>
> 1) Communicate via RS232 to the equipment core to control it and retrieve 
> data. We already have a serial interface protocol for sending and retrieving 
> data and commands, which would be the gateway into the core. So the first 
> question is if there exists some class/component in FPC that can be used to 
> communicate.
>
> 2) Display control screens in a GUI way with standard controls (buttons, text 
> boxes, radio buttons etc). This would be the new user interface for the 
> instrument.
>
> 3) Display data graphically (curves, pie charts etc). We need to improve on 
> the on-board datat display a lot
>
> 4) Store data on a file system, either SSD or flash memory.
>
> Can this be done?

1) I'm not aware of a ready made solution, but it quite probable
exists and if not it would be probable pretty easy to write one. It's
supposedly mostly a matter of getting access to/opening the right
(text) device.

2) Depends. Has the embeded Linux only a frame buffer device or a X
server? On X you can choose from more than one widgetset supported by
FPC/Lazarus. GTK+ can AFAIK also run on bare fbdev but I don't know if
the LCL/GTK does support that.

3) see 2)

4) Linux suports a broader range of filesystems than Windows, no
problem expected here.

> Is it possible to program on a standard Linux distribution but compile for 
> the embedded linux?

Yes, that's what cross compiling is for. In any case, the embeded
Linux CPU has to be a FPC supported one, e.g. x86, AMD64, ARM, ... and
many more.

> Can I even re-use my Delphi7 classes from the windows environment?

Those dependent purely only on RTL/VCL and not on direct WinAPI calls
have a good chance to being ported to FPC. Sometimes they will just
work w/o modifications in Delphi mode.

-- 
bflm
freepascal-bits.blogspot.com
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal