Page 1 of 4 1234 LastLast
Results 1 to 10 of 32

Thread: Phidgets app ?

  1. #1
    FLAC SNOtwistR's Avatar
    Join Date
    Nov 2009
    Location
    Keswick,On Canada
    Posts
    1,548

    Phidgets app ?

    Hi Clockwork How can I change the phidgets name for the sensors instead of analogue in_00, I could put comp volts, comp temp, comp humidity, left front, ect. Great work by the way on this addin Thanks SNO

  2. #2
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    703
    Quote Originally Posted by SNOtwistR View Post
    Hi Clockwork How can I change the phidgets name for the sensors instead of analogue in_00, I could put comp volts, comp temp, comp humidity, left front, ect. Great work by the way on this addin Thanks SNO
    This has been on my mind. The ability to name the inputs (and outputs) would be nice. I can probably add support for this. I was trying to keep the Config window simple, so it didn't need the OSK. And I was just happy enough that the Phidgets worked. But I realize that the ability to name the sensors is pretty much essential. Either this week's version or the next one should address this.

  3. #3
    FLAC SNOtwistR's Avatar
    Join Date
    Nov 2009
    Location
    Keswick,On Canada
    Posts
    1,548
    Nice! take your time, and you will have a great front-end. Thanks SNO

  4. #4
    FLAC SNOtwistR's Avatar
    Join Date
    Nov 2009
    Location
    Keswick,On Canada
    Posts
    1,548
    If I wanted to change the layout of the phidgets skin to add some graphics. Which files would I need to edit/locations? My thinking is gauge type graphics to display the volts, amps, ect. And you have enough on your plate getting v5 out. SNO

  5. #5
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    703
    DriveLine has a built-in function for drawing simple gauges. An example of it's use is the speedometer on the home screen. (I assume you know that clicking on the Logo area of the home screen shows a speedometer-widget-gauge-thing). Look in file Skin_Frame_Main.xml, there's an object named ImageMainGauge. It has a Paint event that looks like this:

    Code:
    PaintGauge ImageMainGaugeSpeed 0 140 10 -130 130 %speedexact%
    ImageMainGaugeSpeed is the name of the object being drawn on.
    0 is the min value
    140 is the max value
    10 is the increment for the labels on the gauge.
    -130 is the starting angle of the gauge.
    130 is the ending angle of the gauge.
    %speedexact% is the value of the gauge. In this case, you'd want to use %phidget_AnalogInFmt00% or %phidget_AnalogInFmt01%, or whichever corresponds to your sensor.

    The colors of the gauge come from the properties of the image object being drawn on.


    For a real easy start (if you don't mind temporarily breaking the speedometer), instead of trying to create a new window or frame, just modify the code that's drawing the speedometer. This is a quick and dirty way to see how it works.

    Step 1:
    In Skin_SkinEvents.XML, under APPEVENT_PHIDGETINPUTCHANGED, add this:
    InvalidateObject ImageMainGaugeSpeed
    That will tell it that the speedometer object needs to be repainted every time the phidgets change.

    Step 2:
    In the Skin_Frame_Main.xml file, under the object mentioned earlier, change %speedexact% to the phidget variable you want to monitor, and change the other values accordingly. You probably don't want to mess with the angles at first. Just the min, max, increment, and variable.


    When you get that working the way you want it to, then try making a new frame and adding multiple gauges.

  6. #6
    FLAC SNOtwistR's Avatar
    Join Date
    Nov 2009
    Location
    Keswick,On Canada
    Posts
    1,548
    Thanks now I have a project to play with SNO

  7. #7
    FLAC SNOtwistR's Avatar
    Join Date
    Nov 2009
    Location
    Keswick,On Canada
    Posts
    1,548
    What size is the workable area in the phidgets window, like whatever DL uses for space on the top and bottom and if any on the sides? whats left over to use for actual phidget data and names area. SNO

  8. #8
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    703
    The Skins in DriveLine allow for absolute values as well as percentage values (where the number is a percentage of the parent object's size). All the Default Skin files are written as percentages (so the skins scale to any screen size automatically). If my math is right on this one, the answer is...

    Width = 98% of screen width.

    Height = 68% of the screen height.

  9. #9
    Variable Bitrate
    Join Date
    May 2009
    Posts
    238
    Quote Originally Posted by ClockWorK View Post
    DriveLine has a built-in function for drawing simple gauges. An example of it's use is the speedometer on the home screen. (I assume you know that clicking on the Logo area of the home screen shows a speedometer-widget-gauge-thing). Look in file Skin_Frame_Main.xml, there's an object named ImageMainGauge. It has a Paint event that looks like this:

    Code:
    PaintGauge ImageMainGaugeSpeed 0 140 10 -130 130 %speedexact%
    ImageMainGaugeSpeed is the name of the object being drawn on.
    0 is the min value
    140 is the max value
    10 is the increment for the labels on the gauge.
    -130 is the starting angle of the gauge.
    130 is the ending angle of the gauge.
    %speedexact% is the value of the gauge. In this case, you'd want to use %phidget_AnalogInFmt00% or %phidget_AnalogInFmt01%, or whichever corresponds to your sensor.
    a bit off topic here:
    is the 140km a hard limit in driveline.
    I tried to change it to 280 to match my speedometer with an increment of 20. Looks good but does not match my car speed when car starts rolling !!

  10. #10
    Mod - Driveline forum
    Auto Apps:loading...
    ClockWorK's Avatar
    Join Date
    Oct 2003
    Location
    Michigan
    Posts
    703
    It is not a hard limit at all. I will look at the code.

    But first, did you change the speed unit from MPH to Km/H in the Settings screen?

Page 1 of 4 1234 LastLast

Similar Threads

  1. C++ and Phidgets
    By Ludercrs in forum Software & Software Development
    Replies: 9
    Last Post: 06-12-2008, 10:08 PM
  2. Help with Phidgets
    By Ludercrs in forum General Hardware Discussion
    Replies: 0
    Last Post: 06-04-2008, 04:20 PM
  3. Phidgets 8/8/8 in RR
    By _dopehead_ in forum Road Runner
    Replies: 23
    Last Post: 12-11-2005, 02:00 PM
  4. Phidgets
    By dmcdlrn in forum General Hardware Discussion
    Replies: 3
    Last Post: 07-26-2005, 10:03 PM
  5. Phidgets
    By strandtc in forum General Hardware Discussion
    Replies: 1
    Last Post: 09-04-2004, 01:44 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
  •