SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-26-2017, 11:02 AM
jvl711's Avatar
jvl711 jvl711 is offline
Sage Fanatic
 
Join Date: Jan 2004
Posts: 750
Studio and enums

Hi,

I am not sure if I am just being dense, but I am having an issue utilizing enums in a project I am working on in studio.

Here is the scenario

Method I am calling which returns an enum
Code:
public HVACMode getHVACMode()
The enum
Code:
public enum HVACMode
    {
        OFF("Off", "Off"),
        HEAT_ON("HeatOn", "Heat On"),
        COOL_ON("CoolOn", "Cool On"),
        AUTO_CHANGE_OVER("AutoChangeOver", "Auto Change Over"),
        UNKNOWN("Unknown", "Unknown");
        
        private String mode;
        private String name;
        
        private HVACMode(String mode, String name)
        {
            this.mode = mode;
            this.name = name;
        }
        
        public static HVACMode parseMode(String mode)
        {
            if(mode.equals(OFF.getMode()))
            {
                return OFF;
            }
            else if(mode.equals(HEAT_ON.getMode()))
            {
                return HEAT_ON;
            }
            else if(mode.equals(COOL_ON.getMode()))
            {
                return COOL_ON;
            }
            else if(mode.equals(AUTO_CHANGE_OVER.getMode()))
            {
                return AUTO_CHANGE_OVER;
            }
            else
            {
                return UNKNOWN;
            }
            
        }
        
        public String getMode()
        {
            return mode;
        }
        
        public String getName()
        {
            return name;
        }
    }
So I am trying to do this call and it is saying that is can not reflect the static value

Code:
IF jvl_vera_devices_Thermostat_getHVACMode(instance) == jvl_vera_devices_Thermostat_HVAVMode_OFF

Sage says it does not know what "jvl_vera_devices_Thermostat_HVAVMode_OFF" is. Is this possible. Am I doing something wrong. What do you do if there is an underscore in the name of the enum like "HEAT_OFF"?

Any help would be appreciated.

Josh
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Working with enums in Studio tmiranda SageTV Studio 2 09-04-2010 03:50 PM
Studio for V7 bclenney SageTV Studio 2 07-30-2010 02:57 PM
any chances of altering the graphics in sage without studio? studio users please read reboot_this SageTV Customizations 1 12-03-2004 04:03 AM


All times are GMT -6. The time now is 06:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.