Code Monkey home page Code Monkey logo

Comments (3)

astrobokonon avatar astrobokonon commented on June 29, 2024

To clarify - the responses from the device will almost always be fine. If I ask a Sunpower GT what it's current power is, but at the same time (or just before) someone asks what its cold tip temperature is, the reply might be garbled, but still ... something. It's the parsing of that reply that will fail and what needs to be cleaned up. The actual communication failures should already be handled by the timeouts in the serialcomm.serComm() method.

from mrfreeze.

astrobokonon avatar astrobokonon commented on June 29, 2024

Initially fixed in ed9278e by adding a simple try...except block to the publisher call outs in actions.queryAllDevices(). It can be expanded upon later (to catch ValueError vs. other errors) but this is good enough for now.

from mrfreeze.

astrobokonon avatar astrobokonon commented on June 29, 2024

try:
if reply is not None:
if dvice.devtype.lower() == 'vactransducer_mks972b':
pubs.publish_MKS972b(dvice, reply, db=dbObj, broker=bkObj)
elif dvice.devtype.lower() in ['sunpowergen1', 'sunpowergen2']:
pubs.publish_Sunpower(dvice, reply, db=dbObj, broker=bkObj)
elif dvice.devtype.lower() in ['lakeshore218', 'lakeshore325']:
pubs.publish_LSThing(dvice, reply, db=dbObj, broker=bkObj)
elif dvice.devtype.lower() == 'arc-loisgettemp':
pass
except Exception as err:
print("Unable to parse instrument response!")
print(str(err))

from mrfreeze.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.