Adding the PzlPort to the application: различия между версиями

Материал из wikiru.visual-prolog.com

м
м
Строка 32: Строка 32:
[[image:PzlPortAddedSuccessfullyReport.png]]
[[image:PzlPortAddedSuccessfullyReport.png]]


Если Pzl-система уже была ранее включена в приложение, определяемое целевым проектом, то сообщение об этом появится и предложит продолжить включение или отказаться от выполнения операции.  
If Pzl-System was included to the application before, then the dialog message will appear and you may cancel the operation performing.


[[Изображение:AddPortReplacementWarning.png]]
[[Image:AddPortReplacementWarning.png]]


Вы можете продолжить выполнение операции, если необходимо, например, изменить имя библиотеки или уровень лицензии.
You may continue the performing the operation if you are making some updates like changing the license level.


Отчет о выполненных замещениях будет выведен в Окно сообщений среды
The resulting report will be seen in the Message Window.


[[Изображение:PzlPortReplacedSuccessfullyReport.png]]
[[Image:PzlPortReplacedSuccessfullyReport.png]]


Возвратившись теперь к IDE, можно откомпилировать проект исполняемого приложения.
Coming back to the IDE, you may compile and build the project of the executable application.


Пример проекта после компиляции приведен ниже
The example of the project window in the IDE after the building the project may be seen below.


[[Изображение:PzlSystemAddedToMainApplicaion.png]]
[[Image:PzlSystemAddedToMainApplicaion.png]]


В результате работы Elementary PzlStudio добавился раздел $(SpbSolutions) со всеми ниже лежащими файлами.
As the result of the execution of the operation by the Elementary PzlStudio the new part of the project tree appeared in the project together with the new files included.


Добавлен и вызов предиката инициализации Pzl-Системы pzlPort::init()
The source code of the main applicaion’s file is also updated and the pzlPort initialization has been added (<vp>pzlPort::init()</vp>)
<vip>
<vip>
clauses
clauses
   run():-
   run():-
     pzlPort::init(), %<--- Добавлен
     pzlPort::init(), %<--- Added
     TaskWindow = taskWindow::new(),
     TaskWindow = taskWindow::new(),
     TaskWindow:show().
     TaskWindow:show().
</vip>
</vip>


Теперь, если необходимо, в среде IDE, пользуясь текстовым редактором, можно добавить назначение файла реестра компонент:
Now you can add the assignment of the component registration file (if needed) using the IDE:


<vip>
<vip>
Строка 65: Строка 65:
   run():-
   run():-
     pzlPort::init(),
     pzlPort::init(),
     pzlPort::setComponentRegisterFileName("РегистрКомонент.pzr"),
     pzlPort::setComponentRegisterFileName("ComponentRegistry.pzr"),
     TaskWindow = taskWindow::new(),
     TaskWindow = taskWindow::new(),
     TaskWindow:show().
     TaskWindow:show().
</vip>
</vip>


=Целевой Проект=
=The Target Project=
Целевой проект - это '''проект исполняемого приложения''', в который должна быть добавлена pzl-Система. Целевой проект представляется файлом проекта системы программирования Visual Prolog c расширением .prj6.
The target Project is the executable application project, which needs to be updated to add the pzl-system. The target project must be chosen as the Project file of the Visual Prolog programming system with the file extension .prj6.


Поэтому для включения pzl-Системы в проект исполняемого приложения необходимо установить имя проектного файла.
So you must set the name of the Project file of the executable application.


При первом открытии формы это поле пустое и непосредственное редактирование в нем невозможно.
When you open the form first, the field is empty and you may not edit the field. Pressing the button at the right side will invoke the file dialog to choose the application project file
Нажатие на кнопку справа при активной строке вызывает диалог для выбора файла проекта.


Проект может быть любым - с пользовательским интерфейсом - на базе VPI или GUI, или без пользовательского интерфейса - консольный, в том числе и предназначенный для использования в качестве Web-приложения.
The project may be any kind of – with the user interface VPI or GUI, with no user interface, the console application or it is the Web cgi application or Web IsApi DLL.


К моменту установки имени проектного файла проект должен существовать.
The project must exist before you try to add the pzl-system to it.


Если Вы создаете проект на основе pzl-технологии "с чистого листа", то необходимо средствами IDE создать новый проект, установив для него все необходимые свойства, затем проект построить  и сохранить (Ctrl-S).
If you create the completely new project from the scratch, then you must first create the project using the IDE, set there all needed options and then build it and save it (Ctrl-S).


Если Ваш проект уже создан, то он уже готов для включения в него pzl-Системы.
If your project exists, then it is ready to include the pzl-system to that project.


Закрывать проект в IDE перед включением в него pzl-Системы не обязательно - достаточно сохранить его (Ctrl-S).
There is no need to close the project in the IDE before you are going to add the pzl-system to it – it is enough to save it (Ctrl-S).


Версия Visual Prolog, которой создан проект, должна быть совместима с версией Elementary PzlStudio. Перечень версий системы Visual Prolog, с которыми совместима Elementary PzlStudio, указывается в About.
The version of the Visual Prolog programming system, which was used to create the project, must be compatible with the version of the Elementary PzlStudio. The list of compatible versions of the Visual Prolog system must be shown in the dialog About of the Elementary PzlStudio.


=Уровень лицензии=
=The license level =
Pzl-Система использует принцип лицензирования.  
The Pzl-system uses the licensing principle.  


Лицензии различаются по уровням:
There are license levels predefined:
*Public - публичная
*Public
*Commercial - коммерческая
*Commercial
*Exclusive - эксклюзивная (исключительная)
*Exclusive
*SuperExclusive  
*SuperExclusive  


Уровень лицензии устанавливается:
The license level is defined:
*для главного приложения - библиотекой pzlPort_X.lib  
*for the main application – by the library pzlPort_X.lib  
*для pzl-Контейнера - библиотекой pzlContainer_X.lib
*for the pzl-container – by the library pzlContainer_X.lib
где X - идентификатор уровня лицензии.
Here X is the license level identifier.


Лицензию уровня Public может иметь только pzl-Контейнер. Главное приложение не может иметь лицензию уровня Public.
The only pzl-container may have the license level Public. The main application may not have the license level Public.


Соответствие уровня лицензии и идентификатора библиотеки приведено ниже:
The correspondence of the license level and the library’s identifier is shown below:
*Commercial - pzlPort_C.lib
*Commercial - pzlPort_C.lib
*Exclusive - pzlPort_EX.lib  (X - персонифицирующий идентификатор)
*Exclusive - pzlPort_EX.lib  (X – the personal identifier)
*SuperExclusive pzlPort_SE.lib  
*SuperExclusive pzlPort_SE.lib  


Поэтому при включении pzl-Системы в главное приложение Вы должны установить уровень лицензии, которым должно обладать Ваше приложение. Выбор уровня лицензии однозначно определяет выбор имени pzl-библиотеки, которая будет включена в проект. В случае, если выбирается уровень лицензии Exclusive, то этому уровню может соответствовать множество библиотек уровня Exclusive.
So when you include the pzl-system to the main application, you must set the license level of the application. Choosing the license level defines exactly the name of the pzl-library, which will be included to the project. If you choose the license level Exclusive, then there may be many libraries of the license level Exclusive, so you must decide which variant of the library you wish to set for the application.


PzlStudio предлагает значение по умолчанию - Commercial, которому соответствует библиотека PzlPort_C.lib.
PzlStudio proposes the license level Commercial by default. This corresponds to the library PzlPort_C.lib.


При выборе уровня лицензии, Elemantary PzlStudio автоматически установливает имя библиотеки в поле '''''Container Library''''' (это поле не редактируется, а является справочным). Если выбирается уровень лицензии Exclusive, то Вам предлагается файловый диалог со списком имеющихся в Вашем распоряжении библиотек. Вы должны выбрать одну из библиотек, относящися к библиотекам уровня Exclusive. Если выбрана библиотека, не относящаяся к уровню Exclusive, то появляется сообщение
When you choose the license level, then the Elemantary PzlStudio automatically assigns the name of the library to the property '''''Container Library'''''. This property is not editable. If the choice is Exclusive license level, then the dialog to choose the filename of the library appears and you see all available libraries. You must choose one of libraries of the Exclusive level. If the choice is wrong, then the error message appears


[[Изображение:PzlPortLicenseLevelErrorDlg.png]]
[[Изображение:PzlPortLicenseLevelErrorDlg.png]]


=Библиотека Pzl-Системы=
=The library of the pzl-system =
Это поле не редактируется и является справочным. Отражает имя библиотеки pzlPort_X.lib, соответствующее уровню [[#Уровень лицензии|лицензии]] главного приложения.
This field is not editable. It shows the name of the library pzlPort_X.lib, which corresponds to the appropriate license level of the main application.


=Версия Pzl-Контейнера=
= Pzl-container Version =


Версия Pzl-Конейнера является строкой, контролируемой только пользователем. Все, что делает Elementary PzlStudio с этой информацией - помещает ее в качестве значения константы pzlContainerVersion_C в файле PzlConfig.i после его создания.
The pzl-container version is the string value, which has the meaning for the developer only. The Elementary PzlStudio only places the value of the property as the value of the constant pzlContainerVersion_C in the file PzlConfig.i, when it will be created.


<vip>
<vip>
Строка 137: Строка 136:
</vip>
</vip>


=Атрибуты из базовых свойств=
=Attributes related to the basic options =
Последние три позиции в форме
The last three positions in the form
*Company
*Company
*Author
*Author
*Copyright
*Copyright
устанавливаются в [[Установка Базовых Свойств#Company| Базовых свойствах]] и здесь могут быть переопределены в случае, отличном от типового. Если Вы их здесь изменили, то значения этих параметров в [[Установка Базовых Свойств#Company| Базовых свойствах]] останутся неизменными.
are taken from the [[Setting of the Basic Options#Company|Basic Options]] and they may be redefined here if there is need. If you modify these properties in the current form, they will not be changed in the  [[Settings of the Basic Options #Company|Basic Options]].


=References=
=References=
[[Category:VpPuZzleEn]]
[[Category:VpPuZzleEn]]

Версия 22:02, 1 февраля 2008

Автор: Виктор Юхтенко

Elementary PzlStudio has no feature to create new executable applications projects, which contain the pzl-system embedded. But Elementary PzlStudio gives the possibility to include the pzl-system into any application project created before.

Invoking the operation

The form to perform the operation may be invoked via menu Tools/Add/Port to Executable. AddPzlPort.png

The Option list includes:

The editing of the option is performed in the right side of the table. The Editing supposed to be done by the explicit editing or it may be done by the pressing the button on the right side of the active field. Double clicking makes the same as pressing the button.

The operation is performed by clicking the button 'Add.

The button may be inactive if there is not enough data entered.

After the operation completion you may add pzl-system to any other application.

The button Close closes the form.

Performing the operation

If the operation complete, then the report will be sent to the Message Window. You will see there also the report regarding the changes, which has been made on the project.

PzlPortAddedSuccessfullyReport.png

If Pzl-System was included to the application before, then the dialog message will appear and you may cancel the operation performing.

AddPortReplacementWarning.png

You may continue the performing the operation if you are making some updates like changing the license level.

The resulting report will be seen in the Message Window.

PzlPortReplacedSuccessfullyReport.png

Coming back to the IDE, you may compile and build the project of the executable application.

The example of the project window in the IDE after the building the project may be seen below.

PzlSystemAddedToMainApplicaion.png

As the result of the execution of the operation by the Elementary PzlStudio the new part of the project tree appeared in the project together with the new files included.

The source code of the main applicaion’s file is also updated and the pzlPort initialization has been added (pzlPort::init())

clauses
  run():-
    pzlPort::init(), %<--- Added 
    TaskWindow = taskWindow::new(),
    TaskWindow:show().

Now you can add the assignment of the component registration file (if needed) using the IDE:

clauses
  run():-
    pzlPort::init(),
    pzlPort::setComponentRegisterFileName("ComponentRegistry.pzr"),
    TaskWindow = taskWindow::new(),
    TaskWindow:show().

The Target Project

The target Project is the executable application project, which needs to be updated to add the pzl-system. The target project must be chosen as the Project file of the Visual Prolog programming system with the file extension .prj6.

So you must set the name of the Project file of the executable application.

When you open the form first, the field is empty and you may not edit the field. Pressing the button at the right side will invoke the file dialog to choose the application project file

The project may be any kind of – with the user interface VPI or GUI, with no user interface, the console application or it is the Web cgi application or Web IsApi DLL.

The project must exist before you try to add the pzl-system to it.

If you create the completely new project from the scratch, then you must first create the project using the IDE, set there all needed options and then build it and save it (Ctrl-S).

If your project exists, then it is ready to include the pzl-system to that project.

There is no need to close the project in the IDE before you are going to add the pzl-system to it – it is enough to save it (Ctrl-S).

The version of the Visual Prolog programming system, which was used to create the project, must be compatible with the version of the Elementary PzlStudio. The list of compatible versions of the Visual Prolog system must be shown in the dialog About of the Elementary PzlStudio.

The license level

The Pzl-system uses the licensing principle.

There are license levels predefined:

  • Public
  • Commercial
  • Exclusive
  • SuperExclusive

The license level is defined:

  • for the main application – by the library pzlPort_X.lib
  • for the pzl-container – by the library pzlContainer_X.lib

Here X is the license level identifier.

The only pzl-container may have the license level Public. The main application may not have the license level Public.

The correspondence of the license level and the library’s identifier is shown below:

  • Commercial - pzlPort_C.lib
  • Exclusive - pzlPort_EX.lib (X – the personal identifier)
  • SuperExclusive pzlPort_SE.lib

So when you include the pzl-system to the main application, you must set the license level of the application. Choosing the license level defines exactly the name of the pzl-library, which will be included to the project. If you choose the license level Exclusive, then there may be many libraries of the license level Exclusive, so you must decide which variant of the library you wish to set for the application.

PzlStudio proposes the license level Commercial by default. This corresponds to the library PzlPort_C.lib.

When you choose the license level, then the Elemantary PzlStudio automatically assigns the name of the library to the property Container Library. This property is not editable. If the choice is Exclusive license level, then the dialog to choose the filename of the library appears and you see all available libraries. You must choose one of libraries of the Exclusive level. If the choice is wrong, then the error message appears

PzlPortLicenseLevelErrorDlg.png

The library of the pzl-system

This field is not editable. It shows the name of the library pzlPort_X.lib, which corresponds to the appropriate license level of the main application.

Pzl-container Version

The pzl-container version is the string value, which has the meaning for the developer only. The Elementary PzlStudio only places the value of the property as the value of the constant pzlContainerVersion_C in the file PzlConfig.i, when it will be created.

interface iPzlConfig
constants
    pzlContainerVersion_C="1.0;001".
 
 % Container Configuration
constants
 
end interface iPzlConfig

Attributes related to the basic options

The last three positions in the form

  • Company
  • Author
  • Copyright

are taken from the Basic Options and they may be redefined here if there is need. If you modify these properties in the current form, they will not be changed in the Basic Options.

References