Deleting ADR Template

Discussions about machine vision support in GdPicture.
Post Reply
ganeshj
Posts: 14
Joined: Fri Aug 07, 2009 7:46 am

Deleting ADR Template

Post by ganeshj » Wed Aug 26, 2009 8:25 am

I have created a template config with 3 templates.

Once i have created this how is it possible to delete a template.

Please see below code.

Code: Select all

Imaging1.ADRLoadTemplateConfig(_strTemplatesFolder + "\\templateconfig.t");

Imaging1.ADRGetTemplateImageCount(template); 
"Returns 1. Template Count is also 1"
Imaging1.ADRDeleteTemplate(template);
Imaging1.ADRGetTemplateImageCount(template);
"Returns 0"
gdStatus = Imaging1.ADRSaveTemplateConfig(_strTemplatesFolder + "\\templateconfig.t"); "Saving changes"

Imaging1.ADRLoadTemplateConfig(_strTemplatesFolder + "\\templateconfig.t");
Imaging1.ADRGetTemplateImageCount(template);
"Still returns 1 and Template Count also is 1"

The delete only seems to remove it from memory the changes are not persisted to the config.
Can you let me know how i can remove a template from the config file.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Deleting ADR Template

Post by Loïc » Wed Aug 26, 2009 11:01 am

Hi,

The reason is the function ADRSaveTemplateConfig doesn't do anything if your number of template is equal to 0.

I suggest you this way:

If you have 1 template or more: Save the template configuration, else: delete or empty the template configuration file.

With best regards,

Loïc

ganeshj
Posts: 14
Joined: Fri Aug 07, 2009 7:46 am

Re: Deleting ADR Template

Post by ganeshj » Wed Aug 26, 2009 12:57 pm

Thanks i will try this.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest