error: 'CurrentRelayState' was not declared in this scope

Do you have a question on how to do something.
Ask in here.
Post Reply
serhiyi
Posts: 49
Joined: Thu Jul 21, 2011 8:59 pm

error: 'CurrentRelayState' was not declared in this scope

Post by serhiyi »

I just got my controller today and playing with code. I'm using RAGen to see how that works (trying to see what WiFi module and other settings can do for me).

I generated code and trying to load it. I got this error and can't pass over it:

Code: Select all

C:\Users\S\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp: In member function 'void ReefAngelClass::ShowInterface()':
C:\Users\S\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp:1464: error: 'CurrentRelayState' was not declared in this scope
C:\Users\S\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp:1501: error: 'CurrentRelayState' was not declared in this scope
Am I missing something?

Thanks.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: error: 'CurrentRelayState' was not declared in this scop

Post by rimai »

I think you just found a bug :)
To overcome this, just make sure not to use the "Save Relay State" on the Features tab.
Then just generate the code again.
Roberto.
serhiyi
Posts: 49
Joined: Thu Jul 21, 2011 8:59 pm

Re: error: 'CurrentRelayState' was not declared in this scop

Post by serhiyi »

It still shows this error. What I did.

1. Opened REGen
2. Used defaults in "Features" and add WiFi
RAgen1.png
RAgen1.png (41.5 KiB) Viewed 5109 times
3. Used defaults in "PDE"
RAgen2.png
RAgen2.png (51.24 KiB) Viewed 5109 times
4. Used defualts in "Internal Memory"
RAgen3.png
RAgen3.png (51.5 KiB) Viewed 5109 times
5. Switched back to "PDE" and clicked Generate
6. Opened PDE file in Arduino (Reef Angel Controller)

Code: Select all

// Autogenerated file by RAGen (v1.0.4.92), (08/19/2011 23:01)
// RA_081911_2301.pde
//
// This version designed for v0.8.5 Beta 12 or later

/* The following features are enabled for this PDE File: 
#define DisplayImages
#define WavemakerSetup
#define DateTimeSetup
#define VersionMenu
#define ATOSetup
#define MetalHalideSetup
#define DirectTempSensor
#define DisplayLEDPWM
#define wifi
#define StandardLightSetup
*/


#include <ReefAngel_Features.h>
#include <ReefAngel_Globals.h>
#include <ReefAngel_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <ReefAngel_EEPROM.h>
#include <ReefAngel_NokiaLCD.h>
#include <ReefAngel_ATO.h>
#include <ReefAngel_Joystick.h>
#include <ReefAngel_LED.h>
#include <ReefAngel_TempSensor.h>
#include <ReefAngel_Relay.h>
#include <ReefAngel_PWM.h>
#include <ReefAngel_Timer.h>
#include <ReefAngel_Memory.h>
#include <ReefAngel.h>


void setup()
{
    ReefAngel.Init();  //Initialize controller

    // Ports that are always on
    ReefAngel.Relay.On(Port8);
}

void loop()
{
    ReefAngel.ShowInterface();

    // Specific functions
    ReefAngel.StandardATO(Port1);
    ReefAngel.StandardLights(Port2);
    ReefAngel.MHLights(Port3);
    ReefAngel.Wavemaker1(Port4);
    ReefAngel.Wavemaker2(Port5);
    ReefAngel.StandardFan(Port6);
    ReefAngel.StandardHeater(Port7);
}
Still got error
C:\Users\Sergey\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp: In member function 'void ReefAngelClass::ShowInterface()':
C:\Users\Sergey\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp:1464: error: 'CurrentRelayState' was not declared in this scope
C:\Users\Sergey\Documents\Arduino\libraries\ReefAngel\ReefAngel.cpp:1501: error: 'CurrentRelayState' was not declared in this scope
serhiyi
Posts: 49
Joined: Thu Jul 21, 2011 8:59 pm

Re: error: 'CurrentRelayState' was not declared in this scop

Post by serhiyi »

Tried with "Save Relay State" selected with same result :(
serhiyi
Posts: 49
Joined: Thu Jul 21, 2011 8:59 pm

Re: error: 'CurrentRelayState' was not declared in this scop

Post by serhiyi »

Looks like I fixed it.
I extracted all library files from RAGen installation and replaced files that I had before. Looks like this resolved the issue.

Sorry for false alarm.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: error: 'CurrentRelayState' was not declared in this scop

Post by rimai »

Make sure the libraries folder in RAGen is setup correctly.
Go to menu Edit->Settings and look at the libraries folder and make sure it points to "Documents\Arduino\libraries"
Roberto.
binder
Posts: 2865
Joined: Fri Mar 18, 2011 6:20 pm
Location: Illinois
Contact:

Re: error: 'CurrentRelayState' was not declared in this scop

Post by binder »

Good you got things fixed. There was an error when you enable the SaveRelayState feature.

The error has been fixed in the upcoming .17 release and SaveRelayState will now compile properly. I have not currently tested the feature but should work as expected.

curt
Post Reply