@@ -22,13 +22,20 @@ Inspector::Inspector(QString name, QString label, QString profile, QVariantMap a
22
22
defineMeAsSequencer ();
23
23
24
24
OST::ElementBool* b = new OST::ElementBool (" Shoot" , " 0" , " " );
25
+ b->setValue (false , false );
25
26
getProperty (" actions" )->addElt (" shoot" , b);
26
- b = new OST::ElementBool (" Loop" , " 2" , " " );
27
+
28
+ b = new OST::ElementBool (" Loop" , " 1" , " " );
27
29
b->setValue (false , false );
28
30
getProperty (" actions" )->addElt (" loop" , b);
29
- b = new OST::ElementBool ( " Abort " , " 2 " , " " );
30
- getProperty ( " actions " )-> addElt ( " abort " , b );
31
+
32
+ b = new OST::ElementBool ( " Reload " , " 2 " , " " );
31
33
b->setValue (false , false );
34
+ getProperty (" actions" )->addElt (" reload" , b);
35
+
36
+ b = new OST::ElementBool (" Abort" , " 3" , " " );
37
+ b->setValue (false , false );
38
+ getProperty (" actions" )->addElt (" abort" , b);
32
39
33
40
getProperty (" actions" )->deleteElt (" startsequence" );
34
41
getProperty (" actions" )->deleteElt (" abortsequence" );
@@ -82,6 +89,13 @@ void Inspector::OnMyExternalEvent(const QString &eventType, const QString &even
82
89
Shoot ();
83
90
}
84
91
}
92
+ if (keyelt == " reload" )
93
+ {
94
+ if (getEltBool (keyprop, keyelt)->setValue (false , true ))
95
+ {
96
+ emit newImage ();
97
+ }
98
+ }
85
99
if (keyelt == " abort" )
86
100
{
87
101
if (getEltBool (keyprop, keyelt)->setValue (false , true ))
@@ -109,6 +123,9 @@ void Inspector::newBLOB(INDI::PropertyBlob pblob)
109
123
delete _image;
110
124
_image = new fileio ();
111
125
_image->loadBlob (pblob, 64 );
126
+ // testing : load fits, comment previous and uncomment **2** lines below
127
+ // _image->loadFits("/pathoftheimage/Light_LLL_008.fits");
128
+ // _image->generateQImage();
112
129
stats = _image->getStats ();
113
130
emit newImage ();
114
131
}
@@ -195,22 +212,68 @@ void Inspector::OnSucessSEP()
195
212
// r.setRect(0,0,im.width(),im.height());
196
213
197
214
/* Drw HFR ellipses around found stars */
198
- QPainter p;
199
- p.begin (&immap);
200
- p.setPen (QPen (Qt::red));
201
- // p.setFont(QFont("Times", 15, QFont::Normal));
202
- // p.drawText(r, Qt::AlignLeft, QDateTime::currentDateTime().toString("dd/MM/yyyy hh:mm:ss zzz") );
203
- p.setPen (QPen (Qt::green));
204
215
foreach ( FITSImage::Star s, _solver.stars )
205
216
{
217
+ QPainter p2;
218
+ p2.begin (&immap);
219
+ p2.setPen (QPen (Qt::green));
220
+
206
221
// qDebug() << "draw " << s.x << "/" << s.y;
207
222
int x = s.x ;
208
223
int y = s.y ;
209
224
int a = s.a ;
210
225
int b = s.b ;
226
+ float dx = 2 * s.a * cos (s.theta * 3.14159 / 360 ) / s.b ;
227
+ float dy = 2 * s.a * sin (s.theta * 3.14159 / 360 ) / s.b ;
228
+
211
229
// qDebug() << "draw " << x << "/" << y;
212
- p.drawEllipse (QPoint (x / 2 , y / 2 ), a * 5 , b * 5 );
230
+ // p2.rotate(s.theta);
231
+ // p2.drawEllipse(QPoint(x / 2, y / 2), a * 5, b * 5);
232
+ p2.drawLine (x / 2 - dx, y / 2 - dy, x / 2 + dx, y / 2 + dy);
233
+ p2.end ();
234
+ }
235
+
236
+ int imgWidth = _image->getStats ().width ;
237
+ int imgHeight = _image->getStats ().height ;
238
+ int ellipseSize = 0.20 * imgHeight / _solver.HFRZones ;
239
+
240
+ for (int line = 0 ; line < _solver.HFRZones ; line++)
241
+ {
242
+ for (int column = 0 ; column < _solver.HFRZones ; column++)
243
+ {
244
+ int zone = _solver.HFRZones * line + column;
245
+
246
+ // qDebug() << "zones theta" << zone << _solver.thetaAvgZone[zone] << _solver.thetaDevAvgZone[zone] <<
247
+ // _solver.aAxeAvgZone[zone] <<
248
+ // _solver.bAxeAvgZone[zone] << _solver.eAxeAvgZone[zone];
249
+
250
+
251
+ int x = (imgWidth / _solver.HFRZones ) * (column + 0.5 ) ;
252
+ int y = (imgHeight / _solver.HFRZones ) * (line + 0.5 ) ;
253
+ float e = _solver.aAxeAvgZone [zone] / _solver.bAxeAvgZone [zone] - 1 ;
254
+ float dx = ellipseSize * e * e * cos (_solver.thetaAvgZone [zone] * 3.14159 / 360 );
255
+ float dy = ellipseSize * e * e * sin (_solver.thetaAvgZone [zone] * 3.14159 / 360 );
256
+
257
+ QPainter p2;
258
+ p2.begin (&immap);
259
+ p2.setPen (QPen (Qt::red, 5 ));
260
+
261
+ // qDebug() << "draw " << x << "/" << y;
262
+ // p2.rotate(_solver.thetaAvgZone[zone]);
263
+ // p2.drawEllipse(QPoint(x / 2, y / 2), a * 15, b * 15);
264
+ p2.drawEllipse (QPoint (x / 2 , y / 2 ), ellipseSize, ellipseSize);
265
+ p2.drawLine (x / 2 - dx, y / 2 - dy, x / 2 + dx, y / 2 + dy);
266
+ p2.end ();
267
+ }
213
268
}
269
+ QPainter p;
270
+ p.begin (&immap);
271
+ p.setPen (QPen (Qt::red));
272
+
273
+ // p.drawLine(0, imgHeight / 6, imgWidth / 2, imgHeight / 6);
274
+ // p.drawLine(0, 2 * imgHeight / 6, imgWidth / 2, 2 * imgHeight / 6);
275
+ // p.drawLine(imgWidth / 6, 0, imgWidth / 6, imgHeight / 2);
276
+ // p.drawLine(2 * imgWidth / 6, 0, 2 * imgWidth / 6, imgHeight / 2);
214
277
215
278
/* determine 4 corner HFR */
216
279
int upperLeftI = 0 ;
@@ -326,7 +389,7 @@ void Inspector::OnSucessSEP()
326
389
}
327
390
void Inspector::OnNewImage ()
328
391
{
329
- _solver.ResetSolver (stats, _image->getImageBuffer ());
392
+ _solver.ResetSolver (stats, _image->getImageBuffer (), getInt ( " parameters " , " zoning " ) );
330
393
connect (&_solver, &Solver::successSEP, this , &Inspector::OnSucessSEP);
331
394
_solver.FindStars (_solver.stellarSolverProfiles [0 ]);
332
395
}
0 commit comments