Graphical alternative for terminal. - Page 1
Forum section: electronics / general

author: ekrzychoooo
author_rank: Newbie
timestamp: August 27, 2013, 11:29:51 am
content: I would like to present my project salamander.The main idea of ??the salamander to enable easy configuration panel communicates with the microcontroller.This can be a fun alternative to the terminal if you want to show on your PC screen data from our ADC uC eg, temperature, logic states.The program also allows you to set / reset bits in the ports by clicking the mouse in the right bottom or set of analog values.The entire panel composes of different elements that can be added as needed.Each of the elements can be placed on the panel at any point by dragging it with the mouse.Each element has a number of settings related to the appearance such as width, height, display range values.Each element has its own address.The program is free and available for download atwww.my-electronics.euConfigure the following panel as below takes a few minutes.InstallationAfter downloading the software installs in a standard way through the installer ..It is recommended that before you uninstall the previous installation.The default is installed in "c: \ program files \ Salamander".Setup creates the "my documents" folder salamander, which is used to store configuration data.Proper operation requires the installation of Java JRE 1.7Configuration.On the "Tools" menu, select "Settings". This opens a blank panelNow, with the list of items to select what interests us and click 'add'.Use the mouse to drag the item to our panel. In the left pane displays the configuration module added item.Characteristic elementsThermometerElement shows the data in the form of a thermometer bar. In this element can set a minimum and maximum value.This is the range of the measured values.Example frame setter value of 21.5 in the element with the address 22 (decimal).LF_0__0_1__6_4__2_1__._ 5_CR0A 30 30 31 36 34 32 31 2E 35 0Danalog MeterElement simulating analog meter. The element can set the range of the measured values ??and the size.Example frame setter value of 15.3 in the element with the address 1234 (hex).LF 1 2 3 4 4 1 5. 3 CR0A 31 32 33 34 34 31 35 2E 33 0DcounterThe element can count events. You can set the number of digits and the size of graphic element.Counter allows you to increase the value other than one. Information increasing step is included in a data frame. While the program is the ability to set the initial value of the counter, alarm values ??and reset to zero.Counter after reaching an alarm is signaled by the sound.Example frame counter increasing by 5 at address 3 (dec);LF 0 0 0 3 1 5 CR0A 30 30 30 33 31 35 0Delement LEDElement is used to provide binary signals. You can configure the number of binary states in the range of 1 to 8, and the width and height of the element.Height set by adjusting the font size of labels describing the signals. States led correspond to the bits in the data word. To light up all the LEDs should be sent to the value of FF and to suppress the value of 00Frame sets the first 4 leds in the element with the address 32 (decimal)LF 0 0 2 0 2 0 F CR0A 30 30 32 30 32 30 46 0DText Label.A text element is used to describe. These elements are in a layer over all the elements so they can be arranged in the area of other elements.It is possible to set width, height, font size, color, and transparency.This element can also be set by the incoming frame.Example frame setter to "Volt" in the element of the address 0x0001.LF 0 0 0 1 4 V o l t CR0A 30 30 30 31 34 56 6F 6C 74 0DElement switches.Element is used to change the binary states. You can set the height, width and number of keys in the range 1 to 8The data represent a byte whose bits correspond to an individual bits.Example frames generated by setting all keys ONLF 0 0 2 0 2 F F CR0A 30 30 32 30 32 46 46 0DSlider elementElement is used to set the analog values. You can set the width, height, and the range of the setting values??.During operation, a new value can be set using the slider or by entering a value in the text box and approving the "Enter" key.Frame created after setting the 68 (dec) with address 5LF 0 0 0 5 2 4 4 CR0A 30 30 30 35 32 34 34 0D

author: AndrejaKo
author_rank: Frequent Contributor
timestamp: August 27, 2013, 11:24:53 pm
content: Looks interesting! I felt the need for such a program when experimenting, but was too lazy to actually write it. Thanks for taking time to do this.At the first look, program workflow doesn't look very good. For example, there's the need to manually restart the program when I'm done configuring. This makes it more difficult to change things "on the fly". It would be best if the need for restart was completely removed, but an automatic restart would be a step in the right direction. While I'm complaining about the configuration of elements, I think that there needs to be a way to edit current configuration. As far as I can see, the only way to do that would be to make a completely new one. This takes time and is a cause of frustration. Why should I have to make a new configuration, if I only want to edit a single value in a display? Also , it would be great if I could export and import configurations so I can have several of them. You're already writing configuration to files, so I don't see a reason why not to allow user to choose which one to use.Next, there are the menus which serve no function but are still there. For example, there's the file->open menu. In my opinion, it just adds to user confusion. It's been a while since I did any AWT programming in Java, but if I remember correctly, it should be extremely easy to just hide it from user, until it actually does something. I think that there was something like "hidden" property which could be set for an element.Also in my opinion words `configure` and `options` are too similar. Make a longer version of the inscription, like configure display elements and serial port options or something like that. People can easily confuse the two menu options. It should be obvious which option does what.On my computer I have 64 bit JRE installed. None of the RxTx stuff worked with it and there was no error message displayed to user about that and no mention of program NOT working in the documentation (or at last as far as I could find it). That's bad practice. I haven't worked with RxTx before, so I don't know how hard it is to get it to work on 64 bit systems, but I do know that it only takes a minute to add to the documentation that 32 bit JRE should be used. It would be even better to check when program is starting if JRE is 32 bit or not. You can check for example the System.getProperty("sun.arch.data.model") output to see if it's 64 bit and display a warning if it is. As a result, you simply get 32 or 64, so it shouldn't be too complicated to write an error message.Finally, if the program can't find the manifest.mf, it will think that there is a new version available and ask the user to get it. That's actually great! Most of the auto-update features I've seen are very badly broken and this one actually does something very useful. It would be even better if it could somehow figure out if it's just the manifest.mf that's missing. I got to see that bug, when I didn't set the running directory correctly once.Unfortunately, I couldn't see the Youtube video. For some reason, I can't load videos with low amount of views.I also don't have an AVR programmer at the moment, so I couldn't try out the demo on the microcontroller.In any case, great work so far!

author: ekrzychoooo
author_rank: Newbie
timestamp: August 28, 2013, 11:17:43 am
content: AndrejaKo thank you for your post. I know that this program has a lot of difficulties. This is a release candidate. Showing it on the forum and look forward to exactly the posts.The file menu open, it will operate in the future exactly as you write. This is the first light of the programI do not know how to insert video here.Thanks for all the suggestions.The following sample program work for ATMEGA8

author: jancumps
author_rank: Unknown
timestamp: August 28, 2013, 11:45:51 am
content: You can embed video if you use the Youtube http:// url in stead of https://

author: ekrzychoooo
author_rank: Newbie
timestamp: August 29, 2013, 11:09:27 am
content: Already a new versionSalamandraRCf. In the configuration panel added "Reload" button.

author: free_electron
author_rank: Super Contributor
timestamp: August 29, 2013, 01:39:07 pm
content: Good idea, but plenty of room for improvementI dont want to do floating point calcs on a microcontroller. Make the objects intelligent.So : for a thermometer:LF<address><cmd><argument><cr>Address : 4 digit hex code giving potential of 65535 ui elementsCmd : 1 digit hex code0: reset and create object , objecttype1: set title: argument is title for object (text to be displayed)2: set minimum value3: set maximum value4: set offset5: set gain6: set textcolor7: set backgroundcolor8: set scalecolor9: set alarmvalue highA: set alarmvalue lowB: set alarmcolor...F : set valueLets say i want a thermometer from -20 to + 50 degrees, white text black background , red alarmcolor , warning if passing 0 degree, warning if passing 30 degrees.LF BEEF 0 THERM CR. ' create thermometer objectLF BEEF 1 THERMOMETER CR ' set the object titleLF BEEF 2 -20 CR ' set minimumLF BEEF 3 50 CRLF BEEF 4 0 CRLF BREF 5 1 CRLF BEEF 6 FFFFFF CRLF BEEF 7 000000 CRLF BEEF 8 F32266 CRLF BEEF 9 40 CRLF BEEF A 0 CRLF BEEF B FF0000 CRThis would have initialised the component.Maybe you could use a two character command code and add top,left,width and height coordinated as well. That way the config strings could be built into the micros program. When connecting the ui would always build correctly.Salamander would send a command to the micro that says : give me the ui code... You simply send a long ascii string. Done. Salamander would have a graphical 'builder , to create the string.Now, in my a bove example i have set the thermometer the program assumes the micro will feed it data between -20 and 50 and will update the bargraph whenever i sendLF BEEF F 17.5 CRthis would show 17.5 degrees.But, this assumes that calculations will have been done on the micro to perform scaling... This requires floating point ! The output of the micros adc is a byte from 0 to 255!A bytecode of zero means -20, 255 means 50 degreesSo, by feeding offset and gain parameters to the object you can actually leave the floating point conversion to the pc.Simply tell it that there is an offset of -20 and that the gain is 255/70 (-20 to 50 is 70 degrees 'span')You could even provide to allow regular expressions so you could feed real formulasLF BEEF C ((SQR(X * 2.17))/3.14)+1.17 CRwhenever you feed data it is multiplied by 2.17, square root pulled , divided by 3.14 and then 1.17 added..You could define this as the salamander protocol.A microcontroller would send a special character like the tilde ( which looks like a wiggling salamander) . Of on the othere side a salamander visualisation program is present it answers with a pound sign #. ( which looks like a fishing net maze ) so this 'traps' the salamander. This pound sign is the trigger for the micro to send the entire configuration string so the salamander client can build the user interface.Storing the config string on the micro means that the user on the pc does not need to worry about having the correct ui file , and it cannot be misconfigured.Just my 2 cents....I like the idea...

author: mariush
author_rank: Super Contributor
timestamp: August 29, 2013, 01:51:52 pm
content: Sparkfun has some displays with an integrated processor and memory onto which you can upload some widgets like the ones you show and then the microcontroller only has to send serial data to the display and display renders everything.Seehttps://www.sparkfun.com/products/11377There's also a video or several videos on their Youtube channel showing them

author: Harvs
author_rank: Super Contributor
timestamp: August 30, 2013, 12:02:16 am
content: Quote from: mariush on August 29, 2013, 01:51:52 pmhmm, 4.3" display is $145. You can buy two 7" Android tablets and a couple of bluetooth modules for that money and have the full Android dev tools at your power.I like this Salamanda idea, and if it gets to a level of maturity I would use it. In particular I think F_E's idea of reg exp is an excellent one, another step further than that would be to also allow a CSV lookup table to be associated with a control that maps a highly non-linear sensor.

author: ekrzychoooo
author_rank: Newbie
timestamp: August 30, 2013, 02:38:07 pm
content: Quote from: free_electron on August 29, 2013, 01:39:07 pmfree_electron, it is a good idea. [Frame Type]  [LENGTH DATA] [REG EX MATH]   REG EX MATH eg [5 * x/1024]. expression will be able to include sine, cosine, tangent cotangent log ln square root, etc..PRECISION is the number of decimal pointsDATA is a 16 bits (two bytes in the code naturally)This allows reduction flash memory consumption of the processor. No data conversion in the microcontroller.Small ATTINY + salamander and you can measure.I think that within a week it will download.

author: free_electron
author_rank: Super Contributor
timestamp: August 30, 2013, 03:11:50 pm
content: Split the dataand the regexpression. There is no need to transmit every time the expression.You need to limit the amount of data that is sent. Only at startup does the micro send the expressionSo the data fram would look like thisLF<target object><data type><data>CRTarget object is the UI element you eant to send info to. 4 hex chars giving 65535 elementsData type tells the element what property you want to change 2 hex chars giving 256 propertiesProperty 0 means : initialise the element with the given elementtype.During ui creation you send the regexpression once.After that you simply update data. The regexpression is applied upon reception of new data.The ui program can be very small. You create objects on the flyWhenever a command string is received you split it in 3 fields.A simple parser does the rest.Case datatype0: case data1 : dim button as new buttonButton.tag = address2: dim textbox as new textboxTextbox.tag = addressEnd case1: for each control as object in me.controlsIf tag=address ... BlablablI have a program that creates user interface conpletely dynamic.At design time there is not a single element on the screen.A simple text file contains the layoutAt runtime the file is parsed, objects are created and positioned and the eventhandlers are dynamicaly hooked.I use this to control the chips i work on. Whenever the registermap changes ( registers added, bit moved ) or i want a different control for a specific field i simply update the textfile. I don't need to write a simgle line of code.So in essence this salamnder thing is the same. Send a bunch of commands on initialisation to create ui elelements. The ui handlers visualises and binds em.After that only data is transferred.