コード例 #1
0
    def post(self, args):
        # Find our attached component
        my_component = find_component("org.labthings.example.mycomponent")

        # Get arguments and start a background task
        n_averages = args.get("averages")
        return my_component.average_data(n_averages)
コード例 #2
0
    def put(self, new_property_value):
        # Find our attached component
        my_component = find_component("org.labthings.example.mycomponent")

        # Apply the new value
        my_component.integration_time = new_property_value

        return my_component.integration_time
コード例 #3
0
    def post(self, new_property_value):
        """Change the current magic_denoise value"""

        # Find our attached component
        my_component = find_component("org.labthings.example.mycomponent")

        # Apply the new value
        my_component.magic_denoise = new_property_value

        return my_component.magic_denoise
コード例 #4
0
    def post(self, args):
        """Start an averaged measurement"""
        logging.warning("Starting a measurement")

        # Find our attached component
        my_component = find_component("org.labthings.example.mycomponent")

        # Get arguments and start a background task
        n_averages = args.get("averages")

        logging.warning("Finished a measurement")

        # Return the task information
        return my_component.average_data(n_averages)
コード例 #5
0
    def get(self):
        """Show the current data value"""

        # Find our attached component
        my_component = find_component("org.labthings.example.mycomponent")
        return my_component.data
コード例 #6
0
    def get(self):
        """Show the current magic_denoise value"""

        # When a GET request is made, we'll find our attached component
        my_component = find_component("org.labthings.example.mycomponent")
        return my_component.magic_denoise
コード例 #7
0
 def get(self):
     # Find our attached component
     my_component = find_component("org.labthings.example.mycomponent")
     return my_component.data
コード例 #8
0
 def get(self):
     # When a GET request is made, we'll find our attached component
     my_component = find_component("org.labthings.example.mycomponent")
     return my_component.integration_time