Commit 06e65385 authored by Jasem Mutlaq's avatar Jasem Mutlaq

Various Ekos bug fixes

parent c647acc5
......@@ -602,10 +602,8 @@ void EkosManager::processNewDevice(ISD::GDInterface *devInterface)
void EkosManager::processLocalDevice(ISD::GDInterface *devInterface)
{
foreach(DriverInfo *di, driversList.values())
{
if (di == devInterface->getDriverInfo())
{
DriverInfo *di = devInterface->getDriverInfo();
switch (di->getType())
{
case KSTARS_TELESCOPE:
......@@ -630,21 +628,21 @@ void EkosManager::processLocalDevice(ISD::GDInterface *devInterface)
case KSTARS_FILTER:
if (filter_di == di)
filter = devInterface;
if (useFilterFromCCD)
ccd = devInterface;
break;
case KSTARS_AUXILIARY:
if (aux_di == di)
aux = devInterface;
break;
default:
return;
break;
}
nDevices--;
break;
}
}
nDevices--;
connect(devInterface, SIGNAL(Connected()), this, SLOT(deviceConnected()));
connect(devInterface, SIGNAL(Disconnected()), this, SLOT(deviceDisconnected()));
......@@ -930,9 +928,9 @@ void EkosManager::processNewProperty(INDI::Property* prop)
{
initCapture();
if (!strcmp(ccd->getDeviceName(), prop->getDeviceName()))
if (ccd && !strcmp(ccd->getDeviceName(), prop->getDeviceName()))
captureProcess->addGuideHead(ccd);
else
else if (guider)
captureProcess->addGuideHead(guider);
......@@ -944,9 +942,9 @@ void EkosManager::processNewProperty(INDI::Property* prop)
{
if (captureProcess)
{
if (!strcmp(ccd->getDeviceName(), prop->getDeviceName()))
if (ccd && !strcmp(ccd->getDeviceName(), prop->getDeviceName()))
captureProcess->syncFrameType(ccd);
else
else if (guider)
captureProcess->syncFrameType(guider);
}
}
......
......@@ -190,6 +190,8 @@ void Focus::stopFocus()
inAutoFocus = false;
inFocusLoop = false;
currentCCD->disconnect(this);
resetButtons();
absIterations = 0;
......
......@@ -99,7 +99,7 @@ void Guide::setTelescope(ISD::GDInterface *newTelescope)
void Guide::addGuideHead()
{
// Let's just make sure
if (currentCCD->hasGuideHead())
if (currentCCD && currentCCD->hasGuideHead())
{
guiderCombo->clear();
guiderCombo->addItem(currentCCD->getDeviceName() + QString(" Guider"));
......
......@@ -540,19 +540,23 @@ void FITSImage::findCentroid(int initStdDev, int minEdgeWidth)
float center = avg/sum;
int i_center = round(center);
Edge *newEdge = new Edge();
if (center > 0)
{
int i_center = round(center);
newEdge->x = center;
newEdge->y = i;
newEdge->scanned = 0;
newEdge->val = image_buffer[i_center+(i*stats.dim[0])] - stats.min;
newEdge->width = pixelRadius;
newEdge->HFR = 0;
newEdge->sum = sum;
Edge *newEdge = new Edge();
edges.append(newEdge);
newEdge->x = center;
newEdge->y = i;
newEdge->scanned = 0;
newEdge->val = image_buffer[i_center+(i*stats.dim[0])] - stats.min;
newEdge->width = pixelRadius;
newEdge->HFR = 0;
newEdge->sum = sum;
edges.append(newEdge);
}
}
......
......@@ -107,6 +107,9 @@ bool FITSTab::loadFITS(const KUrl *imageURL, FITSMode mode, FITSScale filter)
image_data->setHistogram(histogram);
image_data->applyFilter(filter);
if (filter != FITS_NONE)
image->rescale(ZOOM_KEEP_LEVEL);
if (viewer->isStarsMarked())
image->toggleStars(true);
......
......@@ -165,18 +165,26 @@ void INDIListener::registerProperty(INDI::Property *prop)
devices.append(gd);
emit newCCD(gd);
}
else if (gd->getType() == KSTARS_UNKNOWN && !strcmp(prop->getName(), "FILTER_SLOT"))
else if (!strcmp(prop->getName(), "FILTER_SLOT"))
{
devices.removeOne(gd);
gd = new ISD::Filter(gd);
devices.append(gd);
emit newFilter(gd);
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::Filter(gd);
devices.append(gd);
}
emit newFilter(gd);
}
else if (gd->getType() == KSTARS_UNKNOWN && !strcmp(prop->getName(), "FOCUS_MOTION"))
else if (!strcmp(prop->getName(), "FOCUS_MOTION"))
{
devices.removeOne(gd);
gd = new ISD::Focuser(gd);
devices.append(gd);
if (gd->getType() == KSTARS_UNKNOWN)
{
devices.removeOne(gd);
gd = new ISD::Focuser(gd);
devices.append(gd);
}
emit newFocuser(gd);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment