Reference models
Previous Topic  Next Topic 

Reference models are modular standards. They do most of the hard work of ensuring standard designs are followed.

A model can be linked to a reference model in the Project Details form.

When linking an area model to a reference model :

The referenced diagrams and matrices are imported into the Area model

The Area model classes classes, queries etc are synchronised to the reference model

Subsequently, changes in the reference model are automatically reflected in the area model.

The use of reference models enables large projects to be spit into several area models, and one reference model

With a reference model you can manage a distributed project with a collection of separate ControlDraw 'area' models files and a single ControlDraw 'reference' models.

The reference model contains the definitions of the Classes and shared modules, such as valves, motors, and generic mechanisms. Each model then contains a pointer to the reference model (in project options) so that shared pages get their diagrams and matrices from the reference model.

In addition, all queries and pctures defined in a reference model are imported to the area model



When an Area model has a reference model and you open the model you are prompted to update the model from the reference model. This checks versions of the diagrams and updates newer ones.


Referenced diagrams have links to a diagram in the reference model. The link is made by selecting 'use reference page' in the diagram details form and then selecting from the list. These links are by page ID, so if you change the order of the pages in the reference model there is no problem, the links retain their integrity.

When you make an external reference to a page then the page is replaced by a copy of the page in the reference model. This is done by copying the objects from the reference model to the current model. This ensures that the related data is stored in the current model and that the current model retains it's integrity should it lose it's links with the reference model.

When you open the page it is also checked against the reference model and updated if the reference model page has been updated.


If you make a page link to a reference model but then deselect use reference page, the page then becomes a normal page in the model, which you can edit.


NOTES

Another way to add a referenced diagram is to import it using the File Manager.

If a model has ever been used as a Reference model then a  tab appears in Project Properties, 'Area Models'. This lists all the files that have ever been synchronised with the model. You can clear this list and then it will be rebuild one at a time when you synchronise an area model.


A reference diagram can contain links to other diagrams in the reference model. This means that these diagrams should in general also be referenced in the area model. When you run a complete Synchronisation this can be done automatically.

When synchronising referenced diagrams and the diagram has a child and that diagram is not is the model, as well as removing the link, ControlDraw now warns that it has done so and lists the missing child pages.

SetSymbol and CheckSymbol special objects that are in a Reference model do not work in the area model.

Workaround. Since these symbols do not instantiate, there is no loss if data. Look at the reference model instead. Exclude reference diagrams when printing and print the reference model separately.


How it works

Each Diagram, Symbol and Martrix  in a model has a unique ID, and can also have a Reference ID which is used to point to the relevant diagram or object in the reference model. In addition they also have a reference version which is the version of the referenced object when last synchronised. A similar technique is used for classes

When an area model is synchronised the referenced diagrams are copied from the reference model to the area model. The version numbers are used to detect whether the classes, referenced diagrams and objects have changed and need updating.


See also Reference model Updating