Home AMX User Forum NetLinx Studio

Color Wheel control

Hi...

I wanna give a customer the possibility to controll his RGB-lightning levels in his showroom,
with a Color-Wheel on his TP.

I wanna put up a picture of a color wheel on the TP, and based on his touches on the picture, give out coordinates based on:
Distance from center (0-100), reffering to saturation value.
Position in the sircle (0-360), reffering to Hue.

My only problem is, that i don`t have any idea of how to do it... :)
Any suggestions.

I also thought it might be implemented in TPD4????

Kenneth

Comments

  • Done it a bunch with just 4 levels and DMX controllers, allows for dynamic presets and real-time adjustments. Also gave the end-users the ability to edit timelines directly from the touch panel so they can adjust trigger times, effected presets and fade duration Played around with a color-picker model but didn't get too far with it, too busy at the time.
  • Jimweir192Jimweir192 Posts: 502
    Have a look at the joystick button type in TP4, this will give you x:y values
  • PhreaKPhreaK Posts: 966
    The joystick control will give you the input you need. You'll then need some trig functions to get your angle / distance (hue / saturation).
  • jjamesjjames Posts: 2,908
    Here's some C# code that I ported over to Netlinx.

    You indeed CAN change colors in TPD4 and in the panel on the fly - the problem is there that there's no way for it to report back to master so you can save the colors.

    I think my code has a bug in it, but not entirely sure. Play around with this and in the mean time I'll need to look for potentially updated / fixed code. I just don't have time or a way to test out what I have.
  • Joe HebertJoe Hebert Posts: 2,159
    jjames wrote: »
    You indeed CAN change colors in TPD4 and in the panel on the fly - the problem is there that there's no way for it to report back to master so you can save the colors.
    Can't you query the color with a CUSTOM_EVENT?
  • jjamesjjames Posts: 2,908
    Joe Hebert wrote: »
    Can't you query the color with a CUSTOM_EVENT?
    I never tried . . . I guess it's worth trying though. Got some spare time to test? ;)
  • yuriyuri Posts: 861
    i have posted my colorpicker code sometime ago.
    It works with CUSTOM_EVENT, and the "standard" AMX colorpicker from the setup pages.

    I really can't find the example code anymore, but I should be able to extract the needed information from my project module :)
  • jjamesjjames Posts: 2,908
    yuri wrote: »
    It works with CUSTOM_EVENT, and the "standard" AMX colorpicker from the setup pages.
    WHY DO I ALWAYS TRY TO REINVENT THE WHEEL?!

    That darn CUSTOM_EVENT . . . I alway forget about it.

    Just goes to show, many different ways to skin a cat.
  • yuriyuri Posts: 861
    jjames wrote: »
    WHY DO I ALWAYS TRY TO REINVENT THE WHEEL?!

    That darn CUSTOM_EVENT . . . I alway forget about it.

    Just goes to show, many different ways to skin a cat.

    I'll give you a code snippet :p
    BUTTON_EVENT[dvTP_Light,nColorPicker]
    {
        (* this works pretty well *)
        HOLD[1,REPEAT]:
        {
    	(* first copy the value to an invisible button *)
    	SEND_COMMAND dvTP_Light, "'^BMC-',ITOA(nColorPicker),',0,0,93,1,CF'"
    	(* then get that value *)
    	SEND_COMMAND dvTP_Light, "'?BCF-',ITOA(nColorPicker),',0'"; 
        }
    }
    

    then
    CUSTOM_EVENT[dvTP_Light,nColorPicker,1012]      // Fill Color
    {
    }
    

    like i said, I can't really post the particular code, since it's nested in a project...
  • AuserAuser Posts: 506
    Check out the "Real Time Customization" functionality in the Infocomm 2006 demo panels available on the AMX website. Combine the colour picker there with a custom event and you should have pretty much exactly what you need.
  • kennethkkennethk Posts: 86
    Thanks all!!

    I don`t know what i like the most....
    This forum or Amx products :)

    Thanks for the codes(James) and tips(All).

    I will go for the Color Picker, and test it out, to see if it actually is that "easy" :)

    I will tell, when it is out in the field working (or not).

    Have a nice one all!!
  • PhreaKPhreaK Posts: 966
    jjames wrote: »
    WHY DO I ALWAYS TRY TO REINVENT THE WHEEL?!

    So to speak...
  • PhreaK wrote: »
    So to speak...

    haha, missed that completely the first time. Good one Kim!
  • jjamesjjames Posts: 2,908
    LOL - I was waiting for someone to hit that one. :P

    Points go to Kim! :D
  • Thanks again...
    kennethk wrote: »
    Thanks all!!

    I don`t know what i like the most....
    This forum or Amx products :)

    Thanks for the codes(James) and tips(All).

    I will go for the Color Picker, and test it out, to see if it actually is that "easy" :)

    I will tell, when it is out in the field working (or not).

    Have a nice one all!!

    By the way!

    This one is working, and has been for a long time now...

    Just realised i promised to tell...

    Thanks again, and a happy new year to you all!!
Sign In or Register to comment.