PCL
OnlineObjectSearchDialog.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.8.5
6 // ----------------------------------------------------------------------------
7 // pcl/OnlineObjectSearchDialog.h - Released 2024-12-28T16:53:48Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2024 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_OnlineObjectSearchDialog_h
53 #define __PCL_OnlineObjectSearchDialog_h
54 
56 
57 #include <pcl/Defs.h>
58 #include <pcl/Diagnostics.h>
59 
60 #include <pcl/ComboBox.h>
61 #include <pcl/Dialog.h>
62 #include <pcl/Edit.h>
63 #include <pcl/Label.h>
64 #include <pcl/PushButton.h>
65 #include <pcl/Sizer.h>
66 #include <pcl/TextBox.h>
67 
68 namespace pcl
69 {
70 
71 // ----------------------------------------------------------------------------
72 
73 class PCL_CLASS NetworkTransfer;
74 
75 // ----------------------------------------------------------------------------
76 
109 class PCL_CLASS OnlineObjectSearchDialog : public Dialog
110 {
111 public:
112 
117 
122  const String& ObjectName() const
123  {
124  return m_objectName;
125  }
126 
134  const String& ObjectType() const
135  {
136  return m_objectType;
137  }
138 
144  const String& SpectralType() const
145  {
146  return m_spectralType;
147  }
148 
154  double VMagnitude() const
155  {
156  return m_vmag;
157  }
158 
163  double RA() const
164  {
165  return m_RA;
166  }
167 
172  double Dec() const
173  {
174  return m_Dec;
175  }
176 
182  double MuRA() const
183  {
184  return m_muRA;
185  }
186 
192  double MuDec() const
193  {
194  return m_muDec;
195  }
196 
202  double Parallax() const
203  {
204  return m_parallax;
205  }
206 
212  double RadialVelocity() const
213  {
214  return m_radVel;
215  }
216 
223  bool IsValid() const
224  {
225  return m_valid;
226  }
227 
235  {
236  return ObjectName_Edit.Text();
237  }
238 
247  String ServerURL() const;
248 
249 protected:
250 
251  VerticalSizer Global_Sizer;
252  HorizontalSizer Search_Sizer;
253  Label ObjectName_Label;
254  Edit ObjectName_Edit;
255  PushButton Search_Button;
256  HorizontalSizer Server_Sizer;
257  Label Server_Label;
258  ComboBox Server_ComboBox;
259  TextBox SearchInfo_TextBox;
260  HorizontalSizer Buttons_Sizer;
261  PushButton Get_Button;
262  PushButton Cancel_Button;
263 
264  String m_objectName;
265  String m_objectType;
266  String m_spectralType;
267  double m_vmag = 0; // V magnitude
268  double m_RA = 0; // degrees
269  double m_Dec = 0; // degrees
270  double m_muRA = 0; // mas/year
271  double m_muDec = 0; // mas/year
272  double m_parallax = 0; // mas
273  double m_radVel = 0; // km/s
274  bool m_valid = false;
275  bool m_downloading = false;
276  bool m_abort = false;
277  IsoString m_downloadData;
278 
279  void e_Show( Control& sender );
280  void e_GetFocus( Control& sender );
281  void e_LoseFocus( Control& sender );
282  bool e_Download( NetworkTransfer& sender, const void* buffer, fsize_type size );
283  bool e_Progress( NetworkTransfer& sender,
284  fsize_type downloadTotal, fsize_type downloadCurrent,
285  fsize_type uploadTotal, fsize_type uploadCurrent );
286  void e_Click( Button& sender, bool checked );
287  void e_ItemSelected( ComboBox& sender, int itemIndex );
288 
289  void LoadSettings();
290  void SaveSettings() const;
291 };
292 
293 // ----------------------------------------------------------------------------
294 
295 } // pcl
296 
297 #endif // __PCL_OnlineObjectSearchDialog_h
298 
299 // ----------------------------------------------------------------------------
300 // EOF pcl/OnlineObjectSearchDialog.h - Released 2024-12-28T16:53:48Z
Abstract base class for all client-side interfaces to PixInsight button controls.
Definition: Button.h:100
Client-side interface to a PixInsight ComboBox control.
Definition: ComboBox.h:77
Client-side interface to a PixInsight Control object.
Definition: Control.h:126
Client-side interface to a PixInsight modal dialog.
Definition: Dialog.h:97
Client-side interface to a PixInsight Edit control.
Definition: Edit.h:76
Client-side interface to a PixInsight horizontal sizer.
Definition: Sizer.h:580
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Definition: String.h:5443
Client-side interface to a PixInsight Label control.
Definition: Label.h:76
Synchronous network transfers.
A dialog box to search for object data on online astronomical database services.
Client-side interface to a PixInsight PushButton control.
Definition: PushButton.h:75
Unicode (UTF-16) string.
Definition: String.h:8146
Client-side interface to a PixInsight TextBox control.
Definition: TextBox.h:81
Client-side interface to a PixInsight vertical sizer.
Definition: Sizer.h:612
int64 fsize_type
Definition: Defs.h:1185
PCL root namespace.
Definition: AbstractImage.h:77