Page 2 of 5 FirstFirst 12345 LastLast
Results 11 to 20 of 41

Thread: Where do I even start??

  1. #11
    Low Bitrate
    Join Date
    Jul 2007
    Posts
    65
    Thanks! That helps a lot! Now if I wanted the image to change on the digital output setting (on or off) would that be instead of "Image_hover" or "Image_Click" would I code it as "Image_On" or "Image_Off"?

  2. #12
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by jjohnston View Post
    Thanks! That helps a lot! Now if I wanted the image to change on the digital output setting (on or off) would that be instead of "Image_hover" or "Image_Click" would I code it as "Image_On" or "Image_Off"?
    I think you should be doing this in a custom cs file, not in XML. It will get ugly fast in XML.

    I have implemented something real basic for you here. It requires the latest version, 1.1.0.469. If you don't have that version then open FuseGL and let it update. Then do the changes below. You can tell what version you have because it is the first line in the trace output.

    Add this to your UserGUIConfig.XML

    Code:
      <User_Object type="FuseGL_Object">
        <setting type="string" name="GL - HVAC CONTROL - FAN SPEED INDICATOR" />
        <image location="internal" path="NULL" />
        <size width="200" height="200" />
        <location x="300" y="50" alignment="left" z="0.0" />
        <setting type="bool" mouse_cursor_to_hand_on_hover="true" />
        <events>
          <startup action="FuseGL.ExecuteCode" inputArgs="Logic/ExternalExamples/HVAC_Example.cs;HVAC_Example.HVAC_Example;setup_HVAC;{this};{FB.DigitalOutput(0.1)};{FB.DigitalOutput(0.2)};{FB.DigitalOutput(0.3)};{FB.DigitalOutput(0.4)};" />
        </events>
      </User_Object>
    Then put the file "HVAC_Example.cs"in the directory "Logic/ExternalExamples": http://www.fusioncontrolcentre.com/F...VAC_Example.cs

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using FB_USB_2011;
    using FuseGL.GUI;
    
    namespace HVAC_Example
    {
        public class HVAC_Example
        {
            public enum FanSpeed
            {
                OFF,
                LOW,
                MEDIUM,
                HIGH
            }
    
            internal class MyInternalHVAC_FanSpeed_Class
            {
                public FB_Monitor.DigitalOutputPort DigitalOutputPort;
                public FuseGL.GUI.FGLO_Texture FGLO_Texture;
    
                public MyInternalHVAC_FanSpeed_Class(FB_Monitor.DigitalOutputPort digitalOutputPort, FGLO_Texture fgloTexture)
                {
                    DigitalOutputPort = digitalOutputPort;
                    FGLO_Texture = fgloTexture;
                }
            }
    
            internal Dictionary<FanSpeed, MyInternalHVAC_FanSpeed_Class> FanSpeedLookupDictionary = new Dictionary<FanSpeed,MyInternalHVAC_FanSpeed_Class>();
            internal FanSpeed currentFanSpeed = FanSpeed.OFF;
    
            public void setup_HVAC(
                                    FuseGL.GUI.FuseGL_Object displayFuseGL_Object_for_fan_speed,
                                    FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_off, 
                                    FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_low, 
                                    FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_medium, 
                                    FB_Monitor.DigitalOutputPort _digitalOutputPort_for_fan_high
                                  )
            {
                // Setup FanSpeed textures and ports
                FanSpeedLookupDictionary.Add(FanSpeed.OFF, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_off, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___OFF", "images/HVAC/FanSpeed/Off.png")));
                FanSpeedLookupDictionary.Add(FanSpeed.LOW, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_low, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___LOW", "images/HVAC/FanSpeed/Low.png")));
                FanSpeedLookupDictionary.Add(FanSpeed.MEDIUM, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_medium, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___MEDIUM", "images/HVAC/FanSpeed/Medium.png")));
                FanSpeedLookupDictionary.Add(FanSpeed.HIGH, new MyInternalHVAC_FanSpeed_Class(_digitalOutputPort_for_fan_high, FGLO_Texture.MakeQuickFGLOTexture___ConvertFromExternalImagePath("HVAC_Fan_Control___FanSpeedImage___HIGH", "images/HVAC/FanSpeed/High.png")));
    
                // Hook into when the FGLO is pressed
                displayFuseGL_Object_for_fan_speed.MouseEvent___ClickDown += new FuseGL_Object.FuseGL_FGLO_MouseEvent(ChangeHVAC_FanSpeed_Button_Was_Pressed);
    
                // Change the image to something known to begin with
                ChangeFanSpeed(currentFanSpeed, displayFuseGL_Object_for_fan_speed);
            }
    
            void  ChangeHVAC_FanSpeed_Button_Was_Pressed(object sender, FuseGL.FuseGL_GUI.MouseEventInformation MouseInfo)
            {
                switch(currentFanSpeed)
                {
                    case FanSpeed.OFF:
                        currentFanSpeed = FanSpeed.LOW;
                        break;
                    case FanSpeed.LOW:
                        currentFanSpeed = FanSpeed.MEDIUM;
                        break;
                    case FanSpeed.MEDIUM:
                        currentFanSpeed = FanSpeed.HIGH;
                        break;
                    case FanSpeed.HIGH:
                        currentFanSpeed = FanSpeed.OFF;
                        break;
                }
    
                ChangeFanSpeed(currentFanSpeed, (FuseGL.GUI.FuseGL_Object)sender);
            }
    
            public void ChangeFanSpeed(FanSpeed _speed, FuseGL.GUI.FuseGL_Object fanSpeedFGLO = null)
            {
                // Put some info in the trace for debugging perhaps?
                FuseGL.FuseGL_Debugger.Trace.Add("Changing Fan Speed to: " + _speed);
    
                // First turn off all the outputs
                foreach(KeyValuePair<FanSpeed, MyInternalHVAC_FanSpeed_Class> aFanSpeed in FanSpeedLookupDictionary)
                {
                    aFanSpeed.Value.DigitalOutputPort.Value = FB_Monitor.DigitalOutputPort.DIGITAL_OUTPUT_OFF;
                }
    
                // Then if it is a valid fan speed and the dictionary has been setup properly...
                if(FanSpeedLookupDictionary.ContainsKey(_speed))
                {
                    // Turn that output on
                    FanSpeedLookupDictionary[_speed].DigitalOutputPort.Value = FB_Monitor.DigitalOutputPort.DIGITAL_OUTPUT_ON;
    
                    // If the FGLO to display a picture in is valid...
                    if (fanSpeedFGLO != null)
                    {
                        // Change the texture to the correct one depicting the new fan speed
                        fanSpeedFGLO.TextureIsBeingOverriddenAndControlledExternally = true;
                        fanSpeedFGLO.TextureToOverrideWith = FanSpeedLookupDictionary[_speed].FGLO_Texture;
                    }
                }
                return;
            }
        }
    }
    Also make sure to copy these images into the directory "images/HVAC/FanSpeed" (you will need to create it)
    http://www.fusioncontrolcentre.com/F...ample/High.png
    http://www.fusioncontrolcentre.com/F...ple/Medium.png
    http://www.fusioncontrolcentre.com/F...xample/Low.png
    http://www.fusioncontrolcentre.com/F...xample/Off.png

    and the PSD if you want it: http://www.fusioncontrolcentre.com/F...Images_PSD.psd

    Then when you run it, you will see a big ugly FuseGL Object drawn to the screen that changes the mouse to a hover when you hover. When you click it, it will rotate between Off-Low-Medium-High. It will also turn on and off the outputs you need when you do so as commented in the CS file.

    It might be best at this point for you to see it, then ask me questions if you don't get it rather than me trying to explain it.

    Also you can download the Visual Studio Solution here I used to make it: http://www.fusioncontrolcentre.com/F...tomCS_File.zip
    Make sure to update the *.exe and *.dll that are used as references to the newest versions as they come out to keep them in sync.




    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

  3. #13
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    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

  4. #14
    Low Bitrate
    Join Date
    Jul 2007
    Posts
    65
    That's weird. for some reason I try it, but all I get is a blank FuseGL screen. I downloaded your images, and your .cs file to the proper locations... and made no changes to them, just ran them as they downloaded.

  5. #15
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by jjohnston View Post
    That's weird. for some reason I try it, but all I get is a blank FuseGL screen. I downloaded your images, and your .cs file to the proper locations... and made no changes to them, just ran them as they downloaded.
    Did you modify the UserGUI xml file?

    Post your trace if you did and it is just blank.
    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
    Low Bitrate
    Join Date
    Jul 2007
    Posts
    65
    [4444] 30.01.13|15:11:57:465 >> FuseGL Instance Created
    [4443] 30.01.13|15:11:57:411 >> Problem Executing Code: codeFileName = Logic/ExternalExamples/HVAC_Example.cs | className = HVAC_Example.HVAC_Example | functionName = setup_HVAC || System.Exception: Compiler Errors :
    Line 85,88 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_OFF'
    Line 92,105 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_ON'

    at FuseGL.Logic.FuseGL_CommonLogic.BuildAssembly(Stri ng code)
    at FuseGL.Logic.FuseGL_CommonLogic.makeExecutableCode Class(String code, String classname, String functionname)
    at FuseGL.Logic.FuseGL_CommonLogic.ExecuteCode_Entran ce(String codeFileName, String className, String functionName, Object[] inputArgs)
    at FuseGL.FuseGL.ExecuteCode(String codeFileName, String className, String functionName, Object[] inputArgs)
    [4442] 30.01.13|15:11:57:408 >>
    *** COMPILER ERROR ***
    : Compiler Errors :
    Line 85,88 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_OFF'
    Line 92,105 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_ON'


    [4441] 30.01.13|15:11:57:133 >> Invoking: FB.DigitalOutput
    [4440] 30.01.13|15:11:57:133 >> Invoking: FB.DigitalOutput
    [4439] 30.01.13|15:11:57:133 >> Invoking: FB.DigitalOutput
    [4438] 30.01.13|15:11:57:133 >> Invoking: FB.DigitalOutput
    [4437] 30.01.13|15:11:57:133 >> Invoking: FuseGL.ExecuteCode
    [4436] 30.01.13|15:11:57:095 >> Found Matching iSetting use Generic Reflection
    [4435] 30.01.13|15:11:57:094 >> Trying to cast iSettings to wrong type: {FuseGL.FuseGL_Common+Settings+Setting`1[FuseGL.GUI.Text.FuseGL_Font+FuseGL_Text]} being cast to {FuseGL.GUI.Text.FuseGL_Font+FuseGL_Text}
    [4434] 30.01.13|15:11:56:667 >> Successful Dynamic Allocation of Resource
    [4433] 30.01.13|15:11:56:650 >> Assembly Reference not found, trying to dynamically allocate and build from scratch for assembly [InputSimulator]...
    [4432] 30.01.13|15:11:56:619 >> ** WARNING ** Your Execute code needs to have "Logic\" infront of it to find the correct path. FuseGL is auto-adjusting
    [4431] 30.01.13|15:11:56:616 >> Found Matching iSetting use Generic Reflection
    [4430] 30.01.13|15:11:56:613 >> Trying to cast iSettings to wrong type: {FuseGL.FuseGL_Common+Settings+Setting`1[FuseGL.GUI.Text.FuseGL_Font+FuseGL_Text]} being cast to {FuseGL.GUI.Text.FuseGL_Font+FuseGL_Text}
    [4429] 30.01.13|15:11:56:609 >> Invoking: FB.DigitalOutput
    [4428] 30.01.13|15:11:56:608 >> Invoking: FuseGL.ExecuteCode
    [4427] 30.01.13|15:11:56:527 >> ** CONFIGURATOR --> DOING --> NOTHING
    [4426] 30.01.13|15:11:56:525 >> Adding [speech_bubble] to iSetting Master Hash : {<speech_bubble type="FuseGL_Object"><setting type="string" name="Error Speech Bubble FGLO" /><image location="internal" path="FuseGL.Configurator.Configurator_IMG_Resourc es.ErrorBubble" /><setting type="bool" mouse_cursor_to_hand_on_hover="true" /><size width="480" height="395" /><location x="0" y="0" z="0" alignment="center" /><text text="ERROR!!!" size="20.0" font="FuseGL" />"
    </speech_bubble>}

  7. #17
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Got it, perfect. I am so glad the trace file exists!

    I believe the error is that I forgot to update an internal resource. My machine uses external resources so I could not see it. Give me about 6 minutes, then relaunch and grab the update to 471.
    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

  8. #18
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Try the update now.
    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

  9. #19
    Low Bitrate
    Join Date
    Jul 2007
    Posts
    65
    just updated. now I'm getting the below...

    [4446] 30.01.13|15:59:10:193 >> Beginning List of Video information:
    [4445] 30.01.13|15:59:10:191 >> ***#* STARTING GRAPHICS INFO *#***
    [4444] 30.01.13|15:59:10:191 >> FuseGL Instance Created
    [4443] 30.01.13|15:59:10:135 >> Problem Executing Code: codeFileName = Logic/ExternalExamples/HVAC_Example.cs | className = HVAC_Example.HVAC_Example | functionName = setup_HVAC || System.Exception: Compiler Errors :
    Line 85,88 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_OFF'
    Line 92,105 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_ON'

    at FuseGL.Logic.FuseGL_CommonLogic.BuildAssembly(Stri ng code)
    at FuseGL.Logic.FuseGL_CommonLogic.makeExecutableCode Class(String code, String classname, String functionname)
    at FuseGL.Logic.FuseGL_CommonLogic.ExecuteCode_Entran ce(String codeFileName, String className, String functionName, Object[] inputArgs)
    at FuseGL.FuseGL.ExecuteCode(String codeFileName, String className, String functionName, Object[] inputArgs)
    [4442] 30.01.13|15:59:10:132 >>
    *** COMPILER ERROR ***
    : Compiler Errors :
    Line 85,88 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_OFF'
    Line 92,105 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_ON'


    [4441] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4440] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4439] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4438] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4437] 30.01.13|15:59:09:872 >> Invoking: FuseGL.ExecuteCode

  10. #20
    Fusion Brain Creator 2k1Toaster's Avatar
    Join Date
    Mar 2006
    Location
    Colorado, but Canadian!
    Posts
    10,049
    Quote Originally Posted by jjohnston View Post
    just updated. now I'm getting the below...

    [4446] 30.01.13|15:59:10:193 >> Beginning List of Video information:
    [4445] 30.01.13|15:59:10:191 >> ***#* STARTING GRAPHICS INFO *#***
    [4444] 30.01.13|15:59:10:191 >> FuseGL Instance Created
    [4443] 30.01.13|15:59:10:135 >> Problem Executing Code: codeFileName = Logic/ExternalExamples/HVAC_Example.cs | className = HVAC_Example.HVAC_Example | functionName = setup_HVAC || System.Exception: Compiler Errors :
    Line 85,88 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_OFF'
    Line 92,105 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_ON'

    at FuseGL.Logic.FuseGL_CommonLogic.BuildAssembly(Stri ng code)
    at FuseGL.Logic.FuseGL_CommonLogic.makeExecutableCode Class(String code, String classname, String functionname)
    at FuseGL.Logic.FuseGL_CommonLogic.ExecuteCode_Entran ce(String codeFileName, String className, String functionName, Object[] inputArgs)
    at FuseGL.FuseGL.ExecuteCode(String codeFileName, String className, String functionName, Object[] inputArgs)
    [4442] 30.01.13|15:59:10:132 >>
    *** COMPILER ERROR ***
    : Compiler Errors :
    Line 85,88 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_OFF'
    Line 92,105 : 'FB_USB_2011.FB_Monitor.DigitalOutputPort' does not contain a definition for 'DIGITAL_OUTPUT_ON'


    [4441] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4440] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4439] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4438] 30.01.13|15:59:09:872 >> Invoking: FB.DigitalOutput
    [4437] 30.01.13|15:59:09:872 >> Invoking: FuseGL.ExecuteCode
    What's the first line in your trace file, where it spits out the version?

    And do you have anything else in that directory other than the EXE and the trace file?
    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

Page 2 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. start with oem bezel or start from scratc
    By slociviccoupe in forum Fabrication
    Replies: 4
    Last Post: 04-08-2012, 02:01 AM
  2. start with oem ezel or start from scratc
    By slociviccoupe in forum Fabrication
    Replies: 0
    Last Post: 04-01-2012, 11:54 PM
  3. Remote Start Fried? Car continously tries to start
    By Phatsacks in forum General Hardware Discussion
    Replies: 4
    Last Post: 08-17-2008, 06:39 PM
  4. Replies: 1
    Last Post: 10-23-2006, 10:44 PM
  5. Where to start...
    By Rosebud6 in forum Road Runner
    Replies: 5
    Last Post: 12-09-2005, 04:02 AM

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
  •