Exemple #1
0
        public static ReturnKnowType GRBHandler(String Ra, String Dec, String FOV, DateTime UpdateTIme)
        {
            StationHandler ThisSite = KeeperData.FirstOrDefault(Item => Item.StationName == STATIONNAME.TNO);

            if (ThisSite == null)
            {
                return(ReturnKnowType.DefineReturn(ReturnStatus.FAILED, "Station TNO 2.4 Meter Telescope is now offline. Please contact Pakawat Prasit", null));
            }

            try
            {
                //ReturnDeviceInformation OutHum = ThisSite.GetDataT07ByCommandName(DEVICENAME.T24WSC, InformationdName.WEATHER_ATTRIBUTE_DATA_OUTHUM);
                //ReturnDeviceInformation Temp = ThisSite.GetDataT07ByCommandName(DEVICENAME.T24WSC, InformationdName.WEATHER_ATTRIBUTE_DATA_TEMPOUT);
                //ReturnDeviceInformation DewPt = ThisSite.GetDataT07ByCommandName(DEVICENAME.T24WSC, InformationdName.WEATHER_ATTRIBUTE_DATA_DEWPT);
                //ReturnDeviceInformation InfoDate = ThisSite.GetDataT07ByCommandName(DEVICENAME.T24WSC, InformationdName.WEATHER_ATTRIBUTE_DATA_DATE);
                //ReturnDeviceInformation InfoTime = ThisSite.GetDataT07ByCommandName(DEVICENAME.T24WSC, InformationdName.WEATHER_ATTRIBUTE_DATA_TIME);

                //if (Convert.ToDouble(OutHum.ReturnValue.Value) > 85)
                //    return ReturnKnowType.DefineReturn(ReturnStatus.Failed, "We can not open the dome because the humidity is heighter than 85%. (Weather time is " + InfoDate.ReturnValue.Value.ToString() +
                //        " " + InfoTime.ReturnValue.Value.ToString() + ")", null);
                //else if (Convert.ToDouble(Temp.ReturnValue.Value) - Convert.ToDouble(DewPt.ReturnValue.Value) <= 2)
                //    return ReturnKnowType.DefineReturn(ReturnStatus.Failed, "We can not open the dome because the dew point is too height. (Weather time is " + InfoDate.ReturnValue.Value.ToString() +
                //        " " + InfoTime.ReturnValue.Value.ToString() + ")", null);
            }
            catch { }

            return(ThisSite.RelayGRB(Ra, Dec, FOV, UpdateTIme));
        }