Example #1
0
        public void SubscribeInformation(STATIONNAME StationName, DEVICENAME DeviceName, dynamic FieldName)
        {
            ServerCallBack   ClientCallBack = OperationContext.Current.GetCallbackChannel <ServerCallBack>();
            OperationContext Context        = OperationContext.Current;

            AstroData.SubscribeInformation(StationName, DeviceName, FieldName, Context.SessionId, ClientCallBack);
        }
Example #2
0
 public void AddLANOUTLET(STATIONNAME StationName, DEVICENAME DeviceName, LANOUTLET[] FieldName, Object[] Value, DateTime[] DateTime)
 {
     for (int i = 0; i < FieldName.Count(); i++)
     {
         AstroData.NewLANOUTLETInformation(StationName, DeviceName, FieldName[i], Value[i], DateTime[i]);
     }
 }
Example #3
0
 public void AddASTROSERVER(STATIONNAME StationName, DEVICENAME DeviceName, ASTROSERVER[] FieldName, Object[] Value, DateTime[] DateTime)
 {
     for (int i = 0; i < FieldName.Count(); i++)
     {
         AstroData.NewASTROSERVERInformation(StationName, DeviceName, FieldName[i], Value[i], DateTime[i]);
     }
 }
Example #4
0
        public static void DisplayToUI(STATIONNAME StationName, DEVICENAME DeviceNameStr, INFORMATIONSTRUCT ThisInformation)
        {
            if (ActiveStation == StationName && ActiveDeviceNameStr == DeviceNameStr.ToString())
            {
                Boolean IsFound = false;
                ThreadTextHandler(StationStatus, "Online");
                ThreadTextHandler(StationLastestTimeUpdate, ThisInformation.UpdateTime.Value.ToString("MM/dd/yyyy HH:mm:ss.fff"));

                for (int i = 0; i < DeviceGrid.RowCount; i++)
                {
                    if (DeviceGrid[1, i].Value.ToString() == ThisInformation.FieldName.ToString())
                    {
                        DeviceGrid[2, i].Value = ThisInformation.Value.ToString().Length > 30 ? "Too large information to display." : ThisInformation.Value;
                        DeviceGrid[3, i].Value = ThisInformation.UpdateTime;

                        IsFound = true;
                        ThreadTextHandler(DeviceStatus, "Online");
                        break;
                    }
                }

                if (!IsFound)
                {
                    ThreadAddDataGridHandler(ThisInformation.FieldName.ToString(), ThisInformation.Value.ToString(), ThisInformation.UpdateTime.ToString());
                }
            }
            else if (ActiveStation == StationName && DeviceCombo.Items.Count == 0)
            {
                SetDeviceList();
            }
        }
Example #5
0
        private static void SubFrameChecking(DEVICENAME DeviceName, StationHandler ExistingStation)
        {
            try
            {
                int STARTX      = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_STARTX).Value);
                int STARTY      = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_STARTX).Value);
                int CAMERAXSIZE = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_CCD_CAMERAXSIZE).Value);
                int CAMERAYSIZE = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_CCD_CAMERAYSIZE).Value);
                int NUMX        = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_STARTX).Value);
                int NUMY        = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_STARTX).Value);
                int BINX        = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_CCD_BINX).Value);
                int BINY        = Convert.ToInt32(ExistingStation.GetInformation(DeviceName, IMAGING.IMAGING_CCD_BINY).Value);

                if (STARTX > 0 && STARTY > 0 && NUMX < CAMERAXSIZE && NUMY < CAMERAYSIZE && BINX > 1 && BINY > 1)
                {
                    ExistingStation.NewIMAGINGInformation(DeviceName, IMAGING.IMAGING_CCD_ISSUBFRAMEON, true, DateTime.UtcNow);
                }
                else
                {
                    ExistingStation.NewIMAGINGInformation(DeviceName, IMAGING.IMAGING_CCD_ISSUBFRAMEON, false, DateTime.UtcNow);
                }
            }
            catch
            {
                ExistingStation.NewIMAGINGInformation(DeviceName, IMAGING.IMAGING_CCD_ISSUBFRAMEON, false, DateTime.UtcNow);
            }
        }
Example #6
0
 public void AddWEATHERSTATION(STATIONNAME StationName, DEVICENAME DeviceName, WEATHERSTATION[] FieldName, Object[] Value, DateTime[] DateTime)
 {
     for (int i = 0; i < FieldName.Count(); i++)
     {
         AstroData.NewWEATHERSTATIONInformation(StationName, DeviceName, FieldName[i], Value[i], DateTime[i]);
     }
 }
Example #7
0
        public static DEVICENAME DeviceNameStrConverter(String Name)
        {
            String            ThisName      = Name.Trim();
            List <DEVICENAME> AllDEVICENAME = Enum.GetValues(typeof(DEVICENAME)).Cast <DEVICENAME>().ToList();
            DEVICENAME        DeviceName    = AllDEVICENAME.FirstOrDefault(Item => Item.ToString() == ThisName);

            return(DeviceName);
        }
Example #8
0
        public static void SubscribeInformation(STATIONNAME StationName, DEVICENAME DeviceName, dynamic FieldName, String SessionID, Object CallBackObject)
        {
            StationHandler SiteInformation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            if (SiteInformation != null)
            {
                SiteInformation.SubscribeInformation(DeviceName, FieldName, SessionID, CallBackObject);
            }
        }
Example #9
0
        public void AddGPS(String DataGroupID, STATIONNAME StationName, DEVICENAME DeviceName, GPS[] FieldName, Object[] Value, DateTime[] DateTime, Boolean IsHistory)
        {
            for (int i = 0; i < FieldName.Count(); i++)
            {
                AstroData.NewGPSInformation(DataGroupID, StationName, DeviceName, FieldName[i], Value[i], DateTime[i], IsHistory);
            }

            AstroData.ReturnAckState(DataGroupID, StationName, DeviceName);
        }
Example #10
0
        public Boolean AddASTROCLIENT(STATIONNAME StationName, DEVICENAME DeviceName, ASTROCLIENT[] FieldName, Object[] Value, DateTime[] DateTime)
        {
            for (int i = 0; i < FieldName.Count(); i++)
            {
                AstroData.NewASTROCLIENTInformation(StationName, DeviceName, FieldName[i], Value[i], DateTime[i]);
            }

            return(true);
        }
Example #11
0
        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);
            }
        }
Example #12
0
        public static OUTPUTSTRUCT GetInformation(STATIONNAME StationName, DEVICENAME DeviceName, dynamic FieldName, Object[] Paramter)
        {
            StationHandler SiteInformation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            if (SiteInformation != null)
            {
                return(SiteInformation.GetInformation(DeviceName, FieldName));
            }
            return(null);
        }
Example #13
0
        public void ReciveAcknowledge(STATIONNAME StationName, DEVICENAME DeviceName, String FieldName, Object[] Value, DateTime TimeRecive)
        {
            ACKNOWLEDGE ThisAcknowledge = new ACKNOWLEDGE();

            ThisAcknowledge.StationName    = StationName.ToString();
            ThisAcknowledge.DeviceName     = DeviceName.ToString();
            ThisAcknowledge.FieldName      = FieldName;
            ThisAcknowledge.Value          = String.Join(",", Value);
            ThisAcknowledge.ReviceDateTime = TimeRecive.ToString();

            var ReturningJson = new JavaScriptSerializer().Serialize(ThisAcknowledge);

            AstroData.NewASTROCLIENTInformation(StationName, DeviceName, ASTROCLIENT.ASTROCLIENT_LASTESTEXECTIONCOMMAND, ReturningJson.ToString(), TimeRecive);
        }
Example #14
0
 public static void ReturnNTPAckToStation(DEVICENAME DeviceName, String DataGroupID, Object ServerCallBackObject)
 {
     Task CallBackTask = Task.Run(() =>
     {
         try
         {
             MethodInfo MInfo = ServerCallBackObject.GetType().GetMethod("OnInformationSync");
             MInfo.Invoke(ServerCallBackObject, new Object[] { DeviceName, DataGroupID });
         }
         catch (Exception e)
         {
         }
     });
 }
Example #15
0
        public static void UpdateInformation(STATIONNAME StationName, DEVICENAME DeviceName, String FieldName, Object Value, DateTime DataTimestamp)
        {
            INFORMATIONSTRUCT ThisField = GetInformationObject(StationName, DeviceName, FieldName);

            if (ThisField != null)
            {
                ThisField.Value      = Value;
                ThisField.UpdateTime = DataTimestamp;
                UIHandler.DisplayToUI(StationName, DeviceName, ThisField);
            }
            else
            {
                TTCSLog.NewLogInformation(StationName, DateTime.UtcNow, "Station name : " + StationName.ToString() + " mapping error at: " + DeviceName + ".", LogType.FAILED, null);
            }
        }
Example #16
0
        private HttpResponseMessage GetByCommandName(String StationName, String DeviceName, String FieldName, String SessionID)
        {
            XmlDocument    myXml = new XmlDocument();
            XPathNavigator xNav  = myXml.CreateNavigator();

            if (UserSessionHandler.VerifyTimeout(SessionID))
            {
                STATIONNAME ThisStation = HostingHelper.ConvertStationNameStrToSTATIONNAME(StationName);

                DEVICENAME ThisDevice    = HostingHelper.ConvertDevicecNameStrToDEVICENAME(DeviceName);
                dynamic    ThisFieldName = HostingHelper.ConvertFieldNameStrToFIELDNAME(FieldName);

                if (ThisStation == STATIONNAME.NULL)
                {
                    return(HostingHelper.ReturnError("Invalid station name. Please check.", myXml, xNav));
                }

                if (ThisDevice == DEVICENAME.NULL)
                {
                    return(HostingHelper.ReturnError("Invalid device name. Please check.", myXml, xNav));
                }

                if (ThisFieldName == null)
                {
                    return(HostingHelper.ReturnError("Invalid field name. Please check.", myXml, xNav));
                }

                OUTPUTSTRUCT InformationResult = AstroData.GetInformation(ThisStation, ThisDevice, FieldName);
                if (InformationResult != null)
                {
                    JavaScriptSerializer Serializer = new JavaScriptSerializer();
                    Serializer.MaxJsonLength = Int32.MaxValue;
                    var json = Serializer.Serialize(InformationResult);
                    return(new HttpResponseMessage()
                    {
                        Content = new StringContent(json, Encoding.UTF8, "application/json")
                    });
                }
                else
                {
                    return(HostingHelper.ReturnError("An error occur while getting information", myXml, xNav));
                }
            }
            else
            {
                return(HostingHelper.ReturnError("Session is timeout. Please login to the system.", myXml, xNav));
            }
        }
Example #17
0
        public static void ScriptInformationIdentification(STATIONNAME StationName, DEVICENAME DeviceName, ASTROCLIENT FieldName, Object Value, DateTime DataTimestamp)
        {
            switch (FieldName)
            {
            case ASTROCLIENT.ASTROCLIENT_LASTESTEXECTIONCOMMAND: break;

            case ASTROCLIENT.ASTROCLIENT_LASTESTEXECUTIONSCRIPT_STATUS:
            {
                //SendScriptToHTTP();
                UpdateExecutionState(StationName, Value); break;
            }

            case ASTROCLIENT.ASTROCLIENT_LASTESTSCRIPT_RECIVED:
                SetStationStateToWaitingStation(Value);
                break;
            }
        }
Example #18
0
        private HttpResponseMessage Operation(String StationName, String DeviceName, String CommandName, String Value, String SessionID)
        {
            XmlDocument    myXml = new XmlDocument();
            XPathNavigator xNav  = myXml.CreateNavigator();

            if (UserSessionHandler.VerifyTimeout(SessionID))
            {
                STATIONNAME    ThisStation        = HostingHelper.ConvertStationNameStrToSTATIONNAME(StationName);
                DEVICENAME     ThisDeviceName     = HostingHelper.ConvertDevicecNameStrToDEVICENAME(DeviceName);
                DEVICECATEGORY ThisDeviceCategory = HostingHelper.ConvertDeviceNameToDeviceCategory(ThisStation, ThisDeviceName);

                if (ThisStation == STATIONNAME.NULL)
                {
                    return(HostingHelper.ReturnError("Invalid station name. Please check.", myXml, xNav));
                }

                if (ThisDeviceName == DEVICENAME.NULL)
                {
                    return(HostingHelper.ReturnError("Invalid device name. Please check.", myXml, xNav));
                }

                ReturnKnowType VerificationResult = CommandDefinition.VerifyCommand(ThisStation, ThisDeviceCategory, CommandName, HostingHelper.SplitValue(Value));

                if (VerificationResult.ReturnType == ReturnStatus.SUCESSFUL)
                {
                    dynamic       ThisCommandName = CommandDefinition.GetCommandNameENUM(CommandName);
                    XmlSerializer xmlSerializer2  = new XmlSerializer(typeof(ReturnMessage));

                    ReturnKnowType CommandResult = AstroData.SetCommandHandler(ThisStation, ThisDeviceCategory, ThisDeviceName, ThisCommandName.Value, CommandDefinition.ValueConvertion(HostingHelper.SplitValue(Value)), DateTime.UtcNow);

                    XmlSerializer xmlSerializer3 = new XmlSerializer(typeof(ReturnKnowType));
                    using (var xs = xNav.AppendChild()) { xmlSerializer3.Serialize(xs, CommandResult); }
                    return(new HttpResponseMessage()
                    {
                        Content = new StringContent(myXml.OuterXml, Encoding.UTF8, "text/xml")
                    });
                }

                return(HostingHelper.ReturnError(VerificationResult.ReturnMessage, myXml, xNav));
            }
            else
            {
                return(HostingHelper.ReturnError("Session is timeout. Please login to the system.", myXml, xNav));
            }
        }
Example #19
0
        public static void NewIMAGINGInformation(STATIONNAME StationName, DEVICENAME DeviceName, dynamic FieldName, Object Value, DateTime DataTimestamp)
        {
            StationHandler ExistingStation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            if (ExistingStation != null)
            {
                ExistingStation.NewIMAGINGInformation(DeviceName, FieldName, Value, DataTimestamp);

                switch (FieldName)
                {
                case IMAGING.IMAGING_CCD_ACTIVE_IMAGE_FILENAME: ActiveFileName(Value.ToString()); break;

                case IMAGING.IMAGING_CCD_DOWNLOAD_STATUS: if (Value.ToString() == "Completed")
                    {
                        LoadFITSImage(StationName, DeviceName, ExistingStation);
                    }
                    break;

                case IMAGING.IMAGING_PREVIEW_DOWNLOAD_STATUS: if (Value.ToString() == "Completed")
                    {
                        LoadPerviewImage(StationName, DeviceName, ExistingStation);
                    }
                    break;

                case IMAGING.IMAGING_STARTX: SubFrameChecking(DeviceName, ExistingStation); break;

                case IMAGING.IMAGING_STARTY: SubFrameChecking(DeviceName, ExistingStation); break;

                case IMAGING.IMAGING_NUMX: SubFrameChecking(DeviceName, ExistingStation); break;

                case IMAGING.IMAGING_NUMY: SubFrameChecking(DeviceName, ExistingStation); break;

                case IMAGING.IMAGING_CCD_BINX: SubFrameChecking(DeviceName, ExistingStation); break;

                case IMAGING.IMAGING_CCD_BINY: SubFrameChecking(DeviceName, ExistingStation); break;
                }
            }
        }
Example #20
0
        public static void SetActiveDevice(String ActiveDeviceNameStr)
        {
            UIHandler.ActiveDeviceNameStr = ActiveDeviceNameStr;
            DeviceGrid.Rows.Clear();

            StationHandler ThisStation = AstroData.KeeperData.FirstOrDefault(Item => Item.StationName == ActiveStation);
            DEVICENAME     ThisDevice  = Enum.GetValues(typeof(DEVICENAME)).Cast <DEVICENAME>().ToList().FirstOrDefault(Item => Item.ToString() == ActiveDeviceNameStr);
            DEVICECATEGORY DeviceName  = ThisStation.GetDeviceCategoryByDeviceName(ThisDevice);

            switch (DeviceName)
            {
            case DEVICECATEGORY.TS700MM:
                ConcurrentDictionary <TS700MM, INFORMATIONSTRUCT> TS700MMObject = (ConcurrentDictionary <TS700MM, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in TS700MMObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.ASTROHEVENDOME:
                ConcurrentDictionary <ASTROHEVENDOME, INFORMATIONSTRUCT> ASTROHEVENDOMEObject = (ConcurrentDictionary <ASTROHEVENDOME, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in ASTROHEVENDOMEObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.IMAGING:
                ConcurrentDictionary <IMAGING, INFORMATIONSTRUCT> IMAGINGObject = (ConcurrentDictionary <IMAGING, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in IMAGINGObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.SQM:
                ConcurrentDictionary <SQM, INFORMATIONSTRUCT> SQMObject = (ConcurrentDictionary <SQM, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in SQMObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.SEEING:
                ConcurrentDictionary <SEEING, INFORMATIONSTRUCT> SEEINGObject = (ConcurrentDictionary <SEEING, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in SEEINGObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.ALLSKY:
                ConcurrentDictionary <ALLSKY, INFORMATIONSTRUCT> ALLSKYObject = (ConcurrentDictionary <ALLSKY, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in ALLSKYObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.WEATHERSTATION:
                ConcurrentDictionary <WEATHERSTATION, INFORMATIONSTRUCT> WEATHERSTATIONObject = (ConcurrentDictionary <WEATHERSTATION, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in WEATHERSTATIONObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.LANOUTLET:
                ConcurrentDictionary <LANOUTLET, INFORMATIONSTRUCT> LANOUTLETObject = (ConcurrentDictionary <LANOUTLET, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in LANOUTLETObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.CCTV:
                ConcurrentDictionary <CCTV, INFORMATIONSTRUCT> CCTVObject = (ConcurrentDictionary <CCTV, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in CCTVObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.GPS:
                ConcurrentDictionary <GPS, INFORMATIONSTRUCT> GPSObject = (ConcurrentDictionary <GPS, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in GPSObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.ASTROCLIENT:
                ConcurrentDictionary <ASTROCLIENT, INFORMATIONSTRUCT> ASTROCLIENTObject = (ConcurrentDictionary <ASTROCLIENT, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in ASTROCLIENTObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;

            case DEVICECATEGORY.ASTROSERVER:
                ConcurrentDictionary <ASTROSERVER, INFORMATIONSTRUCT> ASTROSERVERObject = (ConcurrentDictionary <ASTROSERVER, INFORMATIONSTRUCT>)ThisStation.DeviceStroage.FirstOrDefault(Item => Item.Key.DeviceName == ThisDevice).Value;
                foreach (INFORMATIONSTRUCT ThisInformation in ASTROSERVERObject.Values)
                {
                    DisplayAllField(ActiveStation, ActiveDeviceNameStr, ThisInformation.FieldName, ThisInformation);
                }
                break;
            }

            //if (OnlineDevice == null)
            //    return;

            //String ThisDeviceStatus = OnlineDevice.FirstOrDefault(Item => Item == ActiveDeviceNameStr);
            //if (ThisDeviceStatus != null && ThisStation.IsStationConnected)
            //{
            //    DeviceStatus.ForeColor = System.Drawing.Color.Green;
            //    DeviceStatus.Text = "Online";
            //}
            //else
            //{
            //    DeviceStatus.ForeColor = System.Drawing.Color.Red;
            //    DeviceStatus.Text = "Offline";
            //}
        }
Example #21
0
 public List <INFORMATIONSTRUCT> GetInformation(STATIONNAME StationName, DEVICENAME DeviceName, dynamic FieldName)
 {
     return(AstroData.GetInformation(StationName, DeviceName, FieldName));
 }
Example #22
0
        public void UnsubscribeByFieldName(STATIONNAME StationName, DEVICENAME DeviceName, dynamic FieldName)
        {
            OperationContext context = OperationContext.Current;

            AstroData.UnsubscribeByFieldName(context.SessionId, StationName, DeviceName, FieldName);
        }
Example #23
0
        public static void NewGPSInformation(String DataGroupID, STATIONNAME StationName, DEVICENAME DeviceName, GPS FieldName, Object Value, DateTime DataTimestamp, Boolean IsHistory)
        {
            StationHandler ExistingStation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            if (ExistingStation != null)
            {
                ExistingStation.NewGPSInformation(DataGroupID, DeviceName, FieldName, Value, DataTimestamp, IsHistory);
            }
        }
Example #24
0
        public ReturnKnowType AstroSet(STATIONNAME StationName, DEVICENAME DeviceName, dynamic CommandName, Object[] Values, DateTime CommandDateTime)
        {
            DEVICECATEGORY DeviceCategory = TTCSHelper.ConvertDeviceNameToDeviceCategory(StationName, DeviceName);

            return(AstroData.SetCommandHandler(StationName, DeviceCategory, DeviceName, CommandName, Values, CommandDateTime));
        }
Example #25
0
        public static void ReturnAckState(String DataGroupID, STATIONNAME StationName, DEVICENAME DeviceName)
        {
            StationHandler ExistingStation = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            ExistingStation.ReturnAckState(DataGroupID, DeviceName);
        }
Example #26
0
        public static ReturnKnowType SetCommandHandler(STATIONNAME StationName, DEVICECATEGORY DeviceCategory, DEVICENAME DeviceName, dynamic CommandName, Object[] Values, DateTime CommandDateTime)
        {
            StationHandler ThisSite = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            if (ThisSite != null)
            {
                Boolean AckState = false;

                if (StationName == STATIONNAME.ASTROSERVER)
                {
                    AckState = true;
                }
                else
                {
                    return(ThisSite.RelayCommandToStation(DeviceCategory, DeviceName, CommandName, Values));
                }

                return(ReturnKnowType.DefineReturn(ReturnStatus.SUCESSFUL, null, AckState));
            }

            return(ReturnKnowType.DefineReturn(ReturnStatus.FAILED, "(#TT003) Failed to relay set command to station.", false));
        }
Example #27
0
 public static DEVICECATEGORY GetDeviceCategoryByDeviceName(STATIONNAME StationName, DEVICENAME DeviceName)
 {
     if (KeeperData != null)
     {
         StationHandler ThisSite = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);
         if (ThisSite != null)
         {
             return(ThisSite.GetDeviceCategoryByDeviceName(DeviceName));
         }
     }
     return(DEVICECATEGORY.NULL);
 }
Example #28
0
        public static void UnsubscribeByFieldName(String SessionID, STATIONNAME StationName, DEVICENAME DeviceName, dynamic FieldName)
        {
            StationHandler ThisSite = KeeperData.FirstOrDefault(Item => Item.StationName == StationName);

            if (ThisSite != null)
            {
                ThisSite.UnsubscribeByFieldName(SessionID, DeviceName, FieldName);
            }
        }
Example #29
0
 public void AddIMAGINGARRAY(STATIONNAME StationName, DEVICENAME DeviceName, int[][] Value, DateTime DateTime)
 {
     Task DomeSending = Task.Run(() => { AstroData.NewIMAGINGInformation(StationName, DeviceName, IMAGING.IMAGING_CCD_IMAGEARRAY16, Value, DateTime); });
 }
Example #30
0
 public ReturnKnowType AddImage(STATIONNAME StationName, DEVICENAME DeviceName, UInt16[][] Value, DateTime DataTimeStamp)
 {
     AstroData.NewIMAGINGInformation(StationName, DeviceName, IMAGING.IMAGING_CCD_IMAGEARRAY16, Value, DataTimeStamp);
     return(ReturnKnowType.DefineReturn(ReturnStatus.SUCESSFUL, null));
 }