Author Topic: HelloWorld in PCL?  (Read 6805 times)

Offline nmontec

  • Member
  • *
  • Posts: 73
    • SkyMonsters
HelloWorld in PCL?
« on: 2012 October 04 08:03:50 »
Dear All, I've just downloaded the PCL and browsed the documentation. Classes seems defined well, however I need a very simple project that helps me in understanding how to create my own modules. Is there an HelloWorld program in PCL to be used as reference? I find rather difficult to follow examples in the modules sections.
Thanks a lot for your info and look forward coding new stuff.

Nicola

Offline zvrastil

  • PixInsight Addict
  • ***
  • Posts: 179
    • Astrophotography
Re: HelloWorld in PCL?
« Reply #1 on: 2012 October 04 08:36:34 »
Hi Nicola,

the Sandbox module is the Hello World example for PCL. I'd also recommend to read Juan's article on PCL development in first and only issue of PixInsight magazine available here http://pixinsight.com/magazine/. Feel free to ask further questions if these resources are not enough.

regards, Zbynek

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Re: HelloWorld in PCL?
« Reply #2 on: 2012 October 04 09:10:20 »

Hi Nicola,

just a word of warning. There is no way to truly write a very simple project in PCL. The way the GUI is set up and variables are shared etc. is complex. Some of this stuff could be taken out of the example but then you wouldn't know how to write a meaningful module. The next release of PCL will have the debayer module included as open source and possibly others as well. I think that will be a great help. Copy/modify is the best way to get started I suspect. That's how I wrote debayer, ripping pieces of other modules and modifying them.

In the end it is very worthwhile and satisfying so I encourage you to give it a try. Make sure you learn how to run the module in your debugger.
Best,

    Sander
---
Edge HD 1100
QHY-8 for imaging, IMG0H mono for guiding, video cameras for occulations
ASI224, QHY5L-IIc
HyperStar3
WO-M110ED+FR-III/TRF-2008
Takahashi EM-400
PIxInsight, DeepSkyStacker, PHD, Nebulosity

Offline nmontec

  • Member
  • *
  • Posts: 73
    • SkyMonsters
Re: HelloWorld in PCL?
« Reply #3 on: 2012 October 09 02:26:27 »
Thank you Zbynek and Sander for your reply. I had a quick read of the magazine article, downloaded the PCL and installed the VC++ 2008.

Two questions:
- How do I compile the modules included inside the compiler? Considering all the environment variables in place of course. Which VC++ project should I create?
- Is it enough to start a new module by just replacing the SandBox name everywhere in the code files and inserting my code in the Apply method of the *Instance.cpp file?

thanks
Nicola

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: HelloWorld in PCL?
« Reply #4 on: 2012 October 09 08:40:43 »
Hi Nicola

You may create the projects with the Makefile Generator script (Development category). As a starting point, yes, replace the  SandBox name everywhere.
Then, you may start creating your own code. I suggest you to start working over the Instance.cpp and .h files. In the header you should just set the variable names you want. Then, modify the constructor and copy functions on the cpp. Your code should be inside the Engine (starting in the Apply function), but you may also work on the ExecuteOn function.
If you are using custom parameters, remember to adjust the Parameters.cpp and .h files, and also Process.cpp to reflect those changes. Of course, you'll need to rewrite the interface too.
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline Carlos Milovic

  • PTeam Member
  • PixInsight Jedi Master
  • ******
  • Posts: 2172
  • Join the dark side... we have cookies
    • http://www.astrophoto.cl
Re: HelloWorld in PCL?
« Reply #5 on: 2012 October 09 08:44:32 »
Oh, and also make intensive use of other examples of code. The PCL release comes with several source codes of modules. In most cases, is better to start over the process that most closely resembles what you are trying to do (in terms of the parameters [numeric controls, image ids, etc] and interface needed)
Regards,

Carlos Milovic F.
--------------------------------
PixInsight Project Developer
http://www.pixinsight.com

Offline NKV

  • PTeam Member
  • PixInsight Guru
  • ****
  • Posts: 677
Re: HelloWorld in PCL?
« Reply #6 on: 2012 October 09 10:11:56 »
For me, best way to start is add one more GUI element into SandBox.