Creating A In Use Status Page on C-Touch Colour

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Jesmond, Jun 3, 2006.

  1. Jesmond

    Jesmond

    Joined:
    May 18, 2005
    Messages:
    107
    Likes Received:
    0
    Location:
    Victoria
    Guys,

    I would like to create a page on a C-Touch Colour unit which only shows the status of all outputs which are ON and to display their current level. Could someone please advise if this concept would work and point me in the direction of where I could source this information?

    Regards
     
    Jesmond, Jun 3, 2006
    #1
  2. Jesmond

    coppo

    Joined:
    Sep 7, 2004
    Messages:
    221
    Likes Received:
    10
    Location:
    Adelaide
    This sounds alot easier than it is.

    considering that you have a minimum of 254 GA's on lighting and then at least 2 other applications that get used as well. You would need to reserve space for each GA so that they do not all display on top of each other, and once you have fully populated a page it would need to branch to a further page.

    reporting of the GA levels is simple, but the process of accumulating their levels and displaying them on the screen is where it falls down. because the logic engine cannot dynamically place components on a page, any displaying of info would need to be coded. I would suggest the alternative is a mimic panel setup where the level of standard components can be viewed.
     
    coppo, Jun 5, 2006
    #2
  3. Jesmond

    coppo

    Joined:
    Sep 7, 2004
    Messages:
    221
    Likes Received:
    10
    Location:
    Adelaide
    displaying GA's state on screen

    you can get the on state showing for a GA.

    Code supplied, and sample graphic of what the result is. It will show up the
    DECIMAL Group address and ON text to indicste that GA is currently on.

    As shown in the code window you will need to copy and paste some info to
    the global variables section and also some code into a new module
    ( the module name is irrelevant to the operation of the code)

    Code:
    < Global Variables>
    i : integer;
    X : integer;
    Y : integer;
    
    
    
    <Module Code>
    
    {You must nominate the page to be displayed or it will use
     the current active page }
    
    ShowPage("YOUR PAGE");
    ClearScreen;
    X := 20;
    Y := 0;
    for i := 0 to 254 do
      if GetLightingState(i) = ON then
      begin
        TextPos(X, Y);
        DrawText(i:3, ' ON');
        X := X + 50;
        if X > 550 then
        begin
          X := 20;
          Y := Y + 30;
        end;
    end;
    
    
     

    Attached Files:

    Last edited by a moderator: Jun 5, 2006
    coppo, Jun 5, 2006
    #3
  4. Jesmond

    JohnC

    Joined:
    Apr 6, 2005
    Messages:
    554
    Likes Received:
    1
    Location:
    Sydney
    I don't know Pascal or how to code for C-Bus, but I can see a potential modification of Coppo's code snippet. Firstly, within the loop you could retreive and print the GroupName - which would make it easier to understand.

    Also, what happens if there is not all groups used? Since Coppo loops from GA 0 to 254, there could be numerous groups undefined and therefore what will GetLightingState( ) return for the "non-existant" ones ?

    In this particular application it doesn't really matter because all Jesmond wants is to know is the Groups that are ON. But for other projects, is there a way to interrogate if a GA exists - and then use GetLightingState to determine if it's ON or OFF or whatever?

    Cheers, John
     
    JohnC, Jun 6, 2006
    #4
  5. Jesmond

    coppo

    Joined:
    Sep 7, 2004
    Messages:
    221
    Likes Received:
    10
    Location:
    Adelaide

    you can already see what happens for the non-existant GA's... nothing.

    For the example i did not specifically create 254 GA's!!

    In the toolkit project i had approx 15 more GA's than were used on the screen grab.

    It's not that unused groups are not defined, more that they don't exist at all, hence it only operates on valid values
    (ie: GA's present in the project within the defined parameters).
     
    Last edited by a moderator: Jun 6, 2006
    coppo, Jun 6, 2006
    #5
  6. Jesmond

    Jesmond

    Joined:
    May 18, 2005
    Messages:
    107
    Likes Received:
    0
    Location:
    Victoria
    Dear Mr Coppo,

    You are the best !!!! Thanks heaps for this. :D

    Regards
     
    Jesmond, Jun 6, 2006
    #6
  7. Jesmond

    PSC

    Joined:
    Aug 3, 2004
    Messages:
    626
    Likes Received:
    0
    Location:
    Brisbane, Australia
    Don't tell him that!

    It's taken us 4 years to get him to some sort of level of normality :p :p :p
     
    PSC, Jun 6, 2006
    #7
  8. Jesmond

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    This isn't easy to do. There is no function currently in logic to allow you to look up the tag for a group address.

    A "non-existant" group is regarded as being at level 0.

    No, there isn't a way to do this.
     
    Last edited by a moderator: Jun 7, 2006
    Darren, Jun 7, 2006
    #8
  9. Jesmond

    JohnC

    Joined:
    Apr 6, 2005
    Messages:
    554
    Likes Received:
    1
    Location:
    Sydney
    Oh yeah, DOH... the Tags are in the Toolkit Project XML, not the CTC. So you cannot interrogate Bus Network for tag names :eek:

    I guess the only other alternative would be to create a (hardcoded) array of (existing) load names or something similar, and then match what gets returned by the GetLightingState(i) loop with an element of that array.

    This would then allow you to draw a page showing all the loads, and display different text or graphic dependant on whether Coppo's GetLightingState loop returned true or false for a particular GA.

    However, the hard-coding I mention above really defeats the purpose of the whole exercise... it would be easier just to create a page of buttons, all set to show as Status Indicators. That is how I was doing it in the B&W screen, due to lack of logic engine.

    Cheers, John
     
    JohnC, Jun 7, 2006
    #9
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.