Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Returning to Fusion Brain - Bug Hunt

  1. #11
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    326
    Thanks for the description. That seems to work fine for the white boxes that represent a static image, but doesn't work for the maroon boxes underneath that determine changing things (in this case, multi-images.) Trouble is that as soon as you click the mouse, those maroon boxes disappear so you can't see what you're doing.

  2. #12
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    326
    With two graphs, and only one data readout (the one generously generated by the Ninja Kitty Wizard at the beginning), it's time to make another readout so that we know exactly what the second temperature is reading.

    MDX has done this by giving us a Static Image, and overlaying a Text Label on top. I recreated this in the following steps:

    1) Load your configuration, and go to the Graphical Layout screen again. Click the button New Static Image

    2) Don't worry about all the boxes with "0" in them. Click the Blue button, and navigate to the only static image provided with MDX. This is in the static_images folder. By selecting this, Configurator will automatically retrieve the size of the image, and set the default size of the image on screen. You can make it bigger or smaller if you want to, but for now, take a note of its size; 355, 70

    3) The position of the image can be anything you like, but to make it line up with the existing image, the values of 402, 119 are put in the Top Left Location fields. Tick the box in the Visible on Pages box.

    4) Z-Order relates to the idea that images can be placed on top of eachother, like layers. The higher the number, the closer to the top. This can stay at 0 for now. Click the Green Tick.

    5) To make the actual display, we need a Text Label. Click the New Text Label button.

    6) The name of the button is to identify it in the Configurator menu. The Default Text is the words shown alongside our varying input data, so I typed Temperature 2. How imaginative. Bear in mind that MDX will display the data from the sensor IMMEDIATELY after this text, so it would help to put a colon and a space after whatever you type as your Default Text. Otherwise, it'll look a bit strange.

    7) For the font, select Verdana, which is the one used on the other box. Give it the colour of white by double-clicking that black square and playing with the sliders, and set the size to 25 so that it matches the first box. Bear in mind that the colour of the entire Text Label is determined by the colour of your font, so if you don't change the colour here, then the Text Label will show up as an enormous black square in the Graphical Layout screen.

    8) Then, just like the multi-image, we have to select what kind of input, and which one, and tick the box to make it visible on the page. We also need to specify the size of the Text Label - it would be silly to make it bigger than the static image underneath (unless you want it like that) so put in those same numbers from Step 2; 355, 70. Click the Green tick, Save the Graphical Layout and go back to the Configurator, save your config and test in MDX

    COMMENT: It all worked extremely simply, but having snooped around the Static Images, the one I made had a Z-Order of "0", while the one made by the Ninja Kitty Wizard had a Z-Order of "0.9". I can't see the relevance of that just now.

    PRAISE: Adding text readouts of sensor data is an absolute breeze.

  3. #13
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    326
    As a Clean-Up, it would be nice to make those text labels read something interesting, and to give accurate names to all the elements (the multi-images, textlabels and static images) so that, as the Page gets more complicated, you can easily find what you're looking for.

    MDX, of course, is internally a very complicated piece of software, so you can't just right-click and rename stuff because then none of the internal coding will work So:

    1) I was a bit lazy with the Ninja Kitty Wizard, and now my first sensor is permanently known as Analogue Input 0. We'll change this by clicking the Analogue Inputs button in the left-hand window of Configurator, finding the Input that needs a new name, clicking on it and changing the name to Temperature 1. That part is simple.

    2) By doing this, we have had an impact on the Multi-image and the Text Label that displayed readings of Input 1. So now we need to check those to make sure they still know what they're reading

    3) In the same left-handed window, go to Multi-Images and find the one that references Input 1. If you double-click, you'll see that the pull-down menu where we selected our input has changed; Configurator has already updated the Input for us. Now is a nice time to change the Multi-image name, which I will do so to the very imaginative Temperature 1. Click the Green Arrow.

    4) Now, if we go to the Text Labels, there should be two; one made ourselves, and one generated by the Ninja Kitty. That generated one has the fantastic name "Text_Label_Analogue_Input_0", and won't work any more because there's no Input 0 to measure. So, double click on it, and you'll see what Configurator thinks is there. Go ahead and change the Name field if you like, as well as the Default Text (remember your colons and spaces!)

    5) Unlike the Multi-Image, you'll see that the Text Label window didn't automatically update our input, and Monitor ID is now showing the rather odd "variable_analogue_input_0". DON'T WORRY. Just click on the pull-down menu above it (the Monitor Type, where it says "Variable"), make your selection, and then choose your renamed input from the Monitor ID field. Click the Green Tick.

    6) Save your configuration and test in MDX. It should all still be working fine now.

    PRAISE: Changing the names of elements doesn't induce hours of head-scratching looking for that mis-placed letter in code

    POSSIBLE BUG: Text labels don't automatically update if you change the name of an Analogue Input.

  4. #14
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    326
    To complete this tutorial/test, I should add a few Digital Outputs. The Ninja Kitty offered me this, but, of course, I forgot to add it, so here's how to add a few buttons to control two on-off relays. SAVE A BACKUP FIRST, because there's a bug here.

    1) Add two Digital Outputs, by clicking the Add a Digital Output button. Specify a name, make sure the port number matches where you plugged in your relay, and that's it. Bear in mind that on old v3 boards like mine, the port numbers don't match up to the physical pins.

    2) Go to the Graphical Layout page again, and this time Add a New Display Button. These are the buttons that you click to trigger any kind of event. These are a bit more complicated that output Images, and the control window for the Display button is made up of three sections

    3) The first section, General Properties, is the positioning of the button on your page. Just like a Static Image, it needs a name, a location and a size. Unlike the Static Image page, Configurator won't generate a size from the defined graphics file, so you need to enter it manually. For our file, it is 230, 70.

    4) The second section, Graphics, determines the picture files you will use, so that as you click the button, it changes how it looks. MDX comes with two picture files (button.png and button_down.png) which you can use to make a button. Click the Blue button for Primary Image, and select button_down.png. Use this image for Pushed Image too. For Secondary Image and Disabled Image, select button.png. You cannot tick the Green Tick if you do not have all four image sections filled. You can also choose some Primary and Secondary text: counter-intuitively, Secondary text is what is displayed when the button is UNclicked, and the Primary is what is displayed when the button is depressed. DON'T CLICK THE GREEN ARROW AT THIS POINT, WHATEVER YOU DO. You NEED to fulfill the Votes section first.

    5) The third and most important section is Votes. If you get this wrong, you make a button that you cannot remove, so BE CAREFUL. On the Down Click section, press the Blue button and select an event you would like to happen when the button is clicked. For this example, I selected Trigger Output, and for the Target ID, I selected one of the two relays. You can now click the Green Tick, save the Graphical Layout and configuration, and test with MDX.

    6) If it all works ok, just do it all again to add a second button for the other relay.

    PRAISE: The complicated tasks of button control has been made very simple, and although I haven't explored their full capabilities, the basic concept of turning an Output on and off is a piece of cake.

    SERIOUS BUG: If you add a Display Button in the Graphical Editor, and don't fulfill ALL the requirements (such as Votes) the button won't show up in the Configurator list of Display Buttons, and is impossible to remove or modify.

  5. #15
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,032
    Quote Originally Posted by Grrrmachine View Post

    FLAW: Graphical Properties window doesn't have a clear way to drag elements around the screen
    Should just be a double left click to select the graphic element and move it around willy nilly. I prefer to use coordinates as it is more precise and faster for someone like me, but I added the double-click much later after a customer request.
    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

  6. #16
    Variable Bitrate Grrrmachine's Avatar
    Join Date
    Sep 2005
    Location
    Warsaw, Poland
    Posts
    326
    Like I said, you can't see what you're doing when dragging the maroon boxes (so text overlays or multi-images.) I agree with you though, using coordinates gives a better finish.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. *NEW* USB Input/Output Board -- Fusion Brain
    By 2k1Toaster in forum Fusion Brain
    Replies: 1123
    Last Post: 02-22-2010, 02:33 AM
  2. Replies: 17
    Last Post: 01-16-2009, 09:48 AM
  3. Replies: 3
    Last Post: 09-23-2008, 09: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, 08: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, 03: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
  •