GithubHelp home page GithubHelp logo

explainer / hypercloneandgo Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 15.54 MB

Attempt to get hyperloop to sleep with Rails and be fruitful

Ruby 75.84% JavaScript 1.26% CSS 2.81% HTML 18.84% Shell 1.24%

hypercloneandgo's Introduction

HyperAQ

Hyperloop version of Aquarius, a lawn sprinkler rails app hosted on a RaspberryPI 3

This is a further development of an earlier version that employed a traditional UI, based on Rails .erb technology. Workman-like, but boring.

I looked around for other options, and decided to deploy a backbone javascript solution, written in CoffeeScript. The app worked, but I found the combination of js, html, and css all mixed up in backbone framework code kind of off-putting. So, I did some more research.

I found ruby-hyperloop kind of by accident. I had considered using the Opal compiler in the past, but building out all the necessary asset pipeline stuff put me off. Hyperloop seemed to be a more complete solution, well thought out. The idea of writing ALL of my application code in Ruby and then letting Hyperloop compile client UI parts into Javascript, while compiling the rest of the app into native Ruby is a genius idea.

I learned a bit how to construct a rails-hyperloop app and decided to build a new version of Aquarius.

Changes Side-effect programming, or Fat Rails Models. External and Hardware dependencies Operations and ServerOps SprinkleEventHandler {id, valve_id, sprinkle_id, history_id } receives SprinkleEvent instance based on crontab callback. If cmd is 1, turn on the valve identified by valve_id, create a history record, identifying the valve used, and the current time as start_time. update the SprinkleEvent identified by id, set the history_id, and save. dispatch a SprinkleStateChange, to be received in client code valve_button should be turned on. re-sort history table. if cmd is 0 turn off the valve of valve_id, fetch the History by history_id, update the history record by setting the current time as stop_time, and save update the SprinkleEvent identified by id, set the history_id, and save. dispatch a SprinkleStateChange, to be received in client code. changes would be made to sprinkle order, highlight (idle, ondeck, active) history changes due to addition of stop_time update sprinkle reference by sprinkle_id to update its next_start_time, and request a re-sort of table. valve_button should be turned off.

ManualValveHandler When a valve button is depressed on the browser display, the associated valve changes state.

Dispatch and Receive.

hypercloneandgo's People

Contributors

explainer avatar

Watchers

 avatar  avatar

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.