From 71c3d556dcad5235571a9e53bc87ad7851785281 Mon Sep 17 00:00:00 2001 From: Salman Naheed Date: Mon, 9 Sep 2024 14:46:10 +0300 Subject: [PATCH] Migrate FileNameTP Property --- libs/indibase/indiccd.cpp | 16 ++++++++-------- libs/indibase/indiccd.h | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/libs/indibase/indiccd.cpp b/libs/indibase/indiccd.cpp index 7911ebb6cc..00e27f197b 100644 --- a/libs/indibase/indiccd.cpp +++ b/libs/indibase/indiccd.cpp @@ -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); /**********************************************/ @@ -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); @@ -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) diff --git a/libs/indibase/indiccd.h b/libs/indibase/indiccd.h index ce667d75ba..a2a2eb1698 100644 --- a/libs/indibase/indiccd.h +++ b/libs/indibase/indiccd.h @@ -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};