Lazarus

Programming => Packages and Libraries => Lazarus Extra Components => Topic started by: JuhaManninen on April 25, 2010, 04:37:53 pm

Title: ESS Model
Post by: JuhaManninen on April 25, 2010, 04:37:53 pm
@Leledumbo (and others, too).

I have hard times porting ESS Model program. There are more problems than I anticipated.
Now finally I got a windows machine myself and installed Delphi 2009 there.
I tested the original Delphi version of ESS Model there. It is stable but doesn't show any diagrams. I only see a striped canvas which doesn't even fill the whole empty area.

Today things don't work for me! Have I done useless work? If I knew there were so many problems with this prog I wouldn't have started porting it.

Do other people really see diagrams with ESS Model built with Delphi?

Juha
Title: Re: ESS Model
Post by: JuhaManninen on April 25, 2010, 05:14:02 pm
Ok, indeed, the original binary built with Delphi 6 works and shows diagrams!
Could someone please build from source again with Delphi 6? Or maybe with Delphi 7, I guess it is still popular. I started to think the source is stripped somehow. No wonder the project didn't see any activity for years.

I removed DRAG_SUPPORT from the project but it should not affect because I am not dragging anything.

The problem can also be the fancy way the program is made. Lots of interfaces are used. There are typecasts which give run-time errors when built with Lazarus. It could be made in a simpler way.

Juha
Title: Re: ESS Model
Post by: JuhaManninen on April 25, 2010, 05:15:25 pm
and the files can be found here:

http://sourceforge.net/projects/essmodel/files/
Title: Re: ESS Model
Post by: Leledumbo on April 26, 2010, 04:02:16 am
I'll give my previous attempt, but where should I post it? This forum surely is not a choice, since it doesn't accept executables and > 128 KB attachment.

I haven't gotten time to retry with current Lazarus snapshot. Moreover, the (maybe) unfinished new autosize code might be a stopper, but I believe it can be done.
Title: Re: ESS Model
Post by: JuhaManninen on April 26, 2010, 08:48:27 pm
I managed to create a version of EssModel that runs and doesn't crash under Lazarus!
I essentially removed all interfaces and replaced them with abstract base classes and virtual functions and some code to redirect the calls.
I am not sure if this is the right approach. Please feel free to improve.

It does not draw the diagram properly but draws something at least. The treeview is not updated properly.

Leledumbo, did you get your version to draw diagram while leaving the interfaces there? I didn't see any diagram even when building with Delphi2009. Something about interfaces has changed since Delphi6.

The code is now in GitHub repository. To download :
  git clone git://github.com/JuhaManninen/Pascal.git

I will give write access to anyone who wants it, once I learn how to do it.
This is the first git repository I have put up myself.

Juha
Title: Re: ESS Model
Post by: JuhaManninen on April 26, 2010, 10:00:46 pm
Contributions to a GitHub repo happen by forking my repo, changing it and sending a pull request to me.

http://jagregory.com/writings/git-remotes-contributions-and-the-letter-n/

It seems you can have forks of many repos in GitHub even with the free personal account.
Title: Re: ESS Model
Post by: Leledumbo on April 27, 2010, 03:37:49 am
Quote
Leledumbo, did you get your version to draw diagram while leaving the interfaces there? I didn't see any diagram even when building with Delphi2009. Something about interfaces has changed since Delphi6.
The converted one? Yes, but only the diagrams and arrows, no methods nor properties. I have no idea why this happens.
Title: Re: ESS Model
Post by: JuhaManninen on May 06, 2010, 07:34:53 am
EssModel is now working somehow. It shows diagrams of at least some programs.
I modified the code heavily, replacing interfaces with listener classes etc.
It would need much more work to make this a really good program.
Anyone interested, please take a look.
 $ git clone git://github.com/JuhaManninen/Pascal.git

Juha
Title: Re: ESS Model
Post by: Leledumbo on May 06, 2010, 08:33:52 am
Can you make a webpage for the github that contains zipped download? I don't have (and don't know) any good (and portable since I must access it from campus through proxy) git client.

I also started the conversion last night, but I haven't changed the code as much as you.
Title: Re: ESS Model
Post by: JuhaManninen on May 06, 2010, 11:17:00 am
Can you make a webpage for the github that contains zipped download? I don't have (and don't know) any good (and portable since I must access it from campus through proxy) git client.

I also started the conversion last night, but I haven't changed the code as much as you.

I am not so happy about making a zipped download now. I am changing the prog and I would need to update the zip package every time. It just doesn't make sense.
If the program gets more stable and worth publishing, then I will make it.

I have tested git client also on Windows, it works well. It should work on Apple as well. And naturally it works on Linux. What other platforms you need supported?
There are nice graphical tools "git gui" and "gitk". I never felt a need for other graphical clients.

EssModel still has problems:
RecentFiles can't be written to registry (XML file under Linux).
TreeView doesn't have icons.

I was fixing memory leaks. Starts to look OK.
Title: Re: ESS Model
Post by: JuhaManninen on May 06, 2010, 11:22:42 am
Hi,

I copy here the instructions I wrote to Lazarus mailing list about GitHub work flow, in case someone wants to change the code:

The GitHub "free plan" account allows only one personal repository and no
other direct committers. However, it allows you to fork any number of existing
repositories, change them and then send pull requests.

The flow is explained nicely here:
http://jagregory.com/writings/git-remotes-contributions-and-the-letter-n/

First, at http://github.com:
 1. Create a "free plan" account.
 2. Find my Pascal repository.
 3. Click the Fork-button. Now you have a forked Pascal repo.

Then at your machine:
 $ git clone git://github.com/YourName/Pascal.git
 Edit code ... git commit ... repeat if needed.
 $ git push origin

Then again at http://github.com:
Select your forked Pascal repo and click "Pull Request" button. There should
be my name selected automatically.

It is actually cool. I was wondering how git users can pull from each other
when most people have dynamic IP addresses. GitHub is one way to solve that.
Title: Re: ESS Model
Post by: Leledumbo on May 07, 2010, 07:23:00 am
Quote
I am not so happy about making a zipped download now. I am changing the prog and I would need to update the zip package every time.
Use dynamic archiving that only zips upon requests.
Quote
I copy here the instructions I wrote to Lazarus mailing list about GitHub work flow, in case someone wants to change the code:
Ok, I'll try it.
Title: Re: ESS Model
Post by: JuhaManninen on May 07, 2010, 08:36:16 am
Use dynamic archiving that only zips upon requests.

Right, I noticed GitHub makes the zip package automatically from the latest sources. Cool.
If you have problems configuring the git repo, I am ready to help through chat or e-mail.

Juha
Title: Re: ESS Model
Post by: Imants on June 12, 2012, 08:00:57 pm
@Leledumbo (and others, too).

I have hard times porting ESS Model program. There are more problems than I anticipated.
Now finally I got a windows machine myself and installed Delphi 2009 there.
I tested the original Delphi version of ESS Model there. It is stable but doesn't show any diagrams. I only see a striped canvas which doesn't even fill the whole empty area.

Today things don't work for me! Have I done useless work? If I knew there were so many problems with this prog I wouldn't have started porting it.

Do other people really see diagrams with ESS Model built with Delphi?

Juha

Sorry to revive dead topic. But you could not load any model with delphi 2009 and lazarus because program uses PChar and string variables to read from stream whitch in lazarus and Delphi is UTF8 you I changed them to PAnsiChar and AnsiString and all loded perfectly

edit:
I even kinda semi successfully (some functionality lost, but model was drawn perfectly) ported it to lazarus
Title: Re: ESS Model
Post by: JuhaManninen on June 12, 2012, 11:03:21 pm
I even kinda semi successfully (some functionality lost, but model was drawn perfectly) ported it to lazarus

Hey, you are clever!
How did you solve the interface delegation part? (Maybe FPC trunk already supports it)
Would you like to share your ESS Model port?

Regards,
Juha
Title: Re: ESS Model
Post by: Imants on June 13, 2012, 07:55:28 am
I put my port here:
https://tankuproj.svn.sourceforge.net/svnroot/tankuproj/essmodel/trunk

for now:
1)open folder do not work because it uses shell components which was removed even in Delphi :)
2)export to wfm files format do not work because I never used it so I kinda didn't know how to port it
3)drag and drop because they used something even Delphi didn't have now, but I know how to ad it to lazarus so it will be back :)
4)for now I think (I did not tested) there are no Linux support but I will fix that
5)Windows 64 bit not tested maybe it works

There where no problems with interface declaration so I think it is solved in trunk or newest stable version
Title: Re: ESS Model
Post by: Ask on June 13, 2012, 06:14:57 pm
Quote
2)export to wfm files format do not work because I never used it so I kinda didn't know how to port it

For the record, you can use TMetafileCanvas class from
components\tachart\tadrawerwmf.pas file
Title: Re: ESS Model
Post by: JuhaManninen on June 13, 2012, 11:20:55 pm
I put my port here:
https://tankuproj.svn.sourceforge.net/svnroot/tankuproj/essmodel/trunk

I still don't see any graphics. The program compiles and runs on Windows32 VM with FPC 2.6.0 but trying to open any *.pas file gives an access violation or arithmetic error.
How did you get a picture? Does it work for others?

FPC trunk does not compile it also because ESSModel defines TClass which is already defined in RTL.
For some reason FPC 2.6.0 compiles it.

Quote
There where no problems with interface declaration so I think it is solved in trunk or newest stable version

"Delegation", not "declaration". Anyway, it may be fixed in recent FPC versions indeed.

Juha
Title: Re: ESS Model
Post by: Imants on June 14, 2012, 07:43:12 am
I get access violation too if I try to parse utf8 source with source in ANSI format I have no problem. I use trunk version to compile my project FPC 2.7.1 and it compiles without problems.

Now I am trying to figure out how to loat utf8 source files

edit:
I kinda noticed that my utf8 source files has these 3 symbols "ļ»æ" at the beginning of the file. Someone know is it common to all utf8 files?

edit:
I build program and put it here for now(I think it wil load utf8 source files now):
http://files.inbox.lv/ticket/40bd8f3fa5324c366bd13290a220c1d418d57729/EssModel.rar
Title: Re: ESS Model
Post by: Imants on June 15, 2012, 10:09:32 am
Finally I ported essmodel to Linux now it runs and compiles in at least ubuntu linux with fpc 2.7.1

here is my linux build:
http://files.inbox.lv/ticket/83709b4413cd182584ea58cab8aa912e77be5224/essmodel.tar.gz

here is my new windows build:
http://files.inbox.lv/ticket/f656a65da56ffef22d6d55b41f8460ae217f71ef/essmodel.rar

now I can at last focus on fixing other issues
Title: Re: ESS Model
Post by: felipemdc on June 15, 2012, 12:03:28 pm
edit:
I kinda noticed that my utf8 source files has these 3 symbols "ļ»æ" at the beginning of the file. Someone know is it common to all utf8 files?

Thats the UTF-8 BOM (Binary Order Marker). You can leave it there or delete it, like you want. It is not part of the text. It's presence might alter the way the compiler handles your strings from what I remember.
Title: Re: ESS Model
Post by: Imants on June 15, 2012, 12:27:31 pm
edit:
I kinda noticed that my utf8 source files has these 3 symbols "ļ»æ" at the beginning of the file. Someone know is it common to all utf8 files?

Thats the UTF-8 BOM (Binary Order Marker). You can leave it there or delete it, like you want. It is not part of the text. It's presence might alter the way the compiler handles your strings from what I remember.

Thanks. In essmodel I just skip it. It is good to know that it is same in every where not some random chars.
Title: Re: ESS Model
Post by: Imants on June 16, 2012, 04:43:32 pm
I restored essmodel document generation by replacing ole objects with libxml2 which is multi-platform.

I have some questions now:
1) In windows I used iconv.dll, libexslt.dll, libxml2.dll, libxmlsec.dll, libxstl.dll so someone know where I can find Linux so versions of these files.
2)I know that Windows loads all dll-s which are placed near exe file. Is Linux doing the same?
3)Where could I put essmodel so that all could try and use it? Has lazarus team such place or I need to create my own place?
Title: Re: ESS Model
Post by: JuhaManninen on June 16, 2012, 04:54:03 pm
I restored essmodel document generation by replacing ole objects with libxml2 which is multi-platform.

I have some questions now:
1) In windows I used iconv.dll, libexslt.dll, libxml2.dll, libxmlsec.dll, libxstl.dll so someone know where I can find Linux so versions of these files.

There are similar but not identical classes in libraries if FPC and Lazarus.
May require some porting.

Quote
2)I know that Windows loads all dll-s which are placed near exe file. Is Linux doing the same?

Unfortunately no. I usually copy .so files to /usr/local/lib and run ldconfig.

Quote
3)Where could I put essmodel so that all could try and use it? Has lazarus team such place or I need to create my own place?

Some public source repository is good. Your original version was in sourceforge.net. I think it is a good place.
I was just planning to test your Linux port. If you put the sources into a repo, I will wait a little more.

Juha
Title: Re: ESS Model
Post by: Imants on June 16, 2012, 06:13:37 pm
I work from many computers so I always put my source in repository. So my Linux patch is there too now.
I do not know how it will now react with my latest commit with libxml2 (because it requires libxml2.so and other so files) but he was working in Linux yesterday when I last tested (at work) without my latest commit. I think I will try to load library dynamically and if it fails hide documentation menu item.
My Linux version of Lazarus is broken at home so I can't test it now and I am too busy to repair it now.

Soon I think I will need to make a new stable version of this project.
Title: Re: ESS Model
Post by: Imants on June 18, 2012, 01:25:27 pm
I checked at least Ubuntu can download libxml packages trough synaptic package manager. And then essmodel works with all documentation generation.
How can I provide these libs to other Linux users or Ubuntu users who aren't instaled these packages. I am little confused because I haven't used Linux too long and do not know how things are done there.
Title: Re: ESS Model
Post by: JuhaManninen on June 19, 2012, 09:41:05 pm
How can I provide these libs to other Linux users or Ubuntu users who aren't instaled these packages. I am little confused because I haven't used Linux too long and do not know how things are done there.

You can just document the dependency now and people can install the package.
"libxml" should be available for all distros.

Juha
Title: Re: ESS Model
Post by: Imants on June 20, 2012, 07:40:53 am
How can I provide these libs to other Linux users or Ubuntu users who aren't instaled these packages. I am little confused because I haven't used Linux too long and do not know how things are done there.

You can just document the dependency now and people can install the package.
"libxml" should be available for all distros.

Juha

Yes I checked that by installing clean Linux version on virtual machine and it had them all. Only problem was for developers (who would want to use this code) because I needed to install libxml-dev packages to compile project
Title: Re: ESS Model
Post by: eastorwest on September 10, 2012, 07:43:17 pm
I found Ess Model 3.0 for Lazarus made by Imants on http://sourceforge.net/projects/essmodelforlaza/ (http://sourceforge.net/projects/essmodelforlaza/).
When trying to run on WinXp Sp2 32bit I got error "The procedure entry point gzdirect could not be located in the dynamic link library zlib1.dll" cause old version of zlib1.dll installed on my operating system. To solve this I copy last version 1.2.7 of zlib1.dll to program directory (see attachment).
Title: Re: ESS Model
Post by: Imants on September 14, 2012, 08:32:32 am
Didn't know that it need zlib. I will add yours to download so that all would have it

eastorwest can you tel me what can be improved in essmodel or found bugs if you have try it. Unfortunately I don't have much time to test it :( and I don't particularly know what such a programs should do..
TinyPortal © 2005-2018