• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • data
  • tools
nomadbinfile2mysql.h
Go to the documentation of this file.
1 /***************************************************************************
2  nomadbinfile2mysql.h -- Declarations for nomadbinfile2mysql.cpp
3  -------------------
4  begin : Sat Jul 2 2011
5  copyright : (C) 2011 by Akarsh Simha
6  email : akarshsimha@gmail.com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef NOMADBINFILE2MYSQL_H
19 #define NOMADBINFILE2MYSQL_H
20 
21 #define pow2(x) (1 << (x))
22 #define HTM_LEVEL 6
23 #define INDEX_ENTRY_SIZE 12
24 #define NTRIXELS 32768 // TODO: Change if HTM Level Changes
25 #define PM_MILLENIA 10 // This is not good. Needs to be stored in the data file
26 
27 #include "HTMesh.h"
28 
29 #include <mysql/mysql.h>
30 #include <sys/types.h>
31 #include <stdio.h>
32 
33 /*
34  * struct to store star data, to be written in this format, into the binary file.
35  */
36 
37 typedef struct DeepStarData {
38  int32_t RA;
39  int32_t Dec;
40  int16_t dRA;
41  int16_t dDec;
42  int16_t B;
43  int16_t V;
44 } DeepStarData;
45 
52 class NOMADStarDataWriter {
53 
54  public:
58  NOMADStarDataWriter( FILE *f, int HTMLevel, MYSQL *link, char *_db_tbl );
59 
63  ~NOMADStarDataWriter();
64 
68  static void bswap_stardata( DeepStarData *stardata );
69 
74  static void calculatePMCoords( double startRA, double startDec, double dRA, double dDec, double *endRA, double *endDec, float years );
75 
80  bool write();
81 
82  private:
86  bool createTable();
87 
91  bool truncateTable();
92 
100  bool insertStarData( unsigned int trixel, const DeepStarData *const data );
101 
106  bool writeStarDataToDB();
107 
113  bool readFileHeader();
114 
115  HTMesh *m_Mesh;
116  MYSQL *m_MySQLLink;
117  char db_tbl[20];
118  bool byteswap;
119  bool m_HeaderRead;
120  long m_IndexOffset;
121  u_int16_t ntrixels;
122  FILE *DataFile;
123 };
124 
125 #endif
HTMesh.h
DeepStarData
struct DeepStarData DeepStarData
HTMesh
Definition: HTMesh.h:58
NOMADStarDataWriter::~NOMADStarDataWriter
~NOMADStarDataWriter()
Destructor.
Definition: nomadbinfile2mysql.cpp:47
DeepStarData::V
int16_t V
Definition: nomadbinfile2mysql.h:43
DeepStarData::dDec
int16_t dDec
Definition: nomadbinfile2mysql.h:41
NaN::f
const float f
Definition: nan.h:36
DeepStarData::dRA
int16_t dRA
Definition: nomadbinfile2mysql.h:40
DeepStarData
Definition: nomadbinfile2mysql.h:37
NOMADStarDataWriter::NOMADStarDataWriter
NOMADStarDataWriter(FILE *f, int HTMLevel, MYSQL *link, char *_db_tbl)
Constructor.
Definition: nomadbinfile2mysql.cpp:38
NOMADStarDataWriter
Writes NOMAD star data.
Definition: nomadbinfile2mysql.h:52
DeepStarData::RA
int32_t RA
Definition: nomadbinfile2mysql.h:38
NOMADStarDataWriter::write
bool write()
Writes the star data into the DB by calling multiple functions.
Definition: nomadbinfile2mysql.cpp:363
DeepStarData::Dec
int32_t Dec
Definition: nomadbinfile2mysql.h:39
DeepStarData::B
int16_t B
Definition: nomadbinfile2mysql.h:42
NOMADStarDataWriter::calculatePMCoords
static void calculatePMCoords(double startRA, double startDec, double dRA, double dDec, double *endRA, double *endDec, float years)
Computes the (unprecessed) coordinates of a star after accounting for proper motion.
Definition: nomadbinfile2mysql.cpp:80
NOMADStarDataWriter::bswap_stardata
static void bswap_stardata(DeepStarData *stardata)
Byteswaps the DeepStarData structure.
Definition: nomadbinfile2mysql.cpp:51
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

Skip menu "kstars"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal