Author Topic: New PCL version 1.0.94  (Read 5193 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 7111
    • http://pixinsight.com/
New PCL version 1.0.94
« on: 2011 May 30 16:30:19 »
Hi all,

This document describes briefly the changes necessary to rebuild all existing PixInsight modules for compatibility with PixInsight 1.7.0.

Breaking Changes

Unfortunately, PixInsight 1.7.0 Starbuck introduces several changes in the low-level API interface that require a recompilation of all existing modules against the latest version of PCL: 1.0.94.

There are some bugs in the low-level API of PixInsight Core 1.6 that cannot be fixed properly without breaking ABI compatibility. This is unfortunate because one of our goals is to guarantee backwards compatibility with existing modules. We hope this won't happen anymore in the future.

The new PCL distribution package is available for download here:

http://pixinsight.com/developer/pcl/download/PCL-01.00.94.0367-20110529.tar.gz

PCL 1.0.94 requires just a small change to derived classes of ProcessInterface. All process interface classes must reimplement the following pure virtual function as non-pure:

   virtual MetaProcess* ProcessInterface::Process() const = 0;

This member function must be reimplemented to return a pointer to the MetaProcess class describing the process that the interface works for. For example, this is the declaration of SandboxInterface in SandboxInterface.h:

Code: [Select]
class SandboxInterface : public ProcessInterface
{
public:

   SandboxInterface();
   virtual ~SandboxInterface();

   virtual IsoString Id() const;
   virtual MetaProcess* Process() const;     /***** new member function *****/
   virtual const char** IconImageXPM() const;

   virtual void ApplyInstance() const;
   virtual void ResetInstance();

   virtual bool Launch( const MetaProcess&, const ProcessImplementation*, bool& dynamic, unsigned& /*flags*/ );

   virtual ProcessImplementation* NewProcess() const;

   virtual bool ValidateProcess( const ProcessImplementation&, String& whyNot ) const;
   virtual bool RequiresInstanceValidation() const;

   virtual bool ImportProcess( const ProcessImplementation& );

private:

   // ...

};

And the implementation in SandboxInterface.cpp:

Code: [Select]
SandboxInterface::SandboxInterface() :
ProcessInterface(), instance( TheSandboxProcess ), GUI( 0 )
{
   TheSandboxInterface = this;
}

SandboxInterface::~SandboxInterface()
{
   if ( GUI != 0 )
      delete GUI, GUI = 0;
}

IsoString SandboxInterface::Id() const
{
   return "Sandbox";
}

MetaProcess* SandboxInterface::Process() const     /***** new member function *****/
{
   return TheSandboxProcess;
}

So the reimplementation in SandboxInterface::Process() returns TheSandboxProcess, which describes the process that SandboxInterface works for.

This new member function is necessary to implement the new Browse Documentation functionality of process interfaces in PixInsight 1.7.

Other than this change, all existing modules should compile fine with PCL 1.0.94.

Visual C++ 2010 Support

One of the most important new features of the PixInsight/PCL platform introduced in PI 1.7.0 is that we now support both Visual C++ 2008 and Visual C++ 2010 on Windows.

VC++ 2010 is much better in terms of compiler stability and performance. All versions of PixInsight 1.7.0 for Windows have been produced with Visual Studio 2010 Professional. On the PCL/lib distribution directory you'll find versions of the PCL-pxi.lib static library for VC++ 2008 (vc9 subfolders) and VC++ 2010 (vc10 subfolders). Finally, the MakefileGenerator script has been updated to generate project files for both development environments (.vcproj files for VC++ 2008 and .vcxproj files for VC++ 2010).


Enjoy and happy PCL development!
Juan Conejero
PixInsight Development Team
http://pixinsight.com/