Mango Clock
-
It doesn't go bad again at 11pm? I should expect it would....
In your overrides/web/WEB-INF/tags/page folder I believe there is a header.tag file.
This file contains the following line:
s += dojo.string.pad(((d.getHours() + 1) % 12) - 1, 2) +":";which is where the issue arises. The getHours() returns 0-23, and we want 12 at 0 or 12, %12 other places, so we can modify it with a ternary/inline if -->
(d.getHours() % 12 == 0) ? 12 : d.getHours() % 12
to get
s += dojo.string.pad((d.getHours() % 12 == 0) ? 12 : d.getHours() % 12, 2) +":";
Edit: Oops, order of operations problem. Fixed!
-
Can u tell me how to make small Mango automation application ? It would be a great help.
-
@ashoksoni.kp@gmail.com said:
Can u tell me how to make small Mango automation application ? It would be a great help.
For purely demo purposes, you should probably look into the virtual data source as that gives you data without needing to configure anything in the physical world to have data within the system to display. Beyond that, all Mango applications are domain specific, and your first question must be: what sort of data am I trying to gather? The problem space of "small Mango automation applications" depends on your definition of 'small', but in all cases there are thousands of projects that could involve less than 20 data points and thus be available under the free license.
-
Thanks..
If I want to design/develop my own mango application then is it possible to build something on top of the free modules given ?
If yes then please give example.Thanks in advance.
:D -
Yes, it is absolutely possible. Say you wished to control a heating unit for your house based on the internal temperature. Mango could certainly work as your thermostat, as well as collect power usage data.
-
How to design any module ? what all are the requirements ? what all concepts i should know to design a fresh mango module ?
I have mango_public_core module and along with that i have mango_public_module, but when i tried to plug it in to mango_core, didn't work for me. How to do this ? -
I misunderstood your question, I didn't realize you were trying to create your own modules. I have only done some cursory work with new modules, so I can't confidently provide help there.
I thought you were asking for projects that could be achieved with the existing modules, which is a large set.
Modules are generally just dropped into the [Mango Home]/web/modules folder in their zips, and Mango automatically detects and tries to read them.
Sorry I can't be more help.
-
Thanks for everything.
-
Here is some documentation on making modules but your best learning tool will be to look at the code of the existing ones:
http://store.infiniteautomation.com/documentation/developersJoel.