next fixes

This commit is contained in:
2026-06-04 18:24:26 +03:00
parent 1f7aad348e
commit f65daab527
13 changed files with 475 additions and 323 deletions

View File

@@ -384,11 +384,11 @@ void focusers(){
if(num < 0) num = 0;
if(num > focuser->Ndevices - 1){
WARNX(_("Found %d focusers, you point number %d"), focuser->Ndevices, num);
return;
goto retn;
}
if(!focuser->setDevNo(num)){
WARNX(_("Can't set active focuser number"));
return;
goto retn;
}
char buf[BUFSIZ];
if(focuser->getModelName(buf, BUFSIZ)){
@@ -402,18 +402,18 @@ void focusers(){
float minpos, maxpos, curpos;
if(!focuser->getMinPos(&minpos) || !focuser->getMaxPos(&maxpos)){
WARNX(_("Can't get focuser limit positions"));
return;
goto retn;
}
verbose(1, "FOCMINPOS=%g", minpos);
verbose(1, "FOCMAXPOS=%g", maxpos);
DBG("FOCMINPOS=%g, FOCMAXPOS=%g", minpos, maxpos);
if(!focuser->getPos(&curpos)){
WARNX(_("Can't get current focuser position"));
return;
goto retn;
}
verbose(1, "FOCPOS=%g", curpos);
DBG("Curpos = %g", curpos);
if(isnan(GP->gotopos) && isnan(GP->addsteps)) return; // no focuser commands
if(isnan(GP->gotopos) && isnan(GP->addsteps)) goto retn; // no focuser commands
float tagpos = 0.;
if(!isnan(GP->gotopos)){ // set absolute position
tagpos = GP->gotopos;
@@ -423,13 +423,15 @@ void focusers(){
DBG("tagpos: %g", tagpos);
if(tagpos < minpos || tagpos > maxpos){
WARNX(_("Can't set position %g: out of limits [%g, %g]"), tagpos, minpos, maxpos);
return;
goto retn;
}
if(tagpos - minpos < __FLT_EPSILON__){
if(!focuser->home(GP->async)) WARNX(_("Can't home focuser"));
}else{
if(!focuser->setAbsPos(GP->async, tagpos)) WARNX(_("Can't set position %g"), tagpos);
}
retn:
focclose();
}
cc_Wheel *startWheel(){
@@ -472,11 +474,11 @@ void wheels(){
if(num < 0) num = 0;
if(num > wheel->Ndevices - 1){
WARNX(_("Found %d wheels, you point number %d"), wheel->Ndevices, num);
return;
goto retn;
}
if(!wheel->setDevNo(num)){
WARNX(_("Can't set active wheel number"));
return;
goto retn;
}
char buf[BUFSIZ];
if(wheel->getModelName(buf, BUFSIZ)){
@@ -492,17 +494,19 @@ void wheels(){
}else WARNX("Can't get current wheel position");
if(!wheel->getMaxPos(&maxpos)){
WARNX(_("Can't get max wheel position"));
return;
goto retn;
}
verbose(1, "WHEELMAXPOS=%d", maxpos);
pos = GP->setwheel;
if(pos == -1) return; // no wheel commands
if(pos == -1) goto retn; // no wheel commands
if(pos < 0 || pos > maxpos){
WARNX(_("Wheel position should be from 0 to %d"), maxpos);
return;
goto retn;
}
if(!wheel->setPos(pos))
WARNX(_("Can't set wheel position %d"), pos);
retn:
closewheel();
}
/*
static void closeall(){
@@ -923,6 +927,7 @@ int start_socket(int isserver){
}
if(isserver){
imsock = cc_open_socket(TRUE, GP->imageport, 2); // image socket should be networked
DBG("imsock=%d, image port=%s", imsock, GP->imageport);
server(sock, imsock);
}else{
#ifdef IMAGEVIEW