OT Routing routine

OT Routing routine

Postby Marc Vanzegbroeck » Wed Dec 14, 2016 9:43 am

Hi,

I have a program in FW then convert text-files to a graphical output.
It is working fine (more the 10 years already :D ), but I want to extend it so the drawing can be larger.

I read the text-file into a database , and then I have a table with connection.
L1 - not-BLOCK5
L2 - BLOCK5
BLOCK5 - BLOCK6
...
..
the result is
Image

In my routine I calculate the position of the blocks, and the coordinates of the lines.

Sometimes, in a more complex drawing, the drawing is not that clear, like this one:
Image

If I want bigger drawings, it will be more difficult en not that clear

A search the internet to some routing programs. yWorks seems nice, but not cheap...

Other ones did't have nice output's.
Doos anyone know a alternative?

I was thinking to create a new routine, that can handle more complex drawings. Does anyone have a suggestion for a routine?

Thanks,
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: OT Routing routine

Postby Antonio Linares » Thu Dec 15, 2016 8:13 am

Marc,

Very nice app, congratulations :-)

Could you post here some screenshots of yWorks ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42069
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: OT Routing routine

Postby Marc Vanzegbroeck » Thu Dec 15, 2016 8:49 am

Antonio,

This is not done with yWorks, but with a routine I wrote myself :D :D .
It is done with LineTo() MoveTo(), ellipse(),.... functions :)
Because I want some more complex(bigger) drawings, I was considering using yWorks.

Here are some examples on the yWorks-site.
http://www.yworks.com/products/yfiles/gallery

I already have try graphviz. The only problem is that the lines are not straight.
The is an option, but then the connections the the blocks are not on the correct place. That is still a bug that they know.

This is an example with graphviz; you helped me before for showing me svg-files :D
http://forums.fivetechsupport.com/viewtopic.php?f=3&t=31550&start=0&hilit=svg


Image
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: OT Routing routine

Postby Antonio Linares » Thu Dec 15, 2016 9:10 am

Marc,

Really amazing :-)

Very interesting the yWorks examples !

Could you post an image of a complex drawing ? Just to get an idea of how bigger it may be
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42069
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: OT Routing routine

Postby Marc Vanzegbroeck » Thu Dec 15, 2016 10:05 am

Antonio,

Here is an example where my routing is not nice :cry:

For yWorks an .NET-library exist. I don't know if we can link in to the FWH64-exe, or maybe create a seperate exe-file that FW calls for making the drawing...


Image
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: OT Routing routine

Postby cnavarro » Thu Dec 15, 2016 11:43 am

Really fantastic
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6541
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: OT Routing routine

Postby Antonio Linares » Fri Dec 16, 2016 9:26 am

Marc,

> For yWorks an .NET-library exist. I don't know if we can link in to the FWH64-exe

We can not link native code (Harbour+FWH) with .NET code

But using FiveNet design you could manage the .NET library from your app:

https://bitbucket.org/fivetech/fivenet/wiki/Home

> , or maybe create a seperate exe-file that FW calls for making the drawing...

Thats basically what FiveNet does, but instead of using an external EXE, it uses a DLL.

Could you post a screenshot of how your screenshot may look like using yWorks ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42069
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: OT Routing routine

Postby Marc Vanzegbroeck » Fri Dec 16, 2016 10:02 am

Antonio,

If you want to see how it looks using yWorks, than I have to draw it with the free editor yEd of yWorks, and then do the autorouting.
I already modified an example that was used in de yWorks evaluation version of yWorks, but I can't use it anymore, because Visual Studio Cummunity 15 doesn't work anymore :(
I have a message that the 30 days of evaluation is over. I thought the Visual Studio Cummunity 15 was free...

I will create it in yEd and post the diagram
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: OT Routing routine

Postby Antonio Linares » Fri Dec 16, 2016 10:38 am

Marc,

> If you want to see how it looks using yWorks, than I have to draw it with the free editor yEd of yWorks, and then do the autorouting.

Its the only way to truly understand what you mean

> I have a message that the 30 days of evaluation is over. I thought the Visual Studio Cummunity 15 was free...

It is free. You just have to register it.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42069
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: OT Routing routine

Postby Marc Vanzegbroeck » Fri Dec 16, 2016 10:50 am

Antonio Linares wrote:Marc,

> If you want to see how it looks using yWorks, than I have to draw it with the free editor yEd of yWorks, and then do the autorouting.

Its the only way to truly understand what you mean

> I have a message that the 30 days of evaluation is over. I thought the Visual Studio Cummunity 15 was free...

It is free. You just have to register it.


Visual Studio is working again after registering :D
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: OT Routing routine

Postby Marc Vanzegbroeck » Tue Dec 20, 2016 8:31 am

Antonio,

Is it correct that if the sample .cs code provided by yWorks is:
Code: Select all  Expand view
using System;
using System.Drawing;
using yWorks.Canvas;
using yWorks.Canvas.Drawing;
using yWorks.Canvas.Geometry.Structs;
using yWorks.yFiles.UI.Drawing;
using yWorks.yFiles.UI.Model;

namespace Demo.yFiles.Layout.PortCandidateDemo
{
  /// <summary>
  /// Basic implementation of port style. Renders a port as a circle.
  /// </summary>
  public class CirclePortStyle : SimpleAbstractPortStyle
  {
    private const double Width = 6;
    private const double Height = 6;
    private readonly Pen pen = new Pen(Brushes.Black);

    protected override void Paint(IPort port, Graphics graphics, IRenderContext renderContext) {
      var location = port.Location;
      graphics.DrawEllipse(pen, (float)(location.X - Width / 2), (float)(location.Y - Height/2), (float)Width, (float)Height);
    }

    protected override RectD GetBounds(IPort port, ICanvasContext canvasContext) {
      var location = port.Location;
      return new RectD(location.X-Width/2, location.Y-Height/2, Width, Height);
    }
  }[code][/code]


that I can call this directly from a FWH prg-file if I use the Fivenet library?
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: OT Routing routine

Postby Antonio Linares » Tue Dec 20, 2016 8:44 am

Marc,

If you create a .NET DLL the same way as FiveNet does, then you should be able to
instantiate an OLE object from the PRG once you register the .NET DLL as FiveNet does also.

In fivetech.cs there is a:

namespace FiveTech

and

public class FiveNet

then from the PRG we can do:

oFiveNet = win_oleCreateObject( "FiveTech.FiveNet" )

If you plan to use FiveNet and want to continue having tech support about it, please use the PayPal donate button from the FiveNet site, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42069
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 83 guests