Skip to content

Commit 80b4724

Browse files
committed
doc: change names
1 parent e095284 commit 80b4724

1 file changed

Lines changed: 9 additions & 20 deletions

File tree

README.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -136,24 +136,13 @@ module is set to demjson3 per default. The backend can be modified by calling
136136

137137
Since version 2.0.0 this client supports general OData models hosted by FROST servers with active OData plugin.
138138

139-
For this purpose the client provides a command line interface for generating a python module containing the URL of the FROST server in use as well as source code for the Python classes corresponding to the data model contained in it. It is called like this:
139+
For this purpose the client provides a command line interface for generating a service configuration module containing the URL of the FROST server in use as well as source code for the Python classes corresponding to the data model contained in it. It is called like this:
140140
```bash
141-
frost-codegen --url http://localhost:8080/FROST-Server --out my_datamodel
141+
frost-codegen --url http://localhost:8080/FROST-Server --out my_service_configuration
142142
```
143-
The generator tries the OData 4.01 endpoint of the FROST server in use first and falls back to the OData 4.0 if the other one is not available.
143+
The generator tries the OData 4.01 endpoint of the FROST server in use first and falls back to the OData 4.0 if the other one is not available. If even the latter is not available the generator fails.
144144

145-
In order to use the custom data model it needs to be imported in the source code. The corresponding service needs to be created with paramter `model` instead of `url`. In fact, the following two programs are equivalent:
146-
```
147-
import frost_sta_client as fsc
148-
import .my_datamodel as my_model
149-
150-
service = fsc.SensorThingsService(model=my_model)
151-
152-
my_entity = my_model.MyEntityClass(...)
153-
service.create(my_entity)
154-
```
155-
156-
For backward compatibility, a client for a FROST server containing the SensorThings data model can be used as in previous versions of this client. In fact, the following two programs are equivalent in this case:
145+
In order to use the generated service configuration module, it needs to be imported in the source code. The corresponding service needs to be created with paramter `config` instead of `url`. In case the FROST server in use contains the SensorThings data model, the following two programs are equivalent:
157146

158147
Variant I:
159148
```
@@ -175,15 +164,15 @@ service.create(thing)
175164
Variant II:
176165
```
177166
import frost_sta_client as fsc
178-
import .my_datamodel as my_model
167+
import my_service_configuration
179168
from geojson import Point
180169
181-
service = fsc.SensorThingsService(model=my_model)
182-
m = service.model
170+
service = fsc.SensorThingsService(config=my_service_configuration)
171+
mdl = service.model
183172
184173
point = Point((-115.81, 37.24))
185-
location = m.Location(name="here", description="and there", location=point, encoding_type='application/geo+json')
186-
thing = m.Thing(name='new thing',
174+
location = mdl.Location(name="here", description="and there", location=point, encoding_type='application/geo+json')
175+
thing = mdl.Thing(name='new thing',
187176
description='I am a thing with a location',
188177
properties={'withLocation': True, 'owner': 'IOSB'})
189178
thing.locations = [location]

0 commit comments

Comments
 (0)