Author Topic: Can't get PCL module loaded into PI  (Read 7307 times)

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Can't get PCL module loaded into PI
« on: 2009 April 20 11:45:45 »
Hi,

I made a copy of the statistics module, renamed the classes and compiled it with VC++ 2008. I had to make some changes to the project file to make things compile and link but finally the build succeeded. I then tried to import the module in PI but that doesn't work. My steps:

- process->modules->install modules
- select c:\pcl\dist (doesn't remember that path)
- recursive search
- finds modules
- press 'install'
- error 'module metadata is not available.....'
- error 'possible hacking attempt'
- more errors

Has anyone succeeded at doing this? I also tried to import the modules unchanged but I imagine that may cause a naming collision so that's why I created a copy and renamed things. I can upload my code later today.
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 Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Can't get PCL module loaded into PI
« Reply #1 on: 2009 April 20 12:25:45 »
Hi Sander,

Sorry for not responding to your initial query. This error (metadata not available) happens because you haven't defined a module class. Every PixInsight module must define a descendant class of MetaModule.

I guess I know why this is happening :) Statistics isn't a module, but just a tool that is part of the Image module. The Image module is a complex one with many processes and interfaces. It isn't a good choice to start a new module. Besides that, Statistics is a plain 'observer' tool without processing capabilities.

Instead of Image and trying to isolate Statistics (which requires some experience), use the GREYCstoration module. This module is good to start a new project because it contains a single process with a relatively simple interface. GREYCstoration is a normal process that runs on images, is maskable and previewable, so its structure doesn't impose any restrictions.

Make a copy of the GREYCstoration folder and play with it. Once you get it compiled, installed and running, rename the classes and files to your convenience, and 'empty' the process and interface classes. Of course, I can do this work for you; I'll make a 'skeleton' module and will upload it. With this empty module you'll be able to start building your magic ;) I'll try to do this with a VC++ project for you as soon as I can.

I'm really sorry for not being able to write a good tutorial on PCL development. It's an important gap that must be filled urgently, but you know how pressed I am. I do what I can! (actually, much more than I can, but don't tell anyone).
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Can't get PCL module loaded into PI
« Reply #2 on: 2009 April 20 12:44:11 »
Hi Juan,

ah, that explains it then. Indeed a skeleton class would be very helpful if you want people to get started with PCL :) But starting with GREYC would be fine too. No need to upload code, I can take care of it. And if not then I'll get back to you.

I do actually want to make some changes to the statistics module as I prefer a csv format for easier import into Excel. Should I be able to rebuild the sources for statistics with my changes and import the result? What happens with the pre-loaded modules with the same names? I mean I tried to import the statistics module unchanged and it didn't work. Not sure if it's supposed to work though.
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 Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Can't get PCL module loaded into PI
« Reply #3 on: 2009 April 20 13:16:41 »
Hi Sander,

There can't be two objects with the same identifier on the PixInsight platform. So you can't install a second process or interface whose identifier is "Statistics". But you just have to change the literal identifiers, since PixInsight knows nothing about the internals of your module.

This means that in your module you can define a Statistics class without problems, however, you should make the following changes:

in StatisticsProcess.cpp:
Code: [Select]
IsoString StatisticsProcess::Id() const
{
   return "CSVStatistics";
}


in StatisticsInterface.cpp:
Code: [Select]
IsoString StatisticsInterface::Id() const
{
   return "CSVStatistics";
}


in ImageModule.cpp:
Code: [Select]
IsoString ImageModule::Name() const
{
   return "MyImage";
}


Also, you cannot supplant a certified module, so you must remove the unique identifier from ImageModule.cpp:

Code: [Select]
#define MODULE_UNIQUE_ID

You can remove all processes and interfaces except Statistics if you like to do so. Then you must make the necessary changes to ImageModule.cpp (essentially, remove the nonexistent #include lines and the unnnecessary instantiations of objects in InstallPixInsightModule()).

Looking forward to see that improved Statistics thing! :)
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Nocturnal

  • PixInsight Jedi Council Member
  • *******
  • Posts: 2727
    • http://www.carpephoton.com
Can't get PCL module loaded into PI
« Reply #4 on: 2009 April 20 13:55:50 »
Hi Juan,

have a look at the code I sent you, I did most, if not all of those things :) I'll have to somehow dislodge the statistics code from the other modules in that project.
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 Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
Can't get PCL module loaded into PI
« Reply #5 on: 2009 April 20 14:14:10 »
Hi Sander,

I've just uploaded a sample module:

http://pixinsight.com/forum/viewtopic.php?t=1112

For now it has makefiles for Linux but I'm sure you'll generate a nice VC++ 2008 project :D. Hope it will help.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/