Skip to content

Commit

Permalink
Migrate FileNameTP Property
Browse files Browse the repository at this point in the history
  • Loading branch information
naheedsa committed Sep 9, 2024
1 parent 036feba commit 71c3d55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
16 changes: 8 additions & 8 deletions libs/indibase/indiccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,8 +397,8 @@ bool CCD::initProperties()
OPTIONS_TAB, IP_RW, 60, IPS_IDLE);

// Upload File Path
IUFillText(&FileNameT[0], "FILE_PATH", "Path", "");
IUFillTextVector(&FileNameTP, FileNameT, 1, getDeviceName(), "CCD_FILE_PATH", "Filename", IMAGE_INFO_TAB, IP_RO, 60,
FileNameTP[0].fill("FILE_PATH", "Path", "");
FileNameTP.fill(getDeviceName(), "CCD_FILE_PATH", "Filename", IMAGE_INFO_TAB, IP_RO, 60,
IPS_IDLE);

/**********************************************/
Expand Down Expand Up @@ -1480,17 +1480,17 @@ bool CCD::ISNewSwitch(const char * dev, const char * name, ISState * states, cha
{
DEBUG(Logger::DBG_SESSION, "Upload settings set to client only.");
if (prevMode != 0)
deleteProperty(FileNameTP.name);
deleteProperty(FileNameTP);
}
else if (UploadSP[UPLOAD_LOCAL].getState() == ISS_ON)
{
DEBUG(Logger::DBG_SESSION, "Upload settings set to local only.");
defineProperty(&FileNameTP);
defineProperty(FileNameTP);
}
else
{
DEBUG(Logger::DBG_SESSION, "Upload settings set to client and local.");
defineProperty(&FileNameTP);
defineProperty(FileNameTP);
}

UploadSP.setState(IPS_OK);
Expand Down Expand Up @@ -2600,11 +2600,11 @@ bool CCD::uploadFile(CCDChip * targetChip, const void * fitsData, size_t totalBy
fclose(fp);

// Save image file path
IUSaveText(&FileNameT[0], imageFileName);
FileNameTP[0].setText(imageFileName);

DEBUGF(Logger::DBG_SESSION, "Image saved to %s", imageFileName);
FileNameTP.s = IPS_OK;
IDSetText(&FileNameTP, nullptr);
FileNameTP.setState(IPS_OK);
FileNameTP.apply();
}

if (targetChip->SendCompressed && EncodeFormatSP[FORMAT_XISF].getState() != ISS_ON)
Expand Down
3 changes: 1 addition & 2 deletions libs/indibase/indiccd.h
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,7 @@ class CCD : public DefaultDevice, GuiderInterface
* but when upload option is set to either @a Both or @a Local, then they are saved on the local disk with
* this name.
*/
ITextVectorProperty FileNameTP;
IText FileNameT[1] {};
INDI::PropertyText FileNameTP {1};

/// Specifies Camera NATIVE capture format (e.g. Mono, RGB, RAW8..etc).
INDI::PropertySwitch CaptureFormatSP {0};
Expand Down

0 comments on commit 71c3d55

Please sign in to comment.