LocationAPI_Templates.ttcn 6.16 KB
Newer Older
Yann Garcia's avatar
Yann Garcia committed
1
2
module LocationAPI_Templates {
  
YannGarcia's avatar
YannGarcia committed
3
4
5
  // JSON
  import from JSON all;
  
Yann Garcia's avatar
Yann Garcia committed
6
7
8
9
10
11
12
13
  // LibCommon
  import from LibCommon_BasicTypesAndValues all;
  
  // LibMec/LocationAPI
  import from LocationAPI_TypesAndValues all;
  import from LocationAPI_Pixits all;
  
  template (value) UserInfo m_user_info(
Yann Garcia's avatar
Yann Garcia committed
14
15
16
17
                                        in Address p_address := PX_USER,
                                        in AccessPointId p_access_point_id := PX_ACCESS_POINT_ID,
                                        in ZoneId p_zone_id := PX_ZONE_ID,
                                        in ResourceURL p_resource_url := PX_RESOURCE_URL
Yann Garcia's avatar
Yann Garcia committed
18
19
  ) := {
    address_            := p_address,
Yann Garcia's avatar
Yann Garcia committed
20
21
22
    accessPointId       := p_access_point_id,
    zoneId              := p_zone_id,
    resourceURL         := p_resource_url,
Yann Garcia's avatar
Yann Garcia committed
23
24
25
26
27
28
    locationInfo        := omit,
    contextLocationInfo := omit,
    ancillaryInfo       := omit
  } // End of template m_user_info
  
  template (present) UserInfo mw_user_info(
Yann Garcia's avatar
Yann Garcia committed
29
30
31
                                           template (present) Address p_address := ?,
                                           template (present) AccessPointId p_access_point_id := ?,
                                           template (present) ZoneId p_zone_id := ?,
YannGarcia's avatar
YannGarcia committed
32
                                           template (present) ResourceURL p_resource_url := ?
Yann Garcia's avatar
Yann Garcia committed
33
34
  ) := {
    address_            := p_address,
Yann Garcia's avatar
Yann Garcia committed
35
36
37
    accessPointId       := p_access_point_id,
    zoneId              := p_zone_id,
    resourceURL         := p_resource_url,
Yann Garcia's avatar
Yann Garcia committed
38
39
40
41
    locationInfo        := *,
    contextLocationInfo := *,
    ancillaryInfo       := *
  } // End of template mw_user_info
Yann Garcia's avatar
Yann Garcia committed
42
43
44

  template (omit) UserList m_user_list(
                                       in template (omit) UserInfos p_userInfo := omit,
Yann Garcia's avatar
Yann Garcia committed
45
                                       in ResourceURL p_resource_url
Yann Garcia's avatar
Yann Garcia committed
46
47
48
49
50
51
52
                                       ) := {
    user        := p_userInfo,
    resourceURL := p_resource_url
  } // End of template m_user_list
  
  template UserList mw_user_list(
                                 template UserInfos p_userInfo := *,
Yann Garcia's avatar
Yann Garcia committed
53
                                 template (present) ResourceURL p_resource_url := ?
Yann Garcia's avatar
Yann Garcia committed
54
55
56
57
                                 ) := {
    user        := p_userInfo,
    resourceURL := p_resource_url
  } // End of template mw_user_list
Yann Garcia's avatar
Yann Garcia committed
58
59
  
  template (value) LocationInfo m_location_info(
YannGarcia's avatar
YannGarcia committed
60
61
                                                in JSON.Number p_latitude,
                                                in JSON.Number p_longitude,
Yann Garcia's avatar
Yann Garcia committed
62
                                                in UInt32 p_accuracy
Yann Garcia's avatar
Yann Garcia committed
63
64
65
66
67
68
69
70
  ) := {
    latitude  := p_latitude,
    longitude := p_longitude,
    altitude  := omit,
    accuracy  := p_accuracy
  } // End of template m_location_info
  
  template (present) LocationInfo mw_location_info(
YannGarcia's avatar
YannGarcia committed
71
72
                                                   template (present) JSON.Number p_latitude := ?,
                                                   template (present) JSON.Number p_longitude := ?,
Yann Garcia's avatar
Yann Garcia committed
73
                                                   template (present) UInt32 p_accuracy := ?
Yann Garcia's avatar
Yann Garcia committed
74
75
76
77
78
79
80
81
  ) := {
    latitude  := p_latitude,
    longitude := p_longitude,
    altitude  := *,
    accuracy  := p_accuracy
  } // End of template mw_location_info
  
  template (value) ZoneInfo m_zone_info(
Yann Garcia's avatar
Yann Garcia committed
82
83
84
85
86
                                        in ZoneId p_zone_id := PX_ZONE_ID,
                                        in NumberOfAccessPoints p_number_of_access_points := PX_NB_ACCESS_POINTS,
                                        in NumberOfUnserviceableAccessPoints p_number_of_unservicable_access_points := PX_NB_UNSERVICABLEL_ACCESS_POINTS,
                                        in NumberOfUsers p_number_of_users := PX_NB_USERS,
                                        in ResourceURL p_resource_url := PX_RESOURCE_URL
Yann Garcia's avatar
Yann Garcia committed
87
                                        ) := {
Yann Garcia's avatar
Yann Garcia committed
88
89
90
91
92
    zoneId                           := p_zone_id,
    numberOfAccessPoints             := p_number_of_access_points,
    numberOfUnservicableAccessPoints := p_number_of_unservicable_access_points,
    numberOfUsers                    := p_number_of_users,
    resourceURL                      := p_resource_url
Yann Garcia's avatar
Yann Garcia committed
93
94
95
  } // End of template m_zone_info
  
  template (present) ZoneInfo mw_zone_info(
Yann Garcia's avatar
Yann Garcia committed
96
97
98
99
100
                                           template (present) ZoneId p_zone_id := ?,
                                           template (present) NumberOfAccessPoints p_number_of_access_points := ?,
                                           template (present) NumberOfUnserviceableAccessPoints p_number_of_unservicable_access_points := ?,
                                           template (present) NumberOfUsers p_number_of_users := ?,
                                           template (present) ResourceURL p_resource_url := ?
Yann Garcia's avatar
Yann Garcia committed
101
                                           ) := {
Yann Garcia's avatar
Yann Garcia committed
102
103
104
105
106
    zoneId                           := p_zone_id,
    numberOfAccessPoints             := p_number_of_access_points,
    numberOfUnservicableAccessPoints := p_number_of_unservicable_access_points,
    numberOfUsers                    := p_number_of_users,
    resourceURL                      := p_resource_url
Yann Garcia's avatar
Yann Garcia committed
107
108
  } // End of template mw_zone_info
  
Yann Garcia's avatar
Yann Garcia committed
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
  template (omit) AccessPointList m_access_point_list(
                                                      in ZoneId p_zoneId := PX_ZONE_ID,
                                                      in ResourceURL p_resourceURL,
                                                      in template (omit) AccessPointInfos p_accessPoint := omit
                                                      ) := {
    zoneId      := p_zoneId,
    accessPoint := p_accessPoint,
    resourceURL := p_resourceURL
  } // End of template m_access_point_list
  
  template AccessPointList mw_access_point_list(
                                                template (present) ZoneId p_zoneId := ?,
                                                template (present) ResourceURL p_resourceURL := ?,
                                                template AccessPointInfos p_accessPoint := *
                                                ) := {
    zoneId      := p_zoneId,
    accessPoint := p_accessPoint,
    resourceURL := p_resourceURL
  } // End of template mw_access_point_list
  
Yann Garcia's avatar
Yann Garcia committed
129
} // End of module LocationAPI_Templates