Exemplo n.º 1
0
        private void exposeFor(bool dark, double exp)
        {
            ccd.Expose(exp, Convert.ToInt16(!dark));

            while (!ccd.ImageReady)
            {
                //wait
                //rotate the HWP to the next spot, it is possible to do it while waiting on readout!
            }
            AppendToTextBox("Server Camera Exposure Is Done!");


            string dt = string.Empty;

            dt = ccd.Document.GetFITSKey("DATE-OBS");
            checkForDirectory(savepath);
            if (chkSave.Checked)
            {
                saveImage(targetName, dt.Replace(":", "-"), savepath);
            }
            else
            {
                AppendToTextBox("Server Camera Exposure *not* saved!");
            }
        }
Exemplo n.º 2
0
        private void handlePacket(string text)
        {
            switch (text)
            {
            case "setup_ccd":
                try
                {
                    ccd             = new MaxIm.CCDCamera();
                    ccd.LinkEnabled = true;
                    AppendToTextBox("Client Camera Is Ready!");
                    sendToServer("Client Camera Is Ready!");
                }
                catch (Exception ex)
                {
                    AppendToTextBox("Cant Connect To Client Camera");
                    sendToServer("Cant Connect To Client Camera");
                    MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                break;

            case "teardown_ccd":
                try
                {
                    ccd.LinkEnabled = false;
                    AppendToTextBox("Client Camera Is Disconnected!");
                    sendToServer("Client Camera Is Disconnected!");
                }
                catch (Exception ex)
                {
                    AppendToTextBox("Cant Connect To Client Camera");
                    sendToServer("Cant Connect To Client Camera");
                    MessageBox.Show(ex.Message, Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                break;

            case "expose_ccd":
                ccd.Expose(1, 1, 0);

                while (!ccd.ImageReady)
                {
                    //wait
                }
                AppendToTextBox("Client Exposure Is Done!");
                sendToServer("Client Exposure Is Done!");
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        private void exposeFor(bool dark, double exp)
        {
            ccd.Expose((double)exp, Convert.ToInt16(!dark));

            while (!ccd.ImageReady)
            {
                //wait
            }
            sendToServer("Client Camera Exposure Is Done!");

            string dt = string.Empty;

            dt = ccd.Document.GetFITSKey("DATE-OBS");
            checkForDirectory(savepath);
            string testing = string.Empty;

            if (saveImages)
            {
                if (orderPos > -1)
                {
                    testing = savepath + dt.Replace(":", "-") + "-" + filter + "-" + orderPos + "-U47.fit";
                }
                else
                {
                    testing = savepath + dt.Replace(":", "-") + "-U47.fit";
                }
                ccd.SaveImage(testing);
                sendToServer("Client Camera Exposure Saved!");
                sendToServer("Client:" + savepath);
                AppendToTextBox("Client Camera Exposure Saved!");
                AppendToTextBox("Client:" + savepath);
            }
            else
            {
                sendToServer("Client Camera Exposure *not* saved!");
                AppendToTextBox("Client Camera Exposure *not* saved!");
            }
        }