Code Monkey home page Code Monkey logo

Comments (3)

TCTaco avatar TCTaco commented on August 25, 2024

This is done with the exception of device status, you said that you had an idea for how to implement this cleanly so we probably need to sit down and talk about how exactly this is going to be done.

from capstone-project.

drmwve avatar drmwve commented on August 25, 2024

So there needs to be two things happening:

  1. Functions (or a function, you might only need one) that reads the device handler's Hardware State and updates the UI elements.
  2. Functions that call the relevant component control functions in the device handler.

Right now you have functions that do both at the same time, the problem with that is you're assuming the requests will be successful and not verifying, and you don't have the means to update the screen when a process changes something automatically. Decoupling the control requests and UI update will solve that issue.

You also added a bunch of your own "state" variables, but that's what the hardware state class is for. You can just read the device handler's instance of that class, which will give you a comprehensive and up-to-date reflection of all the component statuses, including the sensors. You can read it directly every line or copy it to a local variable to save yourself some typing as you read each component, because it's by reference it doesn't make a difference.

from capstone-project.

TCTaco avatar TCTaco commented on August 25, 2024

This should be done unless I forgot something, or we think of something to add to this.

from capstone-project.

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.