RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
HazardDetectionDoor.py
Go to the documentation of this file.
1 from RappCloud.Objects import (
2  File,
3  Payload)
4 
5 from Cloud import (
6  CloudMsg,
7  CloudRequest,
8  CloudResponse)
9 
10 
11 class HazardDetectionDoor(CloudMsg):
12  """ Hazard Detection Light Check Cloud Message object"""
13 
14  class Request(CloudRequest):
15  """ Hazard Detection Door Check Cloud Request object.
16 
17  HazardDetectionDoor.Request
18  """
19  def __init__(self, **kwargs):
20  """!
21  Constructor
22 
23  @param **kwargs - Keyword arguments. Apply values to the request attributes.
24  - @ref imageFilepath
25  """
26  ## File path to the image to load. This is the image to perform
27  # qr-detection on.
28  self.imageFilepath = ''
29  super(HazardDetectionDoor.Request, self).__init__(**kwargs)
30 
31 
32  def make_payload(self):
33  """ Create and return the Payload of the Request. """
34  return Payload()
35 
36 
37  def make_files(self):
38  """ Create and return Array of File objects of the Request. """
39  return [File(self.imageFilepath, postfield='file')]
40 
41 
42  class Response(CloudResponse):
43  """ Hazard Detection Door Check Cloud Response object.
44 
45  HazardDetectionDoor.Response
46  """
47  def __init__(self, **kwargs):
48  """!
49  Constructor
50 
51  @param **kwargs - Keyword arguments. Apply values to the request attributes.
52  - @ref error
53  - @ref door_angle
54  """
55 
56  ## Error message.
57  self.error = ''
58  ## The angle of the detected door.
59  self.door_angle = 0.0
60  super(HazardDetectionDoor.Response, self).__init__(**kwargs)
61 
62 
63  def __init__(self, **kwargs):
64  """!
65  Constructor
66 
67  @param **kwargs - Keyword arguments. Apply values to the request attributes.
68  - @ref Request.imageFilepath
69  """
70 
71  # Create and hold the Request object for this CloudMsg
73  # Create and hold the Response object for this CloudMsg
75  super(HazardDetectionDoor, self).__init__(
76  svcname='hazard_detection_door_check', **kwargs)
77 
78