Tutorial Project. Release 14
Written by Victor Yukhtenko. Email: victor@pdc.spb.su
The programs listed below are part of the Evolutions Tutorial Project article.
Goal
The demonstration of practices of the advanced Vip-based programming:
- The communication of the main application with parts of the application, which are placed to the special kind of DLL (Dynamically Linked Library) - PzlContainers.
Notes:
- PzlContainers contains PzlComponents. Both PzlContainers and PzlComponents fit the agreements of the Pzl Technology (VpPuzzle Technology).
- The detailed description of the VpPuZzle technology can be seen at [http://wiki.visual-prolog.com/index.php?title=Category:VpPuZzle
Functionality
No changes.
Code
- Tested with Visual Prolog 7.3 build 7302.
- The Release 14 contains the set of projects, which demonstrates the different phases of the transformation of the application Polyline Release 13 to the Pzl-based application.
- The set of projects contains:
- The Project MonoApplicaion\Polyline.prj6 shows how classes are converted to pzl-Components. Here the wrapping approach been used.
- The Project MonoApplicaionLib\Polyline.prj6 is the same project as MonoApplicaion\Polyline.prj6, but HumanInterface and model Computer3 represented as the libraries.
- The directory pzlBasedApplication contains again the set of projects - the main application Polyline.prj6 and the set of projects, corresponding to containers (see version dependant details in the file VersionReference.html):
- Containers\Competitors\Competitors.prj6
- Containers\PolylineBlackHorsePlayers\PolylineBlackHorsePlayers.prj6
- Containers\PolylineGame\PolylineGame.prj6
- Containers\PolylineGameStatistics\PolylineGameStatistics.prj6
- Containers\PolylineHumanInterface\PolylineHumanInterface.prj6
- Containers\PolylineJuniourJudge\PolylineJuniourJudge.prj6
- Containers\PolylinePublicPlayers\PolylinePublicPlayers.prj6
- Containers\PolylineSeniourJudge\PolylineSeniourJudge.prj6
Install
If you have VipSpbSDK, then you will find all projects in the directory Examples\Polyline\Polyline13\Programs
To get the full set of projects of the series of the Polyline projects, please download archives using links at PDC forum:
- VipSpbSDK_PE_73_Examples_Polyline_1_14.zip
- VipSpbSDK_PE_73_Tools_Polyline_1_14.zip]
to any convenient directory. The directory named VipSpbSDK will be created automatically.
Building
Please, see first your version specialty
Open and build project Programs\MonoApplicaion\Polyline.prj6
Run command files
- Programs\BuildComputer3Lib.cmd
- Programs\BuildHumanInterfaceLib.cmd
Open and build projects:
- Programs\MonoApplicaionLib\Polyline.prj6
- Programs\pzlBasedApplication\Polyline.prj6
- Programs\pzlBasedApplication\Containers\Competitors\Competitors.prj6
- Programs\pzlBasedApplication\Containers\PolylineBlackHorsePlayers\PolylineBlackHorsePlayers.prj6
- Programs\pzlBasedApplication\Containers\PolylineBlackHorsePlayersLib\PolylineBlackHorsePlayers.prj6
- Programs\pzlBasedApplication\Containers\PolylineGame\PolylineGame.prj6
- Programs\pzlBasedApplication\Containers\PolylineGameStatistics\PolylineGameStatistics.prj6
- Programs\pzlBasedApplication\Containers\PolylineHumanInterface\PolylineHumanInterface.prj6
- Programs\pzlBasedApplication\Containers\PolylineHumanInterfaceLib\PolylineHumanInterface.prj6
- Programs\pzlBasedApplication\Containers\PolylineJuniourJudge\PolylineJuniourJudge.prj6
- Programs\pzlBasedApplication\Containers\PolylinePublicPlayers\PolylinePublicPlayers.prj6
- Programs\pzlBasedApplication\Containers\PolylineSeniourJudge\PolylineSeniourJudge.prj6
Run command file Programs\pzlBasedApplication\RegisterComponents.cmd
To build projects the IDE variable SpbSolutions must be set to the VipSpbSDK directory.
The complex building
To simplify the settings and initial building of applicaions the Build.cmd command file included (BuildPersonal.cmd - please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).
The use of Build.cmd file:
- sets the SpbSolutions IDE variable, which refers to the VipSpb SDK directory;
- "knows" where Visual Prolog is installed and uses VipBuilder.exe;
- builds all projects containing in the subfolders;
- builds all needed libraries;
- registers all pzl-Components (if needed);
- informs regarding the result of each building operation;
- Build.cmd file may be used together with the Visual Prolog CE only (please see details in Polyline Version Reference or in Examples\Polyline\VersionReference.html).
Run
- The executable applications correspond to projects: Programs\MonoApplicaion\Polyline.prj6 or Programs\MonoApplicaionLib\Polyline.prj6, where all components are in one application;
- The project Programs\pzlBasedApplication\Polyline.prj6, which communicates with components placed to pzl-Containers and registered in the PzlRegistry.pzr file. The file PzlRegistry.pzr must be in the same directory as the executable file
- Run the application using the E of the IDE or run the executable at the directory EXE.
- The language of the application may be defined in the command line by the language identifier:
- en - English
- ru - Russian
- When running the program from the IDE, the parameter of the language must be placed to the field "Project Settings"\Run Options\Run Arguments, available from menu Project\Settings...