Author Topic: HA Designer: How to define Control group for Floorplan element  (Read 3252 times)

eNoodle

  • Veteran
  • ***
  • Posts: 93
    • View Profile
HA Designer: How to define Control group for Floorplan element
« on: February 28, 2009, 10:45:55 pm »
Hi guys,

I came across a problem while building a floorplan screen using HA Designer. I used the Basic skin as an example, however the Screen itself (Floorplan with elements, Floorplan selection, Selection text) is working, beside the control box for a single light switch (On, Off, Dim).

When playing around with this, I noticed that the toolbar (control group) for a element is defined in Lightning Plugin function GetFloorplanDeviceInfo.

Code: [Select]
void Lighting_Plugin::GetFloorplanDeviceInfo(DeviceData_Router *pDeviceData_Router,EntertainArea *pEntertainArea,int iFloorplanObjectType,int &iPK_FloorplanObjectType_Color,int &Color,string &sDescription,string &OSD,int &PK_DesignObj_Toolbar)
{
switch(iFloorplanObjectType)
{
case FLOORPLANOBJECTTYPE_LIGHT_CEILING_LIGHT_CONST:
case FLOORPLANOBJECTTYPE_LIGHT_TABLE_LAMP_CONST:
case FLOORPLANOBJECTTYPE_LIGHT_WALL_SCONCE_CONST:
case FLOORPLANOBJECTTYPE_LIGHT_FLOOR_LAMP_CONST:
case FLOORPLANOBJECTTYPE_LIGHT_CHANDALIER_CONST:
case FLOORPLANOBJECTTYPE_LIGHT_PICTURE_LIGHT_CONST:
case FLOORPLANOBJECTTYPE_LIGHT_ACCENT_LIGHT_CONST:
OSD = pDeviceData_Router->m_sState_get();
if(OSD.find("OFF") != string::npos)
iPK_FloorplanObjectType_Color = FLOORPLANOBJECTTYPE_COLOR_LIGHT_CEILING_LIGHT_OFF_CONST;
else
iPK_FloorplanObjectType_Color = FLOORPLANOBJECTTYPE_COLOR_LIGHT_CEILING_LIGHT_ON_CONST;

PK_DesignObj_Toolbar=DESIGNOBJ_grpLightControls_CONST;
break;
default:
OSD = pDeviceData_Router->m_sState_get();
if(OSD.find("OFF") != string::npos)
iPK_FloorplanObjectType_Color = FLOORPLANOBJECTTYPE_COLOR_LIGHT_CEILING_LIGHT_OFF_CONST;
else
iPK_FloorplanObjectType_Color = FLOORPLANOBJECTTYPE_COLOR_LIGHT_CEILING_LIGHT_ON_CONST;

PK_DesignObj_Toolbar=DESIGNOBJ_grpLightControlsOnOff_CONST;
break;
};
}

Of course my Control Group (id: 5646) isn't shown, because DESIGNOBJ_grpLightControls_CONST is set to the id of the Basic skin (which is 2275). So I gave it a try and added the control group of the basic skin. Guess what? it is working, it is toggled when I select and deselect elements on the floorplan and it is sending the commands to the device.

So, how to go on with this? Building a new Lighting plugin based on the given one or is there a better way to solve that and get my control group shown, what do you think?

Thanks in advance,
eNoodle

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: HA Designer: How to define Control group for Floorplan element
« Reply #1 on: March 01, 2009, 02:35:06 am »
Add your stuff to lighting plugin, send us the patch.

-Thom

eNoodle

  • Veteran
  • ***
  • Posts: 93
    • View Profile
Re: HA Designer: How to define Control group for Floorplan element
« Reply #2 on: March 01, 2009, 11:10:45 am »
Hi Thom,

how will the system then know which plugin to use for what skin?

Even if I wouldn't wanted to use existing basic skin elements, I guess I have to stick with the basic control groups for lighting, sprinkler, thermostats and so on (so basically every item which is referenced as toolbar within an plugin). At least I can change the button layout, replacing the pictures.

Greets,
eNoodle

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: HA Designer: How to define Control group for Floorplan element
« Reply #3 on: March 01, 2009, 11:21:32 am »
You can derive which skin is being used, although for the life of me, I can't tell you exactly HOW off the top of my head. You may want to create a designobj skin override table, and do sql2cpp calls to reference that.

-Thom

eNoodle

  • Veteran
  • ***
  • Posts: 93
    • View Profile
Re: HA Designer: How to define Control group for Floorplan element
« Reply #4 on: March 01, 2009, 11:34:57 am »
ok, I'll digg deeper into HA Designer first and build the system for both, the basic controls and the new controls. this will make the skin usable from the very first beginning (using basic controls/given plugins) and later on I can adjust the plugins and make use of the new controls.

Maybe some other changes can also be done, for example the color of the floormap icon can show the dim status of each individual lamp, etc...

eNoodle