U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » UppHub » GraphDraw/GraphCtrl
GraphDraw/GraphCtrl [message #53791] Fri, 01 May 2020 12:20 Go to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Pradip wrote on Fri, 01 May 2020 12:02
Hello Didier,

Thanks for replying! Yes exactly, I need date/time on x-axis. I'm trying to make something like this:
index.php?t=getfile&id=6064&private=0

I already have a tree and an array (synced) showing the activities, I will need to sync them with the graph. Also zooming is important, it should be able to zoom in to days (S, M, T, W...) as in the image, and while zooming out it could show weeks, then months, quarter and finally year.

I won't really need layout designer, in any case I'll have to manipulate it with code.

Thanks a lot, I'll try it once you upload it Smile



Well you can definitly display the days/weeks/wonths as you wan't but you will have to :
  • make you're own GridAxisDraw child class with own grid style drawing (or maybe I could push further into Chameleon capacities)
  • Add time custom display format method (The exact same format is not available out of the box)

For all the zoom/scroll, verything you need is available.
There is also a Linking feature that allows to sync axis between graphs (when one zooms or scrolls, the other ones follow) : maybe you could use this to link to you're grid to the graph Y axis
Re: GraphDraw/GraphCtrl [message #53794 is a reply to message #53791] Fri, 01 May 2020 13:04 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Quote:
make you're own GridAxisDraw child class with own grid style drawing (or maybe I could push further into Chameleon capacities)
Add time custom display format method (The exact same format is not available out of the box)

I'll try it with my limited capacity Laughing. It will be fine to get something close if not same.

Quote:
For all the zoom/scroll, verything you need is available.
There is also a Linking feature that allows to sync axis between graphs (when one zooms or scrolls, the other ones follow) : maybe you could use this to link to you're grid to the graph Y axis

Exactly what I was planning to do!


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53795 is a reply to message #53794] Fri, 01 May 2020 13:30 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Here is the first part of GraphCtrl packages

[Updated on: Sun, 03 May 2020 16:09]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53796 is a reply to message #53795] Fri, 01 May 2020 13:37 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Here is the sencond part.

I packaged my demo app GraphCtrl_demo_GUI (which doesn't look how it should since Layout Designer properties are no more taken into account (for the moment))

Take a look at : GraphCtrl_Demo/CustomDataSource_WF.h
This is the cutom data class used to display the bars you saw on my screenshot

Everything compiles fine with lattest Upp/trunk on windows and linux

[Updated on: Sun, 03 May 2020 16:09]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53799 is a reply to message #53796] Sat, 02 May 2020 10:16 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Maybe the Ctrl name would have to be something like GanttCtrl Smile

Best regards
IƱaki
Re: GraphDraw/GraphCtrl [message #53801 is a reply to message #53799] Sat, 02 May 2020 11:38 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Koldo,

Yes why not have a pre-configured GanttCtrl ready-to go out of the box Smile

But first I have to simplify GraphCtrl/GraphDraw architecture (CRTP layering), since Chameleon introduction is going way to complex du to the layering technique I used, and the use of LayoutDesigner is less needed (that was the first reason for going with CRTP layers) ... so I could probably kick-out a lot of complexity and make it more usable

Re: GraphDraw/GraphCtrl [message #53808 is a reply to message #53801] Sun, 03 May 2020 15:46 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

I started the GanttCtrl class so that you can see where to start coding and it was also at test for me to see if all was goiing to work as intended before letting you search how to do it.

Here is what I get:
index.php?t=getfile&id=6067&private=0

I will upload code later today
  • Attachment: Scatter.png
    (Size: 10.57KB, Downloaded 1434 times)

[Updated on: Sun, 03 May 2020 15:59]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53809 is a reply to message #53808] Sun, 03 May 2020 16:08 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
here is the first part

[Edit] deleted dowload file

[Updated on: Sun, 10 May 2020 14:53]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53810 is a reply to message #53809] Sun, 03 May 2020 16:10 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Here is the second part

[Edit] deleted dowload file

[Updated on: Sun, 10 May 2020 14:54]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53836 is a reply to message #53810] Thu, 07 May 2020 21:10 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Did you download the code ?
Was it useful for you ?
Re: GraphDraw/GraphCtrl [message #53837 is a reply to message #53836] Fri, 08 May 2020 09:37 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,

Sorry for replying late, struggling without salary Sad

It's amazing that you made a custom GanttCtrl! Thanks a lot.

I realized that I need to keep the data set ready for making the graph, so I have learned to use S_* structures last few days, reading every line from database was taking long time. I'll be ready in 2 more days, then I'll download the code and try to make the graph. Thanks again Smile



Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53838 is a reply to message #53837] Fri, 08 May 2020 09:43 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Glad to here this helps you.
Hope you will get a salary soon Confused

Before writing the GanttCtrl, I also refactored GraphDraw/GraphCtrl CRTP part that had become useless and to complex : I almost kicked out all of CRTP Smile
Things are simpler now (although all is not completelly finished)

[Updated on: Sun, 10 May 2020 14:55]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53876 is a reply to message #53838] Sun, 10 May 2020 14:53 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

I made some refactoring, simplifications, cleaning, namespace/include management, one two bug corrections and a compilation issue with latest Upp svn version

Please use this last version

EDIT : removed attachement (see further)

[Updated on: Mon, 18 May 2020 00:01]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53895 is a reply to message #53876] Wed, 13 May 2020 17:42 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,

I've downloaded it. I'm using MSVS17 compiler. GanttCtrl_Test compiles fine (except conversion and possible loss of data warnings) and I'm getting the same graph.

However, GraphCtrl_Demo is giving some errors, perhaps all in Chameleon, see the image.

index.php?t=getfile&id=6077&private=0

Though I could do without any Chameleon capability for now, to understand the working of GraphCtrl, running the demo would be useful.

I'll study more (please bear with my limited coding knowledge) and revert.



Regards,
Pradip

[Updated on: Thu, 14 May 2020 06:37]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53896 is a reply to message #53895] Wed, 13 May 2020 20:51 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Well this is strange, under linux all compiles fine with lattest svn version
The missing functions can be found in uppsrc/CtrlLib/Ch.h so it shoudn't be a problem

Which Upp version are you using ?

I am having difficulties with the lattest Upp svn versions on Win : my MCS V15 compiler crashes Shocked ( and CLANG doesn't work du to path problems and I can't change them: I don't have admin rights to change paths)
The current version I work with on Win is svn 14390
So I am stuck to 14390 for the moment on Win

Didier
Re: GraphDraw/GraphCtrl [message #53897 is a reply to message #53896] Wed, 13 May 2020 21:06 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
I also trie with and withour Blitz : no compilation problem (under linux)

I will have to resolve my Win problem to check further

Re: GraphDraw/GraphCtrl [message #53899 is a reply to message #53896] Thu, 14 May 2020 08:16 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,
Didier wrote on Thu, 14 May 2020 00:21

Which Upp version are you using ?

That could be the issue, I was using 13664, for which uppsrc/CtrlLib/Ch.h contains only this much:
void ChStdSkin();
void ChClassicSkin();
void ChHostSkin();

I'm downloading latest stable release at the moment, I'll let you know the result.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53900 is a reply to message #53899] Thu, 14 May 2020 08:51 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
McAfee is blocking to execute 14429 Mad

Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53901 is a reply to message #53900] Thu, 14 May 2020 09:30 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Pradip wrote on Thu, 14 May 2020 08:51
McAfee is blocking to execute 14429 Mad


This is really worrysome, but I really do not have any means how to prevent that....

I think it is the debugger code causing this issue Sad

That said, I am not sure who would believe this guy: https://cryptopotato.com/wp-content/uploads/2019/01/mcafee-n ew-finke-min-min.jpg

[Updated on: Thu, 14 May 2020 09:33]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53902 is a reply to message #53900] Thu, 14 May 2020 09:44 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,
I can't run 14429 yet, until it gains some "reputation" with McAfee! Well the issue is with Chameleon only, I'll keep studying the demo code and try to get this done.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53903 is a reply to message #53901] Thu, 14 May 2020 10:01 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Mirek Laughing Laughing
Truly these antiviruses make so much trouble at times. First time theide.exe ran, it was the clang.exe that was blocked first, and next time onwards theide.exe was also blocked.
14-05-2020 11:47:34   mfeatp(7744.8772) <SYSTEM> Orchestrator.RepChangeListener.Activity: Real Protect cloud scanner trace complete for process id 3572 , file E:\upp-win-14429\upp\theide.exe with reason id 1
14-05-2020 11:51:22   mfeatp(7744.7476) <SYSTEM> Orchestrator.Action.Activity: Action Taken on File E:\upp-win-14429\upp\bin\clang\bin\clang.exe with reputation 1 is: Block
14-05-2020 11:51:22   mfeatp(7744.7476) <SYSTEM> Orchestrator.Action.Activity: Action Details::  File: clang.exe , Mode: Enforce , Scanner: On-Execute Scan , Detection Name: ATP/Suspect!bcea0d393d11 , Reputation: 1  [Known Malicious] , ActionTaken: Block  Rule id: 0 , Content Version: Not Available
14-05-2020 11:52:58   mfeatp(7744.3840) <SYSTEM> Orchestrator.Action.Activity: Action Taken on File E:\upp-win-14429\upp\theide.exe with reputation 1 is: Block
14-05-2020 11:52:58   mfeatp(7744.3840) <SYSTEM> Orchestrator.Action.Activity: Action Details::  File: theide.exe , Mode: Enforce , Scanner: On-Execute Scan , Detection Name: ATP/Suspect!8b4fa2a4e3c1 , Reputation: 1  [Known Malicious] , ActionTaken: Block  Rule id: 0 , Content Version: Not Available

I think it's all about some 'reputation', saw it happening before too. And this is the reason I don't get the latest stable release immediately on release. Probably after some usage it gains on reputation with those AVs, shouldn't worry about it much.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53904 is a reply to message #53902] Thu, 14 May 2020 10:57 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

If the problem is the Ide.exe that doesn't pass MacAfee

Try mixing Ide.exe old version with uppsrc recent version I'm always doiing this since I update from svn
If the dowload wont acheive because of McAfee, dowload a source only version (svn, git, ..)
Re: GraphDraw/GraphCtrl [message #53905 is a reply to message #53904] Thu, 14 May 2020 12:18 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,
That's a nice trick, using old ide.exe with new uppsrc Very Happy! McAfee is still blocking clang.exe, gcc.exe, c++.exe, but I can use MSVS17 compiler.
GraphCtrl_Demo_GUI is running this way now, so I have enough to study, thanks a lot.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53906 is a reply to message #53905] Thu, 14 May 2020 13:47 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
Pradip wrote on Thu, 14 May 2020 12:18
Hello Didier,
That's a nice trick, using old ide.exe with new uppsrc Very Happy! McAfee is still blocking clang.exe, gcc.exe, c++.exe, but I can use MSVS17 compiler.
GraphCtrl_Demo_GUI is running this way now, so I have enough to study, thanks a lot.


Well, I would offer you even better trick: Uninstall McAfee...
Re: GraphDraw/GraphCtrl [message #53907 is a reply to message #53906] Thu, 14 May 2020 14:15 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Really wish I could do that. This is work laptop, so you know.

Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53921 is a reply to message #53907] Fri, 15 May 2020 13:10 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Didier the code is so complex, but the result is really fascinating! Hope you won't mind if I ask you stupid questions as I go on to try it.

Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53929 is a reply to message #53921] Fri, 15 May 2020 18:04 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

No problem : ask all the questions you need

I will add data to GanttCtrl_Test so that it's more simple.

GraphCtrl_Demo was not intended to be a public demo: it is more my overall testing application with some ugly code.

There is also some documentation in graphDraw and GrapCtrl packages ( although the CRTP part is not completelly true any more : since it was to complex, I qicked out most of it )




Re: GraphDraw/GraphCtrl [message #53939 is a reply to message #53929] Sat, 16 May 2020 10:06 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,

You may consider explicit conversions to avoid these warnings by MS compilers. Anyways this is of low priority, I think other compilers don't complain about it.

e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (81): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (82): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (841): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (857): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (863): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (997): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (1024): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (82): warning C4244: 'return': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (56): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (57): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (58): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (33): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (34): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (35): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (126): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (131): warning C4244: 'initializing': conversion from 'double' to 'unsigned int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (237): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (238): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (240): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (246): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (250): warning C4244: '=': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int16', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (266): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (278): warning C4244: 'initializing': conversion from 'T' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (283): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (302): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (315): warning C4244: '=': conversion from 'T' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (317): warning C4244: 'argument': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (345): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (346): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (347): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (358): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (362): warning C4244: '=': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int16', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (377): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (391): warning C4244: 'initializing': conversion from 'T' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (396): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (415): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (431): warning C4244: 'argument': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (431): warning C4244: '=': conversion from 'T' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (433): warning C4244: 'argument': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (447): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (448): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
E:\UPP_Projects\GraphDraw\GridStepManager.cpp (454): warning C4244: 'initializing': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (841): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (857): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (863): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (997): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (1024): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (82): warning C4244: 'return': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (56): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (57): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (58): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (33): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (34): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (35): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data
e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (81): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (82): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (841): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (857): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (863): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (997): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphDrawBase.h (1024): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (82): warning C4244: 'return': conversion from 'Upp::int64' to 'int', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (56): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (57): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (58): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (33): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (34): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
e:\upp_projects\graphdraw\GraphFunctions.h (35): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data



Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #53945 is a reply to message #53939] Sat, 16 May 2020 20:51 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Usually I remove ALL warnings : A good code does not have any warning at all.

On linux it does not show these errors, and it's my main dev plateform : that's the reason why tey are still around Wink

I will check if I can enable these errors with CLANG or GCC on linux

Re: GraphDraw/GraphCtrl [message #53958 is a reply to message #53945] Sun, 17 May 2020 23:59 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

I removed all the warnings I see on MSC15 + some others that don't appear (sign conversions)

I used the following compile flags on CLANG/linux :
-std=c++14 -Wno-logical-op-parentheses -Wimplicit-float-conversion -Wshorten-64-to-32 -Wfloat-conversion -Wconditional-uninitialized

But there are still some warnings that only appear on MSC Confused

[Updated on: Mon, 18 May 2020 00:03]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #53959 is a reply to message #53958] Mon, 18 May 2020 06:10 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Thanks Didier, now there are not a single warning on MSVS17. I'm working for displaying timeline bars, understanding the CustomData and CustomDataSource classes. Once done I'll show you the result.

Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54051 is a reply to message #53959] Sun, 24 May 2020 13:07 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,
Need some help. Please see my implementation of CustomData and CustomDataSource, similar to your demo:
namespace Upp {
namespace GraphDraw_ns {

class GanttBar : public CustomData {
private:
	int row_num;
	const S_ACTIVITIES* act;
	RectGraph bar;
//	TypeScreenCoord bar_thk = 5;

public:
	GanttBar(int row, const S_ACTIVITIES* ac) : row_num(row), act(ac) {
		bar.left = act->START_DATE_PL.Get();
		bar.right = act->END_DATE_PL.Get();
		bar.top = row_num + 0.25;
		bar.bottom = row_num + 0.75;
	};
	
	virtual ~GanttBar() {};
	
	virtual bool Intersects(const RectGraph& graphView) const {
		return graphView.Intersects(bar);
	};
	
	virtual bool Contains(const PointGraph& pt) const {
		return bar.Contains(pt);
	};
	
	virtual void PaintDataPoint(BufferPainter& dw, int scale,
		const CoordinateConverter* xCoordConv, const CoordinateConverter* yCoordConv) {
		
		const TypeScreenCoord left = xCoordConv->toScreen(bar.left);
		const TypeScreenCoord right = xCoordConv->toScreen(bar.right);
		const TypeScreenCoord bottom = yCoordConv->toScreen(bar.top);
		const TypeScreenCoord top = yCoordConv->toScreen(bar.bottom);
		Rect r(left,top, right, bottom);
		
		ChPaint(dw, r, Yellow());
	};
	
	String ToString() const {
		return Format("Row num=%i\tActivity ID=%i\tBar=%s", row_num, act->ACT_ID, bar.ToString());
	};
};

class GanttBarSeries : public CustomDataSource {
private:
	const ArrayCtrl* array;
	Array<GanttBar> gantt_bars;
	
public:
	GanttBarSeries() {};
	
	void Link(const ArrayCtrl* ar) {
		array = ar;
	};
	
	void RefreshBars() {
		if(!gantt_bars.IsEmpty()) gantt_bars.Clear();
		int n = array->GetCount();
		for(int i = 0; i < n; i++) {
			GanttBar gb(i, &ActById(array->Get(i, ACT_ID)));
			gantt_bars.Add(gb);
		}
		DUMP(gantt_bars);
	};
	
	virtual ~GanttBarSeries() {};
	virtual unsigned int GetCount() const {return gantt_bars.GetCount();};
	virtual const CustomData& Get(unsigned int dataIndex) const {return gantt_bars[dataIndex];};
	virtual CustomData& Get(unsigned int dataIndex) {return gantt_bars[dataIndex];};
};


};
};

You will see that I'm trying to link the Gantt with an ArrayCtrl. The DUMP is showing this:
gantt_bars = [Row num=0	Activity ID=10	Bar=[737830, 0.25] - [737947, 0.75] : (117, 0.5), Row num=1	Activity ID=28	Bar=[737832, 1.25] - [737854, 1.75] : (22, 0.5), Row num=2	Activity ID=29	Bar=[737854, 2.25] - [737856, 2.75] : (2, 0.5), Row num=3	Activity ID=118	Bar=[737856, 3.25] - [737898, 3.75] : (42, 0.5), Row num=4	Activity ID=126	Bar=[737856, 4.25] - [737859, 4.75] : (3, 0.5), Row num=5	Activity ID=127	Bar=[737859, 5.25] - [737862, 5.75] : (3, 0.5), Row num=6	Activity ID=128	Bar=[737862, 6.25] - [737867, 6.75] : (5, 0.5), Row num=7	Activity ID=129	Bar=[737867, 7.25] - [737870, 7.75] : (3, 0.5), Row num=8	Activity ID=130	Bar=[737870, 8.25] - [737881, 8.75] : (11, 0.5), Row num=9	Activity ID=131	Bar=[737870, 9.25] - [737873, 9.75] : (3, 0.5), Row num=10	Activity ID=133	Bar=[737873, 10.25] - [737875, 10.75] : (2, 0.5), Row num=11	Activity ID=134	Bar=[737875, 11.25] - [737879, 11.75] : (4, 0.5), Row num=12	Activity ID=388	Bar=[737879, 12.25] - [737881, 12.75] : (2, 0.5), Row num=13	Activity ID=136	Bar=[737881, 13.25] - [737886, 13.75] : (5, 0.5), Row num=14	Activity ID=137	Bar=[737881, 14.25] - [737883, 14.75] : (2, 0.5), Row num=15	Activity ID=138	Bar=[737883, 15.25] - [737884, 15.75] : (1, 0.5), Row num=16	Activity ID=139	Bar=[737883, 16.25] - [737890, 16.75] : (7, 0.5), Row num=17	Activity ID=140	Bar=[737890, 17.25] - [737895, 17.75] : (5, 0.5), Row num=18	Activity ID=141	Bar=[737895, 18.25] - [737898, 18.75] : (3, 0.5), Row num=19	Activity ID=121	Bar=[737898, 19.25] - [737931, 19.75] : (33, 0.5), Row num=20	Activity ID=143	Bar=[737898, 20.25] - [737901, 20.75] : (3, 0.5), Row num=21	Activity ID=144	Bar=[737901, 21.25] - [737909, 21.75] : (8, 0.5), Row num=22	Activity ID=145	Bar=[737909, 22.25] - [737916, 22.75] : (7, 0.5), Row num=23	Activity ID=148	Bar=[737916, 23.25] - [737924, 23.75] : (8, 0.5), Row num=24	Activity ID=149	Bar=[737924, 24.25] - [737926, 24.75] : (2, 0.5), Row num=25	Activity ID=150	Bar=[737926, 25.25] - [737931, 25.75] : (5, 0.5), Row num=26	Activity ID=123	Bar=[737931, 26.25] - [737939, 26.75] : (8, 0.5), Row num=27	Activity ID=124	Bar=[737939, 27.25] - [737946, 27.75] : (7, 0.5), Row num=28	Activity ID=125	Bar=[737946, 28.25] - [737947, 28.75] : (1, 0.5)]

So the bars are being made alright. In my application (TopWindow) header:
	GraphDraw_ns::GanttCtrl gantt;
	Upp::GraphDraw_ns::GanttBarSeries ganttBarSeries;

In TopWindow constructor:
	ganttBarSeries.Link(&array);
	gantt.AddCustomSeries(ganttBarSeries);

And in a callback which refreshes the linked array:
	ganttBarSeries.RefreshBars();
	gantt.Refresh();


However the gantt chart is always empty, doing FitToData() is also not showing any bar. What am I missing here?


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54052 is a reply to message #54051] Sun, 24 May 2020 20:52 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Two points:
* FitToData() isn't implemented yet for CustomData Embarassed
* RefreshBars() is useless, all the refresh is already managed

What you need to do is:
1 - Set graph limits
      graph.GetX1CoordConverter().SetGraphMin(...)
      graph.GetX1CoordConverter().SetGraphMax(...)
      graph.GetX1CoordConverter().setGraphMinRangeLimit(...);
      graph.GetX1CoordConverter().setGraphMaxRangeLimit(...);


2 - Set data as modified (so it will be refreshed automatically)
This is important because the resulting image is cached to speed-up display when moving a cursor, changing tabs or whatever
      graph.SetModifyCustomSeries(); // this will force full repaint on next refresh
      graph.Refresh();
Re: GraphDraw/GraphCtrl [message #54060 is a reply to message #54052] Thu, 28 May 2020 09:23 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier!

Yes it worked! Fantastic!

Please tell me, is there an easy way to flip the Y axis? Currently the origin is in bottom-left, how to make it in top-left?


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54063 is a reply to message #54060] Thu, 28 May 2020 18:52 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,

Really amazing work with the GraphCtrl!
Is there a way to allow only X axis zooming but prevent Y axis zooming?


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54065 is a reply to message #54063] Fri, 29 May 2020 00:00 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Pradip wrote on Thu, 28 May 2020 18:52
Hello Didier,

Really amazing work with the GraphCtrl!
Is there a way to allow only X axis zooming but prevent Y axis zooming?


Thank you and yes there is Smile
Several restriction methods are available for zoom / scroll (these are also available directly through the layout designer as options)

DisableGraphZoom
DisableGraphScroll
DisableAxisZoom
DisableXZoom
DisableYZoom
DisableAxisScroll
DisableXScroll
DisableYScroll


Quote:
Please tell me, is there an easy way to flip the Y axis? Currently the origin is in bottom-left, how to make it in top-left?

Well I never needed this so it isn't available out of the box, but it should be quite easy to do.
I'll see if I can add a ' void InvertAxis()' method : this may come handy one day

[Updated on: Fri, 29 May 2020 00:03]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #54068 is a reply to message #54065] Fri, 29 May 2020 17:23 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Hello Didier,

DisableXZoom(true) and DisableYZoom(true) individually are not working; they are working only if together; please check.

InvertAxis will really be helpful, there are many engineering graphs which are drawn with origin at top left.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54069 is a reply to message #54068] Fri, 29 May 2020 23:09 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

I will check tomorrow

[Updated on: Fri, 29 May 2020 23:09]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #54077 is a reply to message #54069] Sat, 30 May 2020 12:42 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 109
Registered: February 2019
Location: India
Experienced Member
Thanks Didier,

Take your time.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54080 is a reply to message #54077] Sat, 30 May 2020 15:45 Go to previous messageGo to previous message
Didier is currently offline  Didier
Messages: 740
Registered: November 2008
Location: France
Contributor
Hello Pradip,

I just checked and DisableYAxis() works fine but DisableXAxis() almost works fine

zoom from axis (on one side of graph) (CTRL + mouse wheel) : OK X & Y
zoom from graph area selection (CTRL + mouse left click n drag) : OK X & Y
zoom with ctrl+ mouse wheel : does not work for X and works for Y ==> strange... code for both should be the same

Need more time to investigate further
Previous Topic: Anboto/Surface updated
Next Topic: STEM4U Updates
Goto Forum:
  


Current Time: Sun Apr 26 03:57:17 GMT+2 2026

Total time taken to generate the page: 0.01218 seconds