Check-in [428631ea62]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added ability to convert from glyph symbols. Fixed an issue with compiling v0.5 from the nmspd.pro file.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | v0.5.1
Files: files | file ages | folders
SHA1: 428631ea628c10828ad9df73b7e9b8e444ce857c
User & Date: tion 2018-10-08 21:30:15
References
2019-02-16
03:19 Wiki page "release_notes" artifact: cf2f198ba2 user: tion
Context
2018-10-10
20:53
UI: Added toolbar to replace some buttons check-in: 97f382bf85 user: tion tags: trunk, v0.5.2
02:52
Edited release_notes Closed-Leaf check-in: b689d895a0 user: tion
2018-10-09
17:37
release_notes: minor text change Closed-Leaf check-in: cda41257e5 user: tion
2018-10-08
21:30
Added ability to convert from glyph symbols. Fixed an issue with compiling v0.5 from the nmspd.pro file. check-in: 428631ea62 user: tion tags: trunk, v0.5.1
04:00
Updated screenshot preview and mp4 demo for v0.5 check-in: 172e13f1a2 user: tion tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to README.

34
35
36
37
38
39
40


41
42
43
44
45
46
47
If you prefer to use a specific style already installed on your system:<br />
<pre>$ nmspd -style "NAME-OF-STYLE"</pre>

For information about the CLI:
<pre>$ nmspd -h</pre>

## Usage ##


It is fairly self-explanatory.

Enter the coordinates or glyph code into the appropriate field, then click the button to either 
convert to a glyph code or to a coordinate respectively. Optionally select a portal number when converting a coordinate. If you are unsure what this should be, then leave it at 1.

You can obtain coordinates from other players or in-game. Coordinates can be obtained in-game by building a signal booster on any planet or moon. Interact with the signal booster and look for an alphanumeric sequence in the lower left corner of the form:<br >
<blockquote>XXXX:12AB:34CD:EF56:7890</blockquote>







>
>







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
If you prefer to use a specific style already installed on your system:<br />
<pre>$ nmspd -style "NAME-OF-STYLE"</pre>

For information about the CLI:
<pre>$ nmspd -h</pre>

## Usage ##
![nmspd-in-action](/raw/259adc98da8f01f393e27ee82a60c74d8a4a9518?m=image/jpeg)

It is fairly self-explanatory.

Enter the coordinates or glyph code into the appropriate field, then click the button to either 
convert to a glyph code or to a coordinate respectively. Optionally select a portal number when converting a coordinate. If you are unsure what this should be, then leave it at 1.

You can obtain coordinates from other players or in-game. Coordinates can be obtained in-game by building a signal booster on any planet or moon. Interact with the signal booster and look for an alphanumeric sequence in the lower left corner of the form:<br >
<blockquote>XXXX:12AB:34CD:EF56:7890</blockquote>

Changes to nmspd.pro.

1
2
3
4
5
6
7
8
9
10


11

12
13

14
15
16
17
TEMPLATE = app
TARGET = nmspd
QT = core gui
QT += widgets
DEFINES += QT_DEPRECATED_WARNINGS

# Inputs
HEADERS += src/nmsDecoder.h src/nmsDecoderMainWindow.h \
			src/nmsDecoderUtility.h \
			src/PortalAddressWindow.h


SOURCES += src/nmsDecoderMain.cpp src/nmsDecoder.cpp \

			src/nmsDecoderMainWindow.cpp \
		  	src/PortalAddressWindow.cpp \

          	src/nmsDecoderUtility.cpp
RESOURCES += src/nmsDecoderResources.qrc

VERSION=0.5









|
>
>

>


>
|


|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
TEMPLATE = app
TARGET = nmspd
QT = core gui
QT += widgets
DEFINES += QT_DEPRECATED_WARNINGS

# Inputs
HEADERS += src/nmsDecoder.h src/nmsDecoderMainWindow.h \
			src/nmsDecoderUtility.h \
			src/PortalAddressWindow.h \
			src/PortalAddressPickerWindow.h

SOURCES += src/nmsDecoderMain.cpp src/nmsDecoder.cpp \
			src/nmsDecoderUtility.cpp \
			src/nmsDecoderMainWindow.cpp \
		  	src/PortalAddressWindow.cpp \
		  	src/PortalAddressPickerWindow.cpp

RESOURCES += src/nmsDecoderResources.qrc

VERSION=0.5.1

Changes to release_notes.

1
2






3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Release Notes #







## [0.5](/info/1c929c032cc42460) ##
  - Version update incorporating changes from 0.5.alpha1 and 0.5.beta1
  - Improvements to UI.
  - Improvements to error checking.
  - Minor changes to keep memory consumption stable.
  
## 0.5.beta1 ##
  - Moved glyph symbol drawing to separate window so that main window
    is smaller and less intimidating.
  - Added presets to common civilizations (ex. HUB)
  - UI adjustments to accommodate presets.
    - Added button to show/hide glyph symbol window.
  - Added about window for application details, license, credits.

## 0.5.alpha1 ##
  - Code rewrite. Application should be a bit more robust, for now.
  - Added CLI functionality.
    - Can accept codes (star system coordinates or 
      glyph sequence) and provide conversion from the command line.


>
>
>
>
>
>











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Release Notes #

## 0.5.1 ##
  - Added ability to select glyph symbols directly and convert into 
    glyph code and coordinates.
    - Added button toggle to access this feature.
  - Minor adjustments to UI.
  
## [0.5](/info/1c929c032cc42460) ##
  - Version update incorporating changes from 0.5.alpha1 and 0.5.beta1
  - Improvements to UI.
  - Improvements to error checking.
  - Minor changes to keep memory consumption stable.
  
## 0.5.beta1 ##
  - Moved glyph symbol drawing to separate window so that main window
    is smaller and less intimidating.
  - Added presets to common civilizations (ex. HUB)
  - UI adjustments to accommodate presets.
    - Added button to show/hide portal address window.
  - Added about window for application details, license, credits.

## 0.5.alpha1 ##
  - Code rewrite. Application should be a bit more robust, for now.
  - Added CLI functionality.
    - Can accept codes (star system coordinates or 
      glyph sequence) and provide conversion from the command line.

Added src/PortalAddressPickerWindow.cpp.

















































































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
//==================================================================
#include "PortalAddressPickerWindow.h"
#include "nmsDecoderUtility.h"
//==================================================================
/////////////////////////
// CLASS: PortalDialer //
/////////////////////////
//------------------------------------------------------------------
PortalDialer::PortalDialer()
{
   initialize_glyphs();
   run_gui();
}
//------------------------------------------------------------------
PortalDialer::PortalDialer (const QString &_code)
{
   initialize_glyphs();
   set_glyphs(_code);
   run_gui();
}
//------------------------------------------------------------------
void PortalDialer::initialize_glyphs()
{
   code = new QStack<QChar>;
   code -> clear();
   
   for (int i = 0; i < 16; i++) 
   {
      glyph_input[i] = new QPushButton;
      glyph_input[i] -> setIconSize (QSize(40, 40));
      glyph_input[i] -> setAutoFillBackground (false);
      glyph_input[i] -> setCheckable (false);
      glyph_input[i] -> setFlat (false);
      glyph_input[i] -> setIcon (QIcon (QString (":" + QString(convert_integer_to_hex(i)).toUpper() + QString(".jpg"))));
      
      if ( i < 12 ) {
         glyph_select[i] = new QPushButton;
         glyph_select[i] -> setFlat (false);
         glyph_select[i] -> setCheckable (false);
         glyph_select[i] -> setAutoFillBackground (true);
         glyph_select[i] -> setIconSize (QSize(60, 60));
         glyph_select[i] -> setIcon (QIcon (QString (":empty.png")));
      }
   }
}
//------------------------------------------------------------------
void PortalDialer::set_glyphs (const QString &_code)
{
   QString fileName = QString();
   for (int i = 0; i < 12; i++)
   {
      if ( _code.isEmpty() == true ) {
         fileName = ":" + QString(convert_integer_to_hex(i)).toUpper() + QString(".jpg");
      }
      else {
         code -> push(_code.at(i).toUpper());
         fileName = ":" + QString(_code.at(i)).toUpper() + ".jpg";
      }
      glyph_select[i] -> setIcon (QIcon (QString (fileName)));
   }
}
//------------------------------------------------------------------
QString PortalDialer::get_code()
{
   QString result = QString();
   for (int i = 0; i < code -> size(); i++) {
      result += QString(code -> at(i));
   }

   return (result);
}
//------------------------------------------------------------------
void PortalDialer::get_glyph (const int &index)
{
   if ( code -> size() < 12 ) {
   int i = (code -> size());
   QChar result = convert_integer_to_hex(index).at(0);
   if ( i < 0 )
      i = 0;

   if ( i < 12  ) {
      glyph_select[i] -> setIcon (QIcon (QString (":" + QString(result) + ".jpg")));
      code -> push(result);
      glyph_code -> setText (get_code());
      emit code_incomplete();
      //qDebug() << "Code:" << get_code();
   }
   }

   // Update status of code after (any) change
   if ( code -> size() == 12 )
      emit code_ready();
   else
      emit code_incomplete();
}
//------------------------------------------------------------------
void PortalDialer::clear_values()
{
   code -> clear();
   glyph_code -> clear();
   //qDebug() << "Cleared QStack";
   
   for (int i = 0; i < 12; i++)
   {
      glyph_select[i] -> setIcon (QIcon (QString (":empty.png")));
   }
   emit code_incomplete();
   //qDebug() << "Cleared QPushButtons";
}
//------------------------------------------------------------------
void PortalDialer::clear_one()
{
   if ( code -> isEmpty() == false )
   {
      code -> pop();
   
      glyph_select[code -> size()] -> setIcon (QIcon (QString (":empty.png")));
      glyph_code -> setText (get_code());
      //qDebug() << "Code:" << get_code();
   }
   emit code_incomplete();
}
//------------------------------------------------------------------
void PortalDialer::run_gui()
{
   /*
      Create horizontal layout.

      row_one:
       +--------+---------+-----+--------+
       | Glyph1 |  Glyph2 | ... | Glyph6 |
       +--------+---------+-----+--------+

      row_two:
       +--------+--------+-----+---------+
       | Glyph7 | Glyph8 | ... | Glyph12 |
       +--------+--------+-----+---------+
   */
/*
   QGroupBox *row_one = new QGroupBox;
   QGroupBox *row_two = new QGroupBox;
   QHBoxLayout *row_one_layout = new QHBoxLayout;
   for (int i = 0; i < 8; i++) {
      row_one_layout -> addWidget (glyph_input[i]);
   }
   row_one -> setLayout (row_one_layout);

   QHBoxLayout *row_two_layout = new QHBoxLayout;
   for (int i = 8; i < 16; i++) {
      row_two_layout -> addWidget (glyph_input[i]);
   }
   row_two -> setLayout (row_two_layout);
*/
   glyph_code = new QLineEdit;
   glyph_code -> setMaxLength (12);
   glyph_code -> setReadOnly (true);

   QPushButton *back_button = new QPushButton;
   back_button -> setText (tr ("Delete"));
   back_button -> setToolTip (tr ("Backspace/Delete one digit to the left"));
   back_button -> setCheckable (false);
   QPushButton *reset_button = new QPushButton;
   reset_button -> setText (tr ("Clear"));
   reset_button -> setToolTip (tr ("Reset all glyphs entered"));
   reset_button -> setCheckable (false);
   QPushButton *close_button = new QPushButton;
   close_button -> setText (tr ("Close"));
   close_button -> setToolTip (tr ("Close this window"));
   close_button -> setCheckable (false);

   QGroupBox *control_group = new QGroupBox;
   QGridLayout *buttons = new QGridLayout;
   buttons -> addWidget (back_button, 0, 0, 1, 1);
   buttons -> addWidget (reset_button, 0, 1, 1, 1);
   //buttons -> addWidget (close_button, 1, 0, 1, 1);
   buttons -> addWidget (glyph_code, 1, 0, 1, 2);
   control_group -> setLayout (buttons);

   QGridLayout *box = new QGridLayout;
   for (int i = 0; i < 12; i++) {
      box -> addWidget (glyph_select[i], 0, (i+1), 1, 1);
   }

   for (int i = 0; i < 8; i++)
      box -> addWidget (glyph_input[i], 1, (i+3), 1, 1);

   for (int i = 8, j = 0; i < 16; i++, j++) {
         box -> addWidget (glyph_input[i], 2, (j+3), 1, 1);
   }
   box -> addWidget (control_group, 1, 0, 2, 2);
   //box -> addWidget (back_button, 1, 0, 1, 1);
   //box -> addWidget (reset_button, 1, 1, 1, 1);
   //box -> addWidget (close_button, 2, 0, 1, 1);
   //box -> addWidget (the_code, 0, 0, 1, 1);

   setLayout (box);

   /*
     Handle pushing the buttons 
   */
   // Delete glyph previously selected
   QObject::connect (back_button, SIGNAL (clicked(bool)),
   					 this, SLOT (clear_one()));
   QObject::connect (reset_button, SIGNAL (clicked(bool)),
   					 this, SLOT (clear_values()));

   // If part of a larger program, use hide(). If standalone, 
   // use close() or quit()
   //QObject::connect (close_button, SIGNAL (clicked(bool)),
   //					 this, SLOT (hide()));
   					 
   // Glyph buttons
   QObject::connect (glyph_input[0], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_zero()));
   QObject::connect (glyph_input[1], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_one()));
   QObject::connect (glyph_input[2], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_two()));
   QObject::connect (glyph_input[3], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_three()));
   QObject::connect (glyph_input[4], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_four()));
   QObject::connect (glyph_input[5], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_five()));
   QObject::connect (glyph_input[6], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_six()));
   QObject::connect (glyph_input[7], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_seven()));
   QObject::connect (glyph_input[8], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_eight()));
   QObject::connect (glyph_input[9], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_nine()));
   QObject::connect (glyph_input[10], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_ten()));
   connect (glyph_input[11], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_eleven()));
   QObject::connect (glyph_input[12], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_twelve()));
   QObject::connect (glyph_input[13], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_thirteen()));
   QObject::connect (glyph_input[14], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_fourteen()));
   QObject::connect (glyph_input[15], SIGNAL (clicked(bool)),
   			this, SLOT (glyph_fifteen()));

}
//------------------------------------------------------------------
//------------------------------------------------------------------

Added src/PortalAddressPickerWindow.h.

















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//==================================================================
#ifndef __NMS_PORTAL_DIAL_H__
#define __NMS_PORTAL_DIAL_H__
//==================================================================
#include <QtWidgets>
//==================================================================
class PortalDialer : public QWidget
{
    Q_OBJECT
    
    public:
       //////////////////
       // CONSTRUCTORS //
       //////////////////
       PortalDialer();
       PortalDialer(const QString &);

       void run_gui();
       void set_glyphs(const QString &);
       QString get_code();

   signals:
      void code_incomplete();
      void code_ready();

   public slots:
      void clear_one();
      void clear_values();
      void get_glyph(const int &);
      void glyph_zero () { get_glyph(0); }
      void glyph_one () { get_glyph(1); }
      void glyph_two () { get_glyph(2); }
      void glyph_three () { get_glyph(3); }
      void glyph_four () { get_glyph(4); }
      void glyph_five () { get_glyph(5); }
      void glyph_six () { get_glyph(6); }
      void glyph_seven () { get_glyph(7); }
      void glyph_eight () { get_glyph(8); }
      void glyph_nine () { get_glyph(9); }
      void glyph_ten () { get_glyph(10);}
      void glyph_eleven () { get_glyph(11);}
      void glyph_twelve () { get_glyph(12); }
      void glyph_thirteen () { get_glyph(13); }
      void glyph_fourteen () { get_glyph(14); }
      void glyph_fifteen () { get_glyph(15); }      
   private:
      void initialize_glyphs();
       
      QPushButton *glyph_input[16];
      QPushButton *glyph_select[12];
      QStack<QChar> *code;
      QLineEdit *glyph_code;
};
//==================================================================
#endif	// __NMS_PORTAL_DIAL_H__
//==================================================================

Changes to src/nmsDecoder.h.

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
      int portal;
};
//------------------------------------------------------------------
////////////////////////////////
// NON-CLASS HELPER FUNCTIONS //
////////////////////////////////
//------------------------------------------------------------------
int convert_hex_to_integer (const QString);
QString convert_integer_to_hex (const int);

/*
   QString pad_with_zeros (const QString, const int)

   Returns the QString parameter pre-pended with zeros to 
   fill its size to the int parameter, which must be a value 
   between 1 and 4.
*/
QString pad_with_zeros (const QString, const int);

/*
  bool is_valid_coordinate(const QString)

  Coordinate is 16 hex characters long, with 3 semicolons to
  separate the different axis (x,y,z,star class). QStringList 
  parameter will hold invalid segments found within the 
  provided _code.
*/
bool is_valid_coordinate(const QString _code, QStringList &);

/*
  bool is_valid_glyph_code(const QString)

  Glyph code is 12 hex characters long. Must also be between
  a lower and upper limit: 000182802802 .. F2FF80800800. 
  QStringList parameter will hold invalid segements found 
  within the provided _code.
*/
bool is_valid_glyph_code(const QString _code, QStringList &);

/*
  bool is_valid_portal (int)

  Returns true if parameter is a decimal number between 
  1 and 16.
*/
bool is_valid_portal(int _code);
//------------------------------------------------------------------
#endif  // __NMS_DECODER_H__
//------------------------------------------------------------------







|
|








|









|









|







|



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
      int portal;
};
//------------------------------------------------------------------
////////////////////////////////
// NON-CLASS HELPER FUNCTIONS //
////////////////////////////////
//------------------------------------------------------------------
//int convert_hex_to_integer (const QString);
//QString convert_integer_to_hex (const int);

/*
   QString pad_with_zeros (const QString, const int)

   Returns the QString parameter pre-pended with zeros to 
   fill its size to the int parameter, which must be a value 
   between 1 and 4.
*/
//QString pad_with_zeros (const QString, const int);

/*
  bool is_valid_coordinate(const QString)

  Coordinate is 16 hex characters long, with 3 semicolons to
  separate the different axis (x,y,z,star class). QStringList 
  parameter will hold invalid segments found within the 
  provided _code.
*/
//bool is_valid_coordinate(const QString _code, QStringList &);

/*
  bool is_valid_glyph_code(const QString)

  Glyph code is 12 hex characters long. Must also be between
  a lower and upper limit: 000182802802 .. F2FF80800800. 
  QStringList parameter will hold invalid segements found 
  within the provided _code.
*/
//bool is_valid_glyph_code(const QString _code, QStringList &);

/*
  bool is_valid_portal (int)

  Returns true if parameter is a decimal number between 
  1 and 16.
*/
//bool is_valid_portal(int _code);
//------------------------------------------------------------------
#endif  // __NMS_DECODER_H__
//------------------------------------------------------------------

Changes to src/nmsDecoderMain.cpp.

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
     if the style option is not supplied (which is for GUI anyway)
   */
   if ( argc > 1 && argv[1] != QString("-style") )
   {
      // Use console/non-gui
      QCoreApplication app (argc, argv);
      QCoreApplication::setApplicationName ("nmspd");
      QCoreApplication::setApplicationVersion ("0.5");
      QCommandLineParser parser;
      parser.setApplicationDescription ("Converts coordinates to a portal glyph address, and vice versa. The GUI can be used instead when no options or arguments are specified.");
      parser.addHelpOption();
      parser.addVersionOption();
      parser.addPositionalArgument ("code",
                                    QCoreApplication::translate ("main",
                                          "Coordinate or glyph code sequence to convert."));







|







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
     if the style option is not supplied (which is for GUI anyway)
   */
   if ( argc > 1 && argv[1] != QString("-style") )
   {
      // Use console/non-gui
      QCoreApplication app (argc, argv);
      QCoreApplication::setApplicationName ("nmspd");
      QCoreApplication::setApplicationVersion ("0.5.1");
      QCommandLineParser parser;
      parser.setApplicationDescription ("Converts coordinates to a portal glyph address, and vice versa. The GUI can be used instead when no options or arguments are specified.");
      parser.addHelpOption();
      parser.addVersionOption();
      parser.addPositionalArgument ("code",
                                    QCoreApplication::translate ("main",
                                          "Coordinate or glyph code sequence to convert."));

Changes to src/nmsDecoderMainWindow.cpp.

9
10
11
12
13
14
15

16
17
18
19
20
21
22
23
24
25
26

27
28
29
30
31
32
33
// CLASS: Window //
///////////////////
//==================================================================
Window::Window()
{
   blackbox = new Console;
   glyph_window = new Glyphs;

   coordinates_input = new QLineEdit;
   portal_number = new QSpinBox;
   glyph_sequence = new QLineEdit;
   invalid_messages = new QMessageBox;
   run_gui();
}
//------------------------------------------------------------------
Window::Window (QString _code, bool isCoordinate)
{
   blackbox = new Console(_code, isCoordinate);
   glyph_window = new Glyphs;

   coordinates_input = new QLineEdit;
   glyph_sequence = new QLineEdit;
   portal_number = new QSpinBox;
   invalid_messages = new QMessageBox;
   run_gui();

   if ( isCoordinate == false )







>











>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// CLASS: Window //
///////////////////
//==================================================================
Window::Window()
{
   blackbox = new Console;
   glyph_window = new Glyphs;
   dialer = new PortalDialer;
   coordinates_input = new QLineEdit;
   portal_number = new QSpinBox;
   glyph_sequence = new QLineEdit;
   invalid_messages = new QMessageBox;
   run_gui();
}
//------------------------------------------------------------------
Window::Window (QString _code, bool isCoordinate)
{
   blackbox = new Console(_code, isCoordinate);
   glyph_window = new Glyphs;
   dialer = new PortalDialer;
   coordinates_input = new QLineEdit;
   glyph_sequence = new QLineEdit;
   portal_number = new QSpinBox;
   invalid_messages = new QMessageBox;
   run_gui();

   if ( isCoordinate == false )
112
113
114
115
116
117
118




119
120
121
122
123
124
125
   about_button -> setToolTip (tr ("About this application"));
   about_button -> setCheckable (false);

   show_portal_button = new QPushButton;
   show_portal_button -> setText (tr ("Portal"));
   show_portal_button -> setToolTip (tr ("Show portal address window"));
   show_portal_button -> setCheckable (true);





   // QPushButton for presets
   QPushButton *hub_button = new QPushButton;
   hub_button -> setText ("&HUB");
   hub_button -> setToolTip (tr ("The Galactic Hub"));
   hub_button -> setCheckable (false);
   QPushButton *amino_button = new QPushButton;







>
>
>
>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
   about_button -> setToolTip (tr ("About this application"));
   about_button -> setCheckable (false);

   show_portal_button = new QPushButton;
   show_portal_button -> setText (tr ("Portal"));
   show_portal_button -> setToolTip (tr ("Show portal address window"));
   show_portal_button -> setCheckable (true);
   show_dialer_button = new QPushButton;
   show_dialer_button -> setText (tr ("Glyphs"));
   show_dialer_button -> setToolTip (tr ("Show glyph input window"));
   show_dialer_button -> setCheckable (true);

   // QPushButton for presets
   QPushButton *hub_button = new QPushButton;
   hub_button -> setText ("&HUB");
   hub_button -> setToolTip (tr ("The Galactic Hub"));
   hub_button -> setCheckable (false);
   QPushButton *amino_button = new QPushButton;
162
163
164
165
166
167
168
169
170
171
172

173
174
175
176
177
178
179

      other_buttons_group:
       +----------------------------+
       | clear_button | exit_button |
       +----------------------------+
   */
   QGridLayout *other_buttons_layout = new QGridLayout;
   other_buttons_layout -> addWidget (clear_button, 0, 0, 1, 1);
   other_buttons_layout -> addWidget (exit_button, 1, 1, 1, 1);
   other_buttons_layout -> addWidget (about_button, 1, 0, 1, 1);
   other_buttons_layout -> addWidget (show_portal_button, 0, 1, 1, 1);

   other_buttons_group -> setLayout (other_buttons_layout);

   /*
      Create grid layout.

      preset_group:
       +------------+--------------+







|
|
|
|
>







168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186

      other_buttons_group:
       +----------------------------+
       | clear_button | exit_button |
       +----------------------------+
   */
   QGridLayout *other_buttons_layout = new QGridLayout;
   other_buttons_layout -> addWidget (clear_button, 1, 0, 1, 1);
   other_buttons_layout -> addWidget (exit_button, 2, 1, 1, 1);
   other_buttons_layout -> addWidget (about_button, 2, 0, 1, 1);
   other_buttons_layout -> addWidget (show_portal_button, 0, 0, 1, 1);
   other_buttons_layout -> addWidget (show_dialer_button, 0, 1, 1, 1);
   other_buttons_group -> setLayout (other_buttons_layout);

   /*
      Create grid layout.

      preset_group:
       +------------+--------------+
256
257
258
259
260
261
262




263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
   					 this, SLOT (preset_dtt()));
   QObject::connect (hova_button, SIGNAL (clicked(bool)),
   					 this, SLOT (preset_hova()));

   // Control buttons
   QObject::connect (show_portal_button, SIGNAL (toggled(bool)),
   					 this, SLOT (show_glyphs(bool)));




   QObject::connect (clear_button, SIGNAL (clicked(bool)),
                     this, SLOT (clear_values()));
   QObject::connect (about_button, SIGNAL (clicked(bool)),
   					this, SLOT (about()));
   QObject::connect (exit_button, SIGNAL (clicked(bool)),
                     QApplication::instance(), SLOT (quit()));
}
//------------------------------------------------------------------
void Window::about()
{
	// Set up and display QMessageBox::about
	QMessageBox::about (this, tr ("About nmspd"),
					tr ("<center><h2>nmspd</h2>v0.5.beta1<br><br><br>" 
					"Created by: "
					"tion<br>Contact: " 
					"tion7680@protonmail.com</center>"
					"<hr />"
					"<p>"
					"The glyph symbols used in this program are slightly modified "
					"from images on "







>
>
>
>












|







263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
   					 this, SLOT (preset_dtt()));
   QObject::connect (hova_button, SIGNAL (clicked(bool)),
   					 this, SLOT (preset_hova()));

   // Control buttons
   QObject::connect (show_portal_button, SIGNAL (toggled(bool)),
   					 this, SLOT (show_glyphs(bool)));
   QObject::connect (show_dialer_button, SIGNAL (toggled(bool)),
   					 this, SLOT (show_portal(bool)));
   QObject::connect (dialer, SIGNAL (code_ready()),
   					 this, SLOT (update_glyph()));
   QObject::connect (clear_button, SIGNAL (clicked(bool)),
                     this, SLOT (clear_values()));
   QObject::connect (about_button, SIGNAL (clicked(bool)),
   					this, SLOT (about()));
   QObject::connect (exit_button, SIGNAL (clicked(bool)),
                     QApplication::instance(), SLOT (quit()));
}
//------------------------------------------------------------------
void Window::about()
{
	// Set up and display QMessageBox::about
	QMessageBox::about (this, tr ("About nmspd"),
					tr ("<center><h2>nmspd</h2>v0.5.1<br><br><br>" 
					"Created by: "
					"tion<br>Contact: " 
					"tion7680@protonmail.com</center>"
					"<hr />"
					"<p>"
					"The glyph symbols used in this program are slightly modified "
					"from images on "
368
369
370
371
372
373
374












375
376
377
378
379
380
381
//------------------------------------------------------------------
void Window::clear_values()
{
   blackbox -> clear_values();
   glyph_window -> clear_values();
   initialize_coordinates();
   clear_glyphs();












}
//------------------------------------------------------------------
void Window::show_glyphs (bool is_checked)
{
   if ( is_checked == true ) {
      show_portal_button -> setToolTip ("Hide portal address window");
      glyph_window -> show();







>
>
>
>
>
>
>
>
>
>
>
>







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
//------------------------------------------------------------------
void Window::clear_values()
{
   blackbox -> clear_values();
   glyph_window -> clear_values();
   initialize_coordinates();
   clear_glyphs();
}
//------------------------------------------------------------------
void Window::show_portal (bool is_checked)
{
   if ( is_checked == true ) {
      show_dialer_button -> setToolTip ("Hide glyph input window");
      dialer -> show();
   }
   else {
   	  show_dialer_button -> setToolTip ("Show glyph input window");
   	  dialer -> hide();
   }
}
//------------------------------------------------------------------
void Window::show_glyphs (bool is_checked)
{
   if ( is_checked == true ) {
      show_portal_button -> setToolTip ("Hide portal address window");
      glyph_window -> show();
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
         // Move successful/valid conversion results to GUI
         coordinates_input -> setText (blackbox -> get_coordinate());
         glyph_sequence -> setText (blackbox -> get_glyph_sequence());
         portal_number -> setValue (blackbox -> get_portal());
         glyph_window -> set_glyphs(blackbox -> get_glyph_sequence());
         
         // Show glyph sequence pop-up
         show_portal_button -> setChecked (true);
         show_glyphs(true);
      }
      else
         emit have_errors();
   }
}
//------------------------------------------------------------------
void Window::GUI_convert_to_glyph_sequence()







|
|







423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
         // Move successful/valid conversion results to GUI
         coordinates_input -> setText (blackbox -> get_coordinate());
         glyph_sequence -> setText (blackbox -> get_glyph_sequence());
         portal_number -> setValue (blackbox -> get_portal());
         glyph_window -> set_glyphs(blackbox -> get_glyph_sequence());
         
         // Show glyph sequence pop-up
         //show_portal_button -> setChecked (true);
         //show_glyphs(true);
      }
      else
         emit have_errors();
   }
}
//------------------------------------------------------------------
void Window::GUI_convert_to_glyph_sequence()
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
         // Move successful/valid conversion results to GUI
         glyph_sequence -> setText (blackbox -> get_glyph_sequence());
         coordinates_input -> setText (blackbox -> get_coordinate());
         portal_number -> setValue (blackbox -> get_portal());
         glyph_window -> set_glyphs(blackbox -> get_glyph_sequence());
         
         // Show glyph sequence pop-up
         show_portal_button -> setChecked (true);
         show_glyphs(true);
      }
      else
         emit have_errors();
   }
}
//------------------------------------------------------------------







|
|






450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
         // Move successful/valid conversion results to GUI
         glyph_sequence -> setText (blackbox -> get_glyph_sequence());
         coordinates_input -> setText (blackbox -> get_coordinate());
         portal_number -> setValue (blackbox -> get_portal());
         glyph_window -> set_glyphs(blackbox -> get_glyph_sequence());
         
         // Show glyph sequence pop-up
         //show_portal_button -> setChecked (true);
         //show_glyphs(true);
      }
      else
         emit have_errors();
   }
}
//------------------------------------------------------------------

Changes to src/nmsDecoderMainWindow.h.

1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
16
17
18
19
20
//==================================================================
#ifndef __NMS_CONVERT_GUI_H__
#define __NMS_CONVERT_GUI_H__
//==================================================================
#include <QtWidgets>

#include "nmsDecoder.h"
#include "PortalAddressWindow.h"

//==================================================================
class Window : public QWidget
{
      // Macro to allow for custom slots and signals
      Q_OBJECT

   public:
      //////////////////
      // CONSTRUCTORS //
      //////////////////
      Window();
      Window(QString _code, bool isCoordinate = true);








>



|
|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//==================================================================
#ifndef __NMS_CONVERT_GUI_H__
#define __NMS_CONVERT_GUI_H__
//==================================================================
#include <QtWidgets>

#include "nmsDecoder.h"
#include "PortalAddressWindow.h"
#include "PortalAddressPickerWindow.h"
//==================================================================
class Window : public QWidget
{
   // Macro to allow for custom slots and signals
   Q_OBJECT

   public:
      //////////////////
      // CONSTRUCTORS //
      //////////////////
      Window();
      Window(QString _code, bool isCoordinate = true);
33
34
35
36
37
38
39





40
41
42
43
44
45
46
47
      void have_errors();

   public slots:
      void GUI_convert_to_glyph_sequence();
      void GUI_convert_from_glyph_sequence();
      void about();






      // Show portal address window
      void show_glyphs(bool);
      void hide_glyphs() { glyph_window -> hide(); }

      // Show errors in provided code to convert
      void show_messages();

      // Show coordinates/portal address for location preset







>
>
>
>
>
|







34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
      void have_errors();

   public slots:
      void GUI_convert_to_glyph_sequence();
      void GUI_convert_from_glyph_sequence();
      void about();

      // Show input portal address window
      void show_portal(bool);
      void hide_portal() { dialer -> hide(); }
      void update_glyph() { glyph_sequence -> setText (dialer -> get_code()); }

      // Show resulting portal address window
      void show_glyphs(bool);
      void hide_glyphs() { glyph_window -> hide(); }

      // Show errors in provided code to convert
      void show_messages();

      // Show coordinates/portal address for location preset
74
75
76
77
78
79
80

81
82
83
84
85
86
87
      QGroupBox *other_buttons_group;
      QPushButton *exit_button;
      QPushButton *about_button;
      QPushButton *convert_to_glyph_button;
      QPushButton *convert_from_glyph_button;
      QPushButton *clear_button;
      QPushButton *show_portal_button;

      QMessageBox *invalid_messages;
      Glyphs *glyph_window;
      
};
//------------------------------------------------------------------
#endif  // __NMS_CONVERT_H__
//==================================================================







>


|




80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
      QGroupBox *other_buttons_group;
      QPushButton *exit_button;
      QPushButton *about_button;
      QPushButton *convert_to_glyph_button;
      QPushButton *convert_from_glyph_button;
      QPushButton *clear_button;
      QPushButton *show_portal_button;
      QPushButton *show_dialer_button;
      QMessageBox *invalid_messages;
      Glyphs *glyph_window;
      PortalDialer *dialer;
};
//------------------------------------------------------------------
#endif  // __NMS_CONVERT_H__
//==================================================================

Changes to src/nmsDecoderUtility.cpp.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

28
29
30
31
32
33
34
35
36
37
38
39
40
//==================================================================
#include <QRegularExpressionMatch>
#include <sstream>          // std::stringstream
#include <iomanip>          // std::hex, std::oct, std::dec

#include "nmsDecoderUtility.h"
//==================================================================
//////////////////////
// HELPER FUNCTIONS //
//////////////////////
//==================================================================
//------------------------------------------------------------------
int convert_hex_to_integer (const QString coordinate)
{
   std::stringstream flex_string;
   flex_string << std::dec << coordinate.toUtf8().constData();
   std::string something (flex_string.str());
   QString result = QString::fromStdString(something);
   bool ok;
   return (result.toInt(&ok, 16));
}
//------------------------------------------------------------------
QString convert_integer_to_hex (const int number)
{
   std::stringstream flex_string;
   flex_string << std::setfill ('0') << std::setw(2) << std::hex <<
               number;

   std::string _astring (flex_string.str());
   QString result = QString::fromStdString(_astring).toUpper();
   return (result);
}
//------------------------------------------------------------------
bool is_valid_coordinate (const QString _code, QStringList &errors)
{
   bool result = true;
   QString __code = _code.toUpper();
   QRegularExpression
   lookingForA ("[0-9A-F]{4}:[0-9A-F]{4}:[0-9A-F]{4}:[0-9A-F]{4}");
   QRegularExpressionMatch validCoordinate = lookingForA.match (__code);













|


|






|


|
|
>





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//==================================================================
#include <QRegularExpressionMatch>
#include <sstream>          // std::stringstream
#include <iomanip>          // std::hex, std::oct, std::dec

#include "nmsDecoderUtility.h"
//==================================================================
//////////////////////
// HELPER FUNCTIONS //
//////////////////////
//==================================================================
//------------------------------------------------------------------
int convert_hex_to_integer (const QString &_code)
{
   std::stringstream flex_string;
   flex_string << std::dec << _code.toUtf8().constData();
   std::string something (flex_string.str());
   QString result = QString::fromStdString(something);
   bool ok;
   return (result.toInt(&ok, 16));
}
//------------------------------------------------------------------
QString convert_integer_to_hex (const int &number)
{
   std::stringstream flex_string;
   //flex_string << std::setfill ('0') << std::setw(2) << std::hex <<
   //            number;
   flex_string << std::hex << number;
   std::string _astring (flex_string.str());
   QString result = QString::fromStdString(_astring).toUpper();
   return (result);
}
//------------------------------------------------------------------
bool is_valid_coordinate (const QString &_code, QStringList &errors)
{
   bool result = true;
   QString __code = _code.toUpper();
   QRegularExpression
   lookingForA ("[0-9A-F]{4}:[0-9A-F]{4}:[0-9A-F]{4}:[0-9A-F]{4}");
   QRegularExpressionMatch validCoordinate = lookingForA.match (__code);

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
   }
   else
      result = false;

   return (result);
}
//------------------------------------------------------------------
bool is_valid_glyph_code (const QString _code, QStringList &error)
{
   bool result = true;
   QString __glyph = _code.toUpper();
   const QRegularExpression lookingFor ("[0-9A-F]{12}");
   const QRegularExpression lookingForA ("[0-9A-F]");
   QRegularExpressionMatch validGlyph = lookingFor.match (__glyph);








|







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
   }
   else
      result = false;

   return (result);
}
//------------------------------------------------------------------
bool is_valid_glyph_code (const QString &_code, QStringList &error)
{
   bool result = true;
   QString __glyph = _code.toUpper();
   const QRegularExpression lookingFor ("[0-9A-F]{12}");
   const QRegularExpression lookingForA ("[0-9A-F]");
   QRegularExpressionMatch validGlyph = lookingFor.match (__glyph);

227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
      result = false;
      error.append(__glyph);
   }

   return (result);
}
//------------------------------------------------------------------
bool is_valid_portal (int _code)
{
   bool result;

   if ( _code >= 1 && _code <= 16 )
      result = true;
   else
      result = false;

   return (result);
}
//------------------------------------------------------------------
QString pad_with_zeros (const QString code, const int padding)
{
   QString result = code;

   if ( padding <= 4 && padding > 0 )
   {
      for (int i = code.size(); i < padding; i++)
         result.insert(0, '0');
   }

   return (result);
}







|











|











228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
      result = false;
      error.append(__glyph);
   }

   return (result);
}
//------------------------------------------------------------------
bool is_valid_portal (const int &_code)
{
   bool result;

   if ( _code >= 1 && _code <= 16 )
      result = true;
   else
      result = false;

   return (result);
}
//------------------------------------------------------------------
QString pad_with_zeros (const QString &code, const int &padding)
{
   QString result = code;

   if ( padding <= 4 && padding > 0 )
   {
      for (int i = code.size(); i < padding; i++)
         result.insert(0, '0');
   }

   return (result);
}

Changes to src/nmsDecoderUtility.h.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __NMS_DECODER_UTILITY_H__
#define __NMS_DECODER_UTILITY_H__
//==================================================================
#include <QtCore>
//==================================================================
//////////////////////
// HELPER FUNCTIONS //
//////////////////////
//------------------------------------------------------------------
int convert_hex_to_integer (const QString);
QString convert_integer_to_hex (const int);

/*
   QString pad_with_zeros (const QString, const int)

   Returns the QString parameter pre-pended with zeros to 
   fill its size to the int parameter, which must be a value 
   between 1 and 4.
*/
QString pad_with_zeros (const QString, const int);

/*
  bool is_valid_coordinate(const QString)

  Coordinate is 16 hex characters long, with 3 semicolons to
  separate the different axis (x,y,z,star class). QStringList 
  parameter will hold invalid segments found within the 
  provided _code.
*/
bool is_valid_coordinate(const QString _code, QStringList &);

/*
  bool is_valid_glyph_code(const QString)

  Glyph code is 12 hex characters long. Must also be between
  a lower and upper limit: 000182802802 .. F2FF80800800. 
  QStringList parameter will hold invalid segements found 
  within the provided _code.
*/
bool is_valid_glyph_code(const QString _code, QStringList &);

/*
  bool is_valid_portal (int)

  Returns true if parameter is a decimal number between 
  1 and 16.
*/
bool is_valid_portal(int _code);
//------------------------------------------------------------------
#endif  // __NMS_DECODER_UTILITY_H__
//------------------------------------------------------------------









|
|








|









|









|







|



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef __NMS_DECODER_UTILITY_H__
#define __NMS_DECODER_UTILITY_H__
//==================================================================
#include <QtCore>
//==================================================================
//////////////////////
// HELPER FUNCTIONS //
//////////////////////
//------------------------------------------------------------------
int convert_hex_to_integer (const QString &_code);
QString convert_integer_to_hex (const int &number);

/*
   QString pad_with_zeros (const QString, const int)

   Returns the QString parameter pre-pended with zeros to 
   fill its size to the int parameter, which must be a value 
   between 1 and 4.
*/
QString pad_with_zeros (const QString &code, const int &padding);

/*
  bool is_valid_coordinate(const QString)

  Coordinate is 16 hex characters long, with 3 semicolons to
  separate the different axis (x,y,z,star class). QStringList 
  parameter will hold invalid segments found within the 
  provided _code.
*/
bool is_valid_coordinate(const QString &_code, QStringList &);

/*
  bool is_valid_glyph_code(const QString)

  Glyph code is 12 hex characters long. Must also be between
  a lower and upper limit: 000182802802 .. F2FF80800800. 
  QStringList parameter will hold invalid segements found 
  within the provided _code.
*/
bool is_valid_glyph_code(const QString &_code, QStringList &);

/*
  bool is_valid_portal (int)

  Returns true if parameter is a decimal number between 
  1 and 16.
*/
bool is_valid_portal(const int &_code);
//------------------------------------------------------------------
#endif  // __NMS_DECODER_UTILITY_H__
//------------------------------------------------------------------