public void GetStructure(ASTROCLIENT Astroclient, TS700MM TS700mm, ASTROHEVENDOME Dome, IMAGING Imaging, SQM Sqm, SEEING Seeing, ALLSKY Allsky, WEATHERSTATION Weatherstation, LANOUTLET Lanoutlet, CCTV CCTV, GPS GPS, ASTROSERVER Astroserver) { }
public static dynamic InformationNameConveter(DEVICECATEGORY DeviceName, String FieldNameStr) { switch (DeviceName) { case DEVICECATEGORY.TS700MM: TS700MM TS700MMFieldName = Enum.GetValues(typeof(TS700MM)).Cast <TS700MM>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (TS700MMFieldName == TS700MM.NULL) { return(null); } else { return(TS700MMFieldName); } case DEVICECATEGORY.ASTROHEVENDOME: ASTROHEVENDOME ASTROHEVENDOMEFieldName = Enum.GetValues(typeof(ASTROHEVENDOME)).Cast <ASTROHEVENDOME>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (ASTROHEVENDOMEFieldName == ASTROHEVENDOME.NULL) { return(null); } else { return(ASTROHEVENDOMEFieldName); } case DEVICECATEGORY.IMAGING: IMAGING IMAGINGFieldName = Enum.GetValues(typeof(IMAGING)).Cast <IMAGING>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (IMAGINGFieldName == IMAGING.NULL) { return(null); } else { return(IMAGINGFieldName); } case DEVICECATEGORY.SQM: SQM SQMFieldName = Enum.GetValues(typeof(SQM)).Cast <SQM>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (SQMFieldName == SQM.NULL) { return(null); } else { return(SQMFieldName); } case DEVICECATEGORY.SEEING: SEEING SEEINGFieldName = Enum.GetValues(typeof(SEEING)).Cast <SEEING>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (SEEINGFieldName == SEEING.NULL) { return(null); } else { return(SEEINGFieldName); } case DEVICECATEGORY.ALLSKY: ALLSKY ALLSKYFieldName = Enum.GetValues(typeof(ALLSKY)).Cast <ALLSKY>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (ALLSKYFieldName == ALLSKY.NULL) { return(null); } else { return(ALLSKYFieldName); } case DEVICECATEGORY.WEATHERSTATION: WEATHERSTATION WEATHERSTATIONFieldName = Enum.GetValues(typeof(WEATHERSTATION)).Cast <WEATHERSTATION>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (WEATHERSTATIONFieldName == WEATHERSTATION.NULL) { return(null); } else { return(WEATHERSTATIONFieldName); } case DEVICECATEGORY.LANOUTLET: LANOUTLET LANOUTLETFieldName = Enum.GetValues(typeof(LANOUTLET)).Cast <LANOUTLET>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (LANOUTLETFieldName == LANOUTLET.NULL) { return(null); } else { return(LANOUTLETFieldName); } case DEVICECATEGORY.CCTV: CCTV CCTVFieldName = Enum.GetValues(typeof(CCTV)).Cast <CCTV>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (CCTVFieldName == CCTV.NULL) { return(null); } else { return(CCTVFieldName); } case DEVICECATEGORY.GPS: GPS GPSFieldName = Enum.GetValues(typeof(GPS)).Cast <GPS>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (GPSFieldName == GPS.NULL) { return(null); } else { return(GPSFieldName); } case DEVICECATEGORY.ASTROCLIENT: ASTROCLIENT ASTROCLIENTFieldName = Enum.GetValues(typeof(ASTROCLIENT)).Cast <ASTROCLIENT>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (ASTROCLIENTFieldName == ASTROCLIENT.NULL) { return(null); } else { return(ASTROCLIENTFieldName); } case DEVICECATEGORY.ASTROSERVER: ASTROSERVER ASTROSERVERFieldName = Enum.GetValues(typeof(ASTROSERVER)).Cast <ASTROSERVER>().ToList().FirstOrDefault(Item => Item.ToString() == FieldNameStr.ToUpper()); if (ASTROSERVERFieldName == ASTROSERVER.NULL) { return(null); } else { return(ASTROSERVERFieldName); } default: return(null); } }
public static void NewASTROSERVERInformation(STATIONNAME StationName, DEVICENAME DeviceName, ASTROSERVER FieldName, Object Value, DateTime DataTimestamp) { StationHandler ExistingStation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName); if (ExistingStation != null) { ExistingStation.NewASTROSERVERInformation(DeviceName, FieldName, Value, DataTimestamp); } }
public static dynamic ConvertFieldNameStrToFIELDNAME(String FieldName) { TS700MM ThisTS700MM = Enum.GetValues(typeof(TS700MM)).Cast <TS700MM>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisTS700MM != TS700MM.NULL) { return(ThisTS700MM); } ASTROHEVENDOME ThisASTROHEVENDOME = Enum.GetValues(typeof(ASTROHEVENDOME)).Cast <ASTROHEVENDOME>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisASTROHEVENDOME != ASTROHEVENDOME.NULL) { return(ThisASTROHEVENDOME); } IMAGING ThisIMAGING = Enum.GetValues(typeof(IMAGING)).Cast <IMAGING>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisIMAGING != IMAGING.NULL) { return(ThisIMAGING); } SQM ThisSQM = Enum.GetValues(typeof(SQM)).Cast <SQM>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisSQM != SQM.NULL) { return(ThisSQM); } SEEING ThisSEEING = Enum.GetValues(typeof(SEEING)).Cast <SEEING>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisSEEING != SEEING.NULL) { return(ThisSEEING); } ALLSKY ThisALLSKY = Enum.GetValues(typeof(ALLSKY)).Cast <ALLSKY>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisALLSKY != ALLSKY.NULL) { return(ThisALLSKY); } WEATHERSTATION ThisWEATHERSTATION = Enum.GetValues(typeof(WEATHERSTATION)).Cast <WEATHERSTATION>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisWEATHERSTATION != WEATHERSTATION.NULL) { return(ThisWEATHERSTATION); } LANOUTLET ThisLANOUTLET = Enum.GetValues(typeof(LANOUTLET)).Cast <LANOUTLET>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisLANOUTLET != LANOUTLET.NULL) { return(ThisLANOUTLET); } CCTV ThisCCTV = Enum.GetValues(typeof(CCTV)).Cast <CCTV>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisCCTV != CCTV.NULL) { return(ThisCCTV); } GPS ThisGPS = Enum.GetValues(typeof(GPS)).Cast <GPS>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisGPS != GPS.NULL) { return(ThisGPS); } ASTROCLIENT ThisASTROCLIENT = Enum.GetValues(typeof(ASTROCLIENT)).Cast <ASTROCLIENT>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisASTROCLIENT != ASTROCLIENT.NULL) { return(ThisASTROCLIENT); } ASTROSERVER ThisASTROSERVER = Enum.GetValues(typeof(ASTROSERVER)).Cast <ASTROSERVER>().ToList().FirstOrDefault(Item => Item.ToString() == FieldName); if (ThisASTROSERVER != ASTROSERVER.NULL) { return(ThisASTROSERVER); } return(null); }