Developer Reference Guide
Developer Reference Guide
Reference
Guide
2.6.0
AT260_DRG_E0
Contact Information
Forsk (Head Office) 7 rue des Briquetiers
31700 Blagnac
France
L
{
L
{
L
www.forsk.com
forsk@forsk.com
sales@forsk.com
support@forsk.com
+33 (0) 562 74 72 10
+33 (0) 562 74 72 25
+33 (0) 562 74 72 11
Web
General information
Sales and pricing information
Technical support
General
Technical support
Fax
sales_us@forsk.com
support_us@forsk.com
+1 312 674 4846
+1 888 GoAtoll (+1 888 462 8655)
+1 312 674 4847
www.forsk.com.cn
enquiries@forsk.com.cn
+86 20 8553 8938
+86 20 8553 8285
+86 10 6513 4559
Web
Information and enquiries
Telephone
Fax (Guangzhou)
Fax (Beijing)
Forsk 2007
AT260_DRG_E0
iii
iv
AT260_DRG_E0
Forsk 2007
Table of Contents
Table of Contents
1
1.1
1.2
1.3
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.3.6
2
2.1
2.2
2.2.1
2.2.2
2.2.3
2.2.4
2.2.5
2.2.6
2.2.7
2.3
2.3.1
2.3.1.1
2.3.1.2
2.3.1.3
2.3.1.4
2.3.2
2.3.2.1
2.3.2.2
2.3.2.2.1
2.3.2.2.2
2.3.2.3
2.3.2.3.1
2.3.2.3.2
2.3.2.4
2.3.2.4.1
2.3.2.4.2
2.3.2.5
2.3.3
2.3.3.1
2.3.3.1.1
2.3.3.1.2
2.3.3.1.3
2.3.3.1.4
2.3.3.1.5
2.3.3.2
2.3.3.2.1
2.3.3.3
2.3.3.3.1
2.3.3.3.2
2.3.3.4
2.3.3.4.1
2.3.3.4.2
2.3.3.4.3
2.3.3.4.4
2.3.3.5
2.3.3.5.1
2.3.3.5.2
Forsk 2007
Introduction ..................................................................................... 19
Getting Started ....................................................................................................................................... 19
Prerequisites .......................................................................................................................................... 19
Supported Extensions ............................................................................................................................ 19
Propagation Models ......................................................................................................................... 19
Add-ins ............................................................................................................................................. 19
Macros.............................................................................................................................................. 20
Scripts .............................................................................................................................................. 20
Automatic Frequency Planning Models ............................................................................................ 20
Mixing Extensions ............................................................................................................................ 20
2.3.3.5.3
2.3.3.6
2.3.3.6.1
2.3.3.6.2
2.3.3.6.3
2.3.3.6.4
2.3.3.6.5
2.3.3.6.6
2.3.3.6.7
2.3.3.6.8
2.3.3.6.9
2.3.3.6.10
2.3.3.6.11
2.3.3.6.12
2.3.3.6.13
2.3.3.7
2.3.3.7.1
2.3.3.8
2.3.3.8.1
2.3.3.8.2
2.3.3.8.3
2.3.3.9
2.3.3.9.1
2.3.3.9.2
2.3.3.10
2.3.3.10.1
2.3.3.10.2
2.3.3.10.3
2.3.3.10.4
2.3.3.10.5
2.3.3.10.6
2.3.3.11
2.3.3.11.1
2.3.3.11.2
2.3.3.11.3
2.3.3.11.4
2.3.3.12
2.3.3.12.1
2.3.3.12.2
2.3.3.12.3
2.3.3.12.4
2.3.3.13
2.3.3.13.1
2.3.3.13.2
2.3.3.13.3
2.3.3.13.4
2.3.3.14
2.3.3.14.1
2.3.3.14.2
2.3.3.14.3
2.3.3.14.4
2.3.3.14.5
2.3.3.14.6
2.3.3.15
2.3.3.15.1
2.3.3.15.2
2.3.3.15.3
2.3.3.15.4
2.3.3.15.5
2.3.4
2.3.4.1
2.3.4.2
2.3.4.3
2.3.4.4
2.3.4.5
2.3.4.6
2.3.4.7
2.3.4.8
vi
Forsk 2007
Table of Contents
3
3.1
3.2
3.2.1
3.2.2
3.2.2.1
3.2.2.2
3.2.2.3
3.2.3
3.2.4
3.3
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.4
3.4.1
3.4.2
3.4.3
3.5
3.5.1
3.5.1.1
3.5.1.2
3.5.1.3
3.5.2
3.5.3
3.5.4
3.5.5
3.5.6
3.5.7
3.5.8
3.5.8.1
3.5.8.1.1
3.5.8.1.2
3.5.8.1.3
3.5.8.1.4
3.5.8.1.5
3.5.8.1.6
3.5.8.1.7
3.5.8.1.8
3.5.8.1.9
3.5.8.1.10
3.5.8.1.11
3.5.8.1.12
3.5.8.1.13
3.5.8.1.14
3.5.8.1.15
3.5.8.1.16
3.5.8.2
3.5.8.2.1
3.5.8.2.2
3.5.8.2.3
3.5.8.2.4
3.5.8.2.5
3.5.8.2.6
3.5.8.2.7
3.5.8.2.8
3.5.8.2.9
3.5.8.2.10
3.5.8.3
3.5.8.3.1
3.5.8.3.2
3.5.8.3.3
3.5.8.3.4
3.5.8.3.5
3.5.8.3.6
Forsk 2007
AT260_DRG_E0
vii
3.5.8.3.7
3.5.8.3.8
3.5.8.3.9
3.5.8.3.10
3.5.8.3.11
3.5.8.3.12
3.5.8.3.13
3.5.8.3.14
3.5.8.3.15
3.5.8.3.16
3.5.8.3.17
3.5.8.3.18
3.5.8.3.19
3.5.8.3.20
3.5.8.3.21
3.5.8.3.22
3.5.8.3.23
3.5.8.3.24
3.5.8.3.25
3.5.8.3.26
3.5.8.3.27
3.5.8.4
3.5.8.4.1
3.5.8.4.2
3.5.8.5
3.5.8.5.1
3.5.8.6
3.5.8.6.1
3.5.8.6.2
3.5.8.6.3
3.5.8.6.4
3.5.8.6.5
3.5.8.7
3.5.8.7.1
3.5.8.8
3.5.8.8.1
3.5.8.8.2
3.5.8.8.3
3.5.8.8.4
3.5.8.8.5
3.5.8.8.6
3.5.8.8.7
3.5.8.8.8
3.5.8.8.9
3.5.8.8.10
3.5.8.8.11
3.5.8.8.12
3.5.8.8.13
3.5.8.8.14
3.5.8.8.15
3.5.8.8.16
3.5.8.8.17
3.5.8.8.18
3.5.8.8.19
3.5.8.9
3.5.8.9.1
3.5.8.9.2
3.5.8.9.3
3.5.8.9.4
3.5.8.9.5
3.5.8.9.6
3.5.8.9.7
3.5.8.9.8
3.5.8.9.9
3.5.8.9.10
3.5.8.9.11
3.5.8.10
3.5.8.10.1
viii
Forsk 2007
Table of Contents
3.5.8.10.2
3.5.8.11
3.5.8.11.1
3.5.8.11.2
3.5.8.11.3
3.5.8.11.4
3.5.8.11.5
3.5.8.11.6
3.5.8.11.7
3.5.8.11.8
3.5.8.11.9
3.5.8.11.10
3.5.8.11.11
3.5.8.12
3.5.8.12.1
3.5.8.12.2
3.5.8.12.3
3.5.8.12.4
3.5.8.12.5
3.5.8.12.6
3.5.8.13
3.5.8.13.1
3.5.8.13.2
3.5.8.14
3.5.8.14.1
3.5.8.14.2
3.5.8.14.3
3.5.8.15
3.5.8.15.1
3.5.8.15.2
3.5.8.15.3
3.5.8.15.4
3.5.8.15.5
3.5.8.16
3.5.8.16.1
3.5.8.16.2
3.5.8.16.3
3.5.8.16.4
3.5.8.16.5
3.5.8.16.6
3.5.8.17
3.5.8.17.1
3.5.8.17.2
3.5.8.17.3
3.5.8.17.4
3.5.8.17.5
3.5.8.17.6
3.5.8.17.7
3.5.8.17.8
3.5.8.17.9
3.5.8.17.10
3.5.8.17.11
3.5.8.17.12
3.5.8.17.13
3.5.8.17.14
3.5.8.18
3.5.8.18.1
3.5.8.18.2
3.5.8.18.3
3.5.8.18.4
3.5.8.19
3.5.8.19.1
3.5.8.19.2
3.5.8.19.3
3.5.8.20
3.5.8.20.1
3.5.8.20.2
3.5.8.21
Forsk 2007
ix
3.5.8.21.1
3.5.8.21.2
3.5.8.21.3
3.5.9
3.5.9.1
3.5.9.1.1
3.5.9.1.2
3.5.9.1.3
3.5.9.1.4
3.5.9.1.5
3.5.9.1.6
3.5.9.1.7
3.5.9.1.8
3.5.9.1.9
3.5.9.1.10
3.5.9.1.11
3.5.9.1.12
3.5.9.1.13
3.5.9.1.14
3.5.9.2
3.5.9.2.1
3.5.9.2.2
3.5.9.2.3
3.5.9.2.4
3.5.10
3.5.10.1
3.5.10.2
3.5.10.3
3.5.10.3.1
3.5.10.3.2
3.5.10.4
3.5.11
3.5.11.1
3.5.11.2
3.5.11.3
3.5.11.4
3.5.11.5
3.5.11.6
3.5.11.7
3.5.11.8
3.5.11.9
3.5.11.10
3.5.11.11
3.5.11.12
3.5.11.13
3.5.11.14
3.5.11.15
3.5.11.16
3.5.11.17
3.5.11.18
3.5.11.19
3.5.12
3.5.12.1
3.5.12.1.1
3.5.12.1.2
3.5.12.1.3
3.5.12.1.4
3.5.12.1.5
3.5.12.2
3.5.12.3
3.5.12.3.1
3.5.12.3.2
3.5.12.3.3
3.5.12.3.4
3.5.12.3.5
3.5.12.4
3.5.12.4.1
3.5.12.4.2
Source Property...................................................................................................................152
ClassAttributes Property ......................................................................................................152
DefaultAttributes Property....................................................................................................152
Outgoing Interfaces.........................................................................................................................155
_IApplicationEvents Interface ....................................................................................................155
WillQuitApp Method .............................................................................................................156
DocumentOpenComplete Method .......................................................................................156
WillCloseDocument Method ................................................................................................156
WillSaveDocument Method .................................................................................................156
DocumentSaveComplete Method........................................................................................156
DocumentNewComplete Method.........................................................................................157
WillRefreshDocument Method .............................................................................................157
RefreshDocumentComplete Method ...................................................................................157
WillArchiveDocument Method..............................................................................................157
ArchiveDocumentComplete Method ....................................................................................157
WillRun Method ...................................................................................................................158
RunComplete Method..........................................................................................................158
LicenceAcquireComplete.....................................................................................................158
LicenceReleaseComplete....................................................................................................159
IAddin Interface .........................................................................................................................159
Connecting an External Tool to a Running Session of Atoll ................................................159
Adding Commands ..............................................................................................................160
OnConnection Method.........................................................................................................160
OnDisconnection Method ....................................................................................................160
Rules, Contracts and Advices .........................................................................................................161
Error Handling ...........................................................................................................................161
Automatic Reference Counting .................................................................................................161
MFC Support Considerations ....................................................................................................161
BSTR and VARIANT Types.................................................................................................161
Resource Access.................................................................................................................161
Shutting Down Atoll ...................................................................................................................161
Enumerations ..................................................................................................................................161
AtoSaveStatus...........................................................................................................................161
AtoSaveChanges ......................................................................................................................161
AtoRefreshPriority .....................................................................................................................162
AtoArchiveStatus .......................................................................................................................162
AtoWindowStatus ......................................................................................................................162
AtoLogType ...............................................................................................................................162
AtoCompareOp .........................................................................................................................162
AtoTransmissionUnit .................................................................................................................162
AtoReceptionUnit ......................................................................................................................163
AtoDistanceUnit.........................................................................................................................163
AtoRadiatedPowerUnit ..............................................................................................................163
AtoAntennaGainUnit..................................................................................................................163
AtoHeightOffsetUnit...................................................................................................................163
AtoRootType .............................................................................................................................163
AtoRowFilter ..............................................................................................................................163
AtoRowStatus............................................................................................................................164
GeographicUnit .........................................................................................................................164
ProjectionMethod ......................................................................................................................164
ProjParameterIndices ................................................................................................................165
Raster Data API ..............................................................................................................................165
Raster Data API Structures .......................................................................................................165
GEOPOINT Structure ..........................................................................................................165
GEOSIZE Structure .............................................................................................................165
GEORECT Structure ...........................................................................................................165
GEOGRID Structure ............................................................................................................166
RASTERBUFFER Structure ................................................................................................166
Enumerations ............................................................................................................................166
IGeoCoverage Interface ............................................................................................................167
get_DataType Method .........................................................................................................167
get_NoDataValue Method ...................................................................................................167
get_BoundingBox Method ...................................................................................................168
get_OptimalResolution Method ...........................................................................................168
Rasterize Method.................................................................................................................168
IGeoRaster Interface .................................................................................................................169
get_Grid Method ..................................................................................................................169
ReadDataBlock Method.......................................................................................................170
AT260_DRG_E0
Forsk 2007
Table of Contents
3.5.12.5
3.5.12.5.1
3.5.12.5.2
3.5.12.6
3.5.12.6.1
3.5.12.6.2
3.5.12.6.3
3.5.12.6.4
3.5.12.7
3.5.12.7.1
3.5.12.7.2
3.5.12.7.3
3.5.12.8
3.6
3.6.1
3.6.2
3.6.3
4
4.1
4.2
4.3
4.3.1
4.3.2
4.3.3
4.3.4
4.3.5
4.3.5.1
4.3.5.1.1
4.3.5.1.2
4.4
4.5
4.5.1
4.5.2
4.5.2.1
4.5.2.2
4.5.2.3
4.5.2.4
4.5.2.5
4.5.2.6
4.5.2.7
4.5.2.8
4.5.2.9
4.5.2.10
4.5.3
4.5.3.1
4.5.3.2
4.5.3.3
4.6
4.6.1
4.6.1.1
4.6.1.2
4.6.1.3
4.6.1.4
4.6.1.5
4.6.1.5.1
4.6.1.6
4.6.1.7
4.6.1.8
4.6.1.9
4.6.2
4.6.2.1
4.6.2.1.1
4.6.2.1.2
4.6.2.1.3
4.6.2.1.4
4.6.2.1.5
4.6.2.2
Forsk 2007
xi
4.6.2.2.1
4.6.2.2.2
4.6.2.2.3
4.6.2.2.4
4.6.2.2.5
4.6.2.2.6
4.6.2.2.7
4.6.2.2.8
4.6.2.3
4.6.2.3.1
4.6.2.3.2
4.6.2.3.3
4.6.2.4
4.6.2.4.1
4.6.2.4.2
4.6.2.4.3
4.6.2.4.4
4.6.2.4.5
4.6.2.5
4.6.2.5.1
4.6.2.5.2
4.6.2.5.3
4.6.2.6
4.6.2.6.1
4.6.2.6.2
4.6.2.6.3
4.6.2.6.4
4.6.2.6.5
4.6.2.6.6
4.6.2.6.7
4.6.2.6.8
4.6.2.6.9
4.6.2.6.10
4.6.2.6.11
4.6.2.6.12
4.6.2.6.13
4.6.2.6.14
4.6.2.6.15
4.6.2.6.16
4.6.2.6.17
4.6.2.6.18
4.6.2.7
4.6.2.7.1
4.6.2.7.2
4.6.2.7.3
4.6.2.8
4.6.2.8.1
4.6.2.8.2
4.6.2.8.3
4.6.2.8.4
4.6.2.9
4.6.2.9.1
4.6.2.9.2
4.6.2.9.3
4.6.2.9.4
4.6.2.9.5
4.6.2.9.6
4.6.2.9.7
4.6.2.9.8
4.6.2.10
4.6.2.10.1
4.6.2.10.2
4.6.2.10.3
4.6.2.10.4
4.6.2.10.5
4.6.2.10.6
4.6.3
4.6.3.1
xii
IAssignmentPlan::GetResource Method..............................................................................185
IAssignmentPlan::GetTrxCount Method ..............................................................................186
IAssignmentPlan::GetTrxNumber Method ...........................................................................186
IAssignmentPlan::GetTrxIndex Method ...............................................................................186
IAssignmentPlan::GetTrxNumbers Method .........................................................................187
IAssignmentPlan::CreateClone Method...............................................................................187
IAssignmentPlan::GetMALScheme Method ........................................................................187
IAssignmentPlan::GetAssignmentState Method..................................................................187
IRW_AssignmentPlan:IAssignmentPlan Interface ....................................................................188
IRW_AssignmentPlan::AddTrxs Method .............................................................................188
IRW_AssignmentPlan::RemoveTrx Method ........................................................................188
IRW_AssignmentPlan::SetResource Method ......................................................................188
IGroupingScheme Interface ......................................................................................................188
IGroupingScheme::GetGroupingSchemeID Method ...........................................................188
IGroupingScheme::GetGroupCount Method .......................................................................189
IGroupingScheme::GetGroupSize Method ..........................................................................189
IGroupingScheme::GetResourceNumbers Method .............................................................189
IGroupingScheme::Contains Method...................................................................................189
IDynamicGroupingScheme: IGroupingScheme Interface .........................................................190
IDynamicGroupingScheme::AddGrp Method ......................................................................190
IDynamicGroupingScheme::SetGrp Method .......................................................................190
IDynamicGroupingScheme::DeleteGrp Method ..................................................................190
ITrg Interface .............................................................................................................................190
ITrg::GetIndx Method...........................................................................................................190
ITrg::GetTrxType Method ....................................................................................................191
ITrg::ContainsBroadcastChannel Method............................................................................191
ITrg::GetGroupingScheme Method......................................................................................191
ITrg::GetFrequencyBand Method ........................................................................................191
ITrg::GetDemand Method ....................................................................................................192
ITrg::GetTrafficLoad Method................................................................................................192
ITrg::GetDLTimeSlotUseRatio Method ................................................................................192
ITrg::GetCostWeightingFactor Method ................................................................................192
ITrg::GetHoppingMode Method ...........................................................................................192
ITrg::GetAssignmentMode Method......................................................................................193
ITrg::GetMALSize Method ...................................................................................................193
ITrg::IsInRelation Method ....................................................................................................193
ITrg::GetTrgRelationCount Method .....................................................................................193
ITrg::GetTrgRelation Method ...............................................................................................194
ITrg::GetTransmitter Method ...............................................................................................194
ITrg::GetQualityThreshold Method ......................................................................................194
ITrg::GetProbabilityThreshold Method.................................................................................194
IFrequencyBand Interface .........................................................................................................195
IFrequencyBand::GetMultiPlexingFactor Method ................................................................195
IFrequencyBand::GetCoherenceBandWidth Method ..........................................................195
IFrequencyBand::GetAdjascentSuppression Method..........................................................195
ITrgSeparations Interface ..........................................................................................................195
ITrgSeparations::GetSeparation Method .............................................................................195
ITrgSeparations::GetDefaultSeparation Method..................................................................196
ITrgSeparations::GetRelationsCount Method......................................................................196
ITrgSeparations::GetRelation Method .................................................................................196
IInterfMatrix Interface ................................................................................................................197
IInterfMatrix::GetHistogramSize Method..............................................................................197
IInterfMatrix::GetInterferingHistogram Method ....................................................................197
IInterfMatrix::GetInterferingProbability Method ....................................................................197
IInterfMatrix::GetInterfererCount Method.............................................................................198
IInterfMatrix::GetInterferers Method.....................................................................................198
IInterfMatrix::GetVictimCount Method..................................................................................198
IInterfMatrix::GetVictims Method .........................................................................................198
IInterfMatrix::GetInterfererHistogram Method ......................................................................199
IAFPProgress Interface .............................................................................................................199
IAFPProgress::StartProgressReport Method.......................................................................199
IAFPProgress::OnProgress Method ....................................................................................199
IAFPProgress::Display Method............................................................................................199
IAFPProgress::DisplayLogInfo Method................................................................................200
IAFPProgress::DisplayLogWarning Method ........................................................................200
IAFPProgress::DisplayLogError Method..............................................................................200
Interfaces Implemented by The Model............................................................................................200
IAfpModel Interface ...................................................................................................................200
AT260_DRG_E0
Forsk 2007
Table of Contents
4.6.3.1.1
4.6.3.2
4.6.3.2.1
4.6.3.2.2
4.6.3.3
4.6.3.3.1
4.7
4.7.1
4.7.2
4.7.3
4.7.4
4.7.5
4.7.6
4.7.6.1
4.7.7
4.7.8
4.7.9
4.7.10
5
5.1
5.2
5.2.1
5.2.2
5.2.3
5.3
5.4
5.4.1
5.5
Forsk 2007
AT260_DRG_E0
xiii
xiv
AT260_DRG_E0
Forsk 2007
List of Figures
List of Figures
Figure 2.1:
Figure 2.2:
Figure 2.3:
Figure 2.4:
Figure 2.5:
Figure 2.6:
Figure 2.7:
Figure 2.8:
Figure 3.1:
Figure 3.2:
Figure 3.3:
Figure 3.4:
Figure 3.5:
Figure 3.6:
Figure 3.7:
Figure 3.8:
Figure 3.9:
Figure 3.10:
Figure 3.11:
Figure 3.12:
Figure 3.13:
Figure 3.14:
Forsk 2007
AT260_DRG_E0
23
23
24
25
26
26
27
28
67
68
69
69
70
71
72
74
74
74
75
75
77
79
xv
xvi
AT260_DRG_E0
Forsk 2007
Chapter 1
Introduction
This chapter gives a basic introduction to the Developer Reference Guide and the Atoll Development Toolkit.
18
AT260_DRG_E0
Forsk 2007
Chapter 1: Introduction
Introduction
1.1
Getting Started
Welcome to Atoll Development Toolkit. The Development Toolkit is a set of programmable extensions enabling users to
enhance the already rich functionalities found in Atoll. We recommend that you:
1.2
Read the Prerequisites to know about the development environment supported by this product.
Read the paragraph Supported extensions to learn what you can do with the development toolkit.
Follow the Tutorials1 step by step before starting your own development.
Prerequisites
The Atoll Development Toolkit is based on a set of COM interfaces allowing communication between Atoll and external
modules. This document assumes that the reader is already familiar with the basic concepts of COM. It would, however,
be quite useful to have Microsoft Online Help available.
Although COM is basically programming language independent and supported by all development environments, some
enhanced support is available for Visual C++ .NET and ActiveX Template Library (ATL) users. If you are not familiar with
this environment, especially with the very specific programming style of ATL, we recommend you to go through the ATL
tutorial provided with Visual C++ .NET.
To have the Atoll object wizard correctly installed inside Visual C++ .NET, you must install (or reinstall) Atoll after Visual
C++ .NET. Furthermore, if you consider developing a parameterised model, you must be familiar with some additional
COM concepts, such as:
If you plan to write scripts or macros, you must be familiar with Visual Basic Scripting language.
1.3
Supported Extensions
There are currently five extension types available:
1.3.1
Propagation Models
Add-ins
Macros
Scripts
Automatic Frequency Planning Models
Propagation Models
Atoll delegates propagation calculations to external dynamic libraries registered on the computer. The software incorporates its predefined set of external models. By developing their own external propagation models, users can:
Propagation Models can be built using any COM-compliant C++ development environment. For simplicity and clarity, this
document provides examples using Microsoft Visual C++ only.
For further information, please refer to chapter 2 "Propagation API".
1.3.2
Add-ins
To facilitate extensions in Atoll by external developers, Forsk has introduced a technology greatly inspired from the Microsoft COM automation and add-in technology.
Add-ins allow advanced users to add specific tasks that can interact with the user during their Atoll session. Add-ins can
be built using any COM-compliant C++ development environment. For simplicity and clarity, this document provides examples using Microsoft Visual C++ only.
To learn more about Add-ins, please refer to chapter 3 "General API".
1.
Currently, (Jan 2006) the wizard tutorials are only supported in Visual C++ .NET 2003 environment. The
screenshots in this document only refer to Visual C++ .NET. If Visual C++ 6.0 is installed prior to Atoll, quite similar wizard
dialogs are also available in Visual C++ 6.0. If you require assistance specifically regarding Visual C++ 6.0, please contact
the Forsk Support Team.
Forsk 2007
AT260_DRG_E0
19
1.3.3
Macros
Macros allow the automation of tasks in Atoll without requiring special C++ programming skills. Its possible for a macro
to interact with the user, though in a limited way. Macros are written using VBScript.
To learn more about Macros, please refer to chapter 3 "General API".
1.3.4
Scripts
Scripts allow the automation of tasks when no interaction with the user is needed. Scripts are specially useful for scheduling tasks in batch mode. Scripts are written using VBScript.
To learn more about Scripts, please refer to chapter 3 "General API".
1.3.5
1.3.6
Mixing Extensions
Mixing different types of extensions within the same dynamic link library (.dll) file is not safe and can lead to unpredictable
results and loss of data. Therefore, such practice is strongly discouraged.
20
AT260_DRG_E0
Forsk 2007
Chapter 2
Propagation API
This chapter describes Atolls Propagation Model API. This API has been specifically designed for working with
propagation models in Atoll.
22
AT260_DRG_E0
Forsk 2007
Propagation API
2.1
2.2
2.2.1
Forsk 2007
AT260_DRG_E0
23
File
Description
UserMdl.cpp
UserMdl.def
UserMdl.sln
UserMdl.vcproj
UserMdl.idl
The interface definition language file describing the interfaces specific to your objects.
UserMdl.rc
The resource file, which initially contains the version information and a string containing the
project name.
UserMdl.rgs
Resource.h
UserMdlps.vcproj
The project settings that can be used to build a proxy/stub DLL. You will not need to use this.
UserMdlps.def
StdAfx.cpp
StdAfx.h
To make the UserMdl DLL useful, you have to add the propagation model object using the Visual C++ Add Class dialog
box.
2.2.2
The Class field shows the C++ class name created to implement the model.
.H File and .CPP File fields show the files created containing the definition of the C++ class.
CoClass is the name of the component class for this model.
Interface is the name of the interface on which your control will implement its custom methods and properties.
Type is the descriptive name the user will see in Atoll.
ProgID is the name that identifies the model in the registry.
You have now finished setting options for your model. Click Finish.
24
AT260_DRG_E0
Forsk 2007
File
Description
Model1.h
Model1.cpp
Model1.rgs
A text file that contains the registry script used to register the model.
A statement was added to UserMdl.idl to import AtollAPI.idl, which defines the interfaces Atoll needs to communicate with the model.
The registry script Model1.rgs was added to the project resource.
The model was added to the object map.
The default model generated by the wizard implements a very simple free space algorithm. As this tutorial deals with the
interface between Atoll and the propagation model, we will not implement a more realistic algorithm.
You are now ready to build your model:
1. In the Build menu click Build UserMdl2.
2. Once your project has finished building, run Atoll and select New from the File Menu.
3. Your model should be listed in the Module tab of the Explorer.
In the next step, you will learn how to communicate error messages to Atoll.
2.2.3
2.2.4
Forsk 2007
AT260_DRG_E0
25
double m_a;
Now you can implement the Get and Put methods. The get_A and put_A function definitions have been added to
Model1.cpp. You have to add code similar to the following:
26
AT260_DRG_E0
Forsk 2007
}
STDMETHODIMP CModel1::put_A(double newVal)
{
m_a = newVal;
return S_OK;
}
Repeat these steps for B and C properties and then use these properties in the CalculateGrid method of your model:
HRESULT CalculateGrid(
/*in*/
IRadioTransmitter* tx,
/*in*/
IRadioReceiver* rx,
/*in*/
IProgressCallback* cb,
double affmax,
CModel1::CModel1():m_a(32.4),m_b(20.),m_c(60.)
{}
You have now three parameters in your algorithm. In the next step you will add some user interface enabling a user to
modify their values.
2.2.5
Forsk 2007
AT260_DRG_E0
27
File
Description
Model1Prop.h
Model1Prop.cpp
Model1Prop.rgs
Now, add the fields you want to display on this property page. Switch to ResourceView tab of the Visual C++ Explorer,
then open the dialog IDD_MODEL1PROP. Note that it is empty except for the label "Insert your controls here". Delete this
label and add three edit boxes with IDs IDC_A, IDC_B and IDC_C using the standard method explained in the documentation of the resource editor.
Include Model1.h at the top of the Model1Prop.h file:
#include "Model1.h"
// definition of IModel1
Now, enable the CModel1Prop class to get the properties values from your model when the property page is opened. To
do this, you must implement the Activate function in CModel1Prop.h as follows:
28
AT260_DRG_E0
Forsk 2007
equal =FALSE;
break;
}
else if (i==0)
{
aa=a;
bb=b;
cc=c;
}
}
HRESULT res=IPropertyPageImpl<CModel1Prop>::Activate(hWndParent, prc,
bModal);
if (equal)
{
char buffer[50];
gcvt(aa,5,buffer);
SetDlgItemText(IDC_A, buffer);
gcvt(bb,5,buffer);
SetDlgItemText(IDC_B, buffer);
gcvt(cc,5,buffer);
SetDlgItemText(IDC_C, buffer);
}
return res;
}
Similarly, enable the CModel1Prop class to set the parameters in your model when the Apply button is pressed. Change
the Apply function in CModel1Prop.h as follows:
STDMETHOD(Apply)(void)
{
ATLTRACE(_T("CModel1Prop::Apply\n"));
double a, b, c;
char buffer[50];
GetDlgItemText(IDC_A, buffer, sizeof(buffer));
a = atof(buffer);
GetDlgItemText(IDC_B, buffer, sizeof(buffer));
b = atof(buffer);
GetDlgItemText(IDC_C, buffer, sizeof(buffer));
c = atof(buffer);
for (UINT i = 0; i < m_nObjects; i++)
{
CComQIPtr<IModel1, &IID_IModel1> pModel1(m_ppUnk[i]);
pModel1->put_A(a);
pModel1->put_B(b);
pModel1->put_C(c);
}
m_bDirty = FALSE;
return S_OK;
}
A property page could have more than one client attached to it at a time. So, the Apply function loops back and calls put_X
on each client with the value retrieved from the three edit boxes. You are using the CComQIPtr class, which performs the
QueryInterface on each object to obtain the IModel1 interface from the IUnknown (stored in the m_ppUnk array).
Forsk 2007
AT260_DRG_E0
29
BEGIN_MSG_MAP(CModel1Prop)
CHAIN_MSG_MAP(IPropertyPageImpl<CModel1Prop>)
COMMAND_HANDLER(IDC_A, EN_CHANGE, OnParamChange)
COMMAND_HANDLER(IDC_B, EN_CHANGE, OnParamChange)
COMMAND_HANDLER(IDC_C, EN_CHANGE, OnParamChange)
END_MSG_MAP()
Now, add the OnParamChange function after the Apply function:
public ISpecifyPropertyPages
Add also these lines to the interface map:
BEGIN_COM_MAP(CModel1)
...
COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
END_COM_MAP()
Your model now displays the standard ISpecifyPropertyPages interface. Add the following lines to the CModel1 class definition.
// ISpecifyPropertypages
STDMETHOD(GetPages)(CAUUID* pPages)
{
ATLTRACE(_T("ISpecifyPropertyPages::GetPages\n"));
pPages->cElems = 1;
pPages->pElems = (GUID*) CoTaskMemAlloc(sizeof(CLSID));
pPages->pElems[0] = CLSID_Model1Prop;
return S_OK;
}
Build your model and run Atoll. Select File New. In the list of propagation models right-click your model and you
should see your properties page.
In the next step you will see how to save the parameters a, b and c in the Atoll document file.
2.2.6
STDMETHOD(Load)(LPSTREAM pStrm)
{
pStrm->Read(&m_a, sizeof(m_a), NULL);
pStrm->Read(&m_b, sizeof(m_b), NULL);
pStrm->Read(&m_c, sizeof(m_c), NULL);
30
AT260_DRG_E0
Forsk 2007
return S_OK;
}
2.2.7
As these functions may be called at any time by the program, especially in order to manage multithreading
aspects, you should not add licensing control code inside it.
2.3
Reference Guide
This section describes all the interfaces of the Propagation Model's API. They are divided in two parts:
1.
2.
Notes:
Forsk 2007
No exception can be thrown between Atoll and the model. Each error must be notified by returning an
HRESULT error code.
AT260_DRG_E0
31
Objects created by an Atoll method are returned locked to the model. The model must release them once it
has finished using them.
References to objects, which are sent to the model, are only valid for the duration of the method's call.
2.3.1
Structures
2.3.1.1
Polarization
2.3.1.2
2.3.1.3
POLAR_NONE
POLAR_HORIZ
Horizontal polarization
POLAR_VERT
Vertical polarization
Pixel_Type
PIXEL_POINT
point grid).
Value is point-wise and is associated with the centre of a grid's mesh (corners of a 4-
PIXEL_AREA
Extraction_Mode
EXTRACT_DEFAULT
2.3.1.4
2.3.2
south
east
north
Model Interfaces
The following table lists optional or mandatory interfaces for an object model. Some of these interfaces are not described
here because they are parts of COM.
Format
Mandatory
Implemented
by
ATL Object
Wizard
Comments
IPropagationModel
No
IOnProfilePropagationModel
No
IObjectWithSite
Yes
Yes
**
ISupportErrorInfo
No
Yes
ISpecifyPropertyPage
No
Yes
Management of PropertyPage
IPersistStream
No
Yes
IConnectionPointContainer
No
Yes
IConnectionPoint
No
Yes
To be able to return the result of a surface-area-wise calculation, the model must implement a class derived from IGridData:
32
Interface
Mandator
y
Implemented by
ATL Object
Wizard
Comments
IGridData
Yes
Yes
AT260_DRG_E0
Forsk 2007
Interface
Mandator
y
Implemented by
ATL Object
Wizard
Comments
IPropertyPage
No
Yes
Notes:
2.3.2.1
** Access to geographic data must be possible apart from calculations. For example, a model may need
geographic data to configure its properties pages. So, a model requires access to its client. IObjectWithSite
interface manages communication between an object (here, the model) and its site (object on the Atoll side,
which is client of the model). Model's site object implements IServiceProvider interface. A model can, by
calling the function IServiceProvider: :QueryService, get objects that provide services SID_DEM (access to
DEM) and SID_CLUTTER (access to clutter) or SID_DHM (access to clutter heights). These objects
implement IRasterGeoData, IMultiGridData, and IClutterInfo (only for the clutter).
ISupportErrorInfo: See 2.2.3 step 3 of the tutorial to learn how to use this interface to transmit detailed error messages to Atoll.
ISpecifyPropertyPages: With this interface, Atoll is able to display a specific property page, letting the end user
change some internal properties of the propagation model object. See 2.2.5 step 5 of the tutorial.
IPersistStream: By implementing this interface, you can store data inside Atoll documents. Support for this interface is automatically provided by the ATL propagation model wizard.
IConnectionPointContainer and IConnectionPoint: If your model is a connectable object with support for the
IPropertyNotifySink outgoing interface, it can notify Atoll to consider old calculation results as invalid. See 2.2.7
step 7 of the tutorial to learn how to implement this functionality.
The last three items in the list above are all aimed at the development of parameterised propagation models and should
generally be implemented together.
2.3.2.2
IPropagationModel Interface
IPropagationModel is the interface used by Atoll to execute surface-area-wise and vectorial calculations. It provides the
following two services:
Surface-area-wise calculation: Given a transmitter, IRadioTransmitter, and a receiver, IRadioReceiver, Atoll asks
the model to calculate a path loss (attenuation values in dB) matrix. It is up to the model to determine the calculation grid.
Vectorial calculation: Given a transmitter, IRadioTransmitter, a receiver, IRadioReceiver, and a list of geographic
points GEOPOINT, Atoll uses the model to generate an array of path loss (attenuation values in dB).
2.3.2.2.1
IUnknown
Description
QueryInterface
AddRef
Release
IPropagationModel
Description
CalculateGrid
Calculates the attenuation of the signal from a given transmitter to a given receiver, on each
mesh of a grid defined by the model
CalculatePoints
Calculates the attenuation of the signal from a given transmitter to a given receiver, on each
given geographic point
IPropagationModel::CalculateGrid Method
Calculates the signal attenuation between a given transmitter and a given receiver on each mesh of a defined grid.
HRESULT CalculateGrid(
[in] IRadioTransmitter* tx,
[in] IRadioReceiver* rx,
[in] IProgressCallback* cb,
[in] double resolution,
[in]
double attmax,
Forsk 2007
AT260_DRG_E0
33
Parameters
tx:
rx:
cb:
This object allows the model to inform its client about calculation progress. In return,
the client lets the model know whether the calculation must stop or not.
resolution:
attmax:
Maximum threshold of attenuation used by Atoll (derived from the Prediction Studies).
pLoss:
The attenuation matrix resulting from calculations. To be able to send back an object
with the IGridData interface, you must create a class implementing this interface. If you use the ATL Object Wizard associated with IPropagationModel interface, a class implementing the IGridData interface will be automatically generated.
The type of this matrix is VT_ARRAY|VT_R4.
Return Values
This method supports the standard Return Values E_OUTOFMEMORY, E_ABORT and E_UNEXPECTED.
E_ABORT is sent when the user interrupts the calculation. S_OK implies that the calculation has completed without errors.
Remarks
E_NOTIMPL is not a valid Return Values for this method. If you do not have any method to determine the calculation zone,
you can let the user choose a maximum distance through the properties dialog of the model.
attmax: The different studies present in the Predictions folder may define some Min Signal Level thresholds. The maximum
value of pathloss above which coverage criterion will not be satisfied corresponds to the minimum value of this Signal
Level. This maximum pathloss value is passed to the model to enable it to optimise its calculation phase. It is not mandatory to use this parameter.
2.3.2.2.2
IPropagationModel::CalculatePoints Method
Calculates the signal attenuation between a given transmitter and a given receiver on each given geographic point.
HRESULT CalculatePoints(
[in] IRadioTransmitter* tx,
[in] IRadioReceiver* rx,
[in] ULONG nPoints,
[in, size_is(nPoints)] GEOPOINTpts[],
[out, size_is(nPoints)] float loss[])
Parameters
tx:
rx:
nPoints:
pts:
loss:
Return Values
This method supports the standard Return Values E_OUTOFMEMORY and E_UNEXPECTED. S_OK means that the
calculation has completed without any error.
Remarks
E_NOTIMPL is not a valid Return Values for this method.
Contrary to CalculateGrid function, no IProgressCallback parameter was initially designed to allow the model to inform
Atoll of the calculation progress and to allow Atoll to interrupt it. The calculation time was supposed to be a lot higher in
the matrix case than in the vector case. But this assumption is no longer true. Although, there is yet a simple way to workaround this missing parameter: the model itself implements IProgressCallback2 interface.
_COM_SMARTPTR_TYPEDEF(IProgressCallback2, __uuidof(IProgressCallback2));
IProgressCallback2Ptr CModel::GetProgress()
{
IObjectWithSitePtr os = this;
IProgressCallback2Ptr sp;
os->GetSite(__uuidof(sp), reinterpret_cast<void**>(&sp));
34
AT260_DRG_E0
Forsk 2007
return sp;
}
HRESULT CalculatePoints(IRadioTransmitter*
nPoints, GEOPOINT pts[],float loss[])
tx,
IRadioReceiver*
rx,
ULONG
IProgressCallback2Ptr progress=GetProgress();
progress->OnProgress(
2.3.2.3
IMultiResPropagationModel Interface
IMultiResPropagationModel is the interface used by Atoll to call a model capable of calculating at different resolutions.
2.3.2.3.1
ImultiResPropagationMod
el
Description
CalculateGrids
IMultiResPropagationModel::CalculateGrids Method
Calculates the grids corresponding to the multiple resolutions. This function will only be called for transmitters with the
same model selected as Propagation model for the Main matrix and the Extended Matrix in the Propagation tab of their
Properties dialog. Obviously, this model must implement IMultiResPropagation interface for CalculateGrids to be called.
Otherwise, CalculateGrid of interface IPropagationModel will be called twice (once for each matrix).
HRESULT CalculateGrids(
[in] IRadioTransmitter* tx,
[in] IRadioReceiver* rx,
[in] IProgressCallback* cb,
[in] IMultiResolution* res,
[out] IEnumGridData **pLoss)
Parameters
tx:
rx:
cb:
This object allows the model to inform its client about calculation progress. In return,
the client lets the model know whether the calculation must stop or not.
res:
supported by the calculation.
The multi-resolution object that indicates to the model how many resolutions are
pLoss:
The enumerator of IGridData objects containing the results computed by the model.
pVAl:
Return Values
This method supports the standard Return Values E_OUTOFMEMORY, E_ABORT and E_UNEXPECTED.
E_ABORT is sent if the user interrupts the calculations. S_OK implies that the calculation has completed without errors.
2.3.2.3.2
Interface
1. Add an additional public derivation to your model class:
Forsk 2007
AT260_DRG_E0
35
public IOnProfilePropagationModel,
public IPropagationModel,
public ImultiResPropagationModel
2. Add an additional interface entry in your COM map:
BEGIN_COM_MAP(CModel1)
COM_INTERFACE_ENTRY(I Model1)
COM_INTERFACE_ENTRY(IDispatch)
COM_INTERFACE_ENTRY_IMPL(IObjectWithSite)
COM_INTERFACE_ENTRY(IPersistStream)
COM_INTERFACE_ENTRY(IOnProfilePropagationModel)
COM_INTERFACE_ENTRY(IPropagationModel)
COM_INTERFACE_ENTRY(IMultiResPropagationModel)
END_COM_MAP()
3. Add the declaration of the CalculateGrids function at the end of your model class:
// IMultiResPropagationModel declaration
STDMETHOD(CalculateGrids)(
/* [in] */ IRadioTransmitter* tx,
/* [in] */ IRadioReceiver* rx,
/* [in] */ IProgressCallback* cb,
/* [in] */ IMultiResolution *res,
/* [in] */ IEnumGridData **pLoss);
};
Implementation
// Utility class CSimpleVector
template <typename T> class CSimpleVector
{
T *m_values;
size_t m_allocated, m_size;
public:
CSimpleVector() {m_values = NULL;m_allocated=m_size=0;}
~CSimpleVector() {delete[] m_values;}
void reserve(size_t s)
ATLASSERT(s>0);
m_values=new T[s];
m_allocated=s;
m_size=0;
}
size_t reserve() const
{return m_allocated;}
{return m_size;}
void fill(T t)
void resize(size_t s)
{
ATLASSERT(s >= 0);
if (s<=m_allocated) m_size = s;
else
{
delete [] m_values;
m_values = NULL;
m_values = new T[m_allocated=m_size=s];
36
AT260_DRG_E0
Forsk 2007
}
}
T *begin()
{return m_values;}
{return m_values;}
T *end()
{return m_values+m_size;}
{return m_values+m_size;}
T& operator[](int i)
return m_values[i];}
const T& operator[](int i) const {
return m_values[i];}
};
// Utility typedef
typedef
CComEnum<IEnumGridData,
&__uuidof(IGridData),
_CopyInterface<IGridData> > CPropagResultEnumerator;
IGridData*,
STDMETHODIMP
CModel1::CalculateGrids(IRadioTransmitter*
tx,IRadioReceiver*
rx,IProgressCallback* cb,IMultiResolution *res,IEnumGridData **pLoss)
{
try
{
long nResolutions;
res->GetCount(&nResolutions);
IProgressCallback2* progress;
progress=(IProgressCallback2*)cb;
CSimpleVector<IGridData*> allResults;
allResults.resize(nResolutions);
for (int iRes=0;iRes<nResolutions;iRes++)
{
progress->SetStatusText(iRes==0 ? L"calculating main":L"calculating
extended");
res->GetResolution(iRes, &sradius[iRes], &sresol[iRes]);
IGridData* result=NULL;
HRESULT res=CalculateGrid(tx,rx,cb,sresol[iRes],0,&result);
if (res==S_OK)
allResults[iRes]=result;
else
{
delete result;
*pLoss = NULL;
return E_FAIL;
}
}
CComObject<CPropagResultEnumerator> *pRet;
CComObject<CPropagResultEnumerator>::CreateInstance(&pRet);
pRet->Init(allResults.begin(), allResults.end(), NULL, AtlFlagCopy);
*pLoss = pRet;
(*pLoss)->AddRef();
Forsk 2007
AT260_DRG_E0
37
}
catch(_com_error& err)
{
HRESULT res=E_ABORT;
if (err.Error()!=res)
res=AtlReportError(GetObjectCLSID(),LPOLESTR(err.Description()),__uuidof(IMultiResPropagationModel),err.Error());
return res;
}
return S_OK;
}
Explanation
The basic idea of this example is to request the computation of each of the 2 grids to the CalculateGrid function, which is
not an operational case.
It cannot work unless some modification of the calculation zone is not done in the CalculateGrid function.
The section,
GEORECT bounds;
if (tx->GetCalculationZone(&bounds) == S_FALSE)
return Error("This model needs a calculation zone", __uuidof(IPropagationModel));
double radius;
if (resolution==sresol[0])
radius=sradius[0];
else radius=sradius[1];
GEORECT bounds;
bounds.west=ptTRX.x-radius;bounds.east=ptTRX.x+radius;
bounds.south=ptTRX.y-radius;bounds.north=ptTRX.y+radius;
2.3.2.4
2.3.2.4.1
IUnknown
Description
QueryInterface
AddRef
Release
IOnProfilePropagationModel
Description
CalculateProfile
Calculates the signal attenuation and draws the profile between a given
transmitter and a receiver at a given position.
IOnProfilePropagationModel::CalculateProfile Method
Calculates the signal attenuation and draws the profile between a given transmitter to a receiver at a given position.
HRESULT CalculateProfile(
38
AT260_DRG_E0
Forsk 2007
rx:
pt:
loss:
hDC:
prcBounds:
Pointer to a RECT structure defining the graphic context zone in which the profile
must be drawn. The rectangle dimensions are expressed in logical coordinates.
Return Values
This method supports the standard Return Values E_OUTOFMEMORY and E_UNEXPECTED. S_OK implies that the
calculation has completed without errors.
Remarks
E_NOTIMPL is not a valid Return Values for this method.
IOnProfilePropagationModel2 is the interface used by Atoll to obtain more details about a specific profile calculation.
This interface inherits from IOnProfilePropagationModel. When a model implements this interface, a new entry called
"Model Details" is automatically added to the Profile Analysis windows context menu. The only function of this interface,
ShowDetails, is called when the user clicks on this menu item.
2.3.2.4.2
IOnProfilePropagationMode
l2
Description
ShowDetails
IOnProfilePropagationModel2::ShowDetails Method
Gives details about the calculation of a specific profile. For example, opens a text window describing the values of different
parameters along the profile.
HRESULT ShowDetails(
[in] IRadioTransmitter *tx,
[in] IRadioReceiver *rx,
[in] GEOPOINT *pt)
Parameters
tx:
rx:
pt:
Return Values
S_OK implies that the details generation has completed without errors.
Remarks
The model is entirely responsible for calculating the details but also of displaying it (if necessary).
2.3.2.5
ITransmitterAntennaLossesNotIncluded Interface
ITransmitterAntennaLossesNotIncluded is a utility declarative interface used to specify that the implementation of a
model does not apply the losses due to the transmitter's antenna diagram.
If a propagation model inherits from this interface, Atoll considers that it must take into account these losses itself, in a very
basic way: it determines the azimuth and elevation angles by a direct draw of the line of sight between the transmitter and
the receiver, even if there are obstacles along the non-extracted profile.
This modelling allows, in a primitive way, not to recompute all attenuation values if only the azimuth or the elevation of the
transmitter's antenna have been updated.
Forsk 2007
AT260_DRG_E0
39
2.3.3
Atoll Interfaces
The underlying table lists the interfaces implemented by an Atoll site object that the associated model object can use.
Interface
Comments
IServiceProvider
Through the site object, the model gains access to geographical data objects implementing the following interfaces:
Interface
Comments
IRasterGeoData
IMultiGridData
IClutterInfo
The IMultiGridData interface gives access to an IEnumGridData object allowing the iteration on an IGridData objects list.
Three object types may be transmitted as arguments to a model calculation method:
2.3.3.1
IRadioTransmitter
IRadioReceiver
IProgressCallback
IRasterGeoData Interface
IRasterGeoData is the interface implemented by Atoll that provides access to a raster geographic data to the model. To
obtain an object supporting this interface, the model must request its site object, which supports the IServiceProvider
interface. The model will be able to obtain objects supporting SID_DEM (DEM access), SID_CLUTTER (clutter access) or
SID_DHM (clutter heights) services through a call to the QueryService method of this interface. These objects support
the IRasterGeoData interface.
Notes:
In order to know its site object, the model must implement the IObjectWithSite interface. When using the
ATL Object Wizard associated with the IPropagationModel interface, the generated class will automatically
derive from IObjectWithSiteImpl that implements the IObjectWithSite interface.
IUnknown
Description
QueryInterface
AddRef
Release
IRasterGeoData
2.3.3.1.1
Description
GetBoundingBox
GetGridResolution
ExtractProfile
GetValue
PrepareFastAccessData
IRasterGeoData::GetBoundingBox Method
Returns the bounding zone of the geographic data.
Return Values
If bounds is NULL, this method returns E_POINTER,
Else it returns S_OK.
40
AT260_DRG_E0
Forsk 2007
2.3.3.1.2
IRasterGeoData::GetGridResolution Method
Returns the smallest resolution available on a given zone. If the studied zone is NULL, the returned resolution will be the
smallest available for the geographic data.
HRESULT GetGridResolution(
[in] GEORECT *bounds,
[out] double *resolution)
Parameters
bounds:
Studied zone. If NULL, the zone containing the geographic data is used.
resolution:
Return Values
If resolution is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.1.3
IRasterGeoData::ExtractProfile Method
Extracts a value profile of data between two points.
HRESULT ExtractProfile(
[in] GEOPOINT *from,
[in] GEOPOINT *to,
[in] DWORD flags,
[in] ULONG nPts,
[in] double *dist,
[out] VARIANT *profile)
Parameters
from:
to:
flags:
nPts:
dist:
Array containing the distances between all the points of the profile and the beginning
point (from). These distances may be negative (point extracted below the beginning) or may excess the profile length (point
extracted beyond the ending point). If the argument is NULL, the extraction step in the profile will be regular and derived
from nPts.
profile:
VARIANT of array type (VT_ARRAY|*) containing the nPts extracted values. For DEM
and DHM the array type will be (VT_ARRAY|VT_R4) and for the clutter (VT_ARRAY| VT_I1).
Return Values
This method supports the standard Return Values E_OUTOFMEMORY.
If from, to or profile are NULL, this method returns E_POINTER.
flags should be 0. If dist is not null, E_INVALIDARG is returned. S_OK means that the calculation completed without errors.
2.3.3.1.4
IRasterGeoData::GetValue Method
Returns the data value at one given point.
HRESULT GetValueType(
[in] GEOPOINT *pt,
[in] DWORD flags,
[out] VARIANT *value)
Parameters
Forsk 2007
pt:
flags:
AT260_DRG_E0
41
Return Values
If either pt or value is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.1.5
IRasterGeoData::PrepareFastAccessData Method
This interface loads data, relevant to one geographic zone, in memory to accelerate access times while extracting multiple
profiles. It returns the new object IRasterGeoData associated with this memorized data.
HRESULT PrepareFastAccessData(
[in] GEORECT *bounds,
[out] IRasterGeoData **ppData)
Parameters
bounds:
geographic data will be loaded.
Geographic zone for which the data is pre-loaded. If this argument is NULL, all the
ppData:
Return Values
If ppData is NULL, this method returns E_POINTER.
If the user interrupts the calculation, it returns E_ABORT.
If an error is thrown, it returns DISP_E_EXCEPTION,
If the preparation was successful, it returns S_OK.
Remarks
This service is provided in for optimisation and is not necessarily called by the model. The geographic data returned only
covers the required zone. All the values associated to points outside this zone are considered by the data as null values.
2.3.3.2
IMultiGridData Interface
IMultiGridData is the interface implemented by Atoll to allow access to the list of surface-area-wise geographic data of a
given type (DEM, DHM or CLUTTER). To obtain an object supporting this interface, the model must requests its site object,
which supports the IServiceProvider interface. The model will be able to obtain objects supporting SID_DEM (DEM
access), SID_DHM (DHM access) and SID_CLUTTER (clutter access) services with the IMultiGridData interface through
a call to the QueryService method of this interface.
Methods in Vtable order
2.3.3.2.1
IUnknown
Description
QueryInterface
AddRef
Release
IMultiGridData
Description
EnumDataSet
Returns an object enabling sequential reading of a geographic data list covering a given zone.
IMultiGridData::EnumDataSet Method
Returns an object enabling sequential reading of a geographic data list intersecting a given zone.
HRESULT EnumDataSet (
[in] GEORECT* bounds,
[out] IEnumGridData **pEnum)
Parameters
bounds:
Zone for which one wants to iterate on surface-area-wise geographic data. If bounds
is NULL, pEnum relates to the whole associated geographic data.
pEnum:
bounds.
42
AT260_DRG_E0
Forsk 2007
Return Values
If pEnum is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.3
IClutterInfo Interface
IClutterInfo is the interface implemented by Atoll providing access to the properties of the clutter. To obtain an object
supporting this interface, the model must request its site object, which supports the IServiceProvider interface. The model
will be able to obtain objects supporting the IClutterInfo interface through a call to the QueryService method of this interface.
Methods in Vtable order
2.3.3.3.1
IUnknown
Description
QueryInterface
AddRef
Release
IClutterInfo
Description
GetCount
GetItemProperties
IClutterInfo::GetCount Method
Returns the number of clutter classes.
Return Values
If count is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.3.2
IClutterInfo::GetItemProperties Method
Returns the characteristics of a clutter class.
HRESULT GetItemProperties(
[in]
ULONG index,
name:
code:
height:
color:
Return Values
If code or height are NULL, this method returns E_POINTER,
If index is greater than the managed number of classes, it returns E_INVALIDARG,
Else it returns S_OK.
2.3.3.4
IEnumGridData Interface
IEnumGridData is the interface implemented by Atoll that provides access to a list of IGridData. To obtain an object
supporting this interface, the model must request its site object, which supports the IServiceProvider interface. The model
Forsk 2007
AT260_DRG_E0
43
2.3.3.4.1
IUnknown
Description
QueryInterface
AddRef
Release
IEnumGridData
Description
Next
Skip
Reset
Clone
IEnumGridData::Next Method
Gets the next celt items from the list. If the remaining number of elements is smaller than the requested number, only the
remaining elements are returned. The number of extracted elements is returned as pceltFetched parameter (except if the
caller sets this value to NULL).
HRESULT Next(
[in] ULONG celt,
[out] IGridData **rgelt,
[out] ULONG * pceltFetched )
Parameters
celt:
rgelt:
pceltFetched:
Return Values
S_OK, if the number of returned elements is celt,
Else S_FALSE.
2.3.3.4.2
IEnumGridData::Skip Method
Skips the given number of items in the iteration sequence.
HRESULT Skip(
Parameters
celt:
Return Values
S_OK, if the skipped element number is celt,
Else S_FALSE.
2.3.3.4.3
IEnumGridData::Reset Method
Goes back to the beginning of the iteration.
HRESULT Reset()
Return Values
S_OK.
2.3.3.4.4
IEnumGridData::Clone Method
Creates a new enumerator from the copy of the current one. The caller can use this function to memorise a given state in
the enumeration sequence and later return to this state. The new enumerator supports the same interface as the original
one.
44
AT260_DRG_E0
Forsk 2007
HRESULT Clone(
Parameters
ppenum:
argument is undefined.
Pointer's address of the new enumerator. If this method fails, the final value of this
Return Values
This method supports the standard Return Values E_INVALIDARG, E_OUTOFMEMORY and E_UNEXPECTED.
2.3.3.5
IGridData Interface
IGridData is the interface implemented by Atoll to allow access to geographic data and by the model for accessing the
calculation results. This interface allows access to georeferenced surface-area-wise data. To obtain an object supporting
this interface, the model must request its site object, which supports the IServiceProvider interface. The model will be
able to obtain objects supporting the SID_DEM (DEM access), SID_DHM (DHM access) and SID_CLUTTER (clutter
access) services of IMultiGridData interface through a call to the QueryService method of this interface. The latter gives
access to the list of surface-area-wise geographic data of the requested type (DEM, DHM or CLUTTER). The enumeration
through this list is done by using the IEnumGridData interface.
Notes:
In order for the model to return an object supporting the IGridData interface, a class implementing this
interface must be present in the model. If you use the ATL Object Wizard associated with the
IPropagationModel interface, this class will be automatically generated.
2.3.3.5.1
IUnknown
Description
QueryInterface
AddRef
Release
IGridData
Description
GetDimension
GetPixelType
ExtractSubGrid
Extracts a sub-matrix
IGridData::GetDimension Method
Returns the size of the grid and its georeferencing.
HRESULT GetDimension(
[out] GEOPOINT *pt,
[out] ULONG* nx, [out] ULONG* ny,
[out] double *resX, [out] double *resY)
Parameters
pt:
nx:
ny:
resX:
resY:
Return Values
If any one among pt, nx, ny, resX and resY is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.5.2
IGridData::GetPixelType Method
Returns the value's type of the matrix elements.
HRESULT GetPixelType(
[out] PIXEL_TYPE *type)
Forsk 2007
AT260_DRG_E0
45
Parameters
type:
Pixel_Type):
Type of the values from the matrix. Can take two different values (see 2.3.1.2
PIXEL_AREA
PIXEL_POINT
Return Values
If type is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.5.3
IGridData::ExtractSubGrid Method
Extracts and returns a sub-matrix from the original data.
HRESULT ExtractSubGrid(
[in] ULONG i0,
[in] ULONG j0,
[in] ULONG nX,
[in] ULONG nY,
[out] VARIANT
*grid)
Parameters
i0,j0:
nX:
nY:
grid:
VARIANT of type VT_ARRAY|* containing a matrix of values of the data for the
requested zone. If the requested zone is not entirely included in the matrix, grid gets the VT_ERROR type. The matrix is
written in memory row by row. The real type of the matrix is VT_ARRAY|VT_I2 for DEM and DHM, VT_ARRAY|VT_I1 for
the clutter.
Return Values
If grid is NULL, this method returns E_POINTER,
If the requested zone is not entirely included in the matrix, it returns E_INVALIDARG,
Else it returns S_OK.
2.3.3.6
46
IUnknown
Description
QueryInterface
AddRef
Release
IRadioTransmitter
Description
GetHeight
GetAltitude
GetAzimut
GetTilt
GetFrequency
GetLocation
GetPolarization
GetAntennaLoss
GetCalculationZone
AT260_DRG_E0
Forsk 2007
2.3.3.6.1
IRadioTransmitter::GetHeight Method
Returns the transmitter's height.
HRESULT
Parameters
height:
Return Values
If height is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.6.2
IRadioTransmitter::GetAltitude Method
Returns the altitude of the transmitter's site.
HRESULT
Parameters
altitude:
Return Values
If altitude is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.6.3
IRadioTransmitter::GetAzimut Method
Returns the azimuth of the antenna.
HRESULT
Parameters
azimuth:
wise direction.
Azimuth value of the antenna. Angle in degrees measured from the North in the clock-
Return Values
If azimuth is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.6.4
IRadioTransmitter::GetTilt Method
Returns the tilt angle of the antenna.
HRESULT
Parameters
tilt:
increasing downwards.
Value of the antenna's tilt angle. Angle in degrees measured from the horizontal plane
Return Values
If tilt is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.6.5
IRadioTransmitter::GetFrequency Method
Returns the operating frequency of the transmitter.
HRESULT
Parameters
frequency:
Return Values
If frequency is NULL, this method returns E_POINTER,
Forsk 2007
AT260_DRG_E0
47
2.3.3.6.6
IRadioTransmitter::GetLocation Method
Returns the transmitter's position.
HRESULT
Parameters
location:
Transmitter's position
Return Values
If location is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.6.7
IRadioTransmitter::GetPolarization Method
Returns the antenna's polarization.
HRESULT
Parameters
polarization:
Return Values
If polarization is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.6.8
IRadioTransmitter::GetAntennaLoss Method
Returns the antenna attenuation for a given (azimuth, elevation) pair. The azimuth and elevation are with respect to the
antenna orientation, i.e. the azimuth and tilt of the antenna.
HRESULT GetAntennaLoss(
[in] double azimuth,
[in] double elevation,
[out] double *loss)
Parameters
azimuth:
The difference between the angle of the path against North and the antenna's azimuth
in degrees (angles measured clockwise).
elevation:
The difference between the angle of the path from the horizontal plane and the
antenna's tilt angle in degrees (angles increasing downwards).
loss:
Return Values
If loss is NULL, this method returns E_POINTER,
Else it returns S_OK.
2.3.3.6.9
IRadioTransmitter::GetCalculationZone Method
Returns the calculation zone associated with the transmitter.
Calculation zone
Return Values
If zone is NULL, this method returns E_POINTER.
If the calculation zone is not defined for this transmitter, S_FALSE is returned,
Else S_OK is returned.
IRadioTransmitter2 is the interface, implemented by Atoll that provides access to other characteristics of the calculated
transmitter to the model. It inherits from IRadioTransmitter.
48
AT260_DRG_E0
Forsk 2007
2.3.3.6.10
IRadioTransmitter
2
Description
GetTransmitterId
GetEirp
GetFieldValue
IRadioTransmitter2::GetTransmitterId Method
Returns the transmitter's record id.
HRESULT
Parameter
id:
Return Values
If id is NULL, E_POINTER,
Else S_OK.
2.3.3.6.11
IRadioTransmitter2::GetEirp Method
Returns the EIRP (in dBm) of the transmitter.
HRESULT
Parameters
eirp:
Transmitter's EIRP.
Return Values
If eirp is NULL, E_POINTER,
Else S_OK.
2.3.3.6.12
IRadioTransmitter2::GetFieldValue Method
Returns the value of predefined fields of the transmitter.
HRESULT
Parameters
name:
Name of the parameter taken from the predefined list (see Predefined Fields).
value:
Value of the required attribute. The format differs according to the attribute.
Return Values
If value is NULL, E_POINTER,
Else S_OK if the required parameter belongs to the list, otherwise E_FAIL.
Predefined Fields
This function is only supported for the following fields:
Forsk 2007
"TX_ID"
"ANTENNA_NAME"
"SITE_NAME"
Site name
Character string
"ANTENNA_NAME.GAIN"
"__WORKING_ZONE_BOUNDING_BOX__"
"ANTENNA_NAME.DIAGRAM"
REDT
AT260_DRG_E0
49
2.3.3.6.13
CALC_RADIUS
Private usage of the dev. Please dont use this value because the result
is undefined.
TYPE
Private usage of the dev. Please dont use this value because the result
is undefined.
CODE_SERVICE
Private usage of the dev. Please dont use this value because the result
is undefined.
IRadioTransmitter3::EnumAntennas Method
Returns an antenna enumerator.
0 }
Parameters
filter:
ppEnum:
Return Values
S_OK if the enumerator was returned successfully.
Examples
Example of IRadioTransmitter3::EnumAntennas is available in section 2.3.3.13.4.
2.3.3.7
IRadioReceiver Interface
IRadioReceiver is the interface implemented by Atoll that provides access to the characteristics of the receiver type to the
model to use in calculations:
Methods in Vtable order
2.3.3.7.1
IUnknown
IUnknownDescription
QueryInterface
AddRef
Release
IRadioTransmitter
Description
GetHeight
IRadioReceiver::GetHeight Method
Returns the receiver's height.
HRESULT
Parameters
height:
Return Values
If height is NULL, this method returns E_POINTER,
Else it returns S_OK.
50
AT260_DRG_E0
Forsk 2007
2.3.3.8
2.3.3.8.1
IProgressCallback
Description
OnProgress
IProgressCallback::OnProgress Method
Called to let the client know the progress of a task.
HRESULT OnProgress(
[in]
DWORD
progressCurrent,
[in]
DWORD
progressMaximum)
Parameters
progressCurrent:
progressMaximum:
of work associated to the task.
Total amount of work associated with the task. Allows the caller to refine the amount
Return Values
If the task must be interrupted, S_FALSE,
Else S_OK.
IProgressCallback2 is the interface implemented by Atoll enabling the model to display messages in the events observer
during the calculation. This interface inherits from IProgressCallback.
2.3.3.8.2
IProgressCallback
2
Description
SetStatusText
IProgressCallback2::SetStatusText Method
Called to display a message in the Event Viewer.
HRESULT SetStatusText(
[in]
LPCWSTR
szStatusText)
Parameters
szStatusText:
Message to display
Return Values
S_OK.
2.3.3.8.3
IProgressCallback3::LogEvent Method
Called to display messages of different types in the the Event Viewer.
Forsk 2007
AT260_DRG_E0
51
} PROGRESS_EVENT_TYPE;
szStatusText:
Message to display
Return Values
S_OK.
E_FAIL, if an error occurs while trying to display a message.
2.3.3.9
IMultiResolution Interface
IMultiResolution is the interface implemented by Atoll allowing the model to know about the multi-resolution feature
supported by a calculation.
IMultiResolution
2.3.3.9.1
Description
GetCount
GetResolution
IMultiResolution::GetCount Method
Gets the number of resolutions supported by a calculation.
long *pVal )
Parameters
pVAl:
Return Values
If pVAl is NULL, E_POINTER,
Else S_OK.
Remarks
There are currently only two possibilities implemented:
pVal = 1 (mono-resolution) or
pVal = 2 (bi-resolution)
2.3.3.9.2
IMultiResolution::GetResolution Method
Gets the characteristics of the resolutions supported by a calculation.
HRESULT GetResolution(
[in]
long
index,
[out]
double
*radius,
[out]
double
*resolution)
Parameters
index:
radius:
resolution:
Return Values
If either radius or resolution is NULL, E_POINTER.
If index<0 or index>1, E_INVALIDARG.
Else S_OK.
2.3.3.10
IMeasurements Method
IMeasurements is the interface implemented by Atoll enabling the model to get the measurements items (paths) of the
environment.
IMeasurements
52
Description
GetName
GetTransmitter
AT260_DRG_E0
Forsk 2007
2.3.3.10.1
GetCount
GetLocations
GetMeasurements
IMeasurements::GetName Method
Gets the name of the measurements item.
BSTR *bstr )
Parameters
bstr:
Return Values
S_OK.
2.3.3.10.2
IMeasurements::GetTransmitter Method
Gets the transmitter to which the measurement path is related.
IRadioTransmitter **tx )
Parameters
tx:
Return Values
S_OK.
2.3.3.10.3
IMeasurements::GetReceptionHeight Method
Gets the value of the reception height corresponding to the measurement path. This value is displayed under Receiver
Height in the General tab of the Properties dialog of the measurement path.
double
*height )
Parameters
height:
Return Values
S_OK.
2.3.3.10.4
IMeasurements::GetCount Method
Gets the number of points of the measurement path.
ULONG
*count )
Parameters
count:
Return Values
S_OK.
2.3.3.10.5
IMeasurements::GetLocations Method
Gets the geographical positions of the points of the measurement path.
HRESULT GetLocations(
[in]
ULONG
start,
[in]
ULONG
count,
[out, size_is(count)]
[out]
Forsk 2007
ULONG
GEOPOINT
*locations,
*pceltFetched)
AT260_DRG_E0
53
Parameters
start:
count:
locations:
pceltFetched:
Number of points actually returned by the function. This parameter takes into account
the cases where points are (accidentally) requested past the end of the path.
For example, if there are 500 points and 300 points are requested starting at index 250, this parameter will be set to 250
(500 250).
Return Values
S_OK.
2.3.3.10.6
IMeasurements::GetMeasurements Method
Gets the measurement values for the points in the measurement path, expressed in dBm.
HRESULT GetLocations(
[in]
ULONG
start,
[in]
ULONG
count,
[out, size_is(count)]
[out]
ULONG
double
*measurements,
*pceltFetched)
Parameters
start:
count:
measurements:
pceltFetched:
Number of points actually returned by the function. This parameter takes into account
the cases where points are (accidentally) requested past the end of the path.
For example, if there are 500 points and 300 are requested starting at index 250, this parameter will be set to 250 (500
250).
Return Values
S_OK.
2.3.3.11
IEnumMeasurements Interface
IEnumMeasurements is the interface implemented by Atoll that provides access to a list of IMeasurements.
2.3.3.11.1
IEnumMeasurement
s
Description
Next
Skip
Reset
Clone
IEnumMeasurements::Next Method
Gets the next celt measurements items from the list. If the remaining number of elements is smaller than the requested
number, only the remaining elements are returned. The actual number of extracted elements is returned as pceltFetched
parameter (except if the caller sets this value to NULL).
HRESULT Next(
[in] ULONG celt,
[out] IMeasurements **rgelt,
[out] ULONG * pceltFetched )
Parameters
54
celt:
rgelt:
pceltFetched:
AT260_DRG_E0
Forsk 2007
Return Values
E_POINTER if rgelt is NULL or celt>1 and pceltFetched is NULL.
S_OK if the number of returned elements is celt,
Else S_FALSE.
2.3.3.11.2
IEnumMeasurements::Skip Method
Skips the given number of items in the iteration sequence.
Return Values
S_FALSE if the jump ends past the end of the iteration,
Else S_OK.
2.3.3.11.3
IEnumMeasurements::Reset Method
Goes back to the beginning of the iteration.
HRESULT Reset()
Return Values
S_OK.
2.3.3.11.4
IEnumMeasurements::Clone Method
Creates a new enumerator from copy of the current one. The caller can use this function to memorise a given state in the
enumeration sequence and return later to this state. The new enumerator supports the same interface as the original one.
Pointer's address of the new enumerator. If this method fails, the final value of this
Return Values
E_POINTER, if ppenum is NULL.
This method supports the standard Return Values E_INVALIDARG, E_OUTOFMEMORY and E_UNEXPECTED.
2.3.3.12
IMeasurementsCatalog Interface
IMeasurementsCatalog is the interface implemented by Atoll that provides access to an IEnumMeasurements enumerator. To obtain an object supporting this interface, the model must request its site object, which supports the IServiceProvider interface for the specific SID: SID_MEASURE.
2.3.3.12.1
IMeasurementsCatalo
g
Description
EnumMeasurements
IMeasurementsCatalog::EnumMeasurements Method
Gives access to an object supporting the IEnumMeasurements interface.
HRESULT EnumMeasurements(
[in] IUnknown* filter,
[out] IEnumMeasurements **ppenum)
Parameters
filter:
If set to NULL, the enumerator will allow to run through all measurement paths in the
environment. Otherwise, it will set a filter on the measurement paths to get (see Remarks).
ppenum:
Forsk 2007
AT260_DRG_E0
55
Return Values
E_POINTER, if ppenum is NULL,
Else S_OK.
Code Example
CComQIPtr<IServiceProvider, &IID_IServiceProvider> m_srv;
GetSite(IID_IServiceProvider,(void**)&m_srv);
CComPtr<IMeasurementsCatalog> measurementsCatalog;
m_srv->
QueryService(SID_MEASURE,__uuidof(IMeasurementsCatalog),(void**)&measurementsCatalog);
Remarks
Currently, the only values supported for filter parameter are:
2.3.3.12.2
IEnumGridData::Skip Method
Skips the given number of items in the iteration sequence.
Return Values
S_OK, if the number of skipped elements is celt,
Else S_FALSE.
2.3.3.12.3
IEnumGridData::Reset Method
Returns to the start of the iteration.
HRESULT Reset()
Return Values
S_OK.
2.3.3.12.4
IEnumGridData::Clone Method
Creates a new enumerator from copy of the current one. The caller can use this function to memorise a given state in the
enumeration sequence and return later to this state. The new enumerator supports the same interface as the original one.
HRESULT Clone(
Parameters
ppenum:
argument is undefined.
Pointer's address of the new enumerator. If this method fails, the final value of this
Return Values
This method supports the standard Return Values E_INVALIDARG, E_OUTOFMEMORY and E_UNEXPECTED.
2.3.3.13
IAntenna Interface
IAtenna is the interface implemented by Atoll enabling the model to get antenna properties.
IAntenna
56
Description
GetFieldValue
GetSectionCount
GetSection
AT260_DRG_E0
Forsk 2007
2.3.3.13.1
IAntenna::GetFieldValue Method
Gets antenna properties.
pValue:
A pointer to the location where this method writes the property value.
Notes:
Type
"AZIMUT"
VT_R4
"NAME"
VT_BSTR
"GAIN"
"TILT"
VT_R4
VT_R4
"REDT"
VT_R4
"POWER"
VT_R4
"ISMAIN"
VT_BOOL
Return Values
S_OK if the antenna property was successfully retrieved.
Example
Example of IAntenna::GetFieldValue is available in section 2.3.3.13.4.
2.3.3.13.2
IAntenna::GetSectionCount Method
Gets the count of antenna diagram sections.
Parameters
pCount:
diagram.
A pointer to the location where this method writes the section count of the antenna
Return Values
S_OK is the section count was successfully retrieved.
Example
Example of IAntenna::GetSectionCount is available in section 2.3.3.13.4.
2.3.3.13.3
IAntenna::GetSection Method
Gets an antenna diagram section interface pointer.
Index of the antenna diagram section. Valid indexes are in the interval [0, (section
ppSection:
A pointer to the interface pointer used to read the antenna diagram section.
Return Values
S_OK if the antenna diagram section interface pointer was successfully retrieved.
Examples
Example of IAntenna::GetSection is available in section 2.3.3.13.4.
Forsk 2007
AT260_DRG_E0
57
2.3.3.13.4
Example
HRESULT DumpAntennaDiagrams(IRadioTransmitter *tx)
{
USES_CONVERSION;
HRESULT hr;
IEnumAntennas *pEnumAntennas = NULL;
IRadioTransmitter3 *pRadioTransmitter3 = NULL;
IAntenna *pAntenna = NULL;
IAntennaPatternSection *pSection = NULL;
try
{
hr = tx->QueryInterface(__uuidof(IRadioTransmitter3), (void **)
&pRadioTransmitter3);
if (FAILED(hr))
throw hr;
hr = pRadioTransmitter3->EnumAntennas(ALL_ANTENNAS, &pEnumAntennas);
if (FAILED(hr))
throw hr;
int antenna = 0;
while (hr == S_OK)
{
hr = pEnumAntennas->Next(1, &pAntenna, NULL);
if (FAILED(hr))
throw hr;
if (hr == S_OK)
{
_variant_t azimut;
_variant_t name;
_variant_t gain;
_variant_t tilt;
_variant_t redt;
_variant_t power;
_variant_t ismain;
hr = pAntenna->GetFieldValue(_bstr_t(L"AZIMUT"), &azimut);
if (FAILED(hr))
throw hr;
hr = pAntenna->GetFieldValue(_bstr_t(L"NAME"), &name);
if (FAILED(hr))
throw hr;
hr = pAntenna->GetFieldValue(_bstr_t(L"GAIN"), &gain);
if (FAILED(hr))
throw hr;
hr = pAntenna->GetFieldValue(_bstr_t(L"TILT"), &tilt);
if (FAILED(hr))
throw hr;
hr = pAntenna->GetFieldValue(_bstr_t(L"REDT"), &redt);
if (FAILED(hr))
throw hr;
hr = pAntenna->GetFieldValue(_bstr_t(L"POWER"), &power);
if (FAILED(hr))
58
AT260_DRG_E0
Forsk 2007
throw hr;
hr = pAntenna->GetFieldValue(_bstr_t(L"ISMAIN"), &ismain);
if (FAILED(hr))
throw hr;
_variant_t id;
hr = pRadioTransmitter3->GetTransmitterId(&id);
if (FAILED(hr))
throw hr;
CString n;
n.Format(_T("c:\\diagrams\\tx-%d-%d.txt"), (int)id.dblVal, antenna);
CAtlFile f;
f.Create(n, GENERIC_WRITE|GENERIC_READ, FILE_SHARE_READ,
CREATE_ALWAYS);
CString l;
l.Format(_T("NAME %s\r\n"), OLE2T(name.bstrVal));
f.Write(l, l.GetLength());
l.Format(_T("AZIMUT %f\r\n"), azimut.fltVal);
f.Write(l, l.GetLength());
l.Format(_T("GAIN %f\r\n"), gain.fltVal);
f.Write(l, l.GetLength());
l.Format(_T("TILT %f\r\n"), tilt.fltVal);
f.Write(l, l.GetLength());
l.Format(_T("REDT %f\r\n"), redt.fltVal);
f.Write(l, l.GetLength());
l.Format(_T("POWER %f\r\n"), power.fltVal);
f.Write(l, l.GetLength());
l.Format(_T("ISMAIN %d\r\n"), ismain.boolVal);
f.Write(l, l.GetLength());
ULONG ulSection;
hr = pAntenna->GetSectionCount(&ulSection);
if (FAILED(hr))
throw hr;
for (ULONG i = 0; i < ulSection; ++i)
{
hr = pAntenna->GetSection(i, &pSection);
if (FAILED(hr))
throw hr;
SECTION_ORIENTATION o;
double angle;
ULONG ulSize;
hr = pSection->GetOrientation(&o, &angle);
if (FAILED(hr))
throw hr;
hr = pSection->GetPatternSize(&ulSize);
if (FAILED(hr))
throw hr;
CString l;
l.Format(_T("SECTION %d ORIENTATION %d SIZE %d\r\n"), i, o, ulSize);
f.Write(l, l.GetLength());
ANTENNAPATTERNVALUE *pPattern = new ANTENNAPATTERNVALUE[ulSize];
Forsk 2007
AT260_DRG_E0
59
hr = pSection->GetPattern(ulSize, pPattern);
if (FAILED(hr))
throw hr;
for (ULONG k = 0; k < ulSize; ++k)
{
CString l;
l.Format(_T("%d : %lf
pPattern[k].loss);
%lf\r\n"), k, pPattern[k].angle,
f.Write(l, l.GetLength());
}
delete [] pPattern;
pSection->Release();
pSection = NULL;
}
f.Close();
antenna++;
}
if (pAntenna)
{
pAntenna->Release();
pAntenna = NULL;
}
}
}
catch (HRESULT hrT)
{
hr = hrT;
}
catch (...)
{
hr = E_UNEXPECTED;
}
if (pSection)
pSection->Release();
if (pAntenna)
pAntenna->Release();
if (pEnumAntennas)
pEnumAntennas->Release();
if (pRadioTransmitter3)
pRadioTransmitter3->Release();
return hr;
}
2.3.3.14
IAntennaPatternSection Interface
IAtennaPatternSection is the interface implemented by Atoll enabling the model to get antenna diagram sections.
60
IAntennaPatternSection
Description
GetOrientation
GetPatternSize
GetPattern
AT260_DRG_E0
Forsk 2007
2.3.3.14.1
_IAntennaPatternValue Structure
Gives the loss in dBs for a given angle.
Fields of the _IAntennaPatternValue structure:
angle
Angle in degrees.
loss
Loss in dBs.
2.3.3.14.2
TypeDefs
Gives the loss in dB for a given angle:
2.3.3.14.3
Enumerations
Orientation of a antenna diagram section:
2.3.3.14.4
HORIZONTAL_SECTION
Horizontal orientation.
VERTICAL_SECTION
Vertical orientation.
IAntennaPatternSection::GetOrientation Method
Gets the orientation and angle value.
A pointer to the location where this method writes the section orientation.
pAngle:
the azimuth for a vertical section.
A pointer to the location where this method writes the tilt for an horizontal section or
Return Values
S_OK if the orientation and tilt/azimuth value was successfully retrieved.
Example
Example of IAntennaPatternSection::GetOrientation is available in section 2.3.3.13.4.
2.3.3.14.5
IAntennaPatternSection::GetPatternSize Method
Gets the count of values (angle, loss) for the section.
A pointer to the location where this method writes the section size.
Return Values
S_OK if the section size was successfully retrieved.
Example
Example of IAntennaPatternSection::GetPatternSize is available in section 2.3.3.13.4.
2.3.3.14.6
IAntennaPatternSection::GetPattern Method
Gets the section values.
Forsk 2007
AT260_DRG_E0
61
Parameters
count:
pLoss:
elements.
Notes:
The client must allocate enough memory for the pLoss array to contain count elements. The size of the
pLoss array needed to get all the antenna diagram section values is retrieved with the GetPatternSize
method.
Example
Example of IAntennaPatternSection::GetPattern is available in section 2.3.3.13.4.
2.3.3.15
IEnumAntennas Interface
IEnumAntennas is the interface implemented by Atoll that provides access to a list of IAntennas, and allows to enumerate
antennas.
2.3.3.15.1
IEnumAntennas
Description
Next
Skip
Reset
Clone
Example
Example of IEnumAntennas is available in section 2.3.3.13.4.
2.3.3.15.2
IEnumAntennas::Next Method
Attempts to get the next celt items in the enumeration sequence, and return them through the array pointed to by ppElements.
HRESULT Next ([in] ULONG celt, [out] IAntenna ** ppElements, [out] ULONG *
pceltFetched)
Parameters
celt:
ppElements:
pceltFetched:
Return Values
S_OK if the number of elements returned is celt.
S_FALSE if the number of elements returned is less than celt.
Notes:
If fewer than the requested number of elements remain in the sequence, IEnumAntennas::Next returns only
the remaining elements. The actual number of elements is returned in pCeltFetched, unless it is NULL.
Example
Example of IEnumAntennas::Next is available in section 2.3.3.13.4.
2.3.3.15.3
IEnumAntennas::Skip Method
Attempts to skip over the next celt elements in the enumeration sequence.
Return Values
S_OK if the specified number of elements was skipped.
S_FALSE if the end of the sequence was reached before skipping the requested number of elements.
62
AT260_DRG_E0
Forsk 2007
2.3.3.15.4
IEnumAntennas::Reset Method
Resets the enumeration sequence to the beginning.
HRESULT Reset ()
Return Values
S_OK if reset was successful.
2.3.3.15.5
IEnumAntennas::Clone Method
Creates a copy of the current state of enumeration.
Return Values
S_OK if the clone was successful.
Notes:
Using this function, a particular point in the enumeration sequence can be recorded, and then returned to at
a later time. The returned enumerator is of the same actual interface as the one that is being cloned.
2.3.4
Coding Rules
2.3.4.1
2.3.4.2
2.3.4.3
2.3.4.4
Performance (Multithread)
The model must not make excessive memory allocations, because this causes a drastic decrease in performance.
For more information:
2.3.4.5
http://www.garret.ru/~knizhnik/threadalloc/readme.html, or
http://www.codeproject.com/cpp/rtl_scaling.asp
"ANTENNA_NAME"
"SITE_NAME"
Site name
Character string
"ANTENNA_NAME.GAIN"
"__WORKING_ZONE_BOUNDING_BOX__"
"ANTENNA_NAME.DIAGRAM"
From Atoll version 2.2.2, the access permission is also allowed for the following fields:
Forsk 2007
AT260_DRG_E0
63
2.3.4.6
"REDT"
CALC_RADIUS
Private usage of the dev. Please dont use this value because the result
is undefined.
TYPE
Private usage of the dev. Please dont use this value because the result
is undefined.
CODE_SERVICE
Private usage of the dev. Please dont use this value because the result
is undefined.
[RemoteCalculation]
NumberOfThreads=1
2.3.4.7
2.3.4.8
Only one thread use (see 2.3.4.6 Only One Thread for Calculations (Multithread)),
Display of non remaining messages in Atoll's events viewer with SetStatusText function,
Management of one specific file per calculation instance,
Management of multi-thread access by the model's developers.
64
AT260_DRG_E0
Forsk 2007
Chapter 3
General API
This chapter describes Atolls General API.
66
AT260_DRG_E0
Forsk 2007
General API
The general API enables the implementation of add-ins, macros, and scripts.
3.1
3.2
Script
Macro
Add-in
Interpreted
Yes
Yes
No
Format
Text
Text
Binary
Can be written in
VBScript
Yes
Yes
No
No
No
Yes
No
No
Yes
No
Yes
Yes
Add-in Tutorial
This tutorial has been designed to help you create add-ins. It deliberately ignores some advanced features, which will
nevertheless be detailed later.
3.2.1
Forsk 2007
AT260_DRG_E0
67
Check Support MFC in the Application Settings tab if you want to use MFC in your project.
File
Description
UserAddIn.cpp
UserAddIn.def
UserAddIn.sln
UserAddIn.vcproj
UserAddIn.idl
The interface definition language file describing the interfaces specific to your objects.
UserAddIn.rc
The resource file, which initially contains the version information and a string containing the
project name.
Resource.h
UserAddInps.vcproj
The project settings that can be used to build a proxy/stub DLL. You will not need to use this.
UserAddInps.def
StdAfx.cpp
StdAfx.h
To make the UserAddIn DLL useful, you need to insert the add-in object using the Visual C++ Add Class dialog box.
3.2.2
68
AT260_DRG_E0
Forsk 2007
The Class field shows the C++ class name created to implement the add-in.
The .H File and .CPP File show the files created containing the declaration and the definition of the C++ class.
The CoClass is the name of the component class for this add-in.
Interface is the name of the interface on which your control will implement its custom methods and properties.
ProgID is the name that identifies the add-in in the registry.
To catch events generated by Atoll or add a command in Atoll General User Interface (GUI), click the Add-in tab.
Forsk 2007
AT260_DRG_E0
69
3.2.2.1
Commands
To add your own command in Atoll, check the Provide Command box. This command will automatically be added in the
Tools menu of Atoll. If you check the Toolbar box, your command will also be present as a command button in the Atoll
toolbar.
If your add-in provides commands, the Command Name and Method Name are mandatory.
Command Name is the text that will appear in the Tools menu of Atoll.
Method Name is the method that will be called by Atoll when the user selects the item Command Name in the
Tools menu.
Status bar Text is the text displayed in the status bar when the mouse pointer points to your command.
Tooltips Text is displayed when the mouse pointer is over a button.
3.2.2.2
Events
Application Events is checked so that the add-in is informed about events occurring at the application level in order to
be able to react to them.
3.2.2.3
Connection
A connected add-in is fully operational as soon as Atoll is launched, even if there is no document opened yet. Auto
Connect indicates that the add-in must be connected when Atoll is run. This option is written in the registry whenever your
add-in is registered. It will be read by Atoll at the very beginning of each session.
If you want to change this option afterwards, modify the value of Connect in the .rgs file of your add-in (this .rgs file will be
generated at the end of the wizard) and rebuild your project. (Change ForceRemove Connect = s 0 to ForceRemove
Connect = s 1 or vice versa)
If this option is not checked, your add-in is not connected until the user selects it in the Add-ins and Macros dialog in Atoll
(Tools > Add-ins and Macros). This dialog is available whether an Atoll document is open or not. The Add-ins and Macros
dialog is also used to disconnect a connected add-in.
Notes:
Add-in connection status between two consecutive Atoll sessions is stored in the system registry from Atoll
version 2.4.0 and above.
You have now finished selecting options for your add-in. Click OK.
When an add-in is created, several code changes and additions are made. The following files are created:
File
Description
MyTool.h
MyTool.cpp
MyTool.rgs
A text file that contains the registry script used to register the model.
70
A statement is added to UserAddIn.idl to import AtollAPI.idl, which defines the part of the interfaces Atoll requires
to communicate with the add-in. Your own interface IMyTool and the corresponding CoClass are also added. As
you can see, IMyTool is defined as an IDispatch interface, because your command will be sent by Atoll using the
IDispatch::Invoke method.
The registry script MyTool.rgs is added to the project resource.
AT260_DRG_E0
Forsk 2007
The default add-in generated by the wizard implements a very simple command, which displays a message box Hello
world From Add-in when activated.
You are now ready to build your add-in:
1. On the Build menu click Build UserAddIn.dll3.
2. Once your project has finished building, run Atoll.
3. If you have selected Auto Connect, skip next steps and go to step 6.
4. Select Add-ins and macros from the Tools Menu.
5. Check MyCommand checkbox and close the dialog.
6. You should see a new button in the toolbar.
7. Click the button, a message box is opened:
3.2.3
The base class IDispEventImpl for CMyTool class, implying that events are implemented using the ATL dispatch
mechanism.
A list of sink entries between the macros BEGIN_SINK_MAP and END_SINK_MAP. Each entry matches an event
defined by the Atoll COM interface _IApplicationEvents. The third parameter of the SINK_ENTRY_EX macro is
a number, which must correspond to the number defined by Atoll and must not be modified.
A list of methods whose names are the fourth arguments of the previous macros.
If you read MyTool.cpp, you will see the implementation of these methods. The default code written by the wizard returns
S_OK when an event is caught. S_OK ignores the event.
Two categories of events are thrown:
1. Just before something happens.
2. Just after something has finished.
The method name of an event that occurs before something happens starts with Will. The method name of an event that
occurs after something has finished ends with Complete.
Some of the events methods need parameters depending on their purpose. Each Will event requires an output boolean
status that the wizard sets by default to VARIANT_TRUE, which means that Atoll can carry on its processing. If an add-in
wants to interrupt Atoll from processing at this point, because of a users choice or for any other reason, you should set
this status in the method to VARIANT_FALSE.
To illustrate this tutorial, let's suppose we want to ask the user to confirm a calculation whenever requested.
Open MyTool.cpp and modify the OnWillRun function code:
HRESULT CMyTool::OnWillRun(
IDocument *pDocument,
VARIANT_BOOL all,
VARIANT_BOOL* evtStatus
)
{
3.
If the compiler complains about missing files AtollAPI.idl or AtollAPI.h, ensure that the installation path of these
files (usually C:\Program Files\Forsk\Atoll\API\include) is a part of additional includes of your project, either in its C++
preprocessor and MIDL settings or in the global settings (Tools: Options: VC++ Directories: Include files). An alternate
solution is to copy these files to your project directory. If it complains also about FskGIS.dll, add path C:\Program
Files\Forsk\Atoll.
Forsk 2007
AT260_DRG_E0
71
if (all == VARIANT_FALSE)
{
if (AfxMessageBox("Run is requested. Are you sure to continue ?",
MB_YESNO|MB_ICONQUESTION) == IDYES)
*evtStatus = VARIANT_TRUE;
else
*evtStatus = VARIANT_FALSE;
}
else
*evtStatus = VARIANT_TRUE;
return S_OK;
}
Note that we test the input parameter all because we know that Atoll already asks confirmation from the user when Calculate All is requested. In this case we do not need two confirmation messages.
In this example, the input parameter Document is not used, but another example could have been to read data from this
document, do some work on this data before the run starts (with or without asking confirmation from the user).
To test these changes, build your project, restart Atoll, open a document and run a calculation (F7).
3.2.4
Your ATL project can contain several add-ins. You just have to start from step 2 to insert another add-in into
your project. However, it is recommended to have only a few add-ins and several commands in each
rather than a lot of add-ins with just a few commands ineach, for the following reasons:
- Atoll cannot define more than 1000 commands (add-ins) and 1000 commands (macros).
- Having multiple add-ins in an ATL project gives less control to the developer. Each command is
independent from the other and the order in which commands appear, either in the tool menu or in the
toolbar, only depends on the rank of their associated CLSID in the registry.
3.3
Script Tutorial
Through this tutorial, you will learn to automate some simple tasks, such as archiving databases, running calculations,
and executing scripts on a scheduled time.
3.3.1
Option Explicit
Dim var
Dim myapp
72
AT260_DRG_E0
Forsk 2007
Dim doc
Sub Atoll_RunComplete(arg1, arg2)
var = 1
End Sub
Set myapp = CreateObject("Atoll.Application")
WScript.ConnectObject myapp, "Atoll_"
myapp.Visible = False
Set doc = myapp.Documents.OpenFromDatabase("Provider=SQLOLEDB.1;User ID=myName;Password=myPwd;Initial Catalog=myAtollDbName;Data Source=myServer;", "")
doc.Run True
var = 0
Do While var = 0
WScript.Sleep 1000
Loop
doc.Save("C:\mydoc.atl")
WScript.DisconnectObject myapp
doc = Null
myapp.Documents.CloseAll 0
myapp.Quit 0
myapp = Null
WScript.Quit 0
You must replace all the parameters beginning with my with your own values in the above connection string. This script,
1. Starts an invisible session of Atoll
2. Opens a new document from an existing database
3. Runs all the calculations in this document
4. Waits the end of calculations
Event RunComplete implements this wait. The syntax for catching any event is to concatenate the name of the
event to the string Atoll_. As these parameters have not been used in the above example, they have been named
arg1 and arg2. Moreover, we connect and disconnect the script using the appropriate method of WScript.
5. Saves the document
6. Exits the Atoll session
Save your script file as a .vbs, like C:\Atollmacros\tutorial.vbs.
3.3.2
3.3.3
Forsk 2007
AT260_DRG_E0
73
74
AT260_DRG_E0
Forsk 2007
3.3.4
Myapp.Visible = True
3.3.5
Option Explicit
Dim var
Dim myapp
Dim doc
On Error Resume Next
Sub CatchError
Forsk 2007
AT260_DRG_E0
75
If Err Then
myapp.LogMessage Err.Description, 1
WScript.Echo Err.Description
End If
WScript.Echo "Script failed."
myapp.LogMessage "Script failed.", 1
If IsObject(doc) Then
doc.Close 0
doc = Null
End If
If IsObject(myapp) Then
myapp.Documents.CloseAll 0
myapp.Quit 0
myapp = Null
End If
WScript.Quit -1
End Sub
Sub Atoll_RunComplete(arg1, arg2)
var = 1
End Sub
Set myapp = CreateObject("Atoll.Application")
If Err Then
WScript.Echo "Can't create 'Atoll.Application' object."
Err.Clear
Call CatchError
End If
WScript.ConnectObject myapp, "Atoll_"
myapp.Visible = False
' Set doc = myapp.Documents.OpenFromDatabase ("Provider=SQLOLEDB.1;UserID=myName;Password=myPwd;InitialCatalog=myAtollDbName;DataSource=myServer;", "")
If Err Then Call CatchError End If
doc.Run True
If Err Then Call CatchError End If
var = 0
Do While var = 0
WScript.Sleep 1000
Loop
doc.Save("C:\mydoc.atl")
If Err Then Call CatchError End If
WScript.DisconnectObject myapp
doc = Null
myapp.Documents.CloseAll 0
myapp.Quit 0
myapp = Null
WScript.Quit 0
Error checking is activated with On Error Resume Next. When an error occurs, the script continues being executed from
the next line and the Err object is set accordingly. You can check for Err.Number (or for Err, because Number is its default
property) to catch any error.
76
AT260_DRG_E0
Forsk 2007
3.4
Macro Tutorial
Macros are run by Atoll upon being invoked by the user. Macros are written in VBScript, like scripts. The difference
between scripts and macros is the execution context.
When a macro is launched from Atoll, an instance of the main object Application is automatically added as a global variable of the macro code. Therefore, it must not call CreateObject or GetObject to get an Application object.
The first line of your macro can be directly:
mydoc = ActiveDocument
The global objects name is Atoll and is optional. So, the above line is equivalent to:
mydoc = Atoll.ActiveDocument
Macros can also be invoked in response to application events.
Example:
Sub Atoll_DocumentSaveComplete(doc)
LogMessage "Archive on save running ..."
Dim status
On Error resume Next
status = doc.Archive
If Err.Number <> 0 Then
LogMessage "Archive on save failed. " & Err.Description & ".", 1
Else
If status = 1 Then
LogMessage "Archive on save failed. You must resolve the conflicts manually.", 1
MsgBox "Archive on save failed. You must resolve the conflicts manually."
Else
LogMessage "Archive on save completed successfully."
End If
End If
End Sub
The above example shows a macro used to automatically archive a document once it has been saved.
3.4.1
Forsk 2007
AT260_DRG_E0
77
If you choose a file that does not exist in the Add selection file dialog, an empty macro is created:
Function Atoll_WillRun(doc,success)
doc.Save
Atoll_WillRun = False
End Function
3.4.2
Running a Macro
As mentioned above, to run a macro the user can:
1. Select a macro in the macros dialog and click Run.
2. Double click a macro in this dialog.
3. Click the corresponding button of the toolbar.
If a problem occurs during the macro execution, an error message is displayed in a dialog box with the line number indicated. The same message is also logged in the events' observer window.
Notes:
3.4.3
Macros expecting parameters will always return an error message (Error 450) when started with the Run
button, since no parameters are actually passed.
3.5
Reference Guide
The objects architecture is described in Atoll Objects in this section. Features provided by each object are summarized
in a table (parameters are not detailed).
The part Atoll Interfaces presents the interfaces exposed by Atoll, while the outgoing interfaces (which means interfaces
implemented by Add-ins) are described in the third chapter.
Rules contracts and advice part describes rules for writing safe code.
78
AT260_DRG_E0
Forsk 2007
3.5.1
3.5.1.1
Objects
3.5.1.2
Object name
Description
Application
Top-level object. Provides an entry point for clients to retrieve and navigate through Atolls objects.
Documents
Document
Provides a way to open, open from a database, print, modify, and save a .ATL document.
Provides access to all data.
TabularData
Provides read and write access to radio data, read access to path loss matrices.
ChildFolder
Represents items and sub-items from the Atoll Explorer window tabs.
A property theProperty is defined so that when used in a VBScript language, you simply write:
myValue = theObject.theProperty
Forsk 2007
AT260_DRG_E0
79
You must use this C++ syntax when you import atoll.tlb with the option raw_interfaces_only, as the code
generated by the wizard. But, if you remove this option, you may even write in C++:
myValue = theObject->theProperty;
theObject->theProperty = myValue;
You should refer to MSDN documentation to learn more about importing libraries.
theObject.RunTheMethod()
Or
3.5.1.3
Using GetObject("", Atoll.Application) note the difference in the first parameter will automatically start a
new instance of Atoll if no session is already running and attach the macro to this new instance.
But any subsequent call to GetObject with the same syntax will start a new Atoll instance too, which is not
generally what is intended. GetObject(, Atoll.Application) attaches the macro to the first Atoll session
started when several sessions are running.
In an add-in, you will get an application pointer when the OnConnection method is called. See 3.5.2 Application object and
3.5.9.2.3 OnConnection method.
3.5.2
80
Application Object
Property name
Description
Application
Parent
ActiveDocument
Documents
Name
FullName
Returns the file specification for the application, including the full pathname, e.g. C:\Program
Files\Forsk\Atoll.exe.
Path
Returns the path of the application's executable file, e.g. C:\Program Files\Forsk
WindowStatus
Sets or returns an enumerated string determining the state of the main application window
(minimized, normal, )
StatusBar
Visible
Version
AT260_DRG_E0
Forsk 2007
3.5.3
Displays a message in the Atoll events viewer window (Error, Warning or Info).
Method name
Description
Quit
SetAddinInfo
AddCommand
Active
Documents Object
This collection represents all the opened documents of an Atoll session. Use this collection to create new documents or
to iterate through project files.
To get a documents collection in VBScript:
Dim allDocs
Set allDocs = app.Documents
Or, in a C++ add-in:
IDocumentsPtr pDocs;
HRESULT hr = m_spApplication->get_Documents(&pDocs);
if (FAILED(hr))
return hr;
Property name
Description
Application
Parent
Count
_NewEnum
The property _NewEnum is a special hidden property (not used directly) that you can use to write in VBScript:
Dim allDocs
Dim doc
Set allDocs = app.Documents
For Each doc In allDocs
do some work with doc
...
Next
While in C++ you will write a loop using Count property and Item method. (See 3.5.8.2.1 _NewEnum Property)
3.5.4
Method name
Description
Add
CloseAll
SaveAll
Item
Open
OpenFromDatabase
Create a new document initialised from a database and adds it ot the collection.
Document Object
A document represents a .atl file or a database connection. It can be managed (open, save, close, ) using its properties
and methods. A document is also the main entry to manage all the data it contains.
To get or create a document in VBScript, you can either,
1. Request the active document from the application:
Forsk 2007
AT260_DRG_E0
81
IDocumentPtr pDoc;
HRESULT hr = m_spApplication->get_ActiveDocument(&pDoc);
if (FAILED(hr))
return hr;
if (pDoc == NULL)
return Error("There is no active document", __uuidof(IAddin));
Property name
Description
Application
Parent
FullName
Returns the file specification for the document, including the full pathname, e.g.
C:\Program Files\Forsk\Env.atl.
Name
Returns the file name of the document excluding the file path specification.
Path
Returns the path part of the document file, e.g. C:\Program Files\Forsk.
ReadOnly
Saved
Returns True or False whether the document has changed since the last save.
CoordSystemProjection
CoordSystemDisplay
CoordSystemInternal
Returns the coordinate system used for internal storage of sites position. (See User
Manual).
TransmissionUnit
ReceptionUnit
Sets or returns the current units used for received signal levels.
DistanceUnit
Some of the following methods take required or optional arguments, which are deliberately not listed here. Refer to the
Detailed description for more information.
3.5.5
Method name
Description
Close
Closes all windows associated with the document and removes the document from the
Documents collection.
FilePrint
Save
Saves changes.
Refresh
Archive
Run
Starts a calculation.
SetConfig
Import
GetRecords
Redraw
Redraws the map in the same way as the icon Refresh in Atoll GUI.
CenterMapOn
GetRootFolder
Returns a ChildFolder which is the root of either data tab, geo tab or modules tab.
RunPathloss
Starts the calculation of pathlosses on all or filtered transmitters, taking the validity into
account or not.
GetService
TabularData Object
This object stands for a table of a database even if the Atoll document is not connected to a real database and the table
does not exist in the form of a Table in the database (like PREDICTIONS or ZONES).
A TabularData is defined by its structure (number of columns, name of columns) and its content (rows = records).
Column 0 and row 0 are particular:
82
Row 0 holds the field names, i.e. the table structure description.
AT260_DRG_E0
Forsk 2007
Column 0 holds a unique identifier for records, called RECORD_ID. This identifier is not persistent and must not
be used between two sessions of Atoll, nor when refreshing or archiving.
Dim i
Dim colName
Dim records
Set records = myDoc.GetRecords("Transmitters", True)
For i = 0 To records.ColumnCount
colName = records.GetValue(0, i)
Next i
The first value (for i = 0) is always RECORD_ID. The second (for i = 1) is SITE_NAME in case of TRANSMITTERS
table, and so on. The last one corresponds to i = ColumnCount.
To read the calculation radius of all transmitters, you write:
Dim i
Dim radius
Dim records
Set records = myDoc.GetRecords("Transmitters", True)
For i = 1 To records.RowCount
radius
= records.GetValue(i, CALC_RADIUS)
Next i
Note that the loop does not start with i =0 because GetValue would return the string CALC_RADIUS and not a value.
If we know that column CALC_RADIUS is number 11, we could instead write:
radius
= records.GetValue(i, 11)
Predictions tabular data gives access to path loss and signal level matrices.
Zones tabular data gives access to Calculation and Focus zones.
Property name
Forsk 2007
Description
Application
Parent
ColumnCount
RowCount
Method name
Description
Edit
AddNew
Update
Delete
GetValue
SetValue
GetFormattedValue
Find
Searches for a value in a given column. Returns the row number of the first record that
matches the value.
FindPrimaryKey
Searches for a record whose key equals to the input parameter. Returns the row
number if a record has been found.
GetPrimaryKey
AT260_DRG_E0
83
3.5.6
ChildFolder Object
This object represents an item of the explorer. It might be a collection of sub-items. A ChildFolder is first obtained through
a root entry point from the document and is then related to a tab of the explorer.
Dim folder
Dim item
Dim doc
Dim dataRoot
Set doc = app.ActiveDocument
dataRoot = doc.GetRootFolder(atoData)
For Each folder in dataRoot
do some work with this folder, for instance:
For Each item in folder
do some work with this item
Next
Next
Most child folders can have children and can be selected, set visible or renamed.
Only studies may be exported.
3.5.7
Property name
Description
Application
Parent
Returns the Document for a root child, otherwise returns the ChildFolder parent.
Count
_NewEnum
Name
Item
Returns the item from the collection that matches the index.
Visible
Puts or Gets the visible flag of an item (ignored if the property does not apply to this
item).
Selected
Puts or Gets the selected flag of an item (ignored if the property does not apply to this
item).
Method name
Description
Export
Exports the item in a given format and file name. (Applies only to studies)
CentreOnMap
Redraw
CoordSystem Object
This object contains the entire definition of a coordinate system. Several coordinate systems are used within Atoll; one for
display, one for projected geographic files and one for sites coordinates. The last one can be related to the system used
for display (see Atoll User Manual). All these systems are defined within a document.
This object is not defined in Atoll library but in the Forsk library FSKGISLib. This object can convert points from one system
to another.
As the definition of a coordinate system is quite complex, it is strongly recommended to read the Technical Reference
Guide before modifying any parameter.
To get the coordinate system used for sites coordinates in Visual Basic:
Dim doc
Dim coordSys
Set doc = app.ActiveDocument
Set coordSys = doc.CoordSystemInternal
And in C++:
IDocumentPtr pDoc;
HRESULT hr = m_spApplication->get_ActiveDocument (&pDoc);
84
AT260_DRG_E0
Forsk 2007
3.5.8
Property name
Description
Code
Name
Description
Ellipsoid
EllipsoidName
Datum
DatumName
Unit
ProjMethod
ProjParameter
Method name
Description
SetDatum
SetProjection
ConvertCoordsTo
Converts an array of points to another system and returns the converted points.
Pick
Atoll Interfaces
The following table lists the interfaces implemented by Atoll.
Object name
Description
IApplication
Access to the top-level object. Provides a standard means for clients to retrieve and
navigate through Atolls objects.
IDocuments
IDocument
Provides a means to open, open from database, print, change, and save a .atl
document. Provides an access to all data.
IDocument2
Inherits from IDocument interface. Adds pathloss calculation capabilities and enriches
IDocument with the generic capability to support yet unspecified features.
IDocument3
Inherits from IDocument2 interface. Adds the capability to export configuration files.
IDocument4
IResultFileProvider
Service provider starting the computations of field strength received from a transmitter
and storing the results in a binary .bil file.
ITabularData
Provides a means to read and write radio data and to read calculation results matrices.
IDispCoordSystem
IContextMenu
Provides a means to merge a shortcut menu associated with an Atoll Explorer window
item.
IApplicationKeyRef
Provides a means to get the Forsks reference to the dongle (fixed or floating license)
corresponding to the current Atoll session.
Notes:
Dim vis
vis = app.Visible
Or
vis = False
app.Visible = vis
HRESULT hr = app->get_Visible(&vis);
Forsk 2007
AT260_DRG_E0
85
3.5.8.1
IApplication Interface
To get an external description of this interface, see 3.5.2 Application.
Any add-in will get an IApplication pointer when its OnConnection method is called. The add-in should keep a reference
to this interface as long as it remains connected but this reference must be released as soon as it is disconnected. For
instance, you can use a private member in your class (automatically created by the wizard):
CComPtr<IApplication> m_spApplication;
Initialize this member when Atoll calls OnConnection on your add-in:
STDMETHODIMP CMyTool::OnConnection(IApplication*
Time, long cookie, VARIANT_BOOL* bOnConnection)
pApp,
VARIANT_BOOL
bFirst-
{
HRESULT hr = S_OK;
m_spApplication = pApp;
// additional work is omitted here
//...
return hr;
}
All references to Atoll interfaces held by an Add-in must be released when Atoll calls OnDisconnection. In particular the
IApplication pointer must be released when Atoll calls OnDisconnection.
Object
Application
86
Function
Property (P)
Method (M)
HRESULT Active(VARIANT_BOOL*)
HRESULT Active(VARIANT_BOOL)
HRESULT ActiveDocument(IDocument**)
HRESULT Application(IApplication**)
HRESULT Documents(IDocuments**)
HRESULT FullName(BSTR*)
HRESULT Name(BSTR* )
HRESULT Parent(IApplication**)
HRESULT Path(BSTR*)
HRESULT StatusBar(BSTR)
HRESULT Version(BSTR*)
HRESULT Visible(VARIANT_BOOL*)
HRESULT Visible(VARIANT_BOOL)
HRESULT WindowStatus(AtoWindowStatus*)
HRESULT WindowStatus(AtoWindowStatus)
AT260_DRG_E0
Forsk 2007
3.5.8.1.1
Application Property
(This function is provided for standard conformance only and has no real interest in Add-ins context.)
Read-only property that gets the Atoll application object itself.
HRESULT Application(IApplication**)
Parameters
pVal:
Address of pointer variable that receives the application interface pointer. Upon
successful completion, *pVal contains the requested interface pointer of the object. If the object does not support the
IApplication interface, *pVal is set to NULL.
Return Values
S_OK, if the IApplication interface is supported, otherwise E_NOINTERFACE. E_POINTER, if pVal is NULL.
3.5.8.1.2
Parent Property
(This function is provided for standard conformance only and has no real interest in Add-ins context.
Read-only property that gets the object containing the calling object. In the case of the Application object, it returns the
Application itself.)
Return Values
S_OK, if the IApplication interface is supported, otherwise E_NOINTERFACE. E_POINTER, if pVal is NULL.
3.5.8.1.3
Active Property
Property that gets or sets whether the application is active or not.
newVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Example
Dim app
Dim act
Set app = GetObject(, Atoll.Application)
act = app.Active
app.Active = true
Remarks
Just setting an application to 'not active' has no meaning, as this does not set another application to 'active'. Thus the
newVal parameter is not used and always supposed to be VARIANT_TRUE.
3.5.8.1.4
Documents Property
Read-only property that gets the documents collection object.
Forsk 2007
AT260_DRG_E0
87
Parameters
pVal:
Address of pointer variable that receives the documents interface pointer. Upon
successful completion, *pVal contains the requested interface pointer of the object.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Example
VBScript:
Dim app
Dim docs
Set app = GetObject(, Atoll.Application)
Set docs = app.Documents
C++:
IDocumentsPtr pDocs;
HRESULT hr = m_spApplication->get_Documents(&pDocs) ;
if (pDocs != NULL)
{
//...
}
3.5.8.1.5
Name Property
(This function is provided for standard conformance only and has no real interest in Add-ins context.)
Read-only property that gets the application name. The application name is always Atoll.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.1.6
FullName Property
Read-only property that gets the full path name of the executable Atoll.exe.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
The path name returned is the absolute path (for example, "C:\Program Files\Forsk\Atoll.exe).
3.5.8.1.7
Path Property
Read-only property that gets the path of the executable Atoll.exe.
88
AT260_DRG_E0
Forsk 2007
Parameters
pVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
The path returned is provided as an absolute path (for example, "C:\Program Files\Forsk).
3.5.8.1.8
ActiveDocument Property
Read-only property that gets the active document. The active document is the opened document currently under consideration.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Example
VBScript:
Dim app
Dim doc
Set app = GetObject(, Atoll.Application)
Set doc = app.ActiveDocument
C++:
IDocumentPtr pDoc;
HRESULT hr = m_spApplication->get_ActiveDocument(&pDoc) ;
if (pDoc != NULL)
{
//...
}
3.5.8.1.9
WindowStatus Property
Property that gets or sets the window status of the application.
newVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Example
VBScript:
Dim app
Forsk 2007
AT260_DRG_E0
89
Dim status
Set app = GetObject(, Atoll.Application)
status = app.WindowStatus
app.WindowStatus = 2
C++:
AtoWindowStatus status;
HRESULT hr = m_spApplication->get_WindowStatus(&status) ;
if (SUCCEEDED(hr))
{
status = atoMinimized;
hr = m_spApplication->put_WindowStatus(status) ;
//...
}
3.5.8.1.10
StatusBar Property
Write-only property specifying the text to display in the status bar of an instance of Atoll.
String to display.
Return Values
S_OK.
Example
VBScript:
Dim app
Set app = GetObject(, Atoll.Application)
app.StatusBar = This is my message
C++:
3.5.8.1.11
Visible Property
Property that gets or sets the application visible state.
newVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
90
AT260_DRG_E0
Forsk 2007
Remarks
When Atoll is not visible, all dialog boxes opened during the process that require a users answer have a default returned
value. This value is the default button set for this dialog (the focused one when opening the dialog). This returned value is
used within Atoll, it is not returned to the add-in. This value is as if the user had actually chosen it.
3.5.8.1.12
Version Property
Property that gets the application version.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
The string is formatted like in the About Atoll dialog box (for example, 2.3.1 (Build 1155)).
3.5.8.1.13
Quit Method
Method that stops the application.
Return Values
S_OK.
E_POINTER, if status is NULL.
3.5.8.1.14
LogMessage Method
Method that displays a message in the Events observer window of Atoll.
logType:
An integer that tells which icon must be used depending in the substance of the
message. See 3.5.11.6 AtoLogType.
Return Values
S_OK.
3.5.8.1.15
SetAddinInfo Method
Method called by an add-in when it is connecting to Atoll. It provides Atoll with information about the add-in.
dispatch:
The pointer to the dispatch interface (dispinterface) implemented by the add-in object.
When a user chooses one of the add-in commands, Atoll invokes the command using this pointer to communicate with
the add-in.
Forsk 2007
AT260_DRG_E0
91
Return Values
S_OK.
3.5.8.1.16
AddCommand Method
Method called by an add-in in order to add a command in Atoll.
mthName:
command.
A String that represents the method exposed by the add-in to implement the
toolbar:
A boolean that tells Atoll if this command is assigned to a button in the toolbar. If toolbar is set to VARIANT_TRUE while no resource identifier has been passed in SetAddinInfo, E_FAIL is returned.
cookie:
A Long that is the cookie identifying the add-in. Atoll passes this value to the add-in
through the add-in OnConnection method.
added:
A Boolean that tells the add-in if the command has actually been added in the Tools
menu. If this command conflicts with an existing command, added is sets to VARIANT_FALSE. To avoid conflicts with
other add-in commands, the add-in should prefix this command with its name.
Return Values
S_OK, E_FAIL.
Remarks
Once added, a command cannot be removed during an Atoll session. A command is always enabled as long as the addin is connected. If an add-in is disconnected by the user, the command in the tool menu will be disabled and the related
button is hidden. They will be enabled again when the user reconnects the add-in. If an add-in has never been connected,
its commands do not appear.
3.5.8.2
IDocuments Interface
Object
Documents
3.5.8.2.1
Function
Property (P)
Method (M)
HRESULT _NewEnum(LPUNKNOWN*)
HRESULT Application(IApplication**)
HRESULT CloseAll(AtoSaveChanges,AtoSaveStatus*)
HRESULT Count(LONG*)
HRESULT Parent(IApplication**)
HRESULT SaveAll();
_NewEnum Property
Specific property used to enumerate the objects of a collection.
92
AT260_DRG_E0
Forsk 2007
Return Values
S_OK.
Remarks
With Visual C++, you can browse a collection to find a particular item by using the _NewEnum property or the Item method.
In VBScript, you are not required to use the _NewEnum property because it is automatically used in the implementation
of For Each ... Next.
Example
VBScript:
Dim docs
Set docs = app.Documents
For Each doc In docs
do something with doc
Next
C++:
IDocumentsPtr pDocs;
HRESULT hr = m_spApplication->get_Documents(&pDocs) ;
if (FAILED(hr)) return hr;
for (long i = 0; i < pDocs->get_Count(); ++i)
{
IDocumentPtr pDoc;
hr = pDocs->get_Item(_variant_t(i), &pDoc);
if (FAILED(hr)) return hr;
// Do something with pDoc
}
3.5.8.2.2
Count Property
Read-only property that gets the number of items in the documents collection.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Example
VBScript:
Dim nDocs
nDocs = app.Documents.Count
C++:
IDocumentsPtr pDocs;
HRESULT hr = m_spApplication->get_Documents(&pDocs) ;
if (FAILED(hr)) return hr;
Forsk 2007
AT260_DRG_E0
93
long nDocs = 0;
hr = pDocs->get_Count(&nDocs);
if (FAILED(hr)) return hr;
3.5.8.2.3
Item Property
Read-only property that gets one item from the documents collection.
Return Values
S_OK.
E_FAIL, if document is not found.
Remarks
The title of a document is without its full path, with the '.atl' extension4 and is case sensitive.
3.5.8.2.4
Application Property
Read-only property that gets the Atoll application object.
Return Values
S_OK, if the IApplication interface is supported, otherwise E_NOINTERFACE. E_POINTER, if pVal is NULL.
3.5.8.2.5
Parent Property
Read-only property that gets the object containing the parent object. In the case of the Documents object, returns the Application object.
Return Values
S_OK, if the IApplication interface is supported, otherwise E_NOINTERFACE. E_POINTER, if pVal is NULL.
3.5.8.2.6
Open Method
Method that opens an existing document, adds it to the collection of opened documents and returns it. This method stands
for to the interactive File Open menu command.
4.
Depends on checkbox Hide File Extensions for known file types in the tab Tools Folder Options Display of
Windows Explorer.
94
AT260_DRG_E0
Forsk 2007
Parameters
pathname:
readOnly:
Possible values are:
pDoc:
Address of pointer variable that receives the opened document interface pointer.
Upon successful completion, *pDoc contains the requested interface pointer of the document. If the document cannot be
opened, *pDoc is set to NULL.
Return Values
S_OK.
E_POINTER, if pDoc is NULL.
Example
VBScript:
Dim doc
Set doc = app.Documents.Open(C:\Temp\myProject.atl)
C++:
IDocumentsPtr pDocs;
HRESULT hr = m_spApplication->get_Documents(&pDocs) ;
if (FAILED(hr)) return hr;
IDocumentPtr pDoc;
pDocs->Open(C:\\Temp\\myProject.atl, VARIANT_FALSE, &pDoc);
if (FAILED(hr)) return hr;
3.5.8.2.7
Add Method
Method that creates a new document, adds it to the collection of opened documents and returns it. This method stands
for to the interactive File New menu command.
pDoc:
Address of pointer variable that receives the created document interface pointer.
Upon successful completion, *pDoc contains the requested interface pointer of the document. If the document cannot be
created, *pDoc is set to NULL.
Return Values
S_OK.
E_POINTER, if pDoc is NULL.
Example
VBScript:
Dim doc
Set doc = app.Documents.Add(UMTS)
C++:
IDocumentsPtr pDocs;
HRESULT hr = m_spApplication->get_Documents(&pDocs) ;
if (FAILED(hr)) return hr;
IDocumentPtr pDoc;
pDocs->Add(_bstr_t(UMTS), &pDoc);
if (FAILED(hr)) return hr;
Forsk 2007
AT260_DRG_E0
95
3.5.8.2.8
OpenFromDatabase Method
Method that creates a new document refreshing it from the database, adds it to the collection of the opened documents
and returns it. This method stands for to the interactive File Open From Database menu command.
The schema character string may contain the schema followed by the site lists to load,
as shown the example below. The keyword <ALL> represents all site lists, which is the same as when no parameter is
entered.
If you want to disconnect the document from the database once opened, you can add
DontKeepConnection to the schema string as shown in the examples below.
pDoc:
Address of pointer variable that receives the created document interface pointer.
Upon successful completion, *pDoc contains the requested interface pointer of the document. If the document cannot be
created, *pDoc is set to NULL.
Return Values
S_OK.
E_POINTER, if pDoc is NULL.
Example
VBScript:
Simple:
Dim doc
Set doc = app.Documents.OpenFromDatabase("Provider=Microsoft.Jet.OLEDB.4.0;User ID = USERID;Data Source=C:\Temp\MyProject.mdb","")
With a Site List:
Dim doc
Set doc = app.Documents.OpenFromDatabase("Provider=Microsoft.Jet.OLEDB.4.0;User ID = USERID;Data Source=C:\Temp\MyProject.mdb", ";sitelist0")
Notes:
Dim doc
Set doc = app.Documents.OpenFromDatabase("Provider=Microsoft.Jet.OLEDB.4.0;User
ID
=
USERID;Data
Source=C:\Temp\MyProject.mdb",
"DontKeepConnection
;;sitelist0")
Notes:
C++:
IDocumentsPtr pDocs;
HRESULT hr = m_spApplication->get_Documents(&pDocs);
IDocumentPtr pDoc;
pDocs-> OpenFromDatabase (_variant_t("Provider=Microsoft.Jet.OLEDB.4.0;User ID
= USERID;Data Source=C:\\Temp\\MyProject.mdb"), _bstr_t(";<ALL>"), &pDoc);
C++ example with databases supporting muti-schema base definition:
96
AT260_DRG_E0
Forsk 2007
IDocumentsPtr pDocs;
hr = m_spApplication->get_Documents(&pDocs);
CComPtr<IDocument> pDoc;
3.5.8.2.9
_variant_t
connexion("Provider=MSDAORA.1;User
Source=SOURCE;Password=P");
ID
USERID;Data
pDocs->
OpenFromDatabase
(connexion,
tion;USERID;sitelist0; sitelist1"), &pDoc);
_bstr_t("DontKeepConnec-
CloseAll Method
Method that closes all the documents of the collection.
Return Values
S_OK.
E_POINTER, if status is NULL.
3.5.8.2.10
SaveAll Method
Method that saves all the documents of the collection.
HRESULT SaveAll();
Parameters
None.
Return Values
S_OK.
3.5.8.3
IDocument Interface
Notice that an IDocument is also a service provider, which means that you can get services from this interface using the
QueryService method. To get more information about IServiceProvider interface, see COM documentation.
Thus, in order to obtain services, such as geographical data, you can call the QueryService with the appropriate service
identifier (SID_DEM, SID_CLUTTER, SID_DHM, or SID_MEASURE).
The example below shows how to get a grid containing clutter values (To make it shorter, results have not tested but should
be in a real addin).
HRESULT CMyTool::OnReadGeoData()
{
// Get clutter as a MultiGridData
IDocumentPtr pDoc;
m_spApplication->get_ActiveDocument(&pDoc) ;
IServiceProviderPtr provider;
pDoc->QueryInterface(__uuidof(IServiceProvider),(void**)(&provider));
IRasterGeoDataPtr pGeoData;
provider->QueryService(SID_CLUTTER, &pGeoData);
IMultiGridDataPtr multiGrid;
// Extract an area from the first grid
GEORECT bounds;
Forsk 2007
bounds.west = 985800;
bounds.east = 987300;
bounds.south = 1879100;
bounds.north = 1880700;
AT260_DRG_E0
97
IEnumGridDataPtr pEnum;
multiGrid->EnumDataSet(&bounds, &pEnum);
IGridDataPtr gridData;
ULONG pclFetched = -1;
pEnum->Next(1, &gridData, &pclFetched);
GEOPOINT p0;
ULONG nx, ny;
double resX, resY;
gridData->GetDimension(&p0, &nx, &ny, &resX, &resY);
long i0 = long((bounds.west - p0.x)/resX);
long j0 = long((bounds.south - p0.y)/resY);
_variant_t vgrid;
gridData->ExtractSubGrid(i0,
floatValue);
Object
Document
98
Function
Property (P)
Method (M)
HRESULT Application(IApplication**)
HRESULT Archive(AtoArchiveStatus*)
HRESULT CoordSystemDisplay(IDispCoordSystem**)
HRESULT CoordSystemDisplay(IDispCoordSystem*)
HRESULT CoordSystemInternal(IDispCoordSystem**)
HRESULT CoordSystemProjection(IDispCoordSystem**)
HRESULT CoordSystemProjection(IDispCoordSystem*)
HRESULT DistanceUnit(AtoDistanceUnit*)
HRESULT DistanceUnit(AtoDistanceUnit)
HRESULT FilePrint()
HRESULT FullName(BSTR*)
HRESULT GetRootFolder(AtoRootType,IChildFolder**)
AT260_DRG_E0
Forsk 2007
3.5.8.3.1
HRESULT Import(BSTR)
HRESULT Name(BSTR*)
HRESULT Parent(IApplication**)
HRESULT Path(BSTR*)
HRESULT ReadOnly(VARIANT_BOOL*)
HRESULT ReceptionUnit(AtoReceptionUnit*)
HRESULT ReceptionUnit(AtoReceptionUnit)
HRESULT Redraw();
HRESULT Refresh(AtoRefreshPriority)
HRESULT Run(VARIANT_BOOL)
HRESULT Save(BSTR)
HRESULT Saved(VARIANT_BOOL*)
HRESULT SetConfig(BSTR)
HRESULT TransmissionUnit(AtoTransmissionUnit *)
HRESULT TransmissionUnit(AtoTransmissionUnit)
Application Property
Read-only property that gets the Atoll application object.
Return Values
S_OK, if the IApplication interface is supported, otherwise E_NOINTERFACE. E_POINTER, if pVal is NULL.
3.5.8.3.2
Parent Property
Read-only property that gets the object containing the calling object. In the case of the Document object, it returns the
Documents collection.
Address of pointer variable that receives the documents interface pointer. See 3.5.8.2
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.3
FullName Property
Read-only property that gets the documents full path name with the extension.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.4
Name Property
Read-only property that gets the documents name without the extension.
Forsk 2007
AT260_DRG_E0
99
Parameters
pVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.5
Path Property
Read-only property that gets the documents path.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
In the case of an unsaved document (new or when opening from database), the three functions above: Name, Path and
FullName return empty strings. Nevertheless, if the user wants to know the automatic name, he must call the Item function
of IDocuments interface and pass a string, "DocumentX", where X is the number of the document, as the first variant
parameter.
3.5.8.3.6
ReadOnly Property
Read-only property that returns true or false depending on whether the document is read only or not.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.7
Saved Property
Gets a document's saved status, indicating whether a document has changed since it was last saved.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.8
CoordSystemProjection Property
Property that gets or sets the current coordinate system used for projected geographic data (see User Manual).
100
AT260_DRG_E0
Forsk 2007
Address of reference variable that contains the coordinate system interface pointer.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.9
CoordSystemDisplay Property
Property that gets or sets the current coordinate system used for display (see User Manual).
Address of reference variable that contains the coordinate system interface pointer.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.10
CoordSystemInternal Property
Read-only property that gets the current coordinate system used for sites coordinates.
The internal system will automatically change if the coordinate system used for display is changed and the document is
not connected to a database. If the document is connected to a database, the internal system is the one used for the first
archive in database (see User Manual).
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.11
TransmissionUnit Property
Property that sets or gets the current transmission power units.
Address of an integer variable that receives the unit (see 3.5.11.8 AtoTransmissionU-
newVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.12
ReceptionUnit Property
Property that sets or gets the current reception unit used for signal level.
Forsk 2007
Address of an integer variable that receives the unit (see 3.5.11.9 AtoReceptionUnit).
AT260_DRG_E0
101
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.13
DistanceUnit Property
Property that sets or gets the current displayed distance unit.
Address of an integer variable that receives the unit (see 3.5.11.10 AtoDistanceUnit).
newVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.3.14
Close Method
Method that closes a document. The document is removed from the Documents collection.
Return Values
S_OK.
E_POINTER,if status is NULL.
3.5.8.3.15
FilePrint Method
Sends a document to the current printer. The current print settings are used.
HRESULT FilePrint();
Parameters
None.
Return Values
S_OK.
3.5.8.3.16
Save Method
Saves a document. This method is equivalent to the File Save or File Save As menu commands, depending on the
input filename.
Parameters
filename:
A string specifying the full path of the file to which you want to save the document. If
you omit the name, it uses the default name specified by the FullName property.
102
AT260_DRG_E0
Forsk 2007
Return Values
S_OK or E_FAIL.
Examples
Saving a document as a .atl file:
IDocumentPtr pDoc;
hr = m_spApplication->get_ActiveDocument(&pDoc);
pDoc->Save(_bstr_t(L"C:\\Temp\\MyProject.atl"));
return S_OK;
Exporting a document to an MS-Access database:
IDocumentPtr pDoc;
hr = m_spApplication->get_ActiveDocument(&pDoc);
pDoc->Save(_bstr_t((L"C:\Temp\MyProject.mdb"));
return S_OK;
Exporting a document to an Oracle database:
IDocumentPtr pDoc;
hr = m_spApplication->get_ActiveDocument(&pDoc);
pDoc->Save(_bstr_t(L"Provider=MSDAORA.1;User ID = USERID;Data Source=SOURCE;
Password=P"));
return S_OK;
3.5.8.3.17
Refresh Method
Method that refreshes the document from the database. The connection must have been previously defined.
A Long value that tells Atoll if previous changes in the project file must be kept or not
Return Values
S_OK or E_FAIL.
3.5.8.3.18
Archive Method
Method that archives the document into the database. The connection must have been previously defined.
Address of an integer that will receive the status result of the operation.
Return Values
S_OK or E_FAIL.
E_POINTER, if status is NULL.
3.5.8.3.19
Run Method
Method that starts a calculation.
Forsk 2007
AT260_DRG_E0
103
Return Values
S_OK or E_FAIL.
3.5.8.3.20
SetConfig Method
Method that loads a configuration file
String containing the full path name of the configuration file to load.
Return Values
S_OK or E_FAIL.
Remarks
The configuration file is an XML file. It may contain geographic configuration and folder configurations (see User Manual
.cfg files).
The configurations contained in the .cfg file will replace the corresponding configurations in the document. The previous
one in the document will be lost.
If you want to add some geographic information to a document, youd rather use the Import function instead.
3.5.8.3.21
Import Method
Method that loads a file containing geographic data.
Return Values
S_OK or E_FAIL.
Remarks
The geographic file can be:
An XML file. All data from its geographic section are loaded (see User Manual .geo files).
Any file format supported by Atoll (.bil, .tif, etc).
The geographic content of the imported file (whatever the type: cfg, geo, bil, ) is added to the current configuration of
the geographic data in the document. It does not remove the older geographic configuration.
If you want to replace the geographic configuration of a document, youd rather use the SetConfig function instead.
Warning:
3.5.8.3.22
Because this method has no input parameter, you have to ensure that no inputs are requested from the
user when importing the file (like file type, georeferencement, ) if the application is not visible.
GetRecords Method
Method that returns a tabular data for a requested category of records.
String containing the name of the table from which the records are requested.
all:
Variant of Boolean type. If it is set to VARIANT_TRUE, all the records of the table are
returned. If not, all the records of the associated folder are returned. This means that only the filtered records are returned.
If no associated folder exists, this Boolean is ignored.
pRecords:
Address of pointer variable that receives the tabular data interface pointer. Upon
successful completion, *pRecords contains the requested interface pointer of the tabular data object.
Return Values
S_OK or E_INVALIDARG.
E_POINTER, if pRecords is NULL.
104
AT260_DRG_E0
Forsk 2007
Remarks
The list of available table names defined by Atoll can be found in the template (.mdb) file (see Technical Reference
Guide). Some other table names are available:
According to the purpose of your addin, and maybe its performance, you might prefer to fill a private map of all records
and then use this map for your features. The addin allows you to do that, but in some (rare) cases, this map is not up-todate: this can happen if a celltype has been changed for instance, all its TRGs are deleted.
Example
VBScript:
Dim records
Set records = app.ActiveDocument.GetRecords("Sites", True)
C++:
IDocumentPtr pDoc;
HRESULT hr = m_spApplication->get_ActiveDocument(&pDoc);
if (FAILED(hr)) return hr;
ITabularDataPtr pRecords;
hr = pDoc->GetRecords(_bstr_t(_T("Sites")), VARIANT_TRUE, &pRecords);
if (FAILED(hr)) return hr;
3.5.8.3.23
Redraw Method
Method that refreshes all items in the document.
HRESULT Redraw();
Parameters
None.
Return Values
S_OK.
Remarks
It has the same effect as the icon Refresh (F5) in Atoll GUI.
3.5.8.3.24
CenterMapOn Method
Centres map on the parameter point.
Double values that hold the coordinates of the point. The coordinate system must be
Return Values
S_OK.
3.5.8.3.25
GetRootFolder Method
Returns the root folder of all children belonging to one of the explorer tab.
A Long value that tells Atoll which tab is requested (see 3.5.11.14 AtoRootType).
Item:
Address of pointer variable that receives the child folder interface pointer. Upon
successful completion, *pItem contains the requested interface pointer of the root child folder object.
Forsk 2007
AT260_DRG_E0
105
Return Values
S_OK or E_FAIL.
E_POINTER, if pItem is NULL.
Example
VBScript:
Dim geo
Set geo = app.ActiveDocument.GetRootFolder(1)
C++:
IDocumentPtr pDoc;
HRESULT hr = m_spApplication->get_ActiveDocument(&pDoc);
if (FAILED(hr)) return hr;
IChildFolderPtr pGeoTab;
hr = pDoc->GetRootFolder(atoGeo, &pGeoTab);
if (FAILED(hr)) return hr;
3.5.8.3.26
GetSortedSignals Method
This method is not directly connected to IDocument interface, but indirectly through QueryService mechanism.
sigDatas, serversDatas;
sigDatas.resize(par.m_depth); serversDatas.resize(par.m_depth);
IMultiGridDataPtr pServerNumbers, pSignals;
sig->GetSortedSignals(&zone, par.m_resolution ,par.m_cMin,par.m_cDiff
,par.m_depth, pTxs, &pSignals, &pServerNumbers);
(This code is extracted from the Best Signals Export add-in available upon request from support@forsk.com).
HRESULT GetSortedSignals(
[in]
GEORECT *zone,
[in]
double resolution,
[in]
double minSignalLevel,
[in]
double maxSignalDifference,
[in]
ULONG depth,
[in]
IUnknown pServers,
[out]
IMultiGridData **pSignals,
// Txs
[out]
IMultiGridData **pServerNumbers
);
Returns the nth Best Signal matrices.
Parameters
zone:
resolution:
minSignalLevel:
the depth).
When the signal level goes below this value, it is ignored by the export (used to limit
maxSignalDifference:
When the difference between the max signal value on a bin and the current value
exceeds this value (positive), the current value is ignored.
depth:
Maximum number of potential signals wanted at a given point. If you want only the
best signal, set this parameter to 1.
106
AT260_DRG_E0
Forsk 2007
Pointer to the transmitters that must be taken into account in the calculation.
pSignals:
field levels.
Pointer to MultiGridData containing the n Best Signal Matrices. Contained values are
pServerNumbers:
Pointer to the MultiGridData containing the n Best Signal Matrices. Contained values
are index numbers of transmitters.
Return Values
S_OK.
No invalid entry is tested, so it must be tested outside and used very carefully.
Remarks
When no signal is available at a given point, the value at this point is set to -9999.
When no server is available at a given point, the value at this point is set to 0.
3.5.8.3.27
GetSortedServers Method
This method is not directly connected to IDocument interface, but indirectly through QueryService mechanism.
sigDatas, serversDatas;
sigDatas.resize(par.m_depth); serversDatas.resize(par.m_depth);
IMultiGridDataPtr pServerNumbers, pSignals;
sig->GetSortedServers(&zone, par.m_resolution ,par.m_cMin,par.m_cDiff
,par.m_depth, pTxs, &pSignals, &pServerNumbers);
(This code is extracted from the Best Signals Export add-in available upon request from support@forsk.com).
GEORECT *zone,
[in]
double resolution,
[in]
double minSignalLevel,
[in]
double maxSignalDifference,
[in]
ULONG depth,
[in]
IUnknown pServers,
[in]
[out]
IMultiGridData **pSignals,
[out]
IMultiGridData **pServerNumbers
// Txs
);
Returns the nth Best Signal matrices.
Parameters
Forsk 2007
zone:
resolution:
minSignalLevel:
the depth).
When the signal level goes below this value, it is ignored by the export (used to limit
AT260_DRG_E0
107
Pointer to the transmitters that must be taken into account in the calculation.
ulSortOption:
Sort options can be combined. For example, HCS_PRIORITY + EXTENDED_CELLS would change the order of the
signals and servers and return signals and servers according to HCS layers and extended cells. The sorting algorithm is
explained in the Best Signal Export tool documentation. The GetSortedServers method is the same as the GetSortedSignals method, if it is called with SIGNAL_STRENGTH as the sort option, i.e., HCS layers and extended cells are not taken
into account.
pSignals:
field levels.
Pointer to MultiGridData containing the n Best Signal Matrices. Contained values are
pServerNumbers:
Pointer to the MultiGridData containing the n Best Signal Matrices. Contained values
are index numbers of transmitters.
Return Values
S_OK.
No invalid entry is tested, so it must be tested outside and used very carefully.
Remarks
When no signal is available at a given point, the value at this point is set to -9999.
When no server is available at a given point, the value at this point is set to 0.
3.5.8.4
IDocument2 Interface
Adds a pathloss calculation feature to IDocument, a generic capability to support future functions through a GetService
mechanism and a feature of saving field strength values to a binary file.
Object
Document
3.5.8.4.1
Function
Property (P)
Method (M)
RunPathloss Method
Computes only pathloss values without the need to have a predefined study created.
Return Values
S_OK.
The Return Values of standard ATL AtlReportError function, in case of error.
Please see the online (or MSDN) documentation page of AtlReportError to obtain the list of possible values.
Remarks
This API function corresponds to the menu commands Calculate path loss matrices and Force path loss matrix calculation available in the Calculations sub-menu of the Transmitters folder.
3.5.8.4.2
GetService Property
Gets a service provider inheriting from IDispatch type by giving its predefined name.
108
AT260_DRG_E0
Forsk 2007
Parameters
name:
Name of the service. The name can be either a standard character string or the ClsID
of a component registered on the machine.
pdisp:
service.
Address of an IDispatch pointer receiving the object that implements the requested
Return Values
S_OK.
E_POINTER, if pdisp is NULL.
E_NOINTERFACE, if no object implementing the requested interface were found.
Remarks
The service provider inherits from Idispatch, which permits not only add-ins but also macros to use this interface. Currently
there is only one service provider implemented (see 3.5.8.7 IResultFileProvider interface).
3.5.8.5
IDocument3 Interface
Adds an export capability of configuration files to IDocument.
3.5.8.5.1
Object
Function
Property (P)
Method (M)
Document
ExportConfig Method
Exports the current configuration from the document to an output file, according to the content parameter.
zones (computation+focus)
FULL corresponds to a full export of the configuration file.
file:
Return Values
S_FALSE in case of error.
E_NOTIMPL if content is set to something other than GEO, GEO+ZONES or FULL.
S_OK in case of successful operation.
3.5.8.6
IDocument4 Interface
This interface gives the possibility to invoke arbitrary commands on a document. You have to know the command names.
Forsk 2007
Object
Function
Property (P)
Method (M)
Document
AT260_DRG_E0
109
3.5.8.6.1
GetCommandDefaults Property
Gets current default parameters specific to a command.
BSTR
bstrCommandName,
[out,
retval]
Parameters
bstrCommandName:
ppParameters:
eters, is retreived.
Address of the interface pointer where the property container, holding default param-
Return Values
E_NOTIMPL, if there are no default parameters for this command.
S_OK, if the parameter was successfully retreived.
3.5.8.6.2
InvokeCommand Property
Invokes a command.
HRESULT InvokeCommand([in] const BSTR bstrCommandName, [in, unique, defaultvalue(NULL)] IPropertyContainer *pParameters, [out, retval] IPropertyContainer
**ppResults);
Parameters
bstrCommandName:
pParameters:
ppResults:
Return Values
E_NOTIMPL, if the command is not supported.
S_OK, if the command was successfully carried out.
*ppResults will contain the command results if applicable.
3.5.8.6.3
RadiatedPowerUnit Property
Property that sets or gets the current radiated power unit.
Address of an integer variable that receives the unit (see 3.5.11.11 AtoRadiated-
aNewVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.6.4
AntennaGainUnit Property
Property that sets or gets the current antenna gain unit.
110
AT260_DRG_E0
Forsk 2007
Parameters
pVal:
GainUnit).
Address of an integer variable that receives the unit (see 3.5.11.12 AtoAntenna-
aNewVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.6.5
HeightOffsetUnit Property
Property that sets or gets the current height offset unit.
Address of an integer variable that receives the unit (see 3.5.11.13 AtoAntenna-
aNewVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.7
IResultFileProvider Interface
Specific service provider enabling the field strength results of a transmitter, including high and low resolution results, to be
computed and stored in a binary .bil file.
3.5.8.7.1
Object
Function
Property (P)
Method (M)
ResultFileProvider
Build Method
Service provider returned by a call to GetService on IDocument2 interface with the name SIGNAL as first parameter.
Builds the composite signal matrix of one transmitter and stores the result in a file.
HRESULT Build(BSTR fileName, BSTR txName, long step, long xmin, long xmax, long
ymin, long ymax, long* xorig, long* yorig);
Parameters
fileName:
txName:
step:
Resolution of the matrix in meters. This value may be different from the main and
extended pathloss matrices resolutions of the transmitter.
xmin:
xmax:
ymin:
ymax:
xorig:
Pointer to the actual X origin of the results (depends on the calculation radii of the
transmitter, the general computation zone and so on).
yorig:
Pointer to the actual Y origin of the results (depending on the calculation radii of the
transmitter, the general computation zone and so on).
Return Values
S_OK.
E_ABORT, if the user interrupts the calculation.
E_POINTER, if xorig or yorig are NULL.
Forsk 2007
AT260_DRG_E0
111
Remarks
The parameter name of GetService function can either be SIGNAL or the CLSID of this class: L"{B02A59E4-0F56-4FD1A71A-454576912A20}".
Currently only ASCII .txt file format is supported. The values surrounding the computed ones are set to FLT_MAX.
3.5.8.8
ITabularData Interface
Variant type is used to put or get a value from a tabular data. Mostly a simple VariantChangeType will assure you to safely
get the information you want in a more friendly type. However, some values are more complex and need some additional
treatments.
Object
TabularData
HRESULT AddNew()
HRESULT ColumnCount(long*)
HRESULT Delete(long)
HRESULT Edit(long)
HRESULT
long*)
3.5.8.8.1
Property (P)
Method (M)
Function
Find(long,
VARIANT,
AtoCompareOp,
VARIANT,
HRESULT RowCount(long*)
HRESULT Update(long*);
ColumnCount Property
Property that gets the number of column of the tabular data. This property is read only.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
This number does not include the RECORD_ID column. If a table TABLE1 is defined by FIELD1, FIELD2 and FIELD3,
ColumnCount returns 3.
3.5.8.8.2
RowCount Property
Read-only property that gets the number of rows (records) of the tabular data.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
This number does not include the columns name row. If a table TABLE1 has no record, it returns 0. GetValue(0, 1) returns
FIELD1, which is the name of the column number 1 (read in row number 0). GetValue(0, 0) returns RECORD_ID, which
112
AT260_DRG_E0
Forsk 2007
3.5.8.8.3
Edit Method
Method that informs Atoll which record will be modified.
Return Values
S_OK, if 0 < iRow GetRowCount() and no record is currently being edited or added,
Else E_INVALIDARG.
Notes:
3.5.8.8.4
Dont forget to call this method before a call to SetValue and to call Update to end the changes in the
record.
AddNew Method
Method that adds a new empty record in the tabular data.
HRESULT AddNew();
Parameters
None.
Return Values
S_OK, if the tabular data accepts new records and no record is currently being edited or added,
Else E_FAIL.
Notes:
3.5.8.8.5
Dont forget to call this method before a call to SetValue and to call Update to end the initialisation of the
records fields.
Update Method
Method that ends the editing of a record.
Return Values
S_OK, if a record has been edited or added otherwise E_FAIL.
E_POINTER, if iRow is NULL.
Remarks
This method must be called once after each Edit and AddNew. Editing one record after another without updating the previous one will throw an error. Edit/Update cannot be mixed up for different record, neither can be AddNew/Update.
3.5.8.8.6
Delete Method
Method that deletes a record.
Forsk 2007
Long containing the number of the row of the record which must be deleted.
AT260_DRG_E0
113
Return Values
S_OK, if iRow is a valid row number and if the deletion is allowed,
Else E_INVALIDARG.
Remarks
A valid iRow number is any integer, such that 0 < iRow RowCount(). Deletion can fail if a record is related to another one
(an antenna cannot be deleted if being by a transmitter).
Be careful when using this method with sub-tables, as for instance TRANSMITTERS table and TRXs table. If you delete
one TRX with the toolkit, the field TRX_NUMBER might be erroneous. The workaround to avoid this is to edit records in
the TRXs table.
3.5.8.8.7
GetValue Method
Method that gets the value of a column at a given row.
iCol:
Integer or string that defines the column from which you requested the value.
pVal:
Return Values
S_OK, if iRow and iCol are valid numbers,
Else E_ INVALIDARG.
Remarks
A valid iRow number is any integer, such that 0 iRow RowCount(). A valid iCol is either an integer such that 0 iCol ColumnCount() or a string containing the name of an existing column. The column names are not case sensitive.
You do not have to Edit a record before reading its field values. The returned value is a Variant, which means that in
VBScript, you can generally use simple types instead. While in C++, use VariantChangeType to make sure the conversion
towards a friendly type is valid. For complex returned values, we recommend using C++.
Example
VBScript:
IDocumentPtr pDoc;
HRESULT hr;
if (FAILED(hr = (m_spApplication->get_ActiveDocument(&pDoc))))
return hr;
ITabularDataPtr pRecords;
if (FAILED(hr =
(pDoc->GetRecords(_bstr_t(_T("Sites")), VARIANT_TRUE,
&pRecords))))
return hr;
long nCol = 0;
pRecords->get_ColumnCount(&nCol);
for (long i = 0; i <= nCol; ++i)
{
_variant_t value;
pRecords->GetValue(0, _variant_t(i + 1), value);
}
114
AT260_DRG_E0
Forsk 2007
3.5.8.8.8
SetValue Method
Method that sets the value of a column for the record being edited or added.
newVal:
Return Values
S_OK, if iCol is valid and if newVal type matches the column type,
Else E_ INVALIDARG.
Remarks
A valid iCol is either an integer such that 0 < iCol ColumnCount() or a string containing the name of an existing column.
The column names are not case sensitive.
You must have previously called Edit or AddNew to set the row number before writing the field value. The new value is a
Variant, which means that in VBScript, you can generally use simple types instead. While in C++, use the _variant_t type
to initialize the value. For complex values, we recommend using C++.
If this method is used for a large number of records, it is recommended to get the column numbers beforehand and then
to use the SetValue method with this number and not with a variant of type VT_BSTR. This will run faster. To get the
column number, use the method GetValue with a row number set to 0.
Example
This example increments all the TX Losses by one for each transmitter inside the active document.
VBScript:
Dim transmitters
Dim doc
Dim i
Dim txLosses
Set doc = app.ActiveDocument
Set transmitters = doc.GetRecords(Transmitters)
For i = 1 To transmitters.RowCount
txLosses = transmitters.GetValue(i, TXLOSSES)
Forsk 2007
AT260_DRG_E0
115
transmitters.Edit(i)
transmitters.SetValue(TXLOSSES, txLosses + 1)
transmitters.Update()
Next i
Instead, we could have used:
For i = 1 To transmitters.RowCount
txLosses = transmitters.GetValue(i, 14)
transmitters.Edit(i)
transmitters.SetValue(14, txLosses + 1)
transmitters.Update()
Next i
C++:
IDocumentPtr pDoc;
HRESULT hr;
if (FAILED(hr = (m_spApplication->get_ActiveDocument(&pDoc))))
return hr;
ITabularDataPtr pRecords;
if (FAILED(hr =
VARIANT_TRUE, &pRecords))))
(pDoc->GetRecords(CComBSTR(_T("Transmitters")),
return hr;
long nRows = 0;
pRecords->get_RowCount(&nRow);
_variant_t vCol = long(14);
for (long i = 0; i < nRow; ++i)
{
_variant_t vLoss;
pRecords->GetValue(i+1, vCol, &vLoss);
if (FAILED(hr = VariantChangeType(&vLoss, &vLoss, 0, VT_R8)))
return hr;
double losses = vLoss;
vLoss = losses + 1.;
pRecords->Edit(i+1);
if (FAILED(hr = pRecords->SetValue(vCol, vLoss)))
return hr;
pRecords->Update();
}
Instead, we could have written:
116
= 600000
AT260_DRG_E0
Forsk 2007
pts(1,1)
= 2188000
pts(2,0)
= 600000
pts(2,1)
= 2140000
pts(3,0)
= 555000
pts(3, 1) = 2140000
zones.Edit row
zones.SetValue "POINTS", pts
zones.Update
End Sub
3.5.8.8.9
GetPrimaryKey Method
Method that gets the value of the primary key for a given row number.
pVal:
Return Values
S_OK, if iRow is valid,
Else E_INVALIDARG.
E_POINTER, if pVal is NULL.
Remarks
A valid iRow number is an integer such that 0 < iRow RowCount(). Most of the tabular data have a specific primary key
(for example, a sites name). If no primary key is defined, the RECORD_ID is returned. When the key is made of several
columns, the type of the output variant is VT_ARRAY|VT_VARIANT.
3.5.8.8.10
FindPrimaryKey Method
Method that searches the record whose primary key equals the input value and returns the row number of the record found.
Otherwise, returns 1.
iRow:
Integer that receives the row number corresponding to the record (-1 if not found).
Return Values
S_OK.
E_POINTER, if iRow is NULL.
Remarks
When the key comprises several fields, the input variant must be of type VT_ARRAY|VT_VARIANT.
3.5.8.8.11
Find Method
Method that searches for a value in column iCol starting at iRowStart. Upon successful completion, the row number with
the matching value is returned in iRow.
Parameters
Forsk 2007
iRowStart:
vCol:
op:
See 3.5.11.7 AtoCompareOp.
An integer that specifies the kind of search (equal, greater, less than, equal to, etc).
AT260_DRG_E0
117
iRow:
record is found.
The row number of the first record matching the search criteria. Contains 1 if no
Return Values
S_OK.
E_INVALIDARG, if iRowStart is incorrect.
E_POINTER, if iRow is NULL.
Remarks
Patch iRowStart inside a loop in order to scan several records matching the search criteria.
This method should be used only for a few searches, because on the Atoll side, this method scans the records one after
the other and can be very time consuming.
If your code allows, try to swap your loops and use FindPrimaryKey, or keep a collection (map) of all records and write
your own filter.
Example
In this example, we search for all transmitters whose TxLosses (column number 14) is equal to 2 and we change its value
to 3.
VBScript:
Dim transmitters
Dim iRow
Set transmitters = app.ActiveDocument.GetRecords(Transmitters)
iRow = 1
While iRow > -1
iRow = transmitters.Find(iRow, 14, atoEQ, 2)
transmitters.Edit(iRow)
transmitters.SetValue(iRow, 14, 3)
transitters.Update
Wend
3.5.8.8.12
GetFormattedValue Method
Method that returns a field value formatted as a string.
iCol:
Integer or string that defines the column from which the value is requested.
pVal:
Return Values
S_OK, if iRow and iCol are valid numbers,
Else E_INVALIDARG.
E_POINTER, if pVal is NULL.
If the column cannot be converted into a string type, returns E_FAIL.
Remarks
A valid iRow number is an integer such that 0 iRow RowCount(). A valid iCol is either an integer such that 0 iCol ColumnCount() or a string containing the name of an existing column. The column names are not case sensitive.
3.5.8.8.13
118
AT260_DRG_E0
Forsk 2007
{
// just information to follow the add-in execution
m_spApplication->LogMessage(_bstr_t(_T("MyTool:ReadSignal entered")), atoInfo);
HRESULT hr = S_OK;
// Get all the predictions
ITabularDataPtr pPredictions;
if (FAILED(hr = (pDoc->GetRecords(CComBSTR(_T("Predictions")),
VARIANT_TRUE, &pPredictions))))
_com_issue_errorex(hr, pDoc, __uuidof(pDoc));
// Get Signal field for 1st record
_variant_t sigKey = L"Signal";
_variant_t vSignal;
if (FAILED( hr = (pPredictions ->GetValue(1, sigKey, &vSignal))))
_com_issue_errorex(hr, pPredictions, __uuidof(pPredictions));
// Extract a GridData from the field
IGridDataPtr iGrid = V_UNKNOWN (&vSignal);
// Read the grid data properties
GEOPOINT pt;
ULONG nx, ny;
double rexX,
resY;
PIXEL_TYPE pixType;
if ((FAILED(hr =
|| (FAILED(hr =
(iGrid->GetPixelType(&pixType)))))
Forsk 2007
AT260_DRG_E0
119
3.5.8.8.14
The previous code reads the first record of the prediction tabular data (pPredictions ->GetValue(1, sigKey,
&vSignal)). A more realistic code would be that reads a given matrix and not only the first one, which is not
the first record of the transmitters tabular data. One solution would be to loop through all the transmitters
whose matrices you require, to read its name and to call the method Find on the prediction data to reach
the record where the field TX_ID equals this name. Then for that row, read the PATHLOSS field. This
method may be used for a small number of transmitters but not for a large number because it would be very
time consuming.
If you write your loop in another way, your code should be more efficient: scan each record of prediction,
read the TX_ID field value, then use the method FindPrimaryKey on the TRANSMITTERS table to find the
transmitter with this key. Searching a record using its primary key is faster than searching a record through
any ordinary field.
It is possible to read the full pathname of the shared results through the API. To obtain this, just access the
field SHARED_RESULTS_FOLDER in the NETWORKS table.
Reading a Zone
ITabularDataPtr zones;
doc->GetRecords(_bstr_t(L"ZONES"),_variant_t(true),&zones);
_variant_t NAME = bstr_t("NAME");
_variant_t POINTS = bstr_t("POINTS");
_variant_t CONTOUR_NUM = bstr_t("CONTOUR_NUM");
_variant_t POLYGON_NUM = bstr_t("POLYGON_NUM");
long count_;
zones->get_RowCount(&count_);
for(i=1;i<=count;i++)
{
_variant_t name_;
zones->GetValue(i,NAME, &name_);
//you can test here for "FocusZone" or "ComputationZone"
_variant_t points_;
zones->GetValue(i,POINTS, &points_); //reading points array
if (points_.vt == (VT_ARRAY|VT_VARIANT))
{
COleSafeArray sa_;
sa_.Attach(points_);
long minRow_ = 0, maxRow_ = 0;
sa_.GetUBound(1, &maxRow_);
120
AT260_DRG_E0
Forsk 2007
sa_.GetLBound(1, &minRow_);
long index[2];
_variant_t x,y;
for(long k = minRow_; k <= maxRow_; k++) //reading each point
{
index[0] = k;
index[1] = 0;
sa_.GetElement(index, &x);
index[1] = 1;
sa_.GetElement(index, &y);
}
}
_variant_t contourNum_;
zones->GetValue(i,CONTOUR_NUM, &contourNum_); //get the contour num
_variant_t polygonNum_;
zones->GetValue(i,POLYGON_NUM, &polygonNum_);
}
Writing a Zone
//DROP ALL FOCUS POLYGONS
for(i = count_; i >= 2; i--)
{
_variant_t name_;
//read the name ("FocusZone" or "ComputationZone")
zones->GetValue(i, NAME, &name_);
if (CString(name_) == "FocusZone")
HRESULT hr = zones->Delete(i);
}
//ADD THESE NEW TWO POLYGONS IN THE FOCUS ZONE
static float Poly1gone1_[] = {1000,3000,1500,2500,1000,4500};
static float Poly1gone2_[] = {5000,7000,5500,6500,5000,8500,10000,8500};
static float* polygones_[] = {Poly1gone1_,Poly1gone2_};
for (int poly_=0 ; poly_<sizeof(polygones_)/sizeof(float*) ; poly_++)
{
HRESULT hr=zones->AddNew();
_variant_t name_ = CString("FocusZone");
zones->SetValue(NAME, name_);
_variant_t contourNum_ = int(0);
zones->SetValue(CONTOUR_NUM, contourNum_);
COleSafeArray array;
int size_ = 0;
//number of points
if (poly_ == 0)
size_= sizeof(Poly1gone1_)/sizeof(float)/2;
else
size_= sizeof(Poly1gone2_)/sizeof(float)/2;
= VT_R8;
Forsk 2007
AT260_DRG_E0
121
{
idx[1] = 0;
vv.dblVal = polygones_[poly_][2*idx[0]];
array.PutElement(idx, &vv);
idx[1] = 1;
vv.dblVal = polygones_[poly_][2*idx[0]+1];
array.PutElement(idx, &vv);
}
VARIANT points2_ = array.Detach();
_variant_t value;
value.vt
value.parray =
points2_.vt;
points2_.parray;
points2_.vt
VT_EMPTY;
zones->SetValue(POINTS, value);
long ri_;
zones->Update(&ri_);
}
return TRUE;
}
3.5.8.8.15
Editing Repeaters
Repeaters properties are split between two tables in Atoll data structure. The properties related only to the repeater are
stored in the REPEATERS table, while other properties are stored in the TRANSMITTERS table. To learn more about Atoll
database structure, refer to the Technical Reference Guide.
To read the EIRP property of a repeater, get a Repeaters tabular data" and reach the right record. Then use the GetValue
method requesting for the EIRP column (or _best practice_ its column number).
To change the transmitting antenna of the same repeater, get a Transmitters tabular data" and reach the record with the
same ID (using FindPrimaryKey) as the repeater you are working on. Use the SetValue method for the ANTENNA_NAME
column (or _best practice_ its number).
Since the primary key of the REPEATERS table is also the primary key of the TRANSMITTERS table, you can also loop
through the TRANSMITTERS table and then use FindPrimaryKey on the REPEATERS table. If the row number returned
by this method is -1, then this id corresponds to a pure transmitter and not a repeater.
Reading the pathloss matrix of a repeater is exactly the same as reading the pathloss matrix of a pure transmitter. So as
advised in 3.5.8.8.13, you should first scan the PREDICTION table and use FindPrimaryKey on the REPEATERS table to
reach the repeaters properties (just as you used FindPrimaryKey to reach the transmitter's properties).
3.5.8.8.16
transmitters.RowCount
3.5.8.8.17
ITabularDataPtr pTransmitters;
122
AT260_DRG_E0
Forsk 2007
_variant_t v;
IRadioTransmitter3Ptr pRadioTransmitter;
pTransmitters->GetValue(1, _variant_t(L_RADIO_TRANSMITTER), &v);
IRadioTransmitter3Ptr pRadioTransmitter;
pRadioTransmitter = V_UNKNOWN(&v);
IRadioTransmitter3 is part of the propagation model API.
3.5.8.8.18
sub main
Set data = ActiveDocument.GetRootFolder(0)
ScanFolders data
end sub
sub scanValues (values)
MsgBox values.RowCount
MsgBox values.ColumnCount
maxLine=values.RowCount
if values.RowCount > 2 then
maxLine=6
end if
maxCol=values.ColumnCount
if values.ColumnCount>5 then
maxCol=5
end if
For j = 0 To maxLine
For i = 89 To 89+maxCol
colName = values.GetValue(j, i)
If IsNull(colName) Then
MsgBox "vide"
else
MsgBox colName
end if
Next
Next
end sub
Function ScanFolders (it)
For each item In it
If item.ObjectKind = "{CDDF1E1D-1963-4D80-A057-D23A19570984}" then
MsgBox "Simulations found"
ScanFolders item
end if
if item.ObjectKind = "{AF5E2B98-1D54-48FA-89C5-8BFA2936ABF2}" then
MsgBox "Simulation group found"
set groupsimud= item.dispatch
set mean=groupsimud.MeanSimulation
set meancells=mean.cells
scanvalues meancells
set meansites=mean.sites
Forsk 2007
AT260_DRG_E0
123
scanvalues meansites
set meanmobiles=mean.mobiles
scanvalues meanmobiles
set std=groupsimud.StdDevSimulation
set stdcells=std.cells
scanvalues stdcells
set stdsites=std.sites
scanvalues stdsites
set stdmobiles=std.mobiles
scanvalues stdmobiles
ScanFolders item
end if
if item.ObjectKind = "{095C5D90-96F1-4BA8-85BB-B2F990AC2DD9}" then
MsgBox "Simulation Found"
set simud = item.dispatch
set cells = simud.Cells
scanvalues cells
set sites = simud.Sites
scanvalues sites
set mobiles = simud.mobiles
scanvalues mobiles
end if
Next
end function
3.5.8.8.19
Reading Data Tab Folders (CW Measurements and Test Mobile Data)
This example shows how you can read the data available in the CW Measurements and Test Mobile Data folders.
function ScanFolders
Set data = ActiveDocument.GetRootFolder(0)
For each item In data
LogMessage item.Name
LogMessage item.ObjectKind
If item.ObjectKind = "{41413C4A-C9DE-43DD-A917-612A0AF198FC}" then
LogMessage "CW found"
For each it in item
LogMessage "it.ObjectKind : " + it.ObjectKind
For each meas in it
LogMessage "meas.ObjectKind : " + meas.ObjectKind
LogMessage "meas.Name : " + meas.Name
Set mes = meas.dispatch
Set vals =
mes.Values
124
AT260_DRG_E0
Forsk 2007
end if
Next
Next
Next
Next
end if
if item.ObjectKind = "{21C11380-D8CF-4902-B622-763522AD9FC4}" then
LogMessage "Drive test found"
For each it in item
LogMessage "it.ObjectKind : " + it.ObjectKind
LogMessage "it.Name : " + it.Name
Set mes = it.dispatch
Set vals =
mes.Values
3.5.8.9
ITabularData2 Interface
This interface adds a filter feature to data tables and provides the possibility to access the list of differences between databases through the API. These are the differences listed in the Archive dialog of Atoll, which can be submitted through an
external process using this interface.
ITabularData2 gives access to the original data as retrieved by the latest refresh from the database. it does not allow to
show differences or solve conflicts between the data in the ATL document and the database.
The ITabularData2 interface cannot be used to retrieve or get information about deleted records. In a later version of Atoll,
it will be possible to determine the records which have been deleted.
Original values and the record status are not stored in the database. They are stored in the Atoll document. Atoll compares
these values when it displays the modifications in the archive dialogue.
Object
TabularData2
Forsk 2007
Function
Property (P)
Method (M)
HRESULT CancelUpdate()
AT260_DRG_E0
125
3.5.8.9.1
CancelUpdate Method
Cancels a pending update. This method may be called after Edit or AddNew to cancel the operation.
HRESULT CancelUpdate();
3.5.8.9.2
ColumnNumber Property
Returns a column number.
pCol:
Return Values
S_OK.
Remarks
It is faster to read data from tables using the column number instead of the column name. It also works for linked fields.
For instance you can write in VBScript:
3.5.8.9.3
CanEdit Property
Checks if rows can be modified.
Return Values
S_OK.
VARIANT_FALSE, if the Edit operation on this table is undefined.
3.5.8.9.4
CanAddNew Property
Checks if rows can be added.
Return Values
S_OK.
VARIANT_FALSE, if the AddNew operation on this table is undefined.
3.5.8.9.5
CanFilterSort Property
Checks if rows can be filtered and sorted.
126
AT260_DRG_E0
Forsk 2007
Parameters
pVal:
Return Values
S_OK.
VARIANT_FALSE, if Filter and Sort operations on this table are undefined.
3.5.8.9.6
Filter Property
Filters the table data according to a filter criteria. Refer to section 3.5.11.15 for the list of constants used to filter only modified, added, or deleted rows.
String: contains the filter string as displayed by Atoll in the "Table" property page available in the Atoll Explorer window.
Numeric: can be assigned one of the AtoRowFilter values.
Return Values
S_OK.
Remarks
If the table is retreived from Atoll with filtering on, setting this property is the same as setting the filter interactively in an
Atoll session. To remove any previous filter, call this method either with atoRowFilterNone value or with an empty string.
When the Atoll document is not connected to a database, atoRowFilterModifiedOrNew and atoRowFilterDeleted are not
available.
3.5.8.9.7
Filter Property
Returns the filter previously set on the table.
Return Values
S_OK.
3.5.8.9.8
Sort Property
Sort the table data.
Return Values
S_OK.
Remarks
If the table is retreived from Atoll with filtering on, setting this property is the same as setting the sort order interactively in
an Atoll session. To remove any previous sort order, call this method with an empty string.
Example
Private Sub PrintTransmittersTable(transmRec, infoMsg)
For nRow = 1 To transmRec.RowCount
LogMessage infoMsg & ": " & transmRec.GetValue(nRow, "TX_ID")
Next
Forsk 2007
AT260_DRG_E0
127
End Sub
Sub Main
Set t = ActiveDocument.GetRecords("transmitters", False)
Sort ascending according to the "SITE_NAME" database field
t.Sort = "SITE_NAME"
PrintTransmitterTables t, "Sort = SITE_NAME"
Sort descending according to the "SITE_NAME" database field
t.Sort = "SITE_NAME DESC"
PrintTransmittersTable t, "Sort = SITE_NAME DESC"
end sub
3.5.8.9.9
Sort Property
Returns the sort order previously set on the table.
Return Values
S_OK.
3.5.8.9.10
GetOriginalValue Property
Gets an original field value.
HRESULT GetOriginalValue([in] long iRow, [in] VARIANT iCol, [out, retval] VARIANT *pVal);
Parameters
iRow:
Row number.
iCol:
pVal:
Return Values
S_OK.
Remarks
If the row is unmodified, the original value is the same as the value itself.
3.5.8.9.11
RowStatus Property
Gets a row status. Refer to section 3.5.11.16 for the list of all possible row statuses.
Row number.
pVal:
Return Values
S_OK.
3.5.8.10
128
IPropertyContainer Interface
Object
Function
Property (P)
Method (M)
IDispatch
AT260_DRG_E0
Forsk 2007
3.5.8.10.1
Get Property
Gets a property.
Property name.
pValue:
Return Values
S_OK, if the property was successfully retreived.
E_INVALIDARG, if the property is not present in this property container.
Remarks
Properties can be of the following data types:
3.5.8.10.2
VT_BOOL
VT_UI1 VT_I1
VT_UI2 VT_I2
VT_BSTR
VT_VARIANT
VT_UI4 VT_I4
VT_R4 VT_R8
An array of the previous data types, for instance VT_ARRAY | VT_BSTR
Set Property
Sets a property.
Property name.
varValue:
Return Values
S_OK, if the property was successfully set.
Remarks
Properties can be of the data types listed in .
3.5.8.11
IChildFolder Interface
Object
ChildFolder
Forsk 2007
Function
Property (P)
Method (M)
HRESULT Application(IApplication**)
HRESULT CentreOnMap()
HRESULT Count(long*)
HRESULT Name(BSTR*)
HRESULT Name(BSTR)
HRESULT Parent(VARIANT*)
HRESULT Redraw()
HRESULT Selected(VARIANT_BOOL*)
HRESULT Selected(VARIANT_BOOL)
AT260_DRG_E0
129
HRESULT Visible(VARIANT_BOOL*)
HRESULT Visible(VARIANT_BOOL)
The available properties of a ChildFolder object depend on the exact type of ChildFolder object returned by the ObjectKind
property.
3.5.8.11.1
Application Property
Read-only property that gets the Atoll application object.
HRESULT Application(IApplication**pVal);
Parameters
pVal:
Address of pointer variable that receives the application interface pointer. Upon
successful completion, *pVal contains the requested interface pointer of the object. If the object does not support the
IApplication interface, *pVal is set to NULL (see 3.5.8.1 IApplication interface).
Return Values
S_OK, if the interface is supported. Otherwise, E_NOINTERFACE.
E_POINTER, if pVal is NULL.
3.5.8.11.2
Parent Property
Read-only property that gets the object containing the calling object. In the case of a root child folder object, ti returns the
Document object. In the case of a child of any parent-child, it returns the parent-child.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.11.3
Name Property
Property that gets or sets the item name.
newVal:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Example
VBScript: (Renaming the Transmitters folder)
Dim folder
Dim dataTab
Dim folderName
Set dataTab = app.ActiveDocument.GetRootFolder(atoData)
For Each folder in dataTab
folderName = folder.Name
If folderName = Transmitters Then
Folder.Name = TransmittersTest
130
AT260_DRG_E0
Forsk 2007
End if
Next
3.5.8.11.4
Count Property
Returns the number of sub-children of an item.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.11.5
Item Property
Read-only property that gets one item from the children collection.
Return Values
S_OK.
E_FAIL, if child is not found.
E_POINTER, if pVal is NULL.
3.5.8.11.6
_NewEnum Property
Specific property used to enumerate the objects of a collection.
Return Values
S_OK.
E_POINTER, if ppUnk is NULL.
Remarks
With Visual C++, you can browse a collection to find a particular item using the _NewEnum property or the Item method.
In Visual Basic (or VBScript), it is not necessary to use the _NewEnum property, as it is automatically used in the implementation of For Each ... Next.
Example
VBScript:
Forsk 2007
AT260_DRG_E0
131
IChildFolderPtr pModules;
HRESULT hr = pDoc->GetRootFolder(atoModule, &pModules) ;
if (FAILED(hr)) return hr;
for (int i = 0; i < pModules->get_Count(); i++)
{
IChildFolderPtr pMod;
_variant_t idx = (short)i;
hr = pModules->get_Item(idx, &pMod);
if (FAILED(hr)) return hr;
// Do something with pMod
}
3.5.8.11.7
Visible Property
Property that gets or sets the visibility flag of an item.
Address of the pointer variable that receives VARIANT_TRUE, if the child is visible,
newVal:
VARIANT_TRUE or VARIANT_FALSE.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
This property does not strictly apply to all types of items. However, it will be ignored if called for a child that does not support
it. No error will be returned.
Example
VBScript:
dataFolder.Item("Predictions").Visible = true
3.5.8.11.8
Selected Property
Property that gets or sets the selected flag of an item.
Address of the pointer variable that receives VARIANT_TRUE, if the child is selected,
newVal:
VARIANT_TRUE or VARIANT_FALSE.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
Remarks
This property does not strictly apply to all types of items. However, it will be ignored if called for a child that does not support
it. No error will be returned.
Example
VBScript:
132
AT260_DRG_E0
Forsk 2007
3.5.8.11.9
Export Method
Method that exports a child in a given format. This method can only be used for studies.
proj:
resolution:
The export resolution for the prediction study being exported. If not provided, Atoll
displays a dialog box asking the user to define a resolution.
format:
String containing the file format to be used for the export. These strings are the same
keywords as those written in a configuration file. Read Atoll documentation to learn more about these formats (SHP, AGD,
MIF, BMP, TIF, TXT, and ASC, i.e. ArcView Grid ASCII format).
Return Values
S_OK.
E_POINTER, if proj is NULL.
Remarks
This property does not strictly apply to all types of items. However, it will be ignored if called for a child that does not support
it. No error will be returned.
This method exports the geographic coverage prediction study to the file specified when using SHP, AGD, MIF, BMP, and
TIF formats. However, if you specify TXT or ASC formats, this method will export the study report in a tabulated ASCII text
or ArcView Grid ASCII formats. This prediction study report is the same as the one available by right-clicking the study in
Atoll and selecting Generate Report.
Example
VBScript:
3.5.8.11.10
CentreOnMap Method
Centres the map on this child.
HRESULT CentreOnMap();
Forsk 2007
AT260_DRG_E0
133
Return Values
S_OK.
Remarks
This property does not make sense for all types of items. No error will be thrown when called for items not supporting it.
3.5.8.11.11
Redraw Method
Redraws this child.
HRESULT Redraw();
Parameters
None.
Return Values
S_OK.
Remarks
This property does not make sense for all types of items. No error will be thrown when called for items not supporting it.
3.5.8.12
IChildFolder2 Interface
Object
ChildFolder
3.5.8.12.1
Function
Property (P)
Method (M)
HRESULT Remove()
HRESULT Position(long*)
HRESULT Position(long)
HRESULT Object(IUnknown** o)
HRESULT Dispatch(IDispatch** d)
AddChild Property
Adds a new child to the current child folder.
position:
pVal:
Return Values
E_POINTER, if pVal is NULL.
S_OK, if adding was successful.
E_FAIL, if adding failed.
3.5.8.12.2
Remove Method
This method removes the current item from its parents list of children.
HRESULT Remove();
Parameters
None
Return Values
S_OK.
E_FAIL, if removal fails. This may happen because some folders cannot be removed, even in interactive mode, by design.
134
AT260_DRG_E0
Forsk 2007
3.5.8.12.3
Position Property
Property that gets or sets the item position in the list of children.
HRESULT position(long
*pos);
Return Values
S_OK.
E_POINTER, if pos is NULL.
3.5.8.12.4
Object Property
Access to some specific features on the child folder through some IUnknown interface.
Adress of the pointer to the unknown object implementing the specific features.
Return Values
S_OK.
E_POINTER, if o is NULL.
Remarks
This function is to be used by add-ins and not macros as automation only support dispatch objects. See 3.5.8.12.5
Dispatch method.
3.5.8.12.5
Dispatch Property
Access to some specific features on the child folder through some IDispatch interface.
Adress of the pointer to the dispatch object implementing the specific features.
Return Values
S_OK.
E_POINTER, if d is NULL.
Remarks
This function is to be used by macros as automation only support dispatch objects. It may also be used by add-ins.
3.5.8.12.6
ObjectKind Property
This method returns a character string representing in a unique manner the specific features implemented by the actual
object.
Return Values
S_OK.
Forsk 2007
AT260_DRG_E0
135
Remarks
For add-ins or macros to be able to identify in a unique way character strings used to describe specific features, the API
needs to publish the correspondances.
Atoll
Release
SID
Specific Features
2.4.0
SID_CLUTTER
{7CB51DE8-A961-11D2-8688-0060086457D1}
Access to tabular
clutter properties.
See IClutter interface
2.4.0
SID_SIMULATIONS
{CDDF1E1D-1963-4D80-A057-D23A19570984}
Access to Simulations
folder
2.4.0
SID_SIMULATIONSGROUP
{AF5E2B98-1D54-48FA-89C5-8BFA2936ABF2}
Access to Groups of
simulations subfolder
2.4.0
SID_SIMULATION
{095C5D90-96F1-4BA8-85BB-B2F990AC2DD9}
Access to
Simulation items.
See ISimulation
interface
2.5.1
SID_SITES
{90443F68-5B3B-4AFD-B7BB-B057095EBAAD}
2.5.1
SID_ANTENNAS
{5FBEB2AE-3BBB-4FBA-94D8-5D8EA5A32069}
Access to Antennas
folder
2.5.1
SID_TRANSMITTERS
{F7E891E8-F7F5-4870-BF63-AF559AD50FD3}
Access to
Transmitters folder
2.5.1
SID_PREDICTIONS
{DA676EF0-E300-4AFF-BBFA-EC55D3798E4F}
Access to Predictions
folder
2.5.1
SID_UMTS_PARAMETERS
{D4F57EE3-7785-4348-9BA6-28998AA6BD80}
Access to UMTS
Parameters folder
2.5.1
SID_CW_MEASUREMENTS
{41413C4A-C9DE-43DD-A917-612A0AF198FC}
Access to CW
Measurements folder
2.5.1
SID_MEASURE_TX
{2C102EE5-BFF4-4A5A-8130-02BD0E2F70D7}
Access to CW
Measurements
Transmitter
2.5.1
SID_MEASURE_ITEM
{36858A48-7A85-482E-9DA0-B9E935ADE84C}
Access to CW
Measurements
2.5.1
SID_TESTMOBILEDATA
{21C11380-D8CF-4902-B622-763522AD9FC4}
2.5.1
SID_NUM_MEASURE_ITEM
{916801F9-0539-448C-8C0C-491FAC6399ED}
2.5.1
SID_PARAMETERS_FOLDER
{43B8845-5226-454F-908F-59A500DB4FD1}
Access to Parameters
folder
2.5.1
SID_HEXAGON_SCHEMA
{B167D45E-A0BC-4DC6-B9D7-6F7B131CADF1}
Access to Hexagonal
Design folder
2.6.0
SID_TRAFFICFOLDER
{B3B25A07-A994-4e8d-BBD1-51556D6C4245}
Access to Traffic
folder
3.5.8.13
3.5.8.13.1
IChildFolder3 Interface
Object
Function
Property (P)
Method (M)
ChildFolder
GetProperty Property
Gets a property from a property container.
136
Property name.
AT260_DRG_E0
Forsk 2007
Return Values
S_OK, if the property was successfully retreived.
E_INVALIDARG, if the property is not present in this property container.
Remarks
Properties can be of the following data types:
3.5.8.13.2
VT_BOOL
VT_UI1 VT_I1
VT_UI2 VT_I2
VT_BSTR
VT_VARIANT
VT_DISPATCH (can contain ITabularData data)
VT_UI4 VT_I4
VT_R4 VT_R8
An array of the previous data types, for instance VT_ARRAY | VT_BSTR
SetProperty Method
Sets a property in a property container.
Property name.
varValue:
Return Values
S_OK, if the property was successfully set.
Remarks
Properties can be of the data types listed in .
3.5.8.14
IClutter Interface
Object
Clutter
Function
Property (P)
Method (M)
3.5.8.14.1
Source Property
Provides the original IChildFolder2 source back.
Return Values
E_POINTER, if pSource is NULL
S_OK.
3.5.8.14.2
ClassAttributes Property
This method gives access to all attributes of the clutter, attached with the clutter classes i.e. code, color, STD_DEV,
FORTHO, %INDOOR and so on.
Forsk 2007
AT260_DRG_E0
137
Parameters
ppTable:
Pointer to the attributes of Clutter properties presented in a Tabular-Data manner.
Corresponds to the content of the Description tab in Clutter properties.
Return Values
E_POINTER, if ppTable is NULL
S_OK.
E_FAIL, if reading these data fails.
Remark
In the specific case where the check box Use default values only, in the Default Values tab of the properties dialog of the
clutter, is checked, the tabular data contains these default values.
3.5.8.14.3
DefaultAttributes Property
This method gives access to default attributes of the Clutter.
Return Values
E_POINTER, if ppTable is NULL
S_OK.
E_FAIL, if reading these data fails.
clutter.ClassAttributes
MsgBox values.RowCount
MsgBox values.ColumnCount
For j = 0 To Values.RowCount
For i = 1 To Values.ColumnCount
colName = Values.GetValue(j, i)
MsgBox colName
Next
Next
end if
Next
end function
3.5.8.15
ISimulationsGroup Interface
Object
SimulationsGroup HRESULT
138
Function
Source(IDispatch ** pSource)
AT260_DRG_E0
Property (P)
Method (M)
P
Forsk 2007
HRESULT
Values)
StdDevSimulation
(ISimulation**
stdDev-
3.5.8.15.1
Source Property
Provides the original IChildFolder2 source back.
Return Values
E_POINTER, if pSource is NULL
S_OK.
3.5.8.15.2
Statistics Property
Provides global statistics about the results of the simulations group.
Parameters
ppTable:
Return Values
E_POINTER, if ppTable is NULL
E_NOTIMPL.
3.5.8.15.3
MeanSimulation Property
Access to the mean simulation results. This corresponds to the data obtained when asking for mean simulation in simulation groups menu: Mean Simulation tab.
Return Values
E_POINTER, if meanValues is NULL
S_OK
3.5.8.15.4
StdDevSimulation Property
Access to the standard deviation results of the mean simulation. This corresponds to the data obtained when asking for
mean simulation in simulation groups menu: Standard Deviation tab.
Return Values
E_POINTER, if stdDevValues is NULL
S_OK.
Forsk 2007
AT260_DRG_E0
139
3.5.8.15.5
Example
See section 3.5.8.8.18 for an example of the mehtods of the ISimulationGroups interface. This example shows how to read
the results from the Simulations folder using a VBS macro.
3.5.8.16
ISimulation Interface
ISimulation inherits from IDispatch, thus it may be used directly by macros.
It gives access to all the simulation results.
Object
Simulation
3.5.8.16.1
Function
Property (P)
Method (M)
Source Property
Provides the original IChildFolder2 source back.
Return Values
E_POINTER, if pSource is NULL
S_OK.
3.5.8.16.2
Statistics Property
Provides global statistics about the results of the simulation.
Currently not implemented.
Return Values
E_POINTER, if ppTable is NULL
E_NOTIMPL.
3.5.8.16.3
Cells Property
Provides the results of the simulation as presented in Cells tab of the Property page.
Pointer to the table of results corresponding to the Cells tab of the Simulations Prop-
Return Values
E_POINTER, if pResults is NULL
S_OK
3.5.8.16.4
Sites Property
Provides the results of the simulation as presented in Sites tab of the Property page.
140
AT260_DRG_E0
Forsk 2007
Parameters
pResults:
erty Page.
Pointer to the table of results corresponding to the Cells tab of the Simulations Prop-
Return Values
E_POINTER, if pResults is NULL
S_OK
3.5.8.16.5
Mobiles Property
Provides the results of the simulation as presented in Sites tab of the Property page.
Pointer to the table of results corresponding to the Cells tab of the Simula-
Return Values
E_POINTER, if pResults is NULL
S_OK.
3.5.8.16.6
Example
See section 3.5.8.8.18 for an example of the mehtods of the ISimulationGroups interface. This example shows how to read
the results from the Simulations folder using a VBS macro.
3.5.8.17
IDispCoordSystem Interface
To change any property of a coordinate system, please refer to the Technical Reference Guide.
Object
CoordSystem
3.5.8.17.1
IDispCoordSystem functions
Property (P)
Method (M)
Code Property
Property that gets or sets the numeric code of the coordinates system.
Forsk 2007
AT260_DRG_E0
141
val:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
E_INVALIDARG, if val does not correspond to a system code recognized by Atoll.
Notes:
3.5.8.17.2
Classical system codes have values less than 32767. System codes greater or equal to 32768 correspond
to user defined systems.
ConvertCoordsTo Method
Converts the coordinates of a point expressed in the current system to another one.
InPoints:
VT_R8: x and y.
Coordinates of the input point to convert expressed in the current system. Array of 2
OutPoints:
x and y.
Return Values
S_OK.
E_POINTER, if targetCS is NULL or outPoint is NULL.
E_INVALIDARG, if there is a problem with the converter.
Other output values may be obtained according to the type of error detected (incorrect inputs, problems with some parameters in the conversion, etc).
Example
C++:
//Reading and preparing the coordinates of the first SITE in the TABLE, if any
long nRow=0;
_variant_t latiVal,longiVal;
_variant_t latiCol, longiCol;
latiCol.vt
= VT_BSTR;
longiCol.vt
= VT_BSTR;
latiCol.bstrVal = ::SysAllocString(CComBSTR(_T("LATITUDE")));
longiCol.bstrVal = ::SysAllocString(CComBSTR(_T("LONGITUDE")));
long nSites = 0;
pSites->get_RowCount(&nSites);
// Assumption: nSites >=1
pSites->GetValue(1, latiCol, &latiVal);
pSites->GetValue(1, longiCol, &longiVal);
CComBSTR latiStr, longiStr;
pSites->GetFormattedValue(1, latiCol, &latiStr);
pSites->GetFormattedValue(1, longiCol, &longiStr);
double lati=0, longi=0;
latiVal.ChangeType(VT_R8); lati = latiVal.dblVal;
longiVal.ChangeType(VT_R8); longi = longiVal.dblVal;
142
AT260_DRG_E0
Forsk 2007
= VT_R8;
vv.dblVal = longi.dblVal;
array.PutElement(&idx[0], &vv);
vv.dblVal = lati.dblVal;
array.PutElement(&idx[1], &vv);
VARIANT v
array.Detach();
inputPt.vt
v.vt;
inputPt.parray
v.parray;
v.vt
VT_EMPTY;
= doc.CoordSystemInternal
= internalSystem.ConvertCoordsTo(projectionSystem, ptsInput)
Forsk 2007
AT260_DRG_E0
143
CComPtr<IDispCoordSystem> internalSystem;
CComPtr<IDispCoordSystem> projectionSystem;
pDoc->get_CoordSystemInternal(&internalSystem);
pDoc->get_CoordSystemProjection(&projectionSystem);
CComPtr<ICoordSystem> hiddenInternalSystem;
CComPtr<ICoordSystem> hiddenProjectionSystem;
internalSystem->QueryInterface(__uuidof(ICoordSystem),(void**)&hiddenInternalSystem);
projectionSystem->QueryInterface(__uuidof(ICoordSystem),(void**)&hiddenProjectionSystem);
GEOPOINT points[5];
GetPoints(points); // Whatever function filling the array with 5 points whose
// coordinates follow internal system.
hiddenInternalSystem->InPlaceConvert(hiddenProjectionSystem, 5 , points);
The only restriction to this function is that it cannot be used in a macro context (VBS, VBScript, ) and so it must be used
carefully.
Other methods are available on the ICoordSystem interface, but they are much less useful than InPlaceConvert and wont
be detailed more than the following in this documentation.
3.5.8.17.3
Datum Property
Property that gets or sets the numeric value of the datum.
val:
Return Values
S_OK.
E_POINTER, if pVAl is NULL.
E_INVALIDARG, if val does not correspond to a datum code recognized by Atoll.
3.5.8.17.4
DatumName Property
Name of the datum.
Return Values
S_OK.
E_POINTER, if pVAl is NULL.
3.5.8.17.5
Description Property
Description of the datum.
144
AT260_DRG_E0
Forsk 2007
Parameters
pVAl:
Return Values
S_OK.
E_POINTER, if pVAl is NULL.
3.5.8.17.6
Ellipsoid Property
Property that gets or sets the numeric value of the ellipsoid.
val:
Return Values
S_OK.
E_POINTER, if pVal is NULL.
E_INVALIDARG, if val does not correspond to an ellipsoid code recognized by Atoll.
3.5.8.17.7
EllipsoidName Property
Name of the ellipsoid.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
3.5.8.17.8
Name Property
Property that gets or sets the name of the coordinates system.
val:
Return Values
S_OK.
E_POINTER, if pVAl is NULL.
3.5.8.17.9
Pick Method
Opens the coordinates system dialog.
OLE_HANDLE of the parent window for which the dialog is required to be opened.
types:
Bitset of CoordSysType (see CoordSysTypes) corresponding to the types of systems
the dialog must filter before opening.
ret:
OK, otherwise VARIANT_FALSE.
Forsk 2007
Pointer to a VARIANT_BOOL, set to VARIANT_TRUE if the user quits the dialog with
AT260_DRG_E0
145
Return Values
S_OK.
E_POINTER, if ret is NULL.
CoordSysTypes
enum CoordSysType
{ fgUndefinedCoordSys = 1,
fgGeographic2D
= 2,
fgProjected2D
= 4
} CoordSysType;
3.5.8.17.10
ProjMethod Property
Projection method used for the current coordinates system.
Return Values
S_OK.
E_POINTER, if pVal is NULL.
ProjectionMethods
enum ProjectionMethod
{
fgUndefinedProjection
= 0,
fgNoProjection
= 1,
fgLambertConfConic1SP
= 2,
fgLambertConfConic2SP
= 3,
fgMercator
= 4,
fgCassiniSoldner
= 5,
fgTransverseMercator
= 6,
fgTransvMercatorSouthOriented= 7,
fgObliqueStereographic
= 8,
fgNewZealandMapGrid
= 9,
fgHotineObliqueMercator
= 10,
fgLabordeObliqueMercator
= 11,
fgSwissObliqueCylindrical
= 12,
fgObliqueMercator
= 13,
fgUTMProjection
= 14
} ProjectionMethod;
3.5.8.17.11
ProjParameter Property
Reads a parameter of the projection.
pVal:
Return Values
S_OK.
146
AT260_DRG_E0
Forsk 2007
ProjParameterIndices
enum ProjParameterIndices
{
fgUTMZoneNumber
= 0,
fgLongitudeOfOrigin
= 0,
fgLatitudeOfOrigin
= 1,
fgFalseEasting
= 2,
fgFalseNorthing
= 3,
fgScaleFactorAtOrigin
= 4,
fgLatitudeOf1stParallel
= 4,
fgAzimuthOfCentralLine
= 5,
fgLatitudeOf2ndParallel
= 5,
fgAngleFromRectfifiedToSkewedGrid = 6
} ProjParameterIndices;
3.5.8.17.12
SetDatum Method
Changes the datum of the system.
params:
Return Values
S_OK.
E_INVALIDARG, if the datum is incorrect.
Other errors, if a parameter in the array of variants has incorrect value.
3.5.8.17.13
SetProjection Method
Changes the projection of the system.
projectionParameters:
on the method.
Parameters of the new projection provided as an array of variants. The size depends
Return Values
S_OK.
E_INVALIDARG, if the method is incorrect.
Other errors, if a parameter in the array of variants has incorrect value.
3.5.8.17.14
Unit Property
Property that gets or sets the unit of the coordinate system.
Forsk 2007
AT260_DRG_E0
147
Return Values
S_OK.
E_POINTER, if pVal is NULL.
E_INVALIDARG, if the unit is incorrect.
GeographicUnits
enum GeographicUnit
{
fgUnspecifiedUnit = -1,
fgMeter
= 0,
fgKilometer
= 1,
fgFoot
= 2,
fgLink
= 3,
fgChain
= 4,
fgYard
= 5,
fgNauticalMile
= 6,
fgMile
= 7,
fgRadian
= 100,
fgDegree
= 101,
fgGrad
= 102,
fgArcMinute
= 103,
fgArcSecond
= 104
} GeographicUnit;
3.5.8.18
IApplicationKeyRef Interface
This interface is implemented by an add-in in order to get the reference of the dongle (fixed or floating) on which the current
Atoll session is running.
Object
ApplicationKeyRef
HRESULT IsFixedKey()
HRESULT IsNetworkKey()
HRESULT GetFskKeyRef([in]
BSTR* reference)
3.5.8.18.1
Property (P)
Method (M)
IApplicationKeyRef functions
ULONG
keyType,
[out]
IsFixedKey Method
Method that returns true if the dongle being used for the current Atoll session is a fixed dongle.
HRESULT IsFixedKey();
Parameters
None
Return Values
S_OK for fixed license.
S_FALSE, otherwise.
3.5.8.18.2
IsNetworkKey Method
Method that returns true if the dongle being used for the current Atoll session is a floating license dongle.
HRESULT IsNetworkKey();
Parameters
None
148
AT260_DRG_E0
Forsk 2007
Return Values
S_OK for floating license.
S_FALSE, otherwise.
3.5.8.18.3
GetFskKeyRef Method
Method that returns the Forsks reference of the fixed or floating license dongle being used for the current Atoll session.
reference:
Return Values
E_POINTER if the dongle reference is NULL.
S_OK if the dongle is of the type input in keyTpye.
S_FALSE if the dongle is not of the type input in keyType, and also if keyType is neither 0 nor 1.
3.5.8.18.4
Example
CComPtr<IServiceProvider> pSrv;
GetSite(IID_IServiceProvider,(void**)&pSrv);
IApplicationKeyRefPtr pKeyRef;
HRESULT
hr=pSrv->QueryService(SID_KEY_REF,__uuidof(IApplication
KeyRef),(void**)&pKeyRef);
CComBSTR str("You do not have a fixed key plugged.No ref available");
CComBSTR f=str;
if (hr==S_OK)
{
f=CComBSTR("Reference of fixed key
:");
hr=pKeyRef->IsFixedKey();
if (hr==S_OK)
hr=pKeyRef->GetFskKeyRef(0,&str);
else
{
f=CComBSTR("Reference of floating key :");
hr=pKeyRef->GetFskKeyRef(1,&str);
}
f.Append(str);
}
else
str=CComBSTR("Impossible to find the reference of the key.");
3.5.8.19
ITraffic Interface
Provides access to traffic map features.
Notes:
Forsk 2007
This interface is obtained through the Object or Dispatch property of the Atoll explorer item whose
ObjectKind property is the ITraffic interface identifier, formatted as a string.
Object
ITraffic functions
Property (P)
Method (M)
Traffic
AT260_DRG_E0
149
3.5.8.19.1
Source Property
Gets the IDispatch interface of the explorer item implementing the ITraffic interface.
Return Values
S_OK if the source was successfully retrieved.
E_POINTER if the source pointer is NULL.
E_NOINTERFACE if the source could not be retrieved.
3.5.8.19.2
ScenarioProvider Property
Gets the scenario provider.
Return Values
S_OK if the provider was successfully retrieved.
E_POINTER if the ppProvider pointer is NULL.
E_NOTIMPL if there is no provider available.
E_FAIL if the provider could not be retrieved.
Notes:
3.5.8.19.3
Example
ITrafficPtr GetTrafficFolder(IDocument *pDocument)
{
USES_CONVERSION;
HRESULT hr;
ITrafficPtr pTraffic;
try
{
IChildFolder2Ptr pRoot = pDocument->GetRootFolder(atoGeo);
long count = 0;
hr = pRoot->get_Count(&count);
if (FAILED(hr))
throw hr;
for (long i = 0; i < count; ++i)
{
IChildFolderPtr pItemT;
hr = pRoot->get_Item(_variant_t(i), &pItemT);
if (FAILED(hr))
continue;
CComBSTR itemKind;
IChildFolder2Ptr pItem = pItemT;
hr = pItem->get_ObjectKind(&itemKind);
if (FAILED(hr))
continue;
if (itemKind == __uuidof(ITraffic))
150
AT260_DRG_E0
Forsk 2007
{
// Found the traffic folder
IUnknownPtr pObject;
hr = pItem->get_Object(&pObject);
pTraffic = pObject;
break;
}
}
}
catch (...)
{
}
return pTraffic;
}
3.5.8.20
ITrafficScenarioProvider Interface
The traffic scenario provider allows third parties to build their own UMTS simulation module on top of Atoll core architecture. Raw mobiles data is generated according to a probability law and a set of traffic maps.
3.5.8.20.1
Object
ITrafficScenarioProvider functions
Property (P)
Method (M)
TrafficScenarioProvider
HRESULT
Create
([in]
VARIANT
selectedMapsNames,[in] double scale,[in] AtoTrafficScenarioLaw law,[in] VARIANT reserved,[out, retval]
ITabularData **mobiles)
GetMeanSize Property
Provides the mean count of mobiles.
reserved:
mobilesCount:
Return Values
S_OK if the mobile count was successfully retrieved.
3.5.8.20.2
Create Property
Creates raw mobiles data. The mobiles data is returned as a table containing the position of the mobiles and other information related to the state of mobiles.
Forsk 2007
AT260_DRG_E0
151
Probability law used to get a random count of mobiles, given the mean size of the
reserved:
mobiles:
Column Name
Description
Type
Values
X coordinate
Long
Y coordinate
Long
SERVICE
Service name
String
TERMINAL
Terminal name
String
MOBILITY
Mobility type
String
CLUTTER
Clutter code
Short
ACTIVITY
Mobile activity
String
Return Values
S_OK if the mobiles data was successfully retrieved.
3.5.8.21
ITrafficPerEnvironment Interface
Provides access to traffic per environment information through API interface. Traffic data under the Traffic folder correspond to traffic in various formats, i.e. raster, vector and live traffic. Therefore, this interface goes through all the traffic
data in the Traffic folder to get info from environment based traffic only.
Object
Traffic
Function
Property (P)
Method (M)
3.5.8.21.1
Source Property
Provides the original IChildFolder2 source back.
Return Values
E_POINTER, if pSource is NULL
S_OK.
3.5.8.21.2
ClassAttributes Property
This method gives access to all attributes of the traffic based on environment classes.
Return Values
E_POINTER, if ppTable is NULL
S_OK.
E_FAIL, if reading these data fails.
3.5.8.21.3
DefaultAttributes Property
This method gives access to default attributes of the Traffic.
152
AT260_DRG_E0
Forsk 2007
Return Values
E_POINTER, if ppTable is NULL
S_OK.
E_FAIL, if reading these data fails.
traffic.ClassAttributes
MsgBox values.RowCount
MsgBox values.ColumnCount
For j = 0 To Values.RowCount
For i = 1 To Values.ColumnCount
colName = Values.GetValue(j, i)
MsgBox colName
Next
Next
Next
end if
Next
end function
sub main
Set data = ActiveDocument.GetRootFolder(0)
ScanFolders data
end sub
sub scanValues (values)
MsgBox values.RowCount
MsgBox values.ColumnCount
maxLine=values.RowCount
if values.RowCount > 2 then
maxLine=6
end if
Forsk 2007
AT260_DRG_E0
153
maxCol=values.ColumnCount
if values.ColumnCount>5 then
maxCol=5
end if
For j = 0 To maxLine
For i = 89 To 89+maxCol
colName = values.GetValue(j, i)
If IsNull(colName) Then
MsgBox "vide"
else
MsgBox colName
end if
Next
Next
end sub
function ScanFolders (it)
For each item In it
If item.ObjectKind = "{CDDF1E1D-1963-4D80-A057-D23A19570984}" then
MsgBox "Simulations found"
ScanFolders item
end if
if item.ObjectKind = "{AF5E2B98-1D54-48FA-89C5-8BFA2936ABF2}" then
MsgBox "Simulation group found"
set groupsimud= item.dispatch
set mean=groupsimud.MeanSimulation
set meancells=mean.cells
scanvalues meancells
set meansites=mean.sites
scanvalues meansites
set meanmobiles=mean.mobiles
scanvalues meanmobiles
set std=groupsimud.StdDevSimulation
set stdcells=std.cells
scanvalues stdcells
set stdsites=std.sites
scanvalues stdsites
set stdmobiles=std.mobiles
scanvalues stdmobiles
ScanFolders item
end if
if item.ObjectKind = "{095C5D90-96F1-4BA8-85BB-B2F990AC2DD9}" then
MsgBox "Simulation Found"
set simud = item.dispatch
set cells = simud.Cells
scanvalues cells
set sites = simud.Sites
scanvalues sites
set mobiles = simud.mobiles
scanvalues mobiles
154
AT260_DRG_E0
Forsk 2007
end if
Next
end function
3.5.9
Outgoing Interfaces
3.5.9.1
_IApplicationEvents Interface
All events are managed through the connection point mechanism provided by ATL. Atoll keeps a container of all connection points, which have been declared with AtlAdvise. When something occurs, Atoll loops through its connection point
container and informs each connection point of what occured. The connection point implements the outgoing interface
defined by the server (Atoll) for a given set of events (i.e. the application Event interface) on the client-side (= in the add-in).
The events related to the application are fired:
The method used within the wizard to implement connection points is based on the template class IDispEvenImpl. An
IDispEventImpl COM object handles all events mapped with an event sink map. Each event is identified by an id, whose
value matches the order of its declaration in the interface5.
Notes:
The method used to advise the server is DispEventAdvise, which in turn calls AtlAdvise.
We recommend you to copy the code generated by the wizard (see 3.2.3 Step 3: Catching Events) when you want to implement connection points.
This section describes each default method created by the wizard and explains when it is called by Atoll.
5.
There is a known bug in ATL and sometimes when compiling an add-in youll obtain strange messages about
ambiguity between ATL and a namespace. To troubleshoot it just enclose your declaration of atlbase.h with the following
piece of code :
Forsk 2007
AT260_DRG_E0
155
3.5.9.1.1
WillQuitApp Method
Event fired when the user wants to exit an Atoll session. It occurs just before all add-ins are disconnected and after all
documents have been closed.
Return Values
S_OK.
3.5.9.1.2
DocumentOpenComplete Method
Event fired when a document has been opened.
Document interface pointer to the document object which has been opened.
Return Values
S_OK.
3.5.9.1.3
WillCloseDocument Method
Event fired when the user wants to close a document. It occurs just before the document closes, i.e. after all confirmations
requested by Atoll have been answered (stop running tasks, save changes, etc).
evtStatus:
Boolean set by the add-in telling Atoll if Close can continue or not.
Return Values
S_OK.
3.5.9.1.4
WillSaveDocument Method
Event fired when the user wants to save a document. It occurs just before the document file is saved but after a valid file
name is set.
evtStatus:
Boolean set by the add-in tellin Atoll if Save can continue or not.
Return Values
S_OK.
3.5.9.1.5
DocumentSaveComplete Method
Event fired just after a document has been saved.
Document interface pointer of the document object which has been successfully
Return Values
S_OK.
156
AT260_DRG_E0
Forsk 2007
3.5.9.1.6
DocumentNewComplete Method
Event fired when a new document has been created.
Document interface pointer of the document object that has been successfully
Return Values
S_OK.
3.5.9.1.7
WillRefreshDocument Method
Event fired when the user wants to refresh a document from database. It occurs just before the connection with the database is checked.
evtStatus:
Boolean set by the add-in telling Atoll if Refresh can continue or not.
Return Values
S_OK.
3.5.9.1.8
RefreshDocumentComplete Method
Event fired when a document has been refreshed from database.
Document interface pointer of the document object which has been refreshed.
Return Values
S_OK.
3.5.9.1.9
WillArchiveDocument Method
Event fired when the user wants to archive a document into the database. It occurs just after the connection with the database is set up and after Atoll has checked if any changes have to be archived. If nothing requires archiving, this event is
not fired.
evtStatus:
Return Values
S_OK.
3.5.9.1.10
ArchiveDocumentComplete Method
Event fired when the document has been archived in database. It occurs just before the connection with the database is
broken.
Document interface pointer of the document object which has been archived.
Return Values
S_OK.
Forsk 2007
AT260_DRG_E0
157
3.5.9.1.11
WillRun Method
Event fired when the user wants to start a calculation. If all is set to VARIANT_TRUE, this event occurs after the user has
confirmed that all previous calculations must be deleted.
all:
Boolean containing VARIANT_TRUE (True) if the user has requested Calculate All
(Ctrl+F7) or VARIANT_FALSE (False) if the user has requested Calculate (F7).
evtStatus:
Boolean set by the add-in telling Atoll if Run can continue or not.
Return Values
S_OK.
3.5.9.1.12
RunComplete Method
Event fired when the calculation has finished. It occurs after all tasks have completed.
Document interface pointer of the document object where the calculation were
Return Values
S_OK.
3.5.9.1.13
LicenceAcquireComplete
This feature enables the user to log Atoll licence token usage from an add-in. Licence token consumption is available
globally for all Atoll instances running on one licence server using a dedicated application (monitor.exe).
External licence tokens are not tracked by this event. Licence events for the Measures module will be available for autoconnected add-ins only.
Fired when one licence token is acquired.
HRESULT LicenceAcquireComplete([in,
lModuleID);
unique]
IDocument
*pDocument,[in]
long
Parameters
pDocument:
IDocument interface pointer of the Atoll document that needed one licence token.
lModuleID:
Return Values
S_OK.
Remarks
lModuleID will be one of these constant values:
LICENCE_GSMTDMA
LICENCE_MW
LICENCE_MEASURES
LICENCE_AFP
LICENCE_PACK3G
LICENCE_UMTS
LICENCE_CDMA
LICENCE_TDSCDMA
LICENCE_WIMAX
For LICENCE_MEASURES token, pDocument will be NULL.
158
AT260_DRG_E0
Forsk 2007
3.5.9.1.14
LicenceReleaseComplete
This feature enables the user to log Atoll licence token usage from an add-in. Licence token consumption is available
globally for all Atoll instances running on one licence server using a dedicated application (monitor.exe).
External licence tokens are not tracked by this event. Licence events for the Measures module will be available for autoconnected add-ins only.
Fired when one licence token is released.
IDocument interface pointer of the Atoll document that just released the licence token.
lModuleID:
Return Values
S_OK.
Remarks
lModuleID will be one of these constant values:
3.5.9.2
LICENCE_GSMTDMA
LICENCE_MW
LICENCE_PACK3G
LICENCE_UMTS
LICENCE_CDMA
LICENCE_TDSCDMA
LICENCE_WIMAX
IAddin Interface
An external tool must expose an Add-in COM object by implementing the IAddin interface in order to be loaded by Atoll.
When Atoll finds an object in the registry implementing the category CATID_AtollAddins, it tries to load the Add-in if AutoConnect is set to True. Otherwise, this will be done later when the user selects the add-in in the Add-ins dialog (read Tutorials Step 2 to learn more about this option).
Loading an add-in means that Atoll creates an instance of this add-in and, when successful, calls the OnConnection
method of this object.
3.5.9.2.1
Add-in connection status between two consecutive Atoll sessions is stored in the system registry from Atoll
version 2.4.0.
Each add-in exposes an AddIn object by implementing the COM IAddin interface. When connection is requested, the
add-in receives an application object as an IApplication interface. This interface represents the Atoll Application. The add-
Forsk 2007
AT260_DRG_E0
159
Calling the SetAddinInfos method of the application (to tell the application which object implements commands
and how to load resources)
Adding commands
Informing the application that the add-in wants to receive the fired events or not
The add-in is disconnected when the user unchecks it in the add-ins dialog. The add-in must release the application when
it is disconnected (IApplication interface).
3.5.9.2.2
Adding Commands
While some add-ins are written to automate some Atoll tasks, others can be requested by the user to perform a specific
job. To do so, the add-in has to add its own menu command or toolbar in Atoll. According to the connection mode, these
commands may be added once an Atoll session starts or even later.
External commands are added when implementing the OnConnection method. The identifier of the toolbar and the module
instance are input parameters of the SetAddinInfo method.
When the user selects an add-in item in the Tools menu, Atoll will send the command to this add-in using the dispatch
mechanism. This means that Atoll must know the object that implements this IDispatch COM interface. In the wizard example, it is the same object as the one implementing the IAddin COM interface.
The AddCommand method mainly tells Atoll the name of the command displayed in the GUI and the method name used
in the add-in implementation. A command is eventually added in the Tools menu of Atoll. It can also optionally appear in
a toolbar as well. If no toolbar is provided, no resource id is needed (pass 1 as parameter) in SetAddinInfo and pass
VARIANT_FALSE in AddCommand.
All commands must be defined in the interface definition of the object. A command has no parameter. Atoll always waits
untill the function returns, that means that an add-in must be carefully designed so as not to decrease Atolls performance.
Macros written in VBScript cannot add any command but can add icons in a toolbar (see 3.4.1 Adding Macros in Atoll).
3.5.9.2.3
OnConnection Method
Method called by Atoll when it is loading the add-in. If this method returns S_OK, the add-in is loaded and according to its
purpose will be able to receive events and commands etc.
Application interface pointer of the top-level Application object, in which the add-in is
bFirstTime:
Boolean that equals VARIANT_TRUE only the first time the add-in is being
connected. If the add-in has been connected and then disconnected, the next OnConnection will set bFirstTime to
VARIANT_FALSE.
cookie:
Long value set by Atoll representing an identifier of the add-in. The add-in must send
back this identifier to Atoll when setting information or adding commands.
status:
otherwise, VARIANT_FALSE.
Return Values
S_OK.
3.5.9.2.4
OnDisconnection Method
Method called by Atoll when the add-in is being disconnected.
Return Values
S_OK.
160
AT260_DRG_E0
Forsk 2007
3.5.10
3.5.10.1
Error Handling
No exception can be thrown between Atoll and an add-in. Each error must be notified by returning an HRESULT error
code. When a method from Atoll returns an HRESULT other than S_OK, the add-in can extract error information by
requesting the IErrorInfo interface. In the same way, if the add-in supports IErrorInfo (i.e. implements IsupportErrorInfo)
interface, Atoll will be able to extract meaningful information from the error code when you write for instance:
3.5.10.2
3.5.10.3
3.5.10.3.1
3.5.10.3.2
Resource Access
In order for the add-in to access the dlls defined resources and not the application's, the add-ins developer has to call the
following macro in each function:
AFX_MANAGE_STATE(AfxGetStaticModuleState());
Refer to Microsoft Online Help to obtain precisions on this call.
3.5.10.4
3.5.11
Enumerations
Enumerations are used to specify constants. Two categories of enumerations are defined hereafter.
The first category refers to all enumerations defined in Atoll library. All of them are prefixed with Ato (for Atoll). The second
category refers to all enumeration defined in FSKGISLib Library. All of these are prefixed with fg.
Note that VBScript does not accept enumerations. No errors will be thrown. But when using a constant name, its value is
random and so is the result. In VBScript the value of a constant must be used rather than its name.
3.5.11.1
AtoSaveStatus
Constant
Value
Description
atoSaveSucceeded
atoSaveCanceled
3.5.11.2
Forsk 2007
AtoSaveChanges
Constant
Value
Description
atoSaveNo
161
atoSavePrompt
3.5.11.3
AtoRefreshPriority
Constant
Value
Description
atoCancelChanges
atoSkipChanges
3.5.11.4
AtoArchiveStatus
Constant
Value
Description
atoArchiveSaveSucceeded
atoArchiveCanceled
Archiving has been cancelled (by the user or because conflicts occurred).
Constant
Value
Description
atoMaximized
atoNormal
Normal (Default).
atoMinimized
3.5.11.5
AtoWindowStatus
3.5.11.6
AtoLogType
Constant
Value
Description
atoInfo
atoError
atoWarning
Constant
Value
Description
atoEQ
(EQual) Specifies that the search is for the first value equal to searchVal.
atoLT
(Strictly Lower Than) Specifies that the search is for the first value less
than searchVal.
atoLE
(Lower or Equal) Specifies that the search is for the first value less than or
equal to searchVal.
atoGE
(Greater or Equal) Specifies that the search is for the first value greater
than or equal to searchVal.
atoGT
(Strictly Greater Than) Specifies that the search is for the first value greater
than searchVal.
atoNE
(Not Equal) Specifies that the search is for the first value not equal to
searchVal.
Constant
Value
Description
atoDbm
atoWatt
atoKWatt
3.5.11.7
AtoCompareOp
3.5.11.8
162
AtoTransmissionUnit
AT260_DRG_E0
Forsk 2007
3.5.11.9
AtoReceptionUnit
Constant
Value
Description
atoDbmRx
atoDbMicroVolt
atoDbMicroVoltMeter
3.5.11.10
AtoDistanceUnit
Constant
Value
Description
atoM
atoKm
atoMiles
3.5.11.11
AtoRadiatedPowerUnit
Constant
Value
Description
atoRadiatedPowerEIRP
atoRadiatedPowerERP
3.5.11.12
AtoAntennaGainUnit
Constant
Value
Description
atoAntennaGainDbi
atoAntennaGainDbd
3.5.11.13
AtoHeightOffsetUnit
Constant
Value
Description
atoHeightOffsetM
atoHeightOffsetFeet
3.5.11.14
AtoRootType
Constant
Value
Description
atoData
atoGeo
atoModule
3.5.11.15
AtoRowFilter
Constants to filter only modified, added, or deleted rows.
Constant
Value
Description
atoRowFilterNone
No filter.
atoRowFilterModifiedOrNew
atoRowFilterDeleted
Forsk 2007
AT260_DRG_E0
163
3.5.11.16
AtoRowStatus
All possible row statuses.
Constant
Value
Description
atoRowStatusNew
atoRowStatusModified
atoRowStatusDeleted
atoRowStatusUnmodified
Row is unmodified.
When you open a document from database, atorowstatus is set to Unmodified and original values are set for all records.
When you archive or refresh your document, atorowstatus is set to Unmodified and original values are set for all records
that have been archived or refreshed.
When you create a new record in the document in Atoll, atorowstatus is set to New and original value is set to Null.
When you modify any record in the document in Atoll, atorowstatus is set to Modified. If you undo the modification in the
record, atorowstatus is set to Unmodified.
See 3.5.8.9.11 RowStatus meethod.
3.5.11.17
GeographicUnit
Constant
Value
Description
fgUnspecifiedUnit
-1
FgMeter
FgKilometer
FgFoot
FgLink
FgChain
FgYard
FgNauticalMile
FgMile
FgRadian
100
FgDegree
101
FgGrad
102
FgArcMinute
103
FgArcSecond
104
3.5.11.18
ProjectionMethod
Constant
Value
Description
fgUndefinedProjection
fgNoProjection
fgLambertConfConic1SP
fgLambertConfConic2SP
fgMercator
Mercator.
fgCassiniSoldner
Cassini Soldner.
fgTransverseMercator
Transverse Mercator.
fgTransvMercatorSouthOriented
fgObliqueStereographic
Oblique Stereographic.
fgNewZealandMapGrid
fgHotineObliqueMercator
10
fgLabordeObliqueMercator
11
fgSwissObliqueCylindrical
12
fgObliqueMercator
13
Oblique Mercator.
fgUTMProjection
14
UTM Projection.
See 3.5.8.17.10 ProjMethod property and 3.5.8.17.13 SetProjection method of CoordinateSytem object.
164
AT260_DRG_E0
Forsk 2007
3.5.11.19
ProjParameterIndices
Constant
Value
Description
fgUTMZoneNumber
fgLongitudeOfOrigin
fgLatitudeOfOrigin
fgFalseEasting
False "easting".
fgFalseNorthing
False "northing".
fgScaleFactorAtOrigin
fgLatitudeOf1stParallel
fgAzimuthOfCentralLine
fgLatitudeOf2ndParallel
fgAngleFromRecttifiedToSkewedGrid
3.5.12
3.5.12.1
3.5.12.1.1
GEOPOINT Structure
GEOPOINT is the structure for a geographic position.
3.5.12.1.2
GEOSIZE Structure
GEOSIZE is the structure for a geographic size (e.g. pixel size).
3.5.12.1.3
xsize
ysize
GEORECT Structure
GEORECT is the structure for a geographic rectangle.
Forsk 2007
xmin
ymin
xmax
AT260_DRG_E0
165
3.5.12.1.4
GEOGRID Structure
GEOGRID is the structure for a grid of pixels.
resolution;
SIZE
size;
} GEOGRID;
A GEOGRID can be north oriented or south oriented.
Fields of the GEOGRID structure:
origin
For a north oriented grid, this is the south-west corner of the pixel at the south-west
corner of the grid. For a south oriented grid, this is the north-west corner of the pixel at the north-west corner of the grid.
resolution
The size of a pixel in geographic coordinates. For a north oriented grid, resolution.ysize is a positive number. For a south oriented grid, resolution.ysize is a negative number.
size
are positive numbers.
The size of the grid in pixels (number of columns, number of rows). size.cx and size.cy
For both cases, the geographic coordinates of the centre of pixel (i,j) are:
(origin.x + i * resolution.xsize + resolution.xsize / 2, origin.y + j * resolution.ysize + resolution.ysize / 2)
3.5.12.1.5
RASTERBUFFER Structure
RASTERBUFFER is a structure for describing a memory buffer that can contain raster data. It is similar to the BITMAP
format defined in WIN32.
height
scanline
Memory offset, in bytes, between pixel 0 of row i and pixel 0 of row i+1.
buffer
Note that scanline can be a negative number. In which case, row 0 of the buffer is at the end of the memory block.
3.5.12.2
Enumerations
typedef enum RasterDataType {fgUnsignedInteger = 0x100, fgInteger=0x200, fgReal=0x300, fgColor=0x400} RasterDataType;
typedef enum RasterType
{
fgUndefinedRasterType = 0,
fgUInt_1
= fgUnsignedInteger|1,
fgUInt_4
= fgUnsignedInteger|4,
fgUInt_8
= fgUnsignedInteger|8,
fgUInt_16 = fgUnsignedInteger|16,
fgUInt_32 = fgUnsignedInteger|32,
fgInt_8
= fgInteger|8,
fgInt_16
= fgInteger|16,
fgInt_32
= fgInteger|32,
fgReal_32 = fgReal|32,
fgReal_64 = fgReal|64,
166
AT260_DRG_E0
Forsk 2007
fgColor_24= fgColor|24
} RasterType;
cpp_quote("inline int NBits(RasterType t) {return int(t)&0xFF;}")
RasterType enumeration defines the types supported for a pixel in a raster. This is the combination of a data type
(unsigned integer, signed integer, real or colour value) and a size in bits.
Supported types are:
3.5.12.3
IGeoCoverage Interface
An object implementing IGeoCoverage defines a numeric valued function on a spatial domain. Its main feature is that it
can be rasterized, i.e. the values for each pixel of a GEOGRID can be retrieved in an efficient way. The underlying structure
is not necessarily raster data. It can be a set of raster data with multiple resolutions or a set of polygons with an associated
numeric attribute.
Methods in Vtable order:
3.5.12.3.1
IUnkown
Description
QueryInterface
AddRef
Release
IGeoCoverage
Description
get_DataType
get_NoDataValue
Returns the value used by this coverage as an indicator meaning no data available
at this location.
get_BoundingBox
Get_OptimalResolution
Rasterize
Fills a memory buffer with values defined at each pixel centre of a grid.
get_DataType Method
HRESULT get_DataType([out, retval]RasterType *pType);
Parameters
pType:
Return Values
E_POINTER, if pType is NULL.
S_OK means that the data type was successfully returned.
3.5.12.3.2
get_NoDataValue Method
HRESULT get_NoDataValue([in]WORD
*pBuff);
buffSize,
[out,
size_is(buffSize)]
BYTE
Parameters
buffSize:
pBuff:
Return Values
S_FALSE, if this coverage is defined everywhere in its bounding box. In this case no no data value is needed.
E_INVALIDARG, if the buffer is too small to contain the value.
E_POINTER, if pBuff is NULL.
S_OK means that a no data value was copied in the buffer.
Forsk 2007
AT260_DRG_E0
167
3.5.12.3.3
The buffer pBuff should be considered as a RASTEBUFFER with width=1, height=1 and scanline=buffSize.
For example, if the data type is fgUInt_1 (1 bit per pixel), the bit must be copied to the most significant bit of
the first byte pointed by pBuff.
get_BoundingBox Method
HRESULT get_BoundingBox([out]GEORECT *bounds);
Parameters
bounds:
Return Values
S_OK means that the limits were successfully copied to bounds.
Remark
This function will be called by Atoll at the start of the loading process. The object will not be loaded at all if the bounding
box does not intersect the area displayed on the screen.
3.5.12.3.4
get_OptimalResolution Method
HRESULT get_OptimalResolution([in]const GEORECT *area, [out, retval]GEOSIZE
*resolution);
Parameters
area:
resolution:
Return Values
S_FALSE, if there was a problem to get the optimal resolution
E_POINTER, if area or resolution is NULL.
S_OK means that the optimum resolution was provided
Notes:
3.5.12.3.5
Gets the best available resolution on area which must be included in the limits of the spatial domain
returned by get_BoundingBox().
An IGeoCoverage composed of several raster maps of different resolutions must return the value of the
highest resolution raster map intersecting the area.
An object implementing IGeoRaster must provide the same value as the member resolution provided by the
get_Grid function (cf. get_Grid below).
Rasterize Method
HRESULT
Rasterize([in]const
GEOGRID
*grid,
[in]DWORD
flags,
[in]
IProgressCallback2 *pgr, [in] const POINT *pDst, [in, out]RASTERBUFFER *pBuff);
Parameters
grid:
Defines the regularly spaced points from where coverage values are to be retrieved.
flags:
pgr:
An IProgressCallback2 that can be used to provide feedback to the user. This parameter is allowed to be NULL. In which case, no feedback should be provided to the user.
pDst:
Point in the buffer pBuff where the pixel (0, 0) of the grid should be copied.
pBuff:
Receives the requested values. This buffer can be bigger than the requested grid. In
this case pDst and size define the area of the buffer where values are actually copied.
Notes:
168
pBuff is passed as [in,out] parameter because it contains an in-part, the organization of memory (width,
height, scanline), and an out-part, the buffer.
AT260_DRG_E0
Forsk 2007
Return Values
E_ABORT, if the operation was cancelled by the user (see 2.3.3.8 IProgressCallback2 interface).
E_FAIL, if an error occurred.
E_NOTIMPL, if this function is not implemented. This return code is legal only if the object also supports the IGeoRaster
interface.
Any other error code than E_FAIL implies that the object should also support the ISupportsErrorInfo interface in order to
enable the caller to display an error message.
S_OK, if the values were successfully copied.
Notes:
The values requested are the coverage values at the pixel centre of the grid.
In order to facilitate the implementation of this function, the following assumptions are the responsibility of
the caller:
- All pixel centres of the grid must lie within the rectangle returned by get_BoundingBox.
- If the object supporting this interface also supports IGeoRaster, the requested grid must have the same
orientation and a lower resolution than the one returned by get_Grid (the caller should flip the buffer if
necessary).
- Although it is legal to return E_NOTIMPL when implementing IGeoRaster also, in most case this is not
optimal. This is because the caller has no knowledge of the internal representation of the data (tiling,
compression, presence of overviews etc).
Remark
This function will be called by Atoll if the resolution of the IGeoRaster happens to be higher (lower numeric value) than the
one requested by the map grid to draw. As the underlying representation of data is not known by Atoll, under-sampling
task is at first left to the object. If the object does not implement this, it should return E_NOTIMPL value. Atoll will then call
ReadDataBlock value in return to get high-resolution values and under-sample it itself. Otherwise, ReadDataBlock will not
be called. If the resolution of the IGeoRaster is lower (higher numeric value), then ReadDataBlock will be called and Atoll
will over-sample it itself.
3.5.12.4
IGeoRaster Interface
This interface defines the true raster data. As it is derived from IGeoCoverage, it can provide an efficient way to obtain a
sub-sampled matrix via the Rasterize function.
Objects implementing this interface and reading their data directly from disk will have to be registered under the new category CATID_AtollFileFormat. Objects implementing this interface will be created by add-ins.
Methods in Vtable order:
3.5.12.4.1
IUnknown
Description
QueryInterface
AddRef
Release
IGeoCoverage
Description
get_DataType
get_NoDataValue
Returns the value used by this coverage as an indicator meaning no data available
at this location.
Get_OptimalResolution
get_BoundingBox
Rasterize
Fills a memory buffer with values defined at each pixel centre of a grid.
IGeoRaster
Description
get_Grid
ReadDataBlock
get_Grid Method
HRESULT get_Grid([out] GEOGRID *pGrid);
Parameters
pGrid:
Forsk 2007
AT260_DRG_E0
169
Return Values
S_OK
Remark
This function will be called by Atoll only if the data really requires being drawn on the screen.
3.5.12.4.2
ReadDataBlock Method
HRESULT
ReadDataBlock([in]const
POINT
*pSrc,
IProgressCallback2 *pgr, [in] const POINT *pDst,
[in]const
SIZE
*pSize,
pgr:
An IProgressCallback2 that can be used to provide feedback to the user. This parameter is allowed to be NULL. In which case, no feedback should be provided to the user.
pDst:
Point in the buffer pBuff where the pixel (0, 0) of the block should be copied.
pBuff:
Receives the requested values. This buffer can be bigger than the requested block.
In this case pDst and size define the area of the buffer where values are actually copied.
Notes:
pBuff is passed as [in,out] parameter because it contains an in-part, the organization of memory (width,
height, scanline), and an out-part, the buffer.
Return Values
E_ABORT, if the operation was cancelled by the user (see 2.3.3.8 IProgressCallback2 interface).
E_FAIL, if an error occurred.
Any other error code than E_FAIL implies that the object should also support the ISupportsErrorInfo interface in order to
enable the caller to display an error message.
S_OK means that the values were successfully copied.
3.5.12.5
IColorTable Interface
Georeferenced images are an important subset of georeferenced rasters because they can be directly displayed on a map
without further interpretation.
An object supporting IGeoRaster is considered an image if either its data type is fgColor_24 (each pixel is an RGB value),
or its data type has less than 8 bits and it supports the IColorTable interface. The IColorTable interface provides a colour
interpretation for each pixel value.
Methods in Vtable order:
3.5.12.5.1
IUnknown
Description
QueryInterface
AddRef
Release
IGeoCoverage
Description
get_ColorCount
get_Colors
get_ColorCount Method
HRESULT get_ColorCount([out]LONG *pVal);
Parameters
pVal:
Receives the number of colours in the table. Colour tables always begin at pixel value
0, i.e. provide colour interpretation for pixel values in the range [0,*pVal[.
170
AT260_DRG_E0
Forsk 2007
Return Values
S_OK is the only legal Return Values for this function.
3.5.12.5.2
get_Colors Method
HRESULT get_Colors([in]LONG start, [in]LONG count, [out, size_is(count)]COLORREF *pColors);
Parameters
start:
count:
pColors:
Return Values
S_OK is the only legal Return Values for this function.
3.5.12.6
3.5.12.6.1
IActiveMapObject Method
An object implementing this interface will receive Windows events.
Methods in Vtable order:
3.5.12.6.2
IUnknown
Description
QueryInterface
AddRef
Release
IActiveMapObject
Description
QueryHitPoint
OnWindowMessage
QueryDataTip
QueryHitPoint Method
HRESULT QueryHitPoint([in]const GEOPOINT *pPoint, [in]DWORD flags, [in]IUnknown* pMap);
Parameters
pPoint:
flags:
pMap:
Return Values
S_FALSE, if the point is outside the object or over a transparent part.
E_NOTIMPL, if the object does not implement this function.
In this case Atoll will try any other mean to determine if the point is within the object. For example, if the object implements
IGeoRaster, Atoll will check that the point is inside the grid of the raster and that the pixel value at that point is not the
noDataValue of the raster.
S_OK means that the point is within an opaque part of the object.
3.5.12.6.3
OnWindowMessage Method
HRESULT OnWindowMessage([in] const MSG *msg [in]const GEOPOINT
[in]DWORD flags, [in]IUnknown* pMap, [out]LRESULT *plResult);
Forsk 2007
AT260_DRG_E0
*pPoint,
171
Parameters
msg:
pPoint:
The geographic position where the mouse cursor was when the event occurred. This
parameter is NULL if the event occurred in the Atoll Explorer window.
flags:
pMap:
plResult:
Pointer to result code for the window message as defined in the Windows API.
Return Values
S_OK means that the message was handled and no further processing is necessary.
S_FALSE, if the message was not handled. Let Atoll do the default processing.
Notes:
When the message is on a map window, Atoll calls QueryHitPoint with the coordinate of the mouse cursor.
OnWindowMessage is called only if QueryHitPoint returns S_OK
The following messages are dispatched to the object under the mouse cursor:
WM_MOUSEMOVE
WM_DEADCHAR
WM_SETCURSOR
WM_SYSKEYDOWN
WM_XBUTTONDOWNa
WM_SYSKEYUP
WM_XBUTTONUP
WM_SYSDEADCHAR
WM_XBUTTONDBLCLK
WM_HELP
WM_KEYDOWN
WM_CANCELMODE
WM_KEYUP
WM_CHAR
a.
3.5.12.6.4
QueryDataTip Method
HRESULT QueryDataTip([in]const GEOPOINT *pPoint, [in]DWORD flags, [in]IUnknown*
pMap, [out]LPOLESTR *ppszTip);
Parameters
pPoint:
flags:
pMap:
ppszTip:
The string to be displayed. This string must be allocated with CoTaskMemAlloc. The
caller is responsible to free it with CoTaskMemFree.
Return Values
S_FALSE, if there is no Tip displayable at this position
E_NOTIMPL, if the object does not implement this function.
S_OK means a string was returned in ppszTip.
3.5.12.7
IContextMenu Interface
The IContextMenu interface is called by Atoll to merge a shortcut menu associated with an Atoll Explorer window object.
Object
ContextMenu
172
IContextMenu functions
HRESULT GetCommandString(UINT_PTR idCmd, UINT
uFlags, UINT *pwReserved, LPSTR pszName, UINT
cchMax);
AT260_DRG_E0
Property (P)
Method (M)
M
Forsk 2007
3.5.12.7.1
HRESULT InvokeCommand(LPCMINVOKECOMMANDINFO
lpici);
GetCommandString Method
This method is reserved for future use.
Return Values
Should return E_NOTIMPL to show that it is not implemented.
3.5.12.7.2
QueryContextMenu Method
Adds commands to a shortcut menu.
HRESULT QueryContextMenu(HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags);
Parameters
hmenu:
Handle to the menu. The handler should specify this handle when adding menu items.
indexMenu:
idCmdFirst:
Minimum value that the handler can specify for a menu item identifier.
idCmdLast:
Maximum value that the handler can specify for a menu item identifier.
uFlags:
Return Values
If successful, returns an HRESULT value that has its severity value set to SEVERITY_SUCCESS and its code value set
to the offset of the largest command identifier that was assigned, plus one. For example, assume that idCmdFirst is set to
5 and you add three items to the menu with command identifiers of 5, 7, and 8. The Return Values should be
MAKE_HRESULT(SEVERITY_SUCCESS, 0, 8 - 5 + 1).
Otherwise, returns an OLE error value.
Remarks
This method should call either InsertMenu or InsertMenuItem to insert its menu items into the menu specified by hmenu.
The indexMenu parameter holds the index that should be used for the first menu item. The identifier of each menu item
must fall within the range defined by idCmdFirst and idCmdLast.
A common practice is to set the first command identifier to idCmdFirst (an offset of zero) and increment the offset for each
additional command by one. This practice ensures that you do not exceed idCmdLast and preserves the range of identifiers that are available for use by other handlers. Store the offsets for reference because they can be used to identify the
command in subsequent calls to IContextMenu::InvokeCommand.
3.5.12.7.3
InvokeCommand Method
Carries out the command associated with a shortcut menu item.
struct _CMInvokeCommandInfo {
DWORD cbSize;
DWORD fMask;
HWND hwnd;
Forsk 2007
AT260_DRG_E0
173
LPCSTR lpVerb;
LPCSTR lpParameters;
LPCSTR lpDirectory;
int nShow;
DWORD dwHotKey;
HANDLE hIcon;
} CMINVOKECOMMANDINFO,
*LPCMINVOKECOMMANDINFO;
Members:
cbSize:
fMask:
Not used.
hwnd:
Handle of the window to which the shortcut menu belongs. Can be used as the owner
of any message boxes or dialog boxes it displays.
lpVerb:
A 32-bit value containing the command being invoked, expressed as a menu-identifier
offset. Contains a menu-identifier offset of the command in the LOWORD, as expressed by MAKEINTRESOURCE(idOffset).
lpParameters:
Not used.
lpDirectory:
Not used.
nShow:
Not used.
dwHotKey:
Not used.
hIcon:
Not used.
Return Values
S_OK if the command was successfully invoked.
An appropriate error message if it was not successfully invoked.
3.5.12.8
Other Interfaces
In addition to the interfaces defined by the Atoll API, Atoll can also use the following standard COM interfaces:
1.
2.
ISpecifyPropertyPages: This interface is used by Atoll to display property pages associated with the object
IPersistStream: This interface is used by Atoll to serialize objects in Atoll Document files, without knowing the
semantics of these objects.
IPersistPropertyBag: This interface is used by Atoll to serialize objects in XML files (*.geo or *.cfg)
3.
Notes:
IPersistStream and ISpecifyPropertyPages are already documented for Propagation Models in the DRG.
They constitute an easy way to add property pages to items of the explorer and having the properties saved
in the .atl files and retrieved.
IPersistPropertyBag allows to save a "flat" view of some parameters, for example driver's parameters under
XML format.
3.6
Appendix
3.6.1
174
Column Name
Type
Description
TX_ID
char (50)
Transmitter name.
LOCKED
Boolean
VALID
Boolean
INVALID_CAUSE
Char(50)
SIZE
Integer
PATHNAME
Char(255)
PATHLOSS
IUnknown
SIGNAL
IUnknown
AT260_DRG_E0
Forsk 2007
LOWRES_PATHLOSS
IUnknown
LOWRES_SIGNAL
IUnknown
3.6.2
3.6.3
Type
Description
NAME
Char(50)
POINTS
Variant
CONTOUR_NUM
Real
POLYGON_NUM
Real
Forsk 2007
AT260_DRG_E0
175
176
AT260_DRG_E0
Forsk 2007
Chapter 4
Basic AFP API
This chapter describes the basic Atoll AFP API. The AFP API has been specifically designed for working with
Automatic Frequency Planning module in Atoll.
178
AT260_DRG_E0
Forsk 2007
4.1
Introduction
Since its inception and first implementation (2003), Forsks AFP API has evolved to meet new requirements and challenges. It consists of a basic and an extended interface. In order to fully understand the AFP API, it is recommended to
read and understand the AFP Reference Guide as a prerequisite. This will enable the reader to grasp the role of the AFP
in Atoll and the role of the different entities in the AFP API interface.
The user can start working with the AFP API with the knowledge of the basic interface only. The extended (advanced)
interface of the AFP API can be used if such a need arises. Atoll itself ensures compatibility between the developments
based on the basic AFP API.
Therefore, the AFP API wizard creates a basic AFP class (using only the basic AFP API). The advanced AFP API is
explained in the next chapter.
4.2
4.3
Basic Definitions
4.3.1
Resource Number
This is an integer used to specify a resource.
Resource numbers that can be dealt with in Atoll AFP correspond to:
The AFP is instructed by the user through the API to assign certain resource types. For each of these resource types, the
AFP can ask for the quantity of resources needed (Demand = n) and the domain (D) from which to choose. This means
that it should assign n resources out of D.
4.3.2
Resource Group
This is a group of resource numbers.
The most common example is the Frequency group.
4.3.3
Grouping Scheme
It corresponds to a list of resource groups. The union of this group of groups is the domain. A Grouping scheme is, therefore, a resource domain containing one ore more resource groups. A resource may belong to more than one group in the
grouping scheme (domain).
4.3.4
4.3.5
Forsk 2007
AT260_DRG_E0
179
4.3.5.1
Examples
4.3.5.1.1
4.3.5.1.2
4.4
The manner in which these grouping schemes are used depends on the assignment mode and the hopping mode of the
TRG. The grouping scheme of each TRG supplies domain constraints, which, obviously, differ according to different
RESOURCE_TYPEs. The domain is always the union of all groups in the grouping scheme.
When the hopping mode of the TRG is set to SFH, the IAssignmentPlan interface assigns resources, which are group
numbers of the IAssignmentPlan.GetMALScheme() and not ARFCNs. The AFP is supposed to have created these groups
before assigning them.
If the TRG assignment mode is GROUP_CONSTRAINT and hopping mode is SFH, then the AFP must try to assign groups
according to the groups in the TRG grouping scheme.
If the TRG assignment mode is GROUP_CONSTRAINT and hopping mode is not SFH then the AFP must try to assign all
ARFCNs form a single group of the TRG grouping scheme.
4.5
Data Exchange
4.5.1
180
AT260_DRG_E0
Forsk 2007
Implemented in Atoll
XIAfpNetworkData
XIAfpModel
XIPlanGenerator
XIAssignmentPlan
XIAFPConfigure (Optional)
XIRW_AssignmentPlan
XIDynamicGroupingScheme
XITrg
XIGroupingScheme
XIFrequencyBand
X(IQualityModel)
XIRadioTransmitter2
XItrgSeparations
XIInterfMatrix
XIAFPProgress
4.5.2
4.5.2.1
IAfpNetworkData Interface
This interface bundles together all AFP relevant network information. The network information of each TRG (number of
channels, hopping mode, etc.) is packed together through the ITrg interface. The IAfpNetwork gives an array-like access
to all the ITrg instances of the network. In addition, it delivers two other interfaces, ItrgSeparation and IIInterfMatrix. ITrgSeparation handles the separation requirements between TRGs and the current assignment plan, while IIInterfMatrix gives
access to interference information.
4.5.2.2
IAssignmentPlan Interface
Read access to a Frequency, HSN, MAIO or BSIC plan. A plan is a match of resources to TRXs in a TRG.
4.5.2.3
IRW_AssignmentPlan:IAssignmentPlan Interface
Read and write access to a Frequency, HSN, MAIO or BSIC plan.
4.5.2.4
IGroupingScheme Interface
Read access to groups of resources (RGs) and to groups of RGs (lists of groups of resources).
4.5.2.5
IDynamicGroupingScheme:IGroupingScheme Interface
Read/Write access to groups of resources (RGs) and to groups of RGs.
4.5.2.6
ITrg Interface
Access to TRG and TRX properties.
4.5.2.7
IFrequencyBand Interface
Some AFP related parameters that can vary from one frequency band to another or from one TDMA technology to another.
4.5.2.8
ITrgSeparations Interface
Gives access to the separation constraints due to various reasons (co-site, co-cell, interference, ).
4.5.2.9
IInterfMatrix Interface
Provides access to Atoll interference calculations. It supports the simple interference models, where one or two numbers
weigh the interference between two TRGs. Moreover, it supports more complex interference models by providing access
to a cumulative density function of interference probabilities between pairs of TRGs.
Forsk 2007
AT260_DRG_E0
181
4.5.2.10
IAFPProgress Interface
Provides the AFP a means to report messages and check whether it has permission to continue its execution. IAFPProgress must not be used if the AFP opens a dialog of its own. AFP can choose to display messages in a simple manner
or to put information warnings and errors in Atolls event observer.
4.5.3
4.5.3.1
IAfpModel Interface
Generates an IPlanGenerator instance. Each instance can be paused and reactivated while keeping internal state data.
4.5.3.2
IPlanGenerator Interface
Looks for a good frequency plan.
4.5.3.3
4.6
Reference Guide
4.6.1
4.6.1.1
ALLOCATION_TYPE
a.
4.6.1.2
4.6.1.3
182
Constant
Value
Description
CHANNEL_ALLOC
0x1
Channels.
HSN_ALLOC
0x2
MAIO_ALLOC
0x8
BSIC_ALLOC
0x10
MAL_ALLOCa
0x20
CODE_ALLOC
0x40
Not used.
Value
Description
QUALITY_TARGET
0x1
COMPUTE_SEPARATION
0x2
OPTIMIZE_INTEREFERENCE
0x4
Minimize interference.
ADVANCED_CI_ESTIMATION
0x8
Description
RESOURCE_TYPE
Constant
Value
CHANNEL_TYPE
HSN_TYPE
MAIO_TYPE
BSIC_TYPE
CODE_TYPE
AT260_DRG_E0
Not used.
Forsk 2007
4.6.1.4
ASSIGNMENT_MODE
a.
4.6.1.5
4.6.1.5.1
Constant
Value
Description
FREE_ASSIGNENTa
GROUP_ASSIGNENT4
ASSIGNMENT_STATE
Constant
Value
Description
TO_ASSIGN
0x1
FROZEN
0x2
MODIFIED
0x4
CREATED
0x8
Let F(i) define a TRG i "Frozen for AFP". F(i) = True, if and only if:
TRG i is inside a cell whose Channel and MAIO are frozen at cell level.
TRG i belongs to a TRX type that was frozen by the AFP launch wizard.
Case
Current Approach
Previous Approach
(Atoll 2.4.1 and earlier)
TO_ASSIGN | FROZEN
FROZEN
TO_ASSIGN
TO_ASSIGN
FROZEN
FROZEN
FROZEN
FROZEN
In the case of other resource types, or in the case of (trxNumber != -1), F(i) changes but S(i) remains the same. Thus the
above table remains the same too.
4.6.1.6
4.6.1.7
Forsk 2007
HOPPING_MODE
Constant
Value
Description
NONE_FH
No Frequency Hopping.
BFH
SFH
Constant
Value
Description
COSITE
0x1
AFP_RELATION_TYPE
COCELL
0x2
NEIGHBOUR
0x4
SYNCHRO
0x8
AT260_DRG_E0
183
4.6.1.8
0x10
4.6.1.9
Constant
Value
Description
CI
Interference.
RBER
FER
BLER
MOS
USER_DEFINED
User defined.
AFP_BASE_CONFIG
Structure containing default configuration information.
Members
Type
Description
duration
long
options
int
allocType
int
Mask of ALLOC_TYPE.
keepPrev
boolean
keepFrozen
boolean
quickEvaluation
boolean
seed
int
4.6.2
4.6.2.1
IAfpNetworkData Interface
This interface bundles together all AFP relevant network information. The network information of each TRG (number of
channels, hopping mode, etc.) is packed together through the ITrg Interface. The IAfpNetworkData gives an array-like
access to all the ITrg instances of the network. In addition it delivers the separation access and the interference access
interfaces.
4.6.2.1.1
IAfpNetworkData::GetTRGCount Method
Returns the number of TRX groups (TRG).
HRESULT
Parameters
count:
Number of TRGs.
Return Values
S_OK. (count NULL is not supported)
4.6.2.1.2
IAfpNetworkData::GetFirstTRG Method
Returns the index of the first TRG of the transmitter.
HRESULT
Parameters
t:
firstTRGIndex:
Return Values
E_POINTER, if t or firstTrgIndex is NULL.
S_OK, if there is a TRG for the transmitter in the array,
Else S_FALSE.
184
AT260_DRG_E0
Forsk 2007
4.6.2.1.3
IAfpNetworkData::GetTRG Method
Returns the TRG interface for one TRX group. TRGs are sorted by site and sector.
HRESULT
Parameters
index:
trg:
Return Values
E_POINTER, if trg is NULL.
S_OK, if index corresponds to a TRG in the array,
Else S_INVALIDARG.
4.6.2.1.4
IAfpNetworkData::GetSeparations Method
Provides access to separations between TRG.
HRESULT
Parameters
res:
sep:
Return Values
S_OK.
E_POINTER, if sep is NULL.
res is currently not used, CHANNEL_TYPE is assumed.
4.6.2.1.5
IAfpNetworkData::GetCurrentPlan Method
Provides the current plan.
HRESULT
Parameters
plan:
Return Values
S_OK.
E_POINTER, if plan is NULL.
4.6.2.2
IAssignmentPlan Interface
Through this Interface, the AFP can access a frequency plan, a MAIO plan, an HSN plan, a BSIC plan or a scrambling
code plan. The RESOURCE_TYPE enum determines the type of plan being accessed.
An assignment plan matches resources to TRGs or TRXs. A TRX is identified by its TRG and by its TRX-Number in the
TRG. The TRX-Number is an id-space that can help the user in identifying TRXs. A TRX may have a special assignment
state (Frozen), a frequency or a list of frequencies, a MAIO etc. Different IAssignmentPlan instances can hold different
assigned values for the same TRX (Its assignment state, Frozen or not, is supplied by the ITrg interface and does not
change).
Notes:
4.6.2.2.1
The AFP will hold a few IAssignmentPlan interfaces, one for the existing plan, one for the best and a few
others (if exist). All the IAssignmentPlan interfaces are obtained from each other by the GetClone()
function, which supplies a virtual editable copy. This is the AFP output in the end.
IAssignmentPlan::GetResource Method
Provides access to a resource number at TRX or TRG level.
HRESULT GetResource([in] RESOURCE_TYPE type,[in] int trgIndx,[in] int trxNumber, [out] int *res);
Forsk 2007
AT260_DRG_E0
185
Parameters
type:
Resource type.
trgIndx:
trxNumber:
level.
res:
Return Values
E_POINTER, if res is NULL.
S_OK, if res is not 1,
Else S_FALSE.
Remarks
If the Hopping mode of the TRG is SFH and the resource type is FREQUENCY_TYPE then res is the group number of the
MAL Grouping Scheme (see 4.6.2.2.7 IAssignmentPlan.GetMalScheme()). In all other cases, res is the resource number
(ARFCN, HSN, MAIO, BSIC, etc.).
4.6.2.2.2
IAssignmentPlan::GetTrxCount Method
Provides access to the TRX count of a TRG.
trxCount:
Return Values
E_POINTER, if trxCount is NULL.
S_OK or E_INVALIDARG, if trgIndx is past the end of the array or is < 0.
4.6.2.2.3
IAssignmentPlan::GetTrxNumber Method
Provides access to the TRX number of a TRX from its index.
trxIndx:
trxNumber:
Return Values
E_POINTER, if trxNumber is NULL.
S_OK or E_INVALIDARG, if trgIndx is past the end of the array or is < 0.
E_FAIL, if *trxNumber < 0.
4.6.2.2.4
IAssignmentPlan::GetTrxIndex Method
Provides access to the TRX index of a TRX from its number.
HRESULT GetTrxIndex([in]
Parameters
trgIndx:
trxNumber:
trxIndx:
Return Values
E_POINTER, if trxIndx is NULL.
S_OK or E_ INVALIDARG, if trgIndx is past the end of the array or is < 0.
186
AT260_DRG_E0
Forsk 2007
4.6.2.2.5
IAssignmentPlan::GetTrxNumbers Method
Provides access in a single step to all the TRX numbers of a TRX from the index of the TRG.
count:
trxNumbers:
Return Values
E_POINTER, if trxNumbers is NULL.
S_OK or S_FALSE, if one of the TRX numbers is 1.
4.6.2.2.6
IAssignmentPlan::CreateClone Method
Creates a read/write clone based on the current assignment plan.
Return Values
S_OK.
E_POINTER, if clone is NULL.
4.6.2.2.7
IAssignmentPlan::GetMALScheme Method
Returns a dynamic grouping scheme. You must create new groups in this scheme and fill them up with frequencies. You
can then assign these groups to the SFH TRXs.
Return Values
S_OK.
E_POINTER, if scheme is NULL.
4.6.2.2.8
IAssignmentPlan::GetAssignmentState Method
Gets assignment state of TRG or TRX.
int
trgIndx, [in]
Parameters
type:
trgIndx:
trxNumber:
at TRG level.
The number of the requested TRX in the TRG. If trxNumber is 1, the request is done
state:
Notes:
See section 4.6.1.5.1 for more details on the TO_ASSIGN and FROZEN assignment states.
Return Values
S_OK.
Forsk 2007
AT260_DRG_E0
187
4.6.2.3
IRW_AssignmentPlan:IAssignmentPlan Interface
Read and write access to a Frequency, HSN, MAIO or BSIC plan. By inheriting from IAssignmentPlan it already includes
all read access. Next sections describe the additional write abilities:
4.6.2.3.1
IRW_AssignmentPlan::AddTrxs Method
Adds new TRX numbers to a TRG.
HRESULT AddTrxs([in] int trgIndx, [in] short newTrxCount, [out, size_is(newTrxCount)] int* newTrxNumbers);
Parameters
trgIndx:
newTrxCount:
newTrxNumbers:
Return Values
S_OK.
E_POINTER, if newTrxNumber is NULL.
E_INVALIDARG, in case trgIndx is incorrect.
(newTrxNumber is supposed to be allocated at newTrxCount)
4.6.2.3.2
IRW_AssignmentPlan::RemoveTrx Method
Removes a TRX from a TRG by its number.
trxNumber:
Return Values
S_OK.
E_INVALIDARG, in case trgIndx is incorrect.
4.6.2.3.3
IRW_AssignmentPlan::SetResource Method
Writes a resource number.
trx-
Parameters
type:
Resource type.
trgIndx:
trxNumber:
res:
Resource value.
Return Values
S_OK.
E_INVALIDARG, in case trgIndx is incorrect.
4.6.2.4
IGroupingScheme Interface
This interface provides read access to groups of resources (RGs) and groups of RGs. Two ID spaces are treated by this
interface: The group Ids, which span a set of groups and the resource Ids, which span a set of resources in a group.
The resources themselves are just simple numbers, which can stand for channel numbers, HSNs, MAIOs or others.
4.6.2.4.1
IGroupingScheme::GetGroupingSchemeID Method
Gets the unique identifier of a grouping scheme.
188
AT260_DRG_E0
Forsk 2007
Return Values
S_OK.
E_POINTER, if id is NULL.
4.6.2.4.2
IGroupingScheme::GetGroupCount Method
Gets the number of groups composing the scheme.
Return Values
S_OK.
(count = NULL is not supported)
4.6.2.4.3
IGroupingScheme::GetGroupSize Method
Gets the size of a group in the grouping scheme.
int grpIndx,
// index of group
size:
Return Values
S_OK or E_INVALIDARG.
(size = NULL is not supported)
4.6.2.4.4
IGroupingScheme::GetResourceNumbers Method
Gets the resource numbers of a group in the grouping scheme.
HRESULT
GetResourceNumbers([in]
[out,size_is(count)] int *numbers);
int
grpIndx,
[in]
int
count,
Parameters
grpIndx:
count:
numbers:
Return Values
S_OK or E_INVALIDARG.
(numbers = NULL is not supported)
Checks that count is exactly the group size.
4.6.2.4.5
IGroupingScheme::Contains Method
Searches whether a given number belongs to a given group.
HRESULT Contains([in]
int r);
Parameters
Forsk 2007
grpIndx:
r:
189
Return Values
S_OK, if the resource belongs to the group, otherwise S_FALSE.
E_INVALIDARG, if grpIndx is incorrect.
4.6.2.5
4.6.2.5.1
IDynamicGroupingScheme::AddGrp Method
Creates a new group in the dynamic grouping scheme.
grpIndx:
Return Values
S_OK.
(grpIndx = NULL is not supported)
4.6.2.5.2
IDynamicGroupingScheme::SetGrp Method
Sets the elements of a group in the dynamic grouping scheme.
HRESULT SetGrp([in] int grpIndx, [in] int grpSz, [in, size_is(grpSz)] int *numbers);
Parameters
grpIndx:
grpSz:
numbers:
Return Values
S_OK.
E_INVALIDARG,if there is a problem with grpIndx or grpSz.
(numbers = NULL is not supported)
4.6.2.5.3
IDynamicGroupingScheme::DeleteGrp Method
Deletes a group from the dynamic grouping scheme.
Return Values
S_OK.
E_INVALIDARG, if there is a problem with grpIndx.
Caution:
4.6.2.6
AFP model must delete groups that are no longer assigned in RW_IAssignmentPlan clone to free memory.
ITrg Interface
Provides access to TRG and TRX properties.
4.6.2.6.1
ITrg::GetIndx Method
Gets the index of the TRG (TRX-group) in the IAfPNetworkData.
190
AT260_DRG_E0
Forsk 2007
Parameters
indx:
Return Values
S_OK.
(indx = NULL is not supported)
4.6.2.6.2
ITrg::GetTrxType Method
Gets the TRX type of the TRG. By extension, this type is also called the TRG type.
Return Values
S_OK.
(trxType = NULL is not supported)
4.6.2.6.3
ITrg::ContainsBroadcastChannel Method
Gets the TRX type of the TRG. By extension, this type is also called the TRG type.
HRESULT ContainsBroadcastChannel();
Parameters
None.
Return Values
S_OK, if the TRG contains a (the) broadcast channel,
Else S_FALSE.
4.6.2.6.4
ITrg::GetGroupingScheme Method
Gets the grouping scheme of a given resource type.
Parameters
type:
gs:
Return Values
E_POINTER, if gs is NULL.
S_OK, if the resource type is supported,
Else E_INVALIDARG.
Currently, the only supported resource types are HSN_TYPE, BSIC_TYPE and CHANNEL_TYPE.
4.6.2.6.5
ITrg::GetFrequencyBand Method
Gets the frequency band of the TRG.
Return Values
S_OK.
E_POINTER, if fb is NULL.
Forsk 2007
AT260_DRG_E0
191
4.6.2.6.6
ITrg::GetDemand Method
Gets the demand relative to the resource type.
Parameters
type:
Resource type.
demand:
Return Values
S_OK, for supported types.
E_POINTER, if demand is NULL.
Currently, supported types are HSN_TYPE, BSIC_TYPE, CHANNEL_TYPE and MAIO type.
4.6.2.6.7
ITrg::GetTrafficLoad Method
Gets the traffic load of a TRG. It is the number of Erlangs per Time Slot. In the future versions, it will incorporate data and
signalisation traffic as well but will still be defined in units parallel to Erlangs per Time Slot.
Traffic load.
Return Values
S_OK.
E_POINTER, if traffic is NULL.
4.6.2.6.8
ITrg::GetDLTimeSlotUseRatio Method
Gets the downlink time slot's exploitation ratio, which inludes the effect of DTX.
Return Values
S_OK.
(tsExp = NULL is not supported)
Remarks
When DTX or AMR-HR are used, the downlink part of the communication does not always use 100% of the bursts in its
time slot. The averaging refers to the different communications in the TRG. Typical values are:
4.6.2.6.9
ITrg::GetCostWeightingFactor Method
Gets the cost of the weighting factor.
Return Values
S_OK.
(factor = NULL is not supported)
4.6.2.6.10
ITrg::GetHoppingMode Method
Gets the frequency hopping mode of the TRG.
192
AT260_DRG_E0
Forsk 2007
Return Values
S_OK.
E_POINTER, if mode is NULL.
4.6.2.6.11
ITrg::GetAssignmentMode Method
Gets the assignment mode of the TRG.
Assignment mode.
Return Values
S_OK.
E_POINTER, if mode is NULL.
4.6.2.6.12
ITrg::GetMALSize Method
Gets the maximum permitted MAL size (relevant only in case of SFH).
Return Values
S_OK.
E_POINTER, if sz is NULL.
4.6.2.6.13
ITrg::IsInRelation Method
Evaluates a type of relation between the current TRG and another one.
trgIndx:
Index of the TRGs with which the relation with the current TRG must be evaluated.
Return Values
S_OK, if the TRG fulfils the supported tested relation,
Else S_FALSE.
E_FAIL, for an unsupported relation type.
Currently, the only supported AFP_RELATION_TYPE for this method are COCELL, COSITE, NEIGHBOUR and
SYNCHRO.
4.6.2.6.14
ITrg::GetTrgRelationCount Method
Counts a type of relation between the current TRG and others.
Forsk 2007
type:
count:
AT260_DRG_E0
193
Return Values
E_POINTER, if count is NULL.
S_OK, if type is a supported relation type.
E_FAIL, for an unsupported relation type.
Currently, the only supported AFP_RELATION_TYPE for this method are COCELL, COSITE, NEIGHBOUR and
SYNCHRO.
4.6.2.6.15
ITrg::GetTrgRelation Method
Gets the TRG indexes of the TRG having a relation of a certain type with the current TRG.
count:
trgIndexes:
Indexes of the TRGs having this type of relation with the current one.
Return Values
E_POINTER, if trgIndexes is NULL.
S_OK, if type is a supported relation type.
E_FAIL, for an unsupported relation type.
Currently, the only supported AFP_RELATION_TYPE for this method are COCELL, COSITE, NEIGHBOUR and
SYNCHRO.
4.6.2.6.16
ITrg::GetTransmitter Method
Gets the transmitter to which belong the TRG.
Transmitter.
Return Values
S_OK.
E_POINTER, if tr is NULL.
4.6.2.6.17
ITrg::GetQualityThreshold Method
Gets the quality characteristics, i.e. metric and threshold.
qmin:
Minimum quality threshold. Its actual value and unit depend on the metric.
Return Values
S_OK.
E_POINTER, if metric or qmin is NULL.
Currently, the only supported metric is CI (metric parameter is not used at all) and qmin is a CI threshold in dB.
4.6.2.6.18
ITrg::GetProbabilityThreshold Method
Gets the value of minProba. Quality at this TRG is acceptable if and only if the probability that a communication has acceptable quality (as defined above) is greater than minProba.
194
AT260_DRG_E0
Forsk 2007
Return Values
S_OK.
E_POINTER, if minProba is NULL.
4.6.2.7
IFrequencyBand Interface
Models the frequency bands at the AFP level.
4.6.2.7.1
IFrequencyBand::GetMultiPlexingFactor Method
Gets the number of time slots on a physical carrier.
Number of time slots on a physical carrier (e.g. 8 for GSM, 3 for some other TDMA
Return Values
S_OK.
E_POINTER, if factor is NULL.
4.6.2.7.2
IFrequencyBand::GetCoherenceBandWidth Method
Gets coherence bandwidth (in channels).
Return Values
S_OK.
E_POINTER, if widthInChannels is NULL.
4.6.2.7.3
IFrequencyBand::GetAdjascentSuppression6 Method
Gets the adjacent suppression level for the nth adjacency level.
Adjacency level.
asupp:
Return Values
E_POINTER, if asupp is NULL.
S_OK, if asked for a supported level,
Else E_NOTIMPL.
Currently, levels 0, 1 and 2 are supported.
4.6.2.8
ITrgSeparations Interface
Gives access to the separation constraints due to various reasons (co-site, co-cell, interference, ).
4.6.2.8.1
ITrgSeparations::GetSeparation Method
Gets matrix-like access to separation relations.
HRESULT GetSeparation( [in] int type, [in] int trg1, [in] int trg2, [out] int*
sep);
6.
Forsk 2007
195
Parameters
type:
trg1:
trg2:
sep:
in type.
Maximum values of all the separations caused by the relation types asked for together
Return Values
S_OK.
E_POINTER, if sep is NULL.
E_FAIL, if there was a problem while loading the separations table.
4.6.2.8.2
ITrgSeparations::GetDefaultSeparation Method
No longer supported.
Gets optimized access to separation relations.
Parameters
type:
trg:
Index of TRG.
sep:
in type.
Maximum values of all the separations cause by the relation types asked for together
Return Values
E_POINTER, if sep is NULL.
S_OK, for the supported types.
E_FAIL, if there was a problem while loading the separations table.
E_NOTIMPL, for others.
Currently, the supported types are COSITE, COCELL, NEIGHBOUR and SPECIAL. Combination of types is not
supported. Pass a simple AFP_RELATION_TYPE instead.
4.6.2.8.3
ITrgSeparations::GetRelationsCount Method
Gets count of separation relations of a TRG.
HRESULT GetRelationsCount( [in] int type, [in] int trg, [out] int* count);
Parameters
type:
trg:
Index of TRG.
count:
Return Values
S_OK.
E_POINTER, if count is NULL.
E_FAIL, if there was a problem while loading the separations table.
4.6.2.8.4
ITrgSeparations::GetRelation Method
Gets a specific relation.
HRESULT GetRelation( [in] int type, [in] int trg1, [in] int indx, [out] int*
trg2, [out] int* sep);
Parameters
196
type:
trg1:
Index of TRG.
indx:
Index of the relation among all the relations defined for this TRG.
trg2:
Forsk 2007
Return Values
S_OK.
E_POINTER, if trg2 or sep is NULL.
E_FAIL, if there was a problem while loading the separations table.
4.6.2.9
IInterfMatrix Interface
Provides access to Atoll interference calculations and supports the simple interference models where one or two numbers
weigh the interference between two TRGs. Furthermore, it supports more complex interference models through providing
access to a cumulative density function of interference probabilities between pairs of TRGs.
4.6.2.9.1
IInterfMatrix::GetHistogramSize Method
Gets the histogram size for a given TRG.
nThresh:
Return Values
S_OK.
E_POINTER, if nThresh is NULL.
4.6.2.9.2
IInterfMatrix::GetInterferingHistogram Method
Gets the histogram values for a TRG couple (victim, interferer).
HRESULT GetInterferingHistogram( [in] int trgv, [in] int trgi, [in] int maxCount, [out] int*
count, [out, size_is(maxCount)] float* thresholds, [out,
size_is(maxCount)] float* probas);
Parameters
trgv:
trgi:
maxCount:
count:
thresholds:
probas:
For the ith C/I value, probas[i] is the ratio of traffic below this value. More precisely,
probas[i] is the amount of traffic having better C/I conditions than thresholds[i] divided by total traffic.
Return Values
E_POINTER, if count or thresholds or probas is NULL.
S_OK.
S_FALSE, if trgv and trgi have the same value or (*count) > maxCount.
4.6.2.9.3
IInterfMatrix::GetInterferingProbability Method
Gets the interfering probability for a TRG couple (victim, interferer) and a given C/I threshold.
HRESULT GetInterferingProbability( [in] int trgv, [in] int trgi, [in] float
CI_threshold, [out] float* proba);
Parameters
Forsk 2007
trgv:
trgi:
threshold:
proba:
AT260_DRG_E0
197
Return Values
S_OK.
E_POINTER, if proba is NULL.
4.6.2.9.4
IInterfMatrix::GetInterfererCount Method
Counts the interferer TRGs of a victim TRG.
count:
Return Values
S_OK.
E_POINTER, if count is NULL.
4.6.2.9.5
IInterfMatrix::GetInterferers Method
Gets the interferer TRGs of a victim TRG.
count:
trgi:
Return Values
S_OK.
S_FALSE, if count is different from the actual count of interferers.
E_POINTER, if trgi is NULL.
4.6.2.9.6
IInterfMatrix::GetVictimCount Method
Counts the victim TRGs of an interfering TRG.
count:
Return Values
S_OK.
E_POINTER, if count is NULL.
4.6.2.9.7
IInterfMatrix::GetVictims Method
Gets the victims TRGs of an interfering TRG.
HRESULT GetVictims ( [in] int trgi, [in] int count, [out,size_is(count)] int*
trgv);
Parameters
trgi:
count:
trgv:
Return Values
S_OK.
198
AT260_DRG_E0
Forsk 2007
4.6.2.9.8
IInterfMatrix::GetInterfererHistogram Method
Get the TRG interfering histogram of a victim TRG.
HRESULT GetInterfererHistogram( [in] int trgv, [in] int indx, [out] int* trgi,
[in] int maxCount, [out] int* count, [out, size_is(maxCount)] float* thresholds, [out, size_is(maxCount)] float* probas);
Parameters
trgv:
index:
trgi:
maxCount:
count:
thresholds:
probas:
For the ith C/I value, probas[i] is the ratio of traffic below this value. More precisely,
probas[i] is the amount of traffic having better C/I conditions than thresholds[i] divided by total traffic.
Return Values
S_OK.
S_FALSE, if trgv and trgi have the same value or (*count) > maxCount.
E_POINTER, if trgi or count or thresholds or probas is NULL.
4.6.2.10
IAFPProgress Interface
Provides the AFP model with a default means to report messages and check whether it has permission to continue its
execution. IAFPProgress cyclic reporting is not mandatory if the AFP opens a dialog of its own.
4.6.2.10.1
IAFPProgress::StartProgressReport Method
Opens default progress report dialog.
Return Values
S_OK.
4.6.2.10.2
IAFPProgress::OnProgress Method
It is to be called periodically. If it returns S_FALSE, the AFP had been stopped by the user. In addition, it is used to report
the soft constraints cost (usually Interferences) and the number of broken hard constraints (usually separations), which
were violated by the current best assignment.
sepBreak:
Return Values
S_OK, if the user did not interrupt the task,
S_FALSE otherwise.
4.6.2.10.3
IAFPProgress::Display Method
Appends the status string to the status message in the progress dialog.
Forsk 2007
status);
AT260_DRG_E0
199
Parameters
status:
String to add.
Return Values
S_OK.
4.6.2.10.4
IAFPProgress::DisplayLogInfo Method
Creates a new information entry in Atoll's events observer and appends it to the status message as well.
HRESULT DisplayLogInfo(LPCWSTR
infoMsg);
Parameters
infoMsg:
String to add.
Return Values
S_OK.
4.6.2.10.5
IAFPProgress::DisplayLogWarning Method
Creates a new warning entry in Atoll's events observer and appends it to the status message as well.
HRESULT DisplayLogWarning(LPCWSTR
warnMsg);
Parameters
warnMsg:
String to add.
Return Values
S_OK.
4.6.2.10.6
IAFPProgress::DisplayLogError Method
Creates a new error entry in Atoll's events observer and appends it to the status message as well.
HRESULT DisplayLogError(LPCWSTR
errMsg);
Parameters
errMsg:
String to add.
Return Values
S_OK.
4.6.3
4.6.3.1
IAfpModel Interface
This interface provides with a IPlanGenerator instance, generally result of an assignment.
4.6.3.1.1
IAfpModel::GetPlanGenerator Method
Returns the IPlanGenerator instance.
Pointer to a IPlanGenerator
Return Values
S_OK.
(planGenerator = NULL is not supported)
4.6.3.2
IPlanGenerator Interface
The actual implementation of the AFP model.
200
AT260_DRG_E0
Forsk 2007
4.6.3.2.1
IPlanGenerator::Run Method
Runs the AFP model to generate a new plan.
iMatrix:
progress:
config:
Configuration.
result:
Return Values
S_OK.
E_FAIL in case of problem.
(No parameter can be NULL)
4.6.3.2.2
IPlanGenerator::Improve Method
Improves a previous plan to generate a new plan.
HRESULT Improve ( [in] IAfpNetworkData* netWorkData, [in] IInterfMatrix*iMatrix, [in] IAfpProgress*progress, [in] AFP_BASE_CONFIG* config, [in] IAssignmentPlan* previous, [out] IRW_AssignmentPlan** result);
Parameters
netWorkData:
iMatrix:
progress:
config:
Configuration.
previous:
Previous plan.
result:
Return Values
S_OK.
E_FAIL in case of problem.
(No parameter can be NULL)
4.6.3.3
IAfpConfigure Interface
If the AFP does not implement IAFPConfigure, it will be provided with an AFP_BASE_CONFIG structure containing default
configuration information. By using the COM mechanism of query interface, Atoll will know whether the AFP component
implements IAFPConfigure or not. If it does, Atoll will call the function IAFPConfigure::Configure(wind) which permits the
AFP component to present its own configuration dialog in the window pointed to by wind (Atoll provides this entry window
to the AFP so that the AFP will present its dialogue within Atoll).
4.6.3.3.1
IAfpConfigure::Configure Method
The model may manage a specific configuration dialog inside Atoll.
HWND of the parent to which the model must relate its config dialog(s).
Return Values
S_OK.
Forsk 2007
AT260_DRG_E0
201
4.7
4.7.1
netWorkData,
IInterfMatrix*
iMatrix,
// interfering probabilities
IAFPProgress*
progress,
AFP_CONFIG*
config,
// from configuration
IRW_AssignmentPlan** result)
// result of assignment
{
// Check config to know what to do
//-------------------------------if((config->allocationType&CHANNEL_ALLOC) != config->allocationType )
return E_FAIL;
202
AT260_DRG_E0
Forsk 2007
// manual cleanup
return res;
}
// -------------------------------------------------------------------------// In this example, functions in italic (tryANewAssignment, MyStatisfaction
// Criteria) are assumed to be functions of MyAFP
Optionally, the AFP can provide its own configuration dialog in order to select specific parameters, before the call for the
method Calculate. To do that, it just has to implement IAFPConfigure interface:
// configuration is required
HRESULT Configure(
}
If Atoll detects that this interface is supported (with standard COM QueryInterface method of IUnknown interface), it will
then enable a configuration button in the Atoll GUI and will call the Configure method when the button is pressed. The
parent window parameter is the window in which AFP can open its dialog.
4.7.2
// add to collection
}
return S_OK;
}
Notes:
Forsk 2007
See section 4.6.1.5.1 for more details on the TO_ASSIGN and FROZEN assignment states.
AT260_DRG_E0
203
4.7.3
Access to TRGs
TRGs can be accessed by a contiguous index between 0 and the total number of TRX goups provided by the function
GetTrgCount of IAfpNetworkData interface.
TRGs are sorted by sites and by cell. Functions GetRelationCount and GetRelations provide access to TRGs indices
related to a given one.
new int[nbCoCellTrgs];
p_trg->GetRelations(CO_CELL, nbCoCellTrgs,coCellTrgs);
float cost = IndividualTrgCost(trg);
cost+= IndividualTrgCost(coCellTrgs[t]);
// Clean up
// --------delete coCellTrgs;
p_trg->Release();
return cost;
}
// Remarks -----------------------------------------------------------------// function IndividualTrgCost, in this example, is assumed to be provided by AFP
4.7.4
204
AT260_DRG_E0
Forsk 2007
4.7.5
// Example: this function finds the first resource group (frequency group here)
// index containing a given channel for a given TRG
// if the channel is found, the faction returns TRUE, FALSE otherwise
// -------------------------------------------------------------------------BOOL GetFrequencyGroupIndx(IAfpNetworkData
*groupIndx)
*net,
int
trg,int
channel,int
{
// Getting the scheme
// ------------------ITrg *p_trg;
IgroupingScheme *p_scheme;
net->GetTrg(trg, &p_trg);
P_trg->GetScheme(CHANNEL_TYPE,&p_scheme);
// Scanning groups
Forsk 2007
AT260_DRG_E0
205
// --------------*groupIndx = -1;
int groupCount;
p_scheme->GetGroupCount(&groupCount);
for(int grp=0;grp<groupCount;grp++)
{
HRESULT res =p_scheme->Contains(grp, );
If(res == S_OK)
{
*grpIndx=grp;
return TRUE;
}
}
return FALSE;
}
The interface IDynamicGroupingScheme is derived from IGroupingScheme and is used for the storage of MALs (channels
lists) of the TRGs with SFH having FREE_ASSIGNMENT mode. In this case, the MALs used are free and are all stored
in the temporary Dynamic group scheme provided by the function GetFreeMALScheme of the IAssignmentPlan interface.
See 4.7.7 Working with Several Assignment Plans for an example using dynamic scheme.
4.7.6
4.7.6.1
Example
(victim trg = trgv, interferer trg = trgi)
Index
Threshold
Probability
Meaning
0.01
0.0.5
14
0.15
Notice that the probability of C/I being between 9db and 14db in the example can be retrieved by Proba[2] Probas[1] =
10%.
The method GetHistogram provides these Thresholds and Probabilities for a given couple of TRGs.
The method GetInterferingProbability provides a simplified access to histograms, giving an interpolated probability for a
specified threshold value.
The methods GetInterfererCount, GetVictimCount, GetInterferers, GetVictims and GetInterfererHistogram provide an optimised access, avoiding the necessity to scan all TRGs. This optimised access is similar to the one provided for ITrgSeparations.
4.7.7
206
AT260_DRG_E0
Forsk 2007
In order to minimize the storage space required, created clones keep a pointer on the original one used for
creation and only register modifications.
Important:
If B is an assignment plan that was obtained from A, and both B and A are Read/Write assignment plans,
then A should not be edited once B has been extracted.
netWorkData,
IInterfMatrix*
iMatrix,
// interfering probabilities
IAFPProgress*
progress,
AFP_CONFIG*
config,
// from configuration
IRW_AssignmentPlan** result)
// result of assignment
{
// Some initializations
// ASSIGNMENT:
current->SetResource(CHANNEL_TYPE,someTrg, someTrx, someChannel);
// Clean up
initialPlan->Release();
*result = current;
return S_OK;
}
// EXAMPLE 2: implementation of Calculate function that stores the best plan
// each time that cost is reduced of 30%
// -------------------------------------------------------------------------MyAFP::Calculate(
IAfpNetworkData*
netWorkData,
IInterfMatrix*
iMatrix,
// interfering probabilities
IAFPProgress*
progress,
AFP_CONFIG*
config,
// from configuration
IRW_AssignmentPlan** result)
// result of assignment
Forsk 2007
AT260_DRG_E0
207
// Some initializations
// read only
res= netWorkData->GetCurrentPlan(&initialPlan);
// Initiate a current plan with the initial plan
// --------------------------------------------float bestTotalCost= Cost(initial);
IAssignmentPlan* bestPlan= initial;
IRW_AssignmentPlan* current=0;
// read only
// read write
initialPlan->CreateClone(¤t);
// current is created as a copy of initialPlan
// Assignment main Loop
// ASSIGNMENT:
current->SetResource(CHANNEL_TYPE,someTrg, someTrx, someChannel);
// EVALUATION
float newTotalCost= Cost(current);
if(newTotalCost<= 0.7* bestTotalCost) // gain over 30%
{
// store new best cost
bestTotalCost = newTotalCost;
// store new best plan
bestPlan->Release();
bestPlan = current;
// create a new clone to continue the loop based on the previous one
// in order to avoid changing the best one
bestPlan->CreateClone(¤t);
}
// Clean up
initialPlan->Release();
best->CreateClone(result);
current->Release();
best->Result;
return S_OK;
}
4.7.8
// Example
208
AT260_DRG_E0
Forsk 2007
4.7.9
TRX Manipulations
The AFP is assumed to bring a frequency plan to the state where the number of TRXs equals the number of required TRXs:
int GetDemandedNumTrx(IAfpNetworkData*
{
ITrg* trgp=NULL;
HRESULT ret
if (ret != S_OK)
return 1;
RESOURCE_TYPE type = CHANNEL_TYPE;
int dema = 0;
ret = trgp->GetDemand(type, &dema);
trgp->release();
if (ret = S_OK)
return dema;
else
return 1 ;
}
// Remark 1: If not using a smart ptr, you must not forget to release an object
//
ASSIGNMENT_STATE trg_ass_state;
thePlan->GetAssignmentState( CHANNEL_TYPE, trgIndex, -1 , &trg_ass_state);
bool is_trg_frozen = ( (trg_ass_state & FROZEN) > 0
);
Notes:
Note that the trxNumber set to 1 indicates that we are asking the TRG state. Furthermore, we will be
checking the individual TRXs to see if they were not frozen at TRX level.
Let us now assume that the AFP has found that there are already 2 existing TRXs and two more to create. It will create
the TRXs using the method AddTrxs() of the assignment plan. Then using the given number of the newly created TRXs,
it will assign their resources. If The AFP wants to examine the state of these TRXs in the future, it can check if
(trx_ass_state & CREATED) > 0. Now, for the two already existing TRXs, the AFP will try to change the resources if not
frozen:
Forsk 2007
AT260_DRG_E0
209
thePlan->SetResource(CHANNEL_TYPE, trgIndex,
trxNumberIdentifier, goodFreqsArray[k])
}
If the AFP must remove any TRX, it will use the method RemoveTrx(), still considering that it should not remove Frozen
TRXs.
Notes:
4.7.10
If a TRG is Frozen at TRG level, it will definitely be Frozen at each TRX level.
In the case of resourceType = MAIO_TYPE, TRGs that are Frozen for MAIO are the ones that are out of
the focus zone / calculation zone / Transmitters folder. Otherwise, MAIO is not Frozen and should be
assigned. No special MAIO freeze flag.
The parameter AFP_BASE_CONFIG* config is the overall freezing mechanism. If, for example, ((config>allocType & MAIO_ALLOC) == 0), then no MAIOs should be allocated.
See section 4.6.1.5.1 for more details on the TO_ASSIGN and FROZEN assignment states.
// -------------------------------------------------------------------------// Example: function providing the minimal channel distance between a given TRG
// and a channel value. (If this minimal channel distance is smaller than 1 then
// a Co-channel reuse exists, if it is 1 than an adj-channel reuse exists )
// -------------------------------------------------------------------------#define MAX_MAL_SIZE 1024
int GetChannelDistance(IAssignementPlan *plan,ITrg *p_trg,int channel)
{
int minDist= 1000;
// prefer MAX_INT
// retrieve some useful information
// -------------------------------
HOPPING_MODE hopMode;
p_trg->GetHoppingMode(&hopMode);
ASSIGNMENT_MODE assignMode;
p_trg->GetAssignmentMode(&assignMode) ;
int trgIndx;
p_trg->GetIndex(&trgIndx);
// find associated grouping scheme
// -------------------------------IGroupingScheme *p_gs=0;
If(hopMode!=SFH)
p_trg->GetGroupingScheme(CHANNEL_TYPE,&p_gs);
else
plan->GetFreeMALScheme(&p_gs);
// loop on TRXs
// -----------int trxCount;
plan->GetTrx(&trxCount);
int previousResource=-1;
for(int trx=0;trx<trxCount;trx++)
{
210
AT260_DRG_E0
Forsk 2007
int resource;
plan->GetResource(CHANNEL_TYPE,trgIndx,trx,&resource);
if(resource==previousResource)
continue;
previousResource= resource;
if(hopMode!=SFH)// mode NONE_FH or BBH
minDist= min(minDist,ABS(channel-res)); // res is a channel value
else
{
// Get MAL of this trx
// ------------------int malSize=0;
p_gs->GetGroupSize(resource, &malSize);
if(malSize>MAX_MAL_SIZE)
error(Size of MAL bigger than supported by MyAFP);
int mal[MAX_MAL_SIZE];
p_gs->GetResourceNumbers(resource, malSize,mal);
// Loop on channel list of this TRX
// -------------------------------for(indxInMal =0;indxInMal <malSize; indxInMal ++)
{
minDist = min(minDist,ABS(mal[indxInMal]-channel));
}
p_gs->Release();
}
}
return minDist;
}
Forsk 2007
AT260_DRG_E0
211
212
AT260_DRG_E0
Forsk 2007
Chapter 5
Advanced AFP API
This chapter describes the advanced Atoll AFP API.
214
AT260_DRG_E0
Forsk 2007
5.1
_COM_SMARTPTR_TYPEDEF(IAfpNetworkData2, __uuidof(IAfpNetworkData2));
IAfpNetworkData2Ptr tmp(netWorkData);
// NetworkData is an instance of IAfpNetworkData supplied by the run() function.
// It is also an instance of IAfpNetworkData2.
// The IAfpNetworkData2Ptr will create an IAfpNetworkData2 instance for you.
If (tmp == NULL)
{
// Atoll version is prior to 2.4.0, the
// IAfpNetworkData2Ptr will not be able to create an
// IAfpNetworkData2 instance for you.
// The AFP must continue without using GetNeighborImportance().
}
else
{
// tmp->GetNeighborImportance() can be called safely.
}
5.2
5.2.1
New Capabilities
5.2.2
The AFP can declair its capabilities, by doing it, Atoll will propose the allocation option of these resources only.
The AFP will have a read only access to all data in the document, via the generic Api.
The AFP will have read write access to all fields of Sites, Transmitters, TRGs and TRXs tables.
The AFP could ask atoll to hide the target compution time, and or the resume button. (in the AFP output dlg)
Required Implementation
In order to have the capabilities mentioned above, the advanced AFP must implement the IAfpModel2 and
IPlanGenerator2 interfaces. This means that the AFP should implement all of the methods in IAfpModel2. The AFP should
depict its standard and costum resources when GetResourceCapabilities() is called (see example below).
Scenarios are explained in later sections. For the time-being, AFP can declare 0 senarions. All the other elements are self
explanatory.
The AFP should be ready to exploit the generic API once Atoll calls the IPlanGenerator2::OnPreload() method. It will do it
by casting the IUnknown* to an IDocument:
Forsk 2007
AT260_DRG_E0
215
resources->AddStandardResourceTypes(HSN_ALLOC|MAIO_ALLOC);
Notes:
5.2.3
IResourceCollection, IAssignmentPlan2,
IRW_AssignmentPlan2 Interfaces
Once the AFP resource capabilities are declared, these will be proposed by Atoll to the user so that the user can select
the resources to allocate. The users selection will be communicated to the AFP via the Run() and Improve() methods. If
the AFP requires reading or writing to the standard fields (or to the AFP_RANK resource), it can do so with the
IRW_AssignmentPlan interface. If the AFP requires to use the new costum fields, it must call IResourceCollection::FindCustomResourceType() first, and use the ID thus obtained with the IRW_AssignmentPlan2 interface.
Notes:
5.3
The Get/SetCostumResource() methods use the trg and trxNumber as access keys. There may exist a
many-to-one relation when the resource level is higher than trg. For example:
Let trgs 0 to 12 belong to the same site. If a user uses SetCustomResource() for trg 1 to set a new value,
and then uses GetCustomResource() with any other trg of the site, it will return the new value that was just
set in the last step.
When declaring the AFPs resource capabilities, the corresponding buffers are created for the fields
requested by the AFP. Other fields cannot be accessed by the AFP. All AFP access requirements should
be declared in GetResourceCapabilities().
This generic mechanism eliminates the need of IAfpTransmitter (not yet implemented) or of
IRadioTransmitter2.
Scenarios Support
An AFP scenario is defined as a set of:
Name
A collection of mandatory resources
A collection of optional resources
Permission to alter existing TRXs
Forsks standard AFP does not use scenarios. Scenarios can be useful in order to reduce or limit the AFP flexibility and/
or hide some OMC parameters from the user.
5.4
5.4.1
5.5
This service is temporary and will not be supported for a long time. In future versions, the AFP interface will
evolve to permit multiple IM access in the AFP.
216
AT260_DRG_E0
Forsk 2007
import "oaidl.idl";
import "ocidl.idl";
// {5C9CB832-A0C6-4988-995D-EBC0609209F2}
cpp_quote("EXTERN_GUID(CATID_AFP,0x5c9cb832, 0xa0c6, 0x4988, 0x99, 0x5d, 0xeb,
0xc0, 0x60, 0x92, 0x9, 0xf2);")
interface IPlanGenerator;
interface IPlanGenerator2;
interface IAfpNetworkData;
interface IInterfMatrix;
interface IAfpProgress;
AFP state
interface IAssignmentPlan;
= 0x1,
HSN_ALLOC
to expect
= 0x2,
MAIO_ALLOC
= 0x8,
BSIC_ALLOC
= 0x10,
MAL_ALLOC
= 0x20,
CODE_ALLOC
= 0x40,
// Not Used
GID_ALLOC
= 0x80,
TRX_RANK
= 0x100
ALLOCATION_TYPE;
QUALITY_TARGET
= 0x1,
// Not Used
COMPUTE_SEPARATION
= 0x2,
// Not Used
OPTIMIZE_INTEREFERENCE
= 0x4,
// Not Used
ADVANCED_CI_ESTIMATION
= 0x8,
ALLOCATION_OPTIONS;
duration;
int
options;
selected options )
int
Forsk 2007
allocType;
AT260_DRG_E0
217
boolean
keepPrev;
boolean
keepFrozen;
boolean
uation
int
} AFP_BASE_CONFIG;
duration;
int
options;
selected options )
boolean
keepPrev;
boolean
keepFrozen;
boolean
uation
int
} AFP_INPUT_PARAMETERS;
// MAIN interface !!
{
HRESULT GetPlanGenerator([out] IPlanGenerator** planGenerator);
}
//-----------------------------------------------------------------------------------typedef enum _ENTITY_LEVEL
{
TRX_LEVEL
=0,
TRG_LEVEL
=1,
CELL_LEVEL
=2,
SITE_LEVEL
=3
ENTITY_LEVEL;
218
AT260_DRG_E0
Forsk 2007
PI_CATEGORY=1,
as PIs
GENERIC_CATEGORY =2,// for read write access to other custom fields not displayed to the user
}
FIELD_CATEGORY;
//-----------------------------------------------------------------------------------[
uuid(898B8DF4-142C-4ac8-8F65-8E7FAAF2208A),
helpstring("ISpecifySupportedRessource Interface"),
pointer_default(unique)
]
}
//-----------------------------------------------------------------------------------// Advanced interface : IAfpModel2
//------------------------------------------------------------------------------------
//interface ISpecifyPropertyPages;
//interface IPlanEvaluator;
[
uuid(44B91C99-46EF-41be-8D94-777A0DA669F7),
helpstring("IAfpModel Interface"),
pointer_default(unique)
]
// MAIN interface
Forsk 2007
AT260_DRG_E0
219
// -----------------------HRESULT GetResourceCapabilities([in]
edResourceTypes);
IResourceTypesCollection* support-
int indxScenario
IResourceTypesCollection* madandatorySelection
// to be filled
,[in]
IResourceTypesCollection* optionalSelection
// to be filled
,[out] boolean*
trxExtensionOnly
,[out] BSTR*
scenarioName);
HRESULT SupportResume();
// ---------------------------------------------------------------------------------[
uuid(49BC1603-DDF6-4E17-B5C4-511B650B834B),
helpstring("IPlanGenerator Interface"),
pointer_default(unique)
]
interface IPlanGenerator: IUnknown
{
IInterfMatrix*
IAfpProgress*
iMatrix,
progress,
AFP_BASE_CONFIG*
config,
// interfering probabilities
// for cyclic reporting by Atoll
// from configuration
// result of assignment
220
AT260_DRG_E0
Forsk 2007
HRESULT Improve(
[in] IAfpNetworkData*
[in]
IInterfMatrix*
[in]
IAfpProgress*
[in]
AFP_BASE_CONFIG*
[in] IAssignmentPlan*
iMatrix,
// interfering probabilities
progress,
config,
// from configuration
previous,
// result of assignment
}
// --------------------------------------------------------------------------------[
uuid(48BC2609-ABC1-4F32-B7D1-824A742E121B),
helpstring("IPlanGenerator2 Interface"),
pointer_default(unique)
]
interface IPlanGenerator2: IPlanGenerator
{
HRESULT OnPreload([in] IUnknown* document,[in]
resources);
IResourceTypesCollection*
IAfpNetworkData*
[in] IInterfMatrix*
// interfering probabilities
[in]
IAfpProgress*
progress,
[in]
AFP_INPUT_PARAMETERS*
parameters,
// from configuration
[in]
IResourceTypesCollection*
resources,
//
[in]
int
scenario,
// -1 => free
[in]
HWND
by Atoll
parentWnd,
[out] IRW_AssignmentPlan**
HRESULT Improve(
existing one
[in]
network data
result);
// result of assignment
IAfpNetworkData*
[in] IInterfMatrix*
// interfering probabilities
[in]
IAfpProgress*
progress,
[in]
AFP_INPUT_PARAMETERS*
options,
// from configuration
[in]
IResourceTypesCollection* resources,
by Atoll
[in]
IAssignmentPlan*
previous,
// from configuration
// result of previous
assignment
[in]
int
scenario,
[in]
HWND
parentWnd,
[out] IRW_AssignmentPlan**
Forsk 2007
AT260_DRG_E0
result);
// -1 => free
// result of assignment
221
IAfpNetworkData*
[in] IInterfMatrix*
iMatrix,
// interfering probabilities
[in]
IAfpProgress*
progress,
[in]
AFP_INPUT_PARAMETERS*
parameters,
// from configuration
[in]
IResourceTypesCollection*
resources,
//
[in]
int
scenario,
// -1 => free
[in]
HWND
parentWnd,
//
by Atoll
[out] IRW_AssignmentPlan**
result,
// result of assignment
// total cost of this plan
}
// ----------------------------------------------------------------------------------
[
uuid(A902215E-010D-4423-87C5-A8978CA1DE1D),
helpstring("IAfpConfigure Interface"),
pointer_default(unique)
]
interface IAfpConfigure : IUnknown
requires
{
// to be implemented by AFP if it
// a specific configuration. Atoll will
//
=============================================================================
======
// Interfaces of services provided by the Atoll
//
=============================================================================
=========
//----------------------------------------------------------------------------------// Default Progress : implemented by Atoll, used by AFP to display current cost
// dedicated to "cyclic progress report" of AFP process
//----------------------------------------------------------------------------------[
uuid(B87BC22F-DA8B-44B2-A9B2-F747E0C651F4),
helpstring("IAfpProgress Interface"),
222
AT260_DRG_E0
Forsk 2007
pointer_default(unique)
]
interface IAfpProgress: IUnknown
{
HRESULT StartProgressReport();// Atoll will open its default progress
// report dialog. If the AFP wants to have its
// own progress dialogue suit. It should not call
// this method.
HRESULT OnProgress([in] float softCost, [in] int sepBreak);
// to be call cyclically, softCost reports the
// state of soft constraints optimization while sepBreak
// is the number of hard separation breaking.
// return S_FALSE => stop requested by user
HRESULT Display([in] LPCWSTR
status);
infoMsg);
warnMsg);
errMsg);
//-----------------------------------------------------------------------------------//
interface ITrgSeparations;
between TRX groups
CHANNEL_TYPE
= 0,
HSN_TYPE
= 1,
MAIO_TYPE
= 2,
BSIC_TYPE
= 3,
CODE_TYPE
= 4,
GID_TYPE
= 5,
TRX_RANK_TYPE
= 6
RESOURCE_TYPE;
//-----------------------------------------------------------------------------------[
uuid(8FDEF953-92A6-45D9-AF55-8C7D99AE9476),
helpstring("IAfpNetworkData Interface"),
pointer_default(unique)
Forsk 2007
AT260_DRG_E0
223
]
interface IAfpNetworkData: IUnknown
{
HRESULT GetFirstTrg(
transmitter
[in] IRadioTransmitter2*
t,
// interface ITransmitter2
already
[out] int* firstTrgIndex);
// The
224
AT260_DRG_E0
Forsk 2007
// The one-to-
// Access to TrxTypes
HRESULT GetTrxTypesCount([out] int *count);
HRESULT GetTrxType([in] int indx,[out] BSTR* trxTypeName);
HRESULT GetSeparationRule([in] BSTR trxType1, [in] BSTR trxType2,
[in]
int relationType,
// Neighbour importance
HRESULT GetNeighborImportance([in] int serverTrg,
// BSIC decoding
HRESULT SplitBsic([in] int bsic, [out] int* ncc, [out] int* bcc);
// If the BSIC is not legal, this function will return E_FAIL.
HRESULT ReadIMFile([in] BSTR filePath, IInterfMatrix** im);
}
//-----------------------------------------------------------------------------------//
//
//
//
//
//
//-----------------------------------------------------------------------------------interface IGroupingScheme;
resource groups)
interface IDynamicGroupingScheme;
interface IFrequencyBand;
FREE_ASSIGNENT
= 0,
GROUP_ASSIGNENT
= 1,
ASSIGNMENT_MODE;
Forsk 2007
// Means :
TO_ASSIGN = 0x1,
resource type)
FROZEN
= 0x2,
resource type)
AT260_DRG_E0
225
MODIFIED
assigned.
= 0x4,
CREATED
= 0x8
be created!!)
}
// this TRX was created by the AFP (remark: TRGs can not
ASSIGNMENT_STATE;
NONE_FH
= 0,
BFH
= 1,
SFH
= 2
HOPPING_MODE;
= 0x1,
COCELL
= 0x2,
NEIGHBOUR
= 0x4,
SYNCHRO
agement
SPECIAL
COTRG
then others)
}
= 0x8,
AFP_RELATION_TYPE;
= 0,
// default
RBER
= 1,
FER
= 2,
BLER
= 3,
MOS
USER_DEFINED
}
= 5
QUALITY_METRIC;
//------------------------------------------------------------------------------------
[
uuid(2707F4C7-9F43-4F5F-8934-24BB51A11AC2),
helpstring("ITrg Interface"),
pointer_default(unique)
]
//---------------------------------------------------------interface ITrg: IUnknown
226
AT260_DRG_E0
Forsk 2007
//---------------------------------------------------------{
HRESULT GetIndx([out] int *indx);
HRESULT GetTrxType([out]
"BCCH","TCH","TCH_Inner".
BSTR*
HRESULT ContainsBroadcastChannel();
//
examples:
HRESULT GetGroupingScheme(
[in]
trgType);
RESOURCE_TYPE type,
RESOURCE_TYPE type,
HRESULT GetTrgRelationCount(
[in] AFP_RELATION_TYPE type, // Type is strictly a single relation
type
[out] int* count);
// number of relations
HRESULT GetTrgRelation(
[in] AFP_RELATION_TYPE type,
[in] int count,
// read size
// number of relations
HRESULT GetTransmitter(
[out] IRadioTransmitter2** tr);
// Quality Target:
// ==============
// HRESULT GetQualityModel([out] IQualityModel** qm); => Future use
HRESULT GetQualityThreshold(
unsupported
HRESULT GetProbabilityThreshold(
[out] float* minProba);
Forsk 2007
AT260_DRG_E0
227
}
//-------------------------------------------------------------------------------------------
[
uuid(9CC02198-13D6-4C18-961F-0160EE828C61),
helpstring("ITrg2 Interface"),
pointer_default(unique)
]
interface ITrg2: ITrg
//---------------------------------------------------------{
HRESULT GetSucellTrafic([out] float* voiceTrafic,
// average number of timeslot serving voice
[out] float* paquetTrafic,
// average number of timeslot serving
paquet services
[out] float* signallingTafic);
// average number of timeslot serving
isgnalisation
HRESULT GetRequiredTS(
//------------------------------------------------------------------------------------------[
uuid(24A57CA7-4F33-ED32-8934-2434A3B71AC2),
helpstring("IAfpTransmitter Interface"),
pointer_default(unique)
]
//---------------------------------------------------------interface IAfpTransmitter: IRadioTransmitter2 // Access to a the basic transmitter properties
//---------------------------------------------------------{
HRESULT GetName([out] BSTR* name);
HRESULT GetLocation([out] float* x, [out] float* y, [out] float* mntHigth);
// Two transmitters have the same site if and only if their (x,y,z) are
the same.
HRESULT GetHcsLayerPriority( [out] int* priority);
}
228
AT260_DRG_E0
Forsk 2007
//-------------------------------------------------------------------------------------------
[
uuid(39451C22-FB24-42C1-A14C-AA65083A8321),
helpstring("IAssignmentPlan Interface"),
pointer_default(unique)
]
interface IAssignmentPlan: IUnknown
{
HRESULT CreateClone([out] IRW_AssignmentPlan** clone);
// creates a read/write clone based on the current one
added or remove
// indexs may go out of scope or point to
// variating trxs.
HRESULT GetTrxNumbers([in] int trgIndx,
[in] short count,
[out,size_is(count)] int* trxNumbers);
// Gets all numbers at once.
// partial allocation
& Freezing
//--------------------------------------------------------HRESULT GetAssignmentState(
& trx groups
Forsk 2007
[in]
RESOURCE_TYPE type,
[in]
int
trgIndx,
AT260_DRG_E0
// trgIndx
229
[in]
int
trxNumber,
// if trxNumber == -1
=>
trg state
[out] ASSIGNMENT_STATE* state);
// is assumed to be demanded
res refers to the group number of the MAL scheme (see following
//
// In all other cases res is the resource number (ARFCN, HSN, MAIO, BSIC,
...)
//---------------------------------------------------------------------------------HRESULT GetResource(
[in] RESOURCE_TYPE type,
[in] int
[in] int
trgIndx,
trxNumber,
// --------------------------------------------------------------------------// Dynamic MAL management.(group scheme used for temporary storage of free
MAL)
// --------------------------------------------------------------------------HRESULT GetMALScheme([out] IDynamicGroupingScheme** scheme); // static or
dynamic
}
//------------------------------------------------------------------------------------------[
uuid(2900AAC7-4F03-ED32-8004-243010BED10A),
helpstring("IAssignmentPlan2 Interface"),
pointer_default(unique)
]
interface IAssignmentPlan2: IUnknown
{
HRESULT GetCustomResource(
[in] int
lection::GetCustomResource
[in] int
level. according to
If the level is
// TRG or TRX levels, the trg is simply
a trg. If it is
// CELL or SITE levels, the trgIndx is one
of the trg's in
// the CELL or SITE.
[in] int
230
trxNumber,
AT260_DRG_E0
Forsk 2007
res);
}
//-----------------------------------------------------------------------------------// interface IRW_AssignmentPlan : Read Write Assignment Plan
// (correspondance between trx and resource Numbers (Channel, HSN, MAIO,...) )
// Usage: read of current assignments and write of new ones
//-----------------------------------------------------------------------------------[
uuid(6A9C1110-2D99-4D13-B6F8-AAA01D8734FE),
helpstring("IRW_AssignmentPlan Interface"),
pointer_default(unique)
]
interface IRW_AssignmentPlan: IAssignmentPlan // Assignment plan with read/
write access
{
// Trx edition
//--------------------------------------------------------HRESULT AddTrxs([in] int trgIndx,
[in] short newTrxCount,
[out, size_is(newTrxCount)] int* newTrxNumbers);
// trxCount: number of added trxs
// All new trxnumbers
will be put in a
//
pre-dimentioned ar-
ray: newTrxNumbers[]
HRESULT RemoveTrx([in] int trgIndx,[in] int trxNumber);
// trxNumber: indx
in the transmitter
trgIndx,
// obtained from
ISelectedResource
[in] int
trxNumber,
//-------------------------------------------------------------------------------------------
Forsk 2007
AT260_DRG_E0
231
[
uuid(2A98605E-F255-48a3-9ABD-7BFD4B4C80AF),
helpstring("IRW_AssignmentPlan2 Interface"),
pointer_default(unique)
]
interface IRW_AssignmentPlan2: IUnknown
{
HRESULT SetCustomResource(
[in] int
[in] int
resourceId,
according to
// this level, the trgIndex will be used. If
the level is
// TRG or TRX levels, the trg is simply a trg.
If it is CELL or
//
(the simplest)
// -----------------------------------HRESULT GetSeparation(
[in] int type,
will be co-site)
//###################################################################
// No Longer supported. For getting the defult separation, use
232
AT260_DRG_E0
//
Forsk 2007
[in]
int type,
//
[in]
int trg,
//
//
//###################################################################
HRESULT GetRelationsCount(
[in] int type,
// combination of
AFP_RELATION_TYPE
[in] int trg1,
// group indx
HRESULT GetRelation(
[in] int type,
// combination of
AFP_RELATION_TYPE
[in] int trg1,
// group indx
// index of relation
(0 to count-1)
[out] int* trg2,
// The trg
// It's separation
// a single
HRESULT GetFullSeparationInfo(
[in] int type,
Forsk 2007
AT260_DRG_E0
233
(the simplest)
// -----------------------------------HRESULT GetInterferingHistogram(
[in] int trgv,
// The size
count,
// number of thresholds of
HRESULT GetInterferingProbability(
threshold
// probabilities
// C/I threshold
be under threshold
// (maybe interpolated)
234
AT260_DRG_E0
Forsk 2007
// once we get the interferers, we can access the interference histogram with
// the simple access above.
// -----------------------------------------------------------------HRESULT GetInterfererCount(
[in] int trgv,
HRESULT GetInterferers(
[in] int trgv,
of interferers
[out,size_is(count)] int* trgi);
// trgIn-
dexes of interferers
HRESULT GetVictims(
[in] int trgi,
of victims
[out,size_is(count)] int* trgv);
// trg in-
dexes of victims.
// Special optimized access. Faster then the combination of GetInterferers() and then
// GetInterferingHistogram()
HRESULT GetInterfererHistogram(
[in] int trgv,
[in] int indx,
[out] int* trgi,
// number of thresholds of
// It is used
Forsk 2007
AT260_DRG_E0
235
[
uuid(10C64AA3-9B6C-4A8C-BA5A-D907F668BD84),
helpstring("IGroupingScheme Interface"),
pointer_default(unique)
]
// A Unique identifier of
// the
grouping scheme.
// number of groups
// included in scheme
HRESULT GetGroupSize (
[in]
int grpIndx,
// indx of group
HRESULT GetResourceNumbers(
[in]
int grpIndx,
// indx of group
[in]
int count,
// read size
HSN,MAIO...)
HRESULT Contains(
grpIndx contains r
[in]
[in]
int r);
// indx of group
// resource number searched
}
//-----------------------------------------------------------------------------------// Dynamic group allow storage by AFP of Hopping groups (MAL)
//-----------------------------------------------------------------------------------[
uuid(7005576C-3614-4FF5-A16B-AD59C96A7578),
helpstring("IDynamicGroupingScheme Interface"),
pointer_default(unique)
]
===================================================
Interface of Quality model: TO BE defined (Future)
236
AT260_DRG_E0
Forsk 2007
==================================================
interface IQualityModel: IUnknown
{
}
*/
//-----------------------------------------------------------------------------------// Frequency band
//-----------------------------------------------------------------------------------[
uuid(4225B739-9052-4642-BA25-37FBD228CCFF),
helpstring("IFrequencyBand Interface"),
pointer_default(unique)
]
interface IFrequencyBand: IUnknown
{
HRESULT GetMultiPlexingFactor([out] int* factor);
HRESULT GetCoherenceBandWidth([out] int* widthInChannels);
HRESULT GetAdjascentSuppression([in] int n, [out]float *asupp);
// returns the n'th adjascent suppression
in DBs
}
Forsk 2007
AT260_DRG_E0
237
238
AT260_DRG_E0
Forsk 2007
Forsk 2007
AT260_DRG_E0
239
AT260_DRG_E0
February 2007