Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Returning to Fusion Brain - Bug Hunt

  1. #1
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    346

    Returning to Fusion Brain - Bug Hunt

    Bought a v3 board over a year ago, and unfortunately left it sitting on a shelf for a year as I concentrated on other projects. Now it's time to de-fluff it, and see how the Fusion team have developed in the past year. This thread will therefore document me learning the Brain and the software, and throwing up any bugs or issues, tips and, of course, praise, as required.

    The test setup is two relays and two temp sensors connected to random inputs to see what happens. The aim is to build a dash-needle image representing the temperatures.

    So, I downloaded and installed the new software and drivers with no hassles (what a difference!) and got straight in. Loading the configurator, the brain was detected and identified correctly, and I could quickly make a page that allowed me to read raw voltage and turn the relays on and off.

    FIRST BUG: The Ninja Kitty identified a v3 board, but didn't change the version number from the default (4) to the required (3). With no label for the n00b user to know what that "4" represents, the resulting config file didn't control the Brain in any way.

  2. #2
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    346
    The next step is to add the temp gauge.

    The Configurator comes with a number of image files in the "sample skin" folder. These can be used to create something that moves as the values change, to give you an idea of how it works. So:

    1) Once you have a default configuration with one Brain and one Temp sensor added, click on the Edit Graphical Qualities button

    2) Work out where you want the corner of your image to be. Use the cursor-lines and the ruler, and make a note of that pixel location (100, 200 for example)

    3) In the new window, Insert a New Multi-Image

    4) In the new window, give the image a Name, select Analogue Input from the Monitor Type list, and then choose the temp sensor you declared using the Ninja Kitty Wizard. Click the tick box underneath to make it visible on the first screen.

    5) Remember where you want it to show up in the screen. Type those two numbers (100, 200) in the Top Left Location boxes. Also, decide how big you want this guage to be. The size of the picture files we are using is 150 by 150. Put those numbers in the Display At Size boxes.

    6) Now, click the yellow folder icon and navigate to the multi-image folder buried somewhere in the Sample Skin folder. Once you've selected the folder, the Configurator will load a window telling you to enter a range. Knowing the Brain reads 0-5V, I chose 0.0 as the lower and 5.0 as the higher, just to see what happens.

    This loaded over 170 images in a sequence in the main window. You can now see that each image has assigned to it a tiny range of values, so that as the readings are taken from the input, the relevant image is shown on MDX. At this point it's ok to press the Green arrow.

    7) back in the Graphical Layout window, click Save Graphics State.

    At this point, I saved my config, quit Configurator and loaded MDX.

    There were immediate results. Not pretty or accurate, but a fully-working moving image was quickly produced with little drama, and this is an incredible achievement. Presumably because of the random ranges I had chosen, the graph started at a very advanced stage and flickered around a lot in its readings, but you can still clearly see a bar progressing along as the sensor warmed up.

    PRAISE: Configurator lets you quickly and easily make a gauge and provides all graphics required to do so.

  3. #3
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    346
    So, with a rudimentary but not-really-accurate guage made, it's time to work out how to edit that guage to show a better sweep of information. Here's how I went through it:

    1) Open up the Configurator and load your configuration again. Now, in the top-left of the three Configurator windows (ignoring the top menu bars) there's a button marked Multi Images. Clicking through to this will let you directly edit the properties of the gauge without going back through the Edit Graphical Properties screen.

    2) Now we're in the multi-image form, we'll be concentrating on the left side of the screen. The original generated multi-image had 180 pictures and, going through them one by one, the images had been generated in an incorrect order, even though the ranges underneath are in numerical order. This is because of the numbering of the image files - 0.png to 180.png. Configurator understands that the sequence is 0.png, 1.png, 10.png, 100.png, 101.png... and therefore 180.png is before 2.png.

    3) You can edit the properties of each image by typing in the new Values in the lower fields. You can also delete images or add more. Because I auto-generated a 180-image sequence with flaws, it's a pain in the arse to delete them all one by one, so I cheated, made a new Config file and started afresh.

    4) With a new, clean and empty Multi-image, you can add your own frames with the Green Plus sign. This will make a new empty image with values of zero, added to the END of any existing sequences of images (which is annoying if you want to insert a new image in between two existing ones.)

    5) Once this new image has been made, click on the Blue button to associate an picture file with that image.

    6) Next, type in the minimum and maximum values in the appropriate fields. Do this AFTER loading the picture file - if you do it before, loading the picture file will reset whatever values you typed in to 0 and 5.

    7) Once you've got the range for your first image, click the Green Plus again, and make the next image in your sequence. For my test, I used 11 images reading voltage from 0 to 2, with increments of 0.2. Therefore, Image 1 was 0 to 0.19, Image 2 was 0.2 to 0.39, and so on.

    8) When you've made all your images and set their ranges, tick the green arrow to return to the main Configurator, save the configuration and test with MDX. It's that simple.

    COMMENT: Because my temp sensor was set to display Raw Voltage, I noticed that as it made the transition from 0.79 to 0.8V the image went blank. This was because the Brain reads to four decimal places (so 0.79 is really 0.7900) and, with the next image at 0.8000, no image was shown for the values of 0.7901 to 0.7999. It's a silly mistake to make, but it's worth bearing in mind when manually configuring the ranges for each image.



    POSSIBLE BUG:
    Adding a picture file after inserting the values for that image will reset the values for that image to 0 and 5.

    POSSIBLE BUG:
    The way Configurator reads the numerical order of files when creating multi-images from a folder.

    MISSING FEATURE: Ability to re-order the sequences of images. When you add another image to the sequence, it is always added to the end, and cannot be "inserted" between two existing images, which makes keeping track of the ranges associated with each image very complicated with big multi-images.

    MISSING FEATURE: A Delete-All button

    PRAISE: It's all very intuitive, just think of each Image as the frame of an old movie film.

  4. #4
    Constant Bitrate ACCLR8N's Avatar
    Join Date
    Apr 2009
    Location
    Davisburg, MI
    Posts
    195
    If you make a folder (desktop) with just your multi-images in it. And name each image like Temp001, Temp002, Temp003... You can select the folder, enter the range and configurator will do the rest. It will pull all the images into your skin file when you save. If you want to use the same images for another gauge, select your folder again as it will just harmlessly overwrite the first images.

    I always seem to mess up the simple math for the range and end up having to tweak each images range to align with my static image values however.

  5. #5
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    346
    Yes, I can see that renaming your files to address the issue is feasible, but the idea of this test was to see how you could progress on JUST the files the Fusion team have provided. In this scenario, the picture files that form part of the installation are numbered 0.png, 1.png, 2.png and so on, which would require 100 right-clicks, 100-Renames, and 110 presses of the "0" key to make the first 100 files 000.png, 001.png, 002.png to bypass this issue.

  6. #6
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by Grrrmachine View Post
    Yes, I can see that renaming your files to address the issue is feasible, but the idea of this test was to see how you could progress on JUST the files the Fusion team have provided. In this scenario, the picture files that form part of the installation are numbered 0.png, 1.png, 2.png and so on, which would require 100 right-clicks, 100-Renames, and 110 presses of the "0" key to make the first 100 files 000.png, 001.png, 002.png to bypass this issue.
    I generally use Photoshop and put it on batch rename. Works pretty well.
    Fusion Brain Version 6 Released!
    1.9in x 2.9in -- 47mm x 73mm
    30 Digital Outputs -- Directly drive a relay
    15 Analogue Inputs -- Read sensors like temperature, light, distance, acceleration, and more
    Buy now in the MP3Car.com Store

  7. #7
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    346
    Thanks for the tip Toaster, I'd never used the Bridge feature of Photoshop CS3 so that helped speed things up. I've also attached the renamed files in a thread in the Skins forum. Maybe you could put them in the next install file for tMDX.

    Considering how simple you've made everything, I'd like to edit this thread into a Walkthrough for Noobs, complete with files, so that people with no maths skills or programming knowledge (like me!) can get a Brain up and running in 5 minutes.

  8. #8
    Raw Wave
    Join Date
    Nov 2009
    Posts
    2,118
    Excellent thread Grrr!

    For file renames, I've been using "Renamer" from http://www.den4b.com/downloads.php for years.

    Fairly intuitive, and you can store oft used routines. Warns of conflicts etc.

    If only windoze had the unix soft-link capability (though I'm still using w2k...)

  9. #9
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    346
    Having renamed the files to a numerical sequence compatible with MDX, it was time to make the second graph for the second sensor

    1) Loading the existing config, I clicked the Add An Analogue Input button on the top menu bar

    2) This loaded a new window with a small number of options. Name, Brain and Port Number should be obvious. There are also two other options: Auto Average and History. These two combine historic port data to get rid of irritating "wobbles" caused by the Brain's inputs being so accurate. The default setting is "True" for Auto Average, and "0" for History, which seems contradictory. I set the History to 50, just to see what happened. Tick the Green Arrow.

    3) Now go back to the main window and click the Edit Graphical Properties button again. Now, you WON'T see the first multi-image that was made. Don't worry, it's still there. If you click on something else on the window, like the title bar, all the other elements will show up as maroony-red boxes, so you can see where the current multi-image is.

    4) Insert a New Multi-Image, and give it a name that's different to the other multi-image. Select the Analogue Input, and select the new input that you just added. Don't forget to tick the box to add it to the page.

    5) Damn, I didn't think where I wanted to position this new graph. Never mind, have some random numbers (500, 500), and the image sizes again (150, 150)

    6) This time, it's time to try making a sequence of images from a folder. So, click on the folder button and navigate to the renamed images. Now this time, I remebered that my last temp sensor was about 0.8Volts at room temperature, so I'll give a low range of 0.6 and a high range of 1.0, to see how the graph moves. Click the Green Arrow.

    7) Bang, 181 images generated with fantastically detailed ranges for each. Clcik the green arrow

    8) Don't forget to click Save on the Graphical Properties window, then close, save the Configuration, and test in MDX

    9) And it works. One graph is, of course, weirdly misplaced and overlaps the other, but going back to the Edit Graphical Properties window doesn't seem to help. It looks like there's a feature, through a random series of left- and right-clicking, to select an image and relocate it on the screen, but I couldn't figure it out, so I went back to the main Configurator screen and lined everything up by typing in co-ordinates using the Multi-Image button in the top-left Configurator window

    PRAISE: Extremely easy to add more features to a configuration.

    FLAW: Graphical Properties window doesn't have a clear way to drag elements around the screen

  10. #10
    Constant Bitrate ACCLR8N's Avatar
    Join Date
    Apr 2009
    Location
    Davisburg, MI
    Posts
    195

    Dragging images in graphic editor

    #9 2ways: Cursor on image left click, left click, left click and hold to drag. Or double left click, left click to select, drag image and left click to place. Z-order is important. If images overlap, the lower number Z-ordered image is selected. Labels are always on top.

Page 1 of 2 12 LastLast

Similar Threads

  1. *NEW* USB Input/Output Board -- Fusion Brain
    By 2k1Toaster in forum Fusion Brain
    Replies: 1123
    Last Post: 02-22-2010, 03:33 AM
  2. Replies: 17
    Last Post: 01-16-2009, 10:48 AM
  3. Replies: 3
    Last Post: 09-23-2008, 10:00 PM
  4. How to add a Fusion Brain instance to your configuration file
    By 2k1Toaster in forum FB Documentation and Tutorials
    Replies: 0
    Last Post: 06-07-2008, 09:42 AM
  5. Bug Tracking (sorry long but please read)
    By liquid_smoke in forum Software & Software Development
    Replies: 23
    Last Post: 04-22-2005, 04:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •