Task Development (VC.6)
- Luke Cerwin
The official Source Code Directory Structure
TelePro Official Source Server | \\tnt0\usrvol2\tpriNtRt\… |
Production Systems | D:\tpriNtRt\… |
VB Projects:
ProbeA, TrendX, etc. …tpriNtRt\Std\Screens\Probe\….
VegIO, VegStatus, etc.
…tpriNtRt\Veg\Screens\VegIO\…. TpriTrendGraph, etc.
…tpriNtRt\Std\Controls\tpriBarGraph\….
3Main, 3spbpid, etc …locNtRt\sys\Screens\3Main\…
HTML Files:
ProbeA, TrendX, etc.
…tpriNtRt\Std\Screens\wwwroot\*.htm
VegIO, VegStatus, etc.
…tpriNtRt\Veg\Screens\wwwroot\*.htm
3Main, 3spbpid, etc.
…locNtRt\sys\Screens\wwwroot\*.htm
OCX Files:
TpriTrendGraph, etc. …tpriNtRt\Std\Controls\Official\*.ocx
All user controls (in VB Project Directory)
OBJ Safe Instructions and Code:
IObjSafe.bas …\Screens\IObjSafe\…
Batch Files:
DevSetup.bat, etc. tpriNtRt\Std\Procs\devSetup.bat
Documents:
OPCDefaults.doc, etc. tpriNtRt\Docs\ OPCDefaults.doc
To start a new workspace and template project for a Tsentry system, perform the following tasks. [In the directions below, ‘xxx’ and ‘yyy’ are the local directories; may be used as ‘xxx’ is the site and ‘yyy’ is the system.]
Under Visual Studio v6.0:
Start, Programs, Microsoft Visual Studio, Visual C++
File, Nnew
Workspace tab
Workspace name: Tasks
Location d:\xxx\yyy\tasks
OK
File, new, rtx AppWizard
Project Name: NtRtTask
Location d:\ xxx\yyy \tasks\NtRtTask
Check: Add to current workspace
Platforms: Win32
OK
Check: RTX application
Check: ASCII
Check: Yes, link with multithreaded Run-time library
Next
No Program Framework, just Project Settings
Finish, OK
File, Save Workspace
File, Exit
Using NT Explorer, copy the basic Tsentry task files (NtRtTask.cpp, NtRtTask.h, and stdinc.h) from another location into directory d:\ xxx\yyy \tasks\NtRtTask\*.*
Using NT Explorer, click on file d:\LocNtRt\sys\Tasks\Tasks.dsw
Verify that the NtRtTask files line is selected (should already be highlighted)
Expand the NtRtTask files
Project, Add to Project, Files
Look in d:\ xxx\yyy \tasks\NtRtTask
Select the files NtRtTask.cpp, NtRtTask.h, and stdinc.h
OK
Highlight Source Files
Project, Add to Project, Files
Look in: d:\xxxt\tpri
Select the files dbgdef.h, logmsg.cpp, tpriGsm.cpp, tpriGsm.h TpriGsmDDCom.cpp. TproGsmDDcom.h tpriIniFile.cpp, TpriIniFile.h, TproProc.cpp, TpriProc.h
OK,
Build, Rebuild All
The following procedure may be used to create a new process:
Start, programs, Microsoft Visual Studio 6.0, Visual C++ 6.0
File, New, Projects tab,
Project Name = xxxxxx
Location = xxxxxx
Create new workspace
RTX AppWizard
RTX application
ASCII
Yes, link with the Multithread Runtime library
Next
Build a C program framework
Periodic timer thread
Event server thread
Finish
OK
Build
Rebuild All
File, Save Workspace
Tools, options, tabs
Tab size: 3
Indent size: 3
Insert spaces
Auto indent: default
Macros: ack whether to reload the file
Ok
The following procedure may be used to create a Tsentry process control task. This procedure assumes that you have installed the standard Tsentry release software. In this software you will find a ‘template’ process control task under the directory d:\site\system\task\NtRtTask.
This procedure also assumes that you have installed the shareware program Xreplace-32
The following procedure assumes that the Tsentry software has been installed at d:\site\system\*, and that you would like to create a new task called NewTask.
The process first copies the template task, and then replaces all occurances of “NtRtTask” with the string name of the new task (for example “NewTask”). It then adds this new process to the Visual C workspace and build procedures
Use the NT explorer to navigate to the software distribution directory:
d:\site\system\tasks
Highlight the directory d:\site\system\Tasks\NtRtTask
<cntl-c> to copy to clipboard
Highlight the d:\site\system\Tasks directory
<cntl-v> to paste
New directory is created as d:\site\system\Tasks\Copy of NtRtTask
Right click on d:\site\system\Tasks\Copy of NtRtTask
Rename to d:\site\system\Tasks\NewRtTask
Use the NT explorer to navigate to the d:\site\system\tasks\NewTasks\* file list
Rename the 4 files present (NtRtTask.cpp, .h, .dsp, and .plg) to NewTask.*
Start XReplace-32
In left hand panel, browse to d:\site\system\Tasks\NewRtTask
In center panel, highlight 4 files (NewTask.*) and drag to right hand panel
Set Replace from: NtRtTask
Set Replace with: NewTask
Command | Options
Select: Case Sensitive
DeSelect: Warn if binary
Backups
Select Overwrite Backups
OK
Command | Go
Command | Quit | No | No
Add new process (project) to workspace by:Using Internet Explorer, navigate to d:\site\system\Tasks
Double click tasks.dsw; Visual Studio loads workspace
Project | Insert Project into workspace
Click NewTask | Click NewTask.dsp | OK
Select required process configurations for this process by:
Build | Batch Build
Select appropriate boxes for NewTask:
NewTask – Win32 Release (optional)
NewTask – Win32 Debug (required)
NewTask – Win32 RTSS Release (optional)
NewTask – Win32 RTSS Debug (required)
Add the new processes to the command line task build procedure as follows:Using notepad (or the text editor of choice), edit the file
d:\site\system\Procs\systemBuild.bat
Add the required lines to build the new process. For example, if NewTask is required in both Win32 and Win32 RTSS configurations, add the lines:
echo .
z:msdev tasks.dsw /MAKE "NewTask - Win32 Debug" %1
echo .
z:msdev tasks.dsw /MAKE "NewTask - Win32 RTSS Debug" %1
Execution of this procedure will cause all the processes required by your system to be built in all applicable configurations.
© 2022 TelePro, Inc.
3811 Illinois Avenue, Suite 100, St. Charles, IL 60174