This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ElvishJerricco's profile picture

Cinnamon - Monitor program and framework

Started by ElvishJerricco, 28 March 2015 - 05:06 PM
ElvishJerricco #1
Posted 28 March 2015 - 06:06 PM
Cinnamon

An event based, modular, monitoring system. It comes default with power and system modules. It uses LuaLua to make everything object oriented, making code cleaner. It's designed to show any number of modules on any number of screens, even remote ones.

Modular

In the modules folder, you will find files for each module. The modules are loaded through LuaLua's require function, so modules have to return something. That something in this case, is a class that subclasses Module and implements all the specific behavior for the module. Modules have five methods
  • 
    function (loadModule)
    
  • Load all things for the module, and make sure to set self.name
  • 
    function (drawInWindow:win)
    
  • Draw the module in this particular window. Will be called for any screens displaying this module
  • 
    function (update)
    
  • This function is here because the module is an event handler. Not really used for much in modules
  • 
    function (respondToEvent:event)
    
  • Also only here because modules are event handlers. But this one can be used for quite a lot
  • 
    function (navBarColors)
    
  • If a module would like to change the appearance of the nav bar when on this module's page, override this method and return the desired colors
Currently pre-installed modules:
  • Big Reactors
  • Displays stats about connected reactors and turbines.
  • Boilers
  • Shows the levels of heat, water, and steam in connected boilers.
  • Power
  • Shows how full is each connected RF Provider (such as an Energy Cell or Capacitor Bank).
  • System
  • Calculates the free space on each disk and displays them.
Event Based

Any module can respond to any event. This allows a module to react to any event however it needs, and it can immediately display the results. Any handlers added to the event manager need only implement two methods

  • 
    function (update)
    
  • Called whenever a display update is requested.
  • 
    function (respondToEvent:event)
    
  • Asks you to respond to an event. Return true if you'd like an update to result from this event, or false if you don't care
Usage

Install via grin-get. Run cinnamon.lua. Any monitors configured (via monitors.cfg) to display modules will begin showing the specified screen. Use the navigation buttons to switch screens on the fly.

This program can also display on remote screens. Use any computer capable of communicating with the main (server) computer via rednet. Install Cinnamon on that computer. Run cinnamon_client.lua <hostname> . Hostname is specified in server.cfg. Now the client computer will be used as a monitor, just like in-world monitors or the screen of the server computer. This works with pocket computers, so you can have pocket monitors.

You can also add peripherals to Cinnamon over a distance with rednet using workers. Connect any peripherals to a worker computer, install Cinnamon on the worker, and run cinnamon_worker.lua <hostname> to supply the host with those peripherals.

Installation
grin-get install Team-CC-Corp/Cinnamon

Github

Screenshots
Spoiler





Edited on 02 April 2015 - 11:07 PM
ElvishJerricco #2
Posted 28 March 2015 - 06:14 PM
This started out as my CCJam June 2014 project. I recently cleaned it up and started developing for it again. I would appreciate any suggestions for new modules.

I wish OpenPeripheral had AE2 support. Would have loved to have a module that checks a config for items to show the level of.
SquidDev #3
Posted 28 March 2015 - 06:29 PM
Impressive program as always.

Would it be possible to pre-package a 'remote' peripheral provider? Something like Wireless Peripherals specifically for Cinnamon? I would suggest an automatic lookup on "elvishjerricco.cinnamon.peripheral" occurs but that then runs the risk of interfering with other people's systems on a server.
Edited on 28 March 2015 - 05:29 PM
ElvishJerricco #4
Posted 28 March 2015 - 06:33 PM
Thanks =)

As for your suggestion, I'm not exactly sure what that would be for?
SquidDev #5
Posted 28 March 2015 - 06:39 PM
Thanks =)

As for your suggestion, I'm not exactly sure what that would be for?

Well I was thinking for when you have systems on the other side your base - where running wired networks just isn't feasible. The idea would be that you can host the peripheral over rednet so the main server can still provide status updates on it.
ElvishJerricco #6
Posted 28 March 2015 - 06:43 PM
Well I was thinking for when you have systems on the other side your base - where running wired networks just isn't feasible. The idea would be that you can host the peripheral over rednet so the main server can still provide status updates on it.

Oh I see. So like giving Cinnamon little workers to get peripheral information for it. That's a good idea.
cdel #7
Posted 29 March 2015 - 12:41 AM
This is neat, could support for IC2 Reactors also be implemented by any chance?
ElvishJerricco #8
Posted 29 March 2015 - 03:29 AM
This is neat, could support for IC2 Reactors also be implemented by any chance?

Does OpenPeripherals support that? I could probably add that in. That is, if I can figure out how to use IC2's new reactors =P
cdel #9
Posted 29 March 2015 - 03:34 AM
I think so, don't quote me on it although. The new IC2 update made me cry inside, older versions were more fun :P/>
ElvishJerricco #10
Posted 03 April 2015 - 01:08 AM
Version 1.2!

Updated:
  • Migrated to new ownership
Added:
  • Worker clients
  • Install on a remote computer and run cinnamon_worker.lua <hostname> to supply the host with peripherals attached to the worker.
SquidDev #11
Posted 04 April 2015 - 07:17 PM
This started out as my CCJam June 2014 project. I recently cleaned it up and started developing for it again. I would appreciate any suggestions for new modules.

I wish OpenPeripheral had AE2 support. Would have loved to have a module that checks a config for items to show the level of.

Does OpenPeripheral Integration not have AE support? There are some Java files for it here.
ElvishJerricco #12
Posted 05 April 2015 - 02:41 AM
This started out as my CCJam June 2014 project. I recently cleaned it up and started developing for it again. I would appreciate any suggestions for new modules.

I wish OpenPeripheral had AE2 support. Would have loved to have a module that checks a config for items to show the level of.

Does OpenPeripheral Integration not have AE support? There are some Java files for it here.

Hm I did some very limited testing and didn't see any of those methods exposed. Maybe I was just trying on the wrong blocks.
apemanzilla #13
Posted 05 April 2015 - 04:50 AM
This started out as my CCJam June 2014 project. I recently cleaned it up and started developing for it again. I would appreciate any suggestions for new modules.

I wish OpenPeripheral had AE2 support. Would have loved to have a module that checks a config for items to show the level of.

Does OpenPeripheral Integration not have AE support? There are some Java files for it here.

Hm I did some very limited testing and didn't see any of those methods exposed. Maybe I was just trying on the wrong blocks.

They might be for AE1.
SquidDev #14
Posted 05 April 2015 - 03:38 PM
They might be for AE1.

Ok. It hadn't been released yet. It has it now though.
apemanzilla #15
Posted 05 April 2015 - 08:41 PM
They might be for AE1.

Ok. It hadn't been released yet. It has it now though.

Perfect timing!
HackSawFred3232 #16
Posted 23 August 2015 - 08:00 PM
Help! I dont know how to use this. Please make a video explaining how to install and use this!
ElvishJerricco #17
Posted 24 August 2015 - 12:12 AM
Help! I dont know how to use this. Please make a video explaining how to install and use this!

Installation is outlined in the post. You'll need to install grin-get. Then, in grin/packages/Team-CC-Corp/Cinnamon, go to the configs folder and edit the config to your pleasing.
HackSawFred3232 #18
Posted 24 August 2015 - 12:31 PM
Well lets put it this way, As soon i try to load Cinnamon.lua, It finds a unexpected symbol at line 9.

Found out the problem. LuaLua was needed for the program. Just need to find out what the aguments have to be at "appendPath" on line 9.