Changeset 17640


Ignore:
Timestamp:
03/31/14 16:16:52 (11 years ago)
Author:
tbretz
Message:
Implemented an outomatic voltage off at sunrise
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/biasctrl.cc

    r17515 r17640  
    16051605
    16061606    bool fExpertMode;
    1607     bool fEmergencyShutdown;
    16081607
    16091608    Time fSunRise;
     
    18671866    {
    18681867        fBias.RampAllDacs(0);
    1869         fEmergencyShutdown = true;
    1870         T::Info("Emergency Sutdown initiated.");
    1871         return T::GetCurrentState();
     1868        T::Info("Emergency shutdown initiated.");
     1869        return State::kLocked;
    18721870    }
    18731871
    18741872    int Unlock()
    18751873    {
    1876         fEmergencyShutdown = false;
    1877         return T::GetCurrentState();
     1874        return fBias.GetStatus();
    18781875    }
    18791876
     
    18851882        if (now>fSunRise)
    18861883        {
    1887             if (state==State::kRamping       ||
    1888                 state==State::kVoltageOn     ||
    1889                 state==State::kNotReferenced)
    1890                 return Shutdown();
    1891 
    1892             if (state==State::kLocked)
     1884            if ((state==State::kRamping       ||
     1885                 state==State::kVoltageOn     ||
     1886                 state==State::kNotReferenced ||
     1887                 state==State::kOverCurrent))
    18931888            {
    1894                 fSunRise = now.GetNextSunRise(-6);
    1895 
    1896                 ostringstream msg;
    1897                 msg << "Next sun-rise will be at " << fSunRise;
    1898                 T::Info(msg);
    1899 
    1900                 return T::GetCurrentState();
     1889                T::Error("Voltage on at end of nautical twilight!");
     1890                Shutdown();
    19011891            }
    1902         }
    1903 
    1904         if (T::GetCurrentState()==State::kVoltageOff && T::GetCurrentState()==State::kLocked)
     1892
     1893            fSunRise = now.GetNextSunRise(-6);
     1894
     1895            ostringstream msg;
     1896            msg << "During next sun-rise nautical twilight will end at " << fSunRise;
     1897            T::Info(msg);
     1898
    19051899            return State::kLocked;
    1906  
     1900        }
     1901
    19071902        if (fExpertMode && state>=State::kConnected)
    19081903            return State::kExpertMode;
Note: See TracChangeset for help on using the changeset viewer.