コード例 #1
0
    def close(self):
        if self.handle is not None:

            log_and_warn_on_error(
                sensel.stopScanning(self.handle),
                'stop scanning before close for {}'.format(self.serial_num))
            log_and_warn_on_error(
                sensel.freeFrameData(self.handle, self.frame),
                'free frame data before close for {}'.format(self.serial_num))
            log_and_warn_on_error(
                sensel.close(self.handle),
                'close handle for {} ({})'.format(self.serial_num,
                                                  self.handle))
            self.handle = None
        else:
            logger.debug(
                'Attempt to close Morph {} with None handle (already closed?)'.
                format(self.serial_num))
コード例 #2
0
ファイル: example_contacts.py プロジェクト: spewil/motormaps
def closeSensel(frame):
    error = sensel.freeFrameData(handle, frame)
    error = sensel.stopScanning(handle)
    error = sensel.close(handle)
コード例 #3
0
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
# FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
##########################################################################

import sensel
import binascii

if __name__ == "__main__":

    handle = None
    (error, device_list) = sensel.getDeviceList()
    if device_list.num_devices != 0:
        (error, handle) = sensel.openDeviceByID(device_list.devices[0].idx)
    if handle != None:
        (error, info) = sensel.getSensorInfo(handle)

        print "\nSensel Device: " + str(
            bytearray(device_list.devices[0].serial_num))
        print "Width: " + str(info.width) + "mm"
        print "Height: " + str(info.height) + "mm"
        print "Cols: " + str(info.num_cols)
        print "Rows: " + str(info.num_rows)
        error = sensel.close(handle)
コード例 #4
0
ファイル: board.py プロジェクト: zsyzgu/TouchType
 def _closeSensel(self):
     self.is_running = False
     error = sensel.freeFrameData(self.handle, self._frame)
     error = sensel.stopScanning(self.handle)
     error = sensel.close(self.handle)