Pzl-Component in 10 steps: различия между версиями
м (Новая: '''Основные понятия Pzl-Технологии''' Классы, и пакеты, в которые они помещаются, удовлетворяющие принят...) |
|||
(не показано 5 промежуточных версий этого же участника) | |||
Строка 1: | Строка 1: | ||
''' | '''Basic Definitions of the Pzl-Technology''' | ||
Classes and packages, wrapping these classes, which fit the special agreement, are called the Pzl-components. | |||
Pzl- | Pzl-components are placed in pzl-containers. Pzl-container may contain an unlimited amount of pzl-components. | ||
The interaction between the usual Visual Prolog classes and pzl-components, and the interaction between pzl-components are handled by the pzl-system. | |||
The main part of the application, which includes the pzl-system core, is named PzlPort. | |||
DLL, | The DLL, which is built in accordance with the pzl-technology agreements, is named the DLL-container. | ||
The dll-container and the pzlPort are pzl-containers. | |||
= | =Step 1. The first run of the Elementary PzlStudio= | ||
If you have no PzlStudio PzlStudio in the menu '''Start/...''' of you computer, then you should find the directory '''SpbSolutions/Bin''' and run the application PzlStudioElementary.exe. | |||
[[Image:PzlStudio DemoRun Initialized.png]] | [[Image:PzlStudio DemoRun Initialized.png]] | ||
Please check the status of your settings and modify them if there is such a need. | |||
To do so you should call the form to set the Basic Options using the menu item '''Tools/Options''': | |||
[[Image:PzlStudio OptionsDLG.png]] | [[Image:PzlStudio OptionsDLG.png]] | ||
Press '''Close''' to close the form. | |||
= | =Step 2. Create the pzl-container MyHelloWorld= | ||
Using the menu entry '''File/New.../Container''' in the Elementary PzlStudio invoke the form and set: | |||
* | *the name of the directory of the pzl-container ''MyDemoContainer''. | ||
* | *the name of the container ''MyDemoContainer''. | ||
[[Image:PzlStudio DemoRun ContainerCreate.png]] | [[Image:PzlStudio DemoRun ContainerCreate.png]] | ||
Press '''Create'''. The container is created! | |||
Press '''Close''' to close the form. | |||
= | =Step 3. Compile the pzl-container= | ||
Open the IDE of the Visual Prolog system. | |||
Open the project ''MyDemoContainer.prj6''. | |||
[[Image:PzlStudio DemoRun ContainerAtIDE.png]] | [[Image:PzlStudio DemoRun ContainerAtIDE.png]] | ||
Build the project (Ctrl-Shift-B). | |||
Save the project (Ctrl-S). | |||
=Шаг 4. | =Шаг 4. Crate the pzl-component = | ||
Using the menu item '''File/New.../Component''' in the Elementary PzlStudio invoke the form and set: | |||
* | *The directory name ''MyHelloWorld'' | ||
* | *The name of the pzl-component ''MyHelloWorld''. | ||
There is no need to edit the rest parameters. | |||
[[Image:PzlStudio DemoRun ComponentCreate.png]] | [[Image:PzlStudio DemoRun ComponentCreate.png]] | ||
Press '''Create'''. The pzl-component is created! | |||
Press '''Close''' to close the form. | |||
= | =Step 5. Add the pzl-component to the pzl-container = | ||
Invoke the form using the menu item '''Tools/Add.../Component To Container''' and set there: | |||
* | *The name of the pzl-container ''... /MyDemoContainer.prj6'' | ||
* | *The package of the pzl-component ''... /MyHelloWorld.pack''. | ||
[[Image:PzlStudio DemoRun AddComponent.png]] | [[Image:PzlStudio DemoRun AddComponent.png]] | ||
Press '''Add As Original'''. The pzl-component placed to the pzl-container! | |||
Press '''Close''' to close the form. | |||
= | =Step 7. Compile the pzl-container = | ||
Come back to IDE. It is supposed the project MyDemoContainer.prj6 is still opened. | |||
[[Image:PzlStudio Demo ComponentAddedProject.png]] | [[Image:PzlStudio Demo ComponentAddedProject.png]] | ||
Build the project (Ctrl-Shift-B). Accept the adding of the new packages to the project by pressing '''Add All'''. | |||
[[Image:PzlStudio DemoRun ContainerAddGuiDialog.png]] | [[Image:PzlStudio DemoRun ContainerAddGuiDialog.png]] | ||
Now you can see all files of the package MyHelloWorld.pack in the project window. | |||
[[Image:PzlStudio Demo ProjectCompiled.png]] | [[Image:PzlStudio Demo ProjectCompiled.png]] | ||
Save the project (Ctrl-S). | |||
= | =Step 7. Register the pzl-component = | ||
Invoke the registration form using the menu entry '''Tools/Register Components''' and set there: | |||
* | *The name of the pzl-container file ''MyDemoContainer.PZL (...)'' – you can find if in the target directory of the project | ||
*View The Content of '''<Container>''' at Target '''<Current User>''' | *View The Content of '''<Container>''' at Target '''<Current User>''' | ||
[[Image:PzlStudio DemoRun RegisteringSelection.png]] | [[Image:PzlStudio DemoRun RegisteringSelection.png]] | ||
Select the pzl-component "MyHelloWorld". | |||
Press the button '''Register Selected'''. The component is registered! | |||
[[Image:PzlStudio DemoRun RegisteringRegistered.png]] | [[Image:PzlStudio DemoRun RegisteringRegistered.png]] | ||
Press ‘’’Close’’’ to close the form. | |||
=Шаг 8. | =Шаг 8. Write the code in the class MyHelloWorld= | ||
Come back to the IDE of the Visual Prolog system. | |||
Make the DoubleClick on the file MyHelloWorld.pro. | |||
[[Image:PzlStudio DemoRun IDESourceImplementation.png]] | [[Image:PzlStudio DemoRun IDESourceImplementation.png]] | ||
Write to the predicate's spbRun(...) body the call | |||
<vip> | <vip> | ||
clauses | clauses | ||
Строка 125: | Строка 123: | ||
[[Image:PzlStudio DemoRun IDESourceUpdated.png]] | [[Image:PzlStudio DemoRun IDESourceUpdated.png]] | ||
= | =Step 9. Compile the pzl-container = | ||
Run project building (Ctrl-Shift-B). | |||
Accept proposals of the IDE by pressing '''Add All''' | |||
[[Image:PzlStudio DemoRun AddVPIToProject.png]] | [[Image:PzlStudio DemoRun AddVPIToProject.png]] | ||
Now component makes something valuable! | |||
= | =Step 10. Run it!= | ||
In the PzlStudio: | |||
* | *Using the menu entry '''View/PzlStatus''' invoke the pzl-system status form | ||
* | *Using the menu entry '''Tools/Run Component''' invoke the component invocation form, find there the component ''MyHelloWorld'', and write the text to the ‘’’Parameter’’’ field: | ||
[[Image:PzlStudio DemoRun InvokeRun.png]] | [[Image:PzlStudio DemoRun InvokeRun.png]] | ||
Press '''Run''' and get | |||
[[Image:PzlStudio DemoRun RunResult.png]] | [[Image:PzlStudio DemoRun RunResult.png]] |
Текущая версия на 11:16, 7 февраля 2008
Basic Definitions of the Pzl-Technology
Classes and packages, wrapping these classes, which fit the special agreement, are called the Pzl-components.
Pzl-components are placed in pzl-containers. Pzl-container may contain an unlimited amount of pzl-components.
The interaction between the usual Visual Prolog classes and pzl-components, and the interaction between pzl-components are handled by the pzl-system.
The main part of the application, which includes the pzl-system core, is named PzlPort.
The DLL, which is built in accordance with the pzl-technology agreements, is named the DLL-container.
The dll-container and the pzlPort are pzl-containers.
Step 1. The first run of the Elementary PzlStudio
If you have no PzlStudio PzlStudio in the menu Start/... of you computer, then you should find the directory SpbSolutions/Bin and run the application PzlStudioElementary.exe.
Please check the status of your settings and modify them if there is such a need. To do so you should call the form to set the Basic Options using the menu item Tools/Options:
Press Close to close the form.
Step 2. Create the pzl-container MyHelloWorld
Using the menu entry File/New.../Container in the Elementary PzlStudio invoke the form and set:
- the name of the directory of the pzl-container MyDemoContainer.
- the name of the container MyDemoContainer.
Press Create. The container is created!
Press Close to close the form.
Step 3. Compile the pzl-container
Open the IDE of the Visual Prolog system.
Open the project MyDemoContainer.prj6.
Build the project (Ctrl-Shift-B).
Save the project (Ctrl-S).
Шаг 4. Crate the pzl-component
Using the menu item File/New.../Component in the Elementary PzlStudio invoke the form and set:
- The directory name MyHelloWorld
- The name of the pzl-component MyHelloWorld.
There is no need to edit the rest parameters.
Press Create. The pzl-component is created!
Press Close to close the form.
Step 5. Add the pzl-component to the pzl-container
Invoke the form using the menu item Tools/Add.../Component To Container and set there:
- The name of the pzl-container ... /MyDemoContainer.prj6
- The package of the pzl-component ... /MyHelloWorld.pack.
Press Add As Original. The pzl-component placed to the pzl-container!
Press Close to close the form.
Step 7. Compile the pzl-container
Come back to IDE. It is supposed the project MyDemoContainer.prj6 is still opened.
Build the project (Ctrl-Shift-B). Accept the adding of the new packages to the project by pressing Add All.
Now you can see all files of the package MyHelloWorld.pack in the project window.
Save the project (Ctrl-S).
Step 7. Register the pzl-component
Invoke the registration form using the menu entry Tools/Register Components and set there:
- The name of the pzl-container file MyDemoContainer.PZL (...) – you can find if in the target directory of the project
- View The Content of <Container> at Target <Current User>
Select the pzl-component "MyHelloWorld". Press the button Register Selected. The component is registered!
Press ‘’’Close’’’ to close the form.
Шаг 8. Write the code in the class MyHelloWorld
Come back to the IDE of the Visual Prolog system.
Make the DoubleClick on the file MyHelloWorld.pro.
Write to the predicate's spbRun(...) body the call
clauses spbRun(""):- !, MSG="My Hello to World from MyDemoContainer!", write(MSG), vpiCommonDialogs::note(MSG). spbRun(UserText):- MSG=string::format("My Hello to World from MyDemoContainer!\nEntered:%\n",UserText), write(MSG), vpiCommonDialogs::note(MSG).
Step 9. Compile the pzl-container
Run project building (Ctrl-Shift-B).
Accept proposals of the IDE by pressing Add All
Now component makes something valuable!
Step 10. Run it!
In the PzlStudio:
- Using the menu entry View/PzlStatus invoke the pzl-system status form
- Using the menu entry Tools/Run Component invoke the component invocation form, find there the component MyHelloWorld, and write the text to the ‘’’Parameter’’’ field:
Press Run and get