bool IpFocus::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(strcmp(dev,getDeviceName())==0) { if(strcmp(name,"FOCUSER_API_ENDPOINT")==0) { IUUpdateText(&FocuserEndpointTP, texts, names, n); FocuserEndpointTP.s = IPS_OK; IDSetText(&FocuserEndpointTP, NULL); return true; } if(strcmp(name,"BACKLASH_APPROACH_SETTINGS")==0) { IUUpdateText(&AlwaysApproachDirectionP, texts, names, n); AlwaysApproachDirectionP.s = IPS_OK; IDSetText(&AlwaysApproachDirectionP, NULL); return true; } if(strcmp(name,"BACKLASH_STEPS_SETTINGS")==0) { IUUpdateText(&BacklashStepsP, texts, names, n); BacklashStepsP.s = IPS_OK; IDSetText(&BacklashStepsP, NULL); return true; } } return INDI::Focuser::ISNewText(dev,name,texts,names,n); }
bool WeatherSafetyProxy::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) { if (strcmp(name, keywordTP.name) == 0) { keywordTP.s = IPS_OK; IUUpdateText(&keywordTP, texts, names, n); // update client display IDSetText(&keywordTP, nullptr); return true; } if (strcmp(name, ScriptsTP.name) == 0) { ScriptsTP.s = IPS_OK; IUUpdateText(&ScriptsTP, texts, names, n); // update client display IDSetText(&ScriptsTP, nullptr); return true; } if (strcmp(name, UrlTP.name) == 0) { UrlTP.s = IPS_OK; IUUpdateText(&UrlTP, texts, names, n); // update client display IDSetText(&UrlTP, nullptr); return true; } } return INDI::Weather::ISNewText(dev, name, texts, names, n); }
bool WeatherWatcher::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) { if (!strcmp(watchFileTP.name, name)) { IUUpdateText(&watchFileTP, texts, names, n); watchFileTP.s = IPS_OK; IDSetText(&watchFileTP, nullptr); return true; } if (!strcmp(keywordTP.name, name)) { IUUpdateText(&keywordTP, texts, names, n); keywordTP.s = IPS_OK; IDSetText(&keywordTP, nullptr); return true; } if (!strcmp(separatorTP.name, name)) { IUUpdateText(&separatorTP, texts, names, n); separatorTP.s = IPS_OK; IDSetText(&separatorTP, nullptr); return true; } } return INDI::Weather::ISNewText(dev, name, texts, names, n); }
bool INDI::CCD::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { // Ok, lets see if this is a property wer process //IDLog("IndiTelescope got %d new text items name %s\n",n,name); // first check if it's for our device if(strcmp(dev,getDeviceName())==0) { // This is for our device // Now lets see if it's something we process here if(strcmp(name,ActiveDeviceTP->name)==0) { int rc; //IDLog("calling update text\n"); ActiveDeviceTP->s=IPS_OK; rc=IUUpdateText(ActiveDeviceTP,texts,names,n); //IDLog("update text returns %d\n",rc); // Update client display IDSetText(ActiveDeviceTP,NULL); saveConfig(); IUFillNumberVector(&EqNP,EqN,2,ActiveDeviceT[0].text,"EQUATORIAL_PEC","EQ PEC",MAIN_CONTROL_TAB,IP_RW,60,IPS_IDLE); IDSnoopDevice(ActiveDeviceT[0].text,"EQUATORIAL_PEC"); IDSnoopDevice(ActiveDeviceT[0].text,"TELESCOPE_INFO"); IDSnoopDevice(ActiveDeviceT[1].text,"FWHM"); // We processed this one, so, tell the world we did it return true; } } return INDI::DefaultDevice::ISNewText(dev,name,texts,names,n); }
bool EQModSimulator::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { // first check if it's for our device if(strcmp(dev,telescope->getDeviceName())==0) { ITextVectorProperty *tvp =telescope->getText(name); if (tvp) { if ((tvp != SimMCVersionTP)) return false; if (telescope->isConnected()) { DEBUGDEVICE(telescope->getDeviceName(), INDI::Logger::DBG_WARNING,"Can not change simulation settings when mount is already connected"); return false; } tvp->s=IPS_OK; IUUpdateText(tvp,texts,names,n); IDSetText(tvp,NULL); return true; } } return false; }
bool ScopeScript::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (strcmp(dev, getDeviceName()) == 0 && strcmp(name, ScriptsTP.name) == 0) { IUUpdateText(&ScriptsTP, texts, names, n); IDSetText(&ScriptsTP, nullptr); return true; } return Telescope::ISNewText(dev, name, texts, names, n); }
bool GPhotoCCD::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(strcmp(dev,getDeviceName())==0) { if(strcmp(name,PortTP.name)==0) { PortTP.s=IPS_OK; IUUpdateText(&PortTP,texts,names,n); IDSetText(&PortTP, NULL); return true; } if(CamOptions.find(name) != CamOptions.end()) { cam_opt *opt = CamOptions[name]; if (opt->widget->type != GP_WIDGET_TEXT) { DEBUGF(INDI::Logger::DBG_ERROR, "ERROR: Property '%s'is not a string", name); return false; } if (opt->widget->readonly) { DEBUGF(INDI::Logger::DBG_WARNING, "WARNING: Property %s is read-only", name); IDSetText(&opt->prop.text, NULL); return false; } if (IUUpdateText(&opt->prop.text, texts, names, n) < 0) return false; gphoto_set_widget_text(gphotodrv, opt->widget, texts[0]); opt->prop.num.s = IPS_OK; IDSetText(&opt->prop.text, NULL); return true; } } return INDI::CCD::ISNewText(dev, name, texts, names, n); }
bool DomeScript::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) { if (strcmp(name, ScriptsTP.name) == 0) { IUUpdateText(&ScriptsTP, texts, names, n); ScriptsTP.s = IPS_OK; IDSetText(&ScriptsTP, nullptr); return true; } } return Dome::ISNewText(dev, name, texts, names, n); }
bool WatchDog::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { // first check if it's for our device if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) { if (!strcmp(SettingsTP.name, name)) { IUUpdateText(&SettingsTP, texts, names, n); SettingsTP.s = IPS_OK; IDSetText(&SettingsTP, nullptr); return true; } if (!strcmp(ActiveDeviceTP.name, name)) { if (watchdogClient->isBusy()) { ActiveDeviceTP.s = IPS_ALERT; IDSetText(&ActiveDeviceTP, nullptr); LOG_ERROR("Cannot change devices names while shutdown is in progress..."); return true; } IUUpdateText(&ActiveDeviceTP, texts, names, n); ActiveDeviceTP.s = IPS_OK; IDSetText(&ActiveDeviceTP, nullptr); //watchdogClient->setTelescope(ActiveDeviceT[0].text); //watchdogClient->setDome(ActiveDeviceT[1].text); return true; } } return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n); }
/* Handle a request to change text. */ bool ShelyakEshel::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (!strcmp(dev, getDeviceName())) // check if the message is for our device { if (!strcmp(PortTP.name, name)) //check if is a port change request { IUUpdateText(&PortTP, texts, names, n); // update port PortTP.s = IPS_OK; // set state to ok IDSetText(&PortTP, nullptr); // tell clients to update the port return true; } } return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n); }
bool Vantage::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(!strcmp(dev,getDeviceName())) { if (!strcmp(PortTP.name, name)) { IUUpdateText(&PortTP, texts, names, n); PortTP.s = IPS_OK; IDSetText(&PortTP, NULL); return true; } } return INDI::Weather::ISNewText(dev,name,texts,names,n); }
bool XAGYLWheel::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(strcmp(dev,getDeviceName())==0) { if (!strcmp(PortTP.name, name)) { IUUpdateText(&PortTP, texts, names, n); PortTP.s = IPS_OK; IDSetText(&PortTP, NULL); return true; } } return INDI::FilterWheel::ISNewText(dev, name, texts, names, n); }
bool WunderGround::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(!strcmp(dev,getDeviceName())) { if (!strcmp(wunderAPIKeyTP.name, name)) { IUUpdateText(&wunderAPIKeyTP, texts, names, n); wunderAPIKeyTP.s = IPS_OK; IDSetText(&wunderAPIKeyTP, NULL); return true; } } return INDI::Weather::ISNewText(dev,name,texts,names,n); }
bool TCP::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (!strcmp(dev, device->getDeviceName())) { // TCP Server settings if (!strcmp(name, AddressTP.name)) { IUUpdateText(&AddressTP, texts, names, n); AddressTP.s = IPS_OK; IDSetText(&AddressTP, nullptr); return true; } } return false; }
bool INDI::Focuser::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(strcmp(dev,getDeviceName())==0) { if (!strcmp(name, PortTP.name)) { IUUpdateText(&PortTP, texts, names, n); PortTP.s = IPS_OK; IDSetText(&PortTP, NULL); return true; } } controller->ISNewText(dev, name, texts, names, n); return DefaultDevice::ISNewText(dev, name, texts, names, n); }
bool INDI::Weather::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { // first check if it's for our device if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) { if (!strcmp(name, ActiveDeviceTP.name)) { ActiveDeviceTP.s = IPS_OK; IUUpdateText(&ActiveDeviceTP, texts, names, n); // Update client display IDSetText(&ActiveDeviceTP, nullptr); IDSnoopDevice(ActiveDeviceT[0].text, "GEOGRAPHIC_COORD"); return true; } } return DefaultDevice::ISNewText(dev, name, texts, names, n); }
bool FlipFlat::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(strcmp(dev,getDeviceName())==0) { if (processLightBoxText(dev, name, texts, names, n)) return true; if (!strcmp(PortTP.name, name)) { IUUpdateText(&PortTP, texts, names, n); PortTP.s = IPS_OK; IDSetText(&PortTP, NULL); return true; } } return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n); }
bool Controller::ISNewText (const char * dev, const char * name, char * texts[], char * names[], int n) { if(strcmp(dev,device->getDeviceName())==0) { if (!strcmp(name, "JOYSTICKSETTINGS") && n <= JoystickSettingTP.ntp) { for (int i=0; i < JoystickSettingTP.ntp; i++) { IText * tp = IUFindText(&JoystickSettingTP, names[i]); if (tp) { ControllerType cType = getControllerType(texts[i]); ControllerType myType = *((ControllerType *) JoystickSettingT[i].aux0); if (cType != myType) { JoystickSettingTP.s = IPS_ALERT; IDSetText(&JoystickSettingTP, NULL); DEBUGFDEVICE(dev, INDI::Logger::DBG_ERROR, "Cannot change controller type to %s.", texts[i]); return false; } } } IUUpdateText(&JoystickSettingTP, texts, names, n); for (int i=0; i < n; i++) { if (strstr(JoystickSettingT[i].text, "JOYSTICK_")) IDSnoopDevice("Joystick", JoystickSettingT[i].text); } JoystickSettingTP.s = IPS_OK; IDSetText(&JoystickSettingTP, NULL); return true; } } return false; }
bool INDI::LightBoxInterface::processLightBoxText(const char *dev, const char *name, char *texts[], char *names[], int n) { if(strcmp(dev,device->getDeviceName()) == 0) { if(!strcmp(name,ActiveDeviceTP.name)) { ActiveDeviceTP.s=IPS_OK; IUUpdateText(&ActiveDeviceTP,texts,names,n); // Update client display IDSetText(&ActiveDeviceTP,NULL); IDSnoopDevice(ActiveDeviceT[0].text,"FILTER_SLOT"); IDSnoopDevice(ActiveDeviceT[0].text,"FILTER_NAME"); return true; } } return false; }
bool JoyStick::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) { if (strcmp(name, PortTP.name) == 0) { PortTP.s = IPS_OK; IUUpdateText(&PortTP, texts, names, n); // Update client display IDSetText(&PortTP, nullptr); driver->setPort(PortT[0].text); return true; } } return DefaultDevice::ISNewText(dev, name, texts, names, n); }
bool NFocus::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { if(strcmp(dev,getDeviceName())==0) { // =================================== // Port Name // =================================== if (!strcmp(name, PortTP.name) ) { if (IUUpdateText(&PortTP, texts, names, n) < 0) return false; PortTP.s = IPS_OK; IDSetText (&PortTP, NULL); return true; } } return INDI::Focuser::ISNewText(dev, name, texts, names, n); }
bool QSICCD::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { int maxFilters = (int) FilterSlotN[0].max; //std::string filterDesignation[maxFilters]; if(strcmp(dev,getDeviceName())==0) { if (!strcmp(name, FilterNameTP->name)) { if (IUUpdateText(FilterNameTP, texts, names, n) < 0) { FilterNameTP->s = IPS_ALERT; IDSetText(FilterNameTP, "Error updating names. XML corrupted."); return false; } for (int i=0; i < maxFilters; i++) filterDesignation[i] = FilterNameT[i].text; if (SetFilterNames() == true) { FilterNameTP->s = IPS_OK; IDSetText(FilterNameTP, NULL); return true; } else { FilterNameTP->s = IPS_ALERT; IDSetText(FilterNameTP, "Error updating filter names."); return false; } } } return INDI::CCD::ISNewText(dev, name, texts, names, n); }
bool WeatherMeta::ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) { if (dev != nullptr && strcmp(dev, getDeviceName()) == 0) { if (strcmp(name, ActiveDeviceTP.name) == 0) { ActiveDeviceTP.s = IPS_OK; IUUpdateText(&ActiveDeviceTP, texts, names, n); // Update client display IDSetText(&ActiveDeviceTP, nullptr); if (ActiveDeviceT[0].text != nullptr) { IDSnoopDevice(ActiveDeviceT[0].text, "WEATHER_STATUS"); IDSnoopDevice(ActiveDeviceT[0].text, "WEATHER_UPDATE"); } if (ActiveDeviceT[1].text != nullptr) { IDSnoopDevice(ActiveDeviceT[1].text, "WEATHER_STATUS"); IDSnoopDevice(ActiveDeviceT[1].text, "WEATHER_UPDATE"); } if (ActiveDeviceT[2].text != nullptr) { IDSnoopDevice(ActiveDeviceT[2].text, "WEATHER_STATUS"); IDSnoopDevice(ActiveDeviceT[2].text, "WEATHER_UPDATE"); } if (ActiveDeviceT[3].text != nullptr) { IDSnoopDevice(ActiveDeviceT[3].text, "WEATHER_STATUS"); IDSnoopDevice(ActiveDeviceT[3].text, "WEATHER_UPDATE"); } return true; } } return INDI::DefaultDevice::ISNewText(dev, name, texts, names, n); }
/***************************************************************************** ** Process Text properties *****************************************************************************/ bool AAGCloudWatcher::ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n) { // Ignore if not ours if (strcmp (dev, getDefaultName())) { return false; } ITextVectorProperty *tvp = getText(name); if (!tvp) { return false; } // Are we updating the serial port if (!strcmp(tvp->name, "serial")) { IUUpdateText(tvp, texts, names, n); tvp->s = IPS_OK; IDSetText(tvp, NULL); return true; } return false; }
bool AAGCloudWatcher::resetConstants() { INumberVectorProperty *nvp = getNumber("constants"); ITextVectorProperty *tvp = getText("FW"); CloudWatcherConstants constants; int r = cwc->getConstants(&constants); if (!r) { return false; } int N_CONSTANTS = 11; double values[N_CONSTANTS]; char *names[N_CONSTANTS]; names[0] = const_cast<char *>("internalSerialNumber"); values[0] = 0; names[1] = const_cast<char *>("zenerVoltage"); values[1] = 0; names[2] = const_cast<char *>("LDRMaxResistance"); values[2] = 0; names[3] = const_cast<char *>("LDRPullUpResistance"); values[3] = 0; names[4] = const_cast<char *>("rainBetaFactor"); values[4] = 0; names[5] = const_cast<char *>("rainResistanceAt25"); values[5] = 0; names[6] = const_cast<char *>("rainPullUpResistance"); values[6] = 0; names[7] = const_cast<char *>("ambientBetaFactor"); values[7] = 0; names[8] = const_cast<char *>("ambientResistanceAt25"); values[8] = 0; names[9] = const_cast<char *>("ambientPullUpResistance"); values[9] = 0; names[10] = const_cast<char *>("anemometerStatus"); values[10] = 0; IUUpdateNumber(nvp, values, names, N_CONSTANTS); nvp->s = IPS_IDLE; IDSetNumber(nvp, NULL); char *valuesT[1]; char *namesT[1]; namesT[0] = const_cast<char *>("firmwareVersion"); valuesT[0] = const_cast<char *>("-"); IUUpdateText(tvp, valuesT, namesT, 1); tvp->s = IPS_IDLE; IDSetText(tvp, NULL); }
void MathPluginManagement::ProcessTextProperties(Telescope* pTelescope, const char *name, char *texts[], char *names[], int n) { DEBUGFDEVICE(pTelescope->getDeviceName(), INDI::Logger::DBG_DEBUG, "ProcessTextProperties - name(%s)", name); if (strcmp(name, AlignmentSubsystemCurrentMathPluginV.name) == 0) { AlignmentSubsystemCurrentMathPluginV.s=IPS_OK; IUUpdateText(&AlignmentSubsystemCurrentMathPluginV, texts, names, n); if (0 != strcmp(AlignmentSubsystemMathPlugins.get()[0].label, AlignmentSubsystemCurrentMathPlugin.text)) { // Unload old plugin if required if (NULL != LoadedMathPluginHandle) { typedef void Destroy_t(MathPlugin *); Destroy_t* Destroy = (Destroy_t*)dlsym(LoadedMathPluginHandle, "Destroy"); if (NULL != Destroy) { Destroy(pLoadedMathPlugin); pLoadedMathPlugin = NULL; if (0 == dlclose(LoadedMathPluginHandle)) { LoadedMathPluginHandle = NULL; } else { IDLog("MathPluginManagement - dlclose failed on loaded plugin - %s\n", dlerror()); AlignmentSubsystemMathPluginsV.s = IPS_ALERT; } } else { IDLog("MathPluginManagement - cannot get Destroy function - %s\n", dlerror()); AlignmentSubsystemMathPluginsV.s = IPS_ALERT; } } // It is not the built in so try to load it if (NULL != (LoadedMathPluginHandle = dlopen(AlignmentSubsystemCurrentMathPlugin.text, RTLD_NOW))) { typedef MathPlugin* Create_t(); Create_t* Create = (Create_t*)dlsym(LoadedMathPluginHandle, "Create"); if (NULL != Create) { pLoadedMathPlugin = Create(); // TODO - Update the client to reflect the new plugin int i; for (i = 0; i < MathPluginFiles.size(); i++) { if (0 == strcmp(AlignmentSubsystemCurrentMathPlugin.text, MathPluginFiles[i].c_str())) break; } if (i < MathPluginFiles.size()) { IUResetSwitch(&AlignmentSubsystemMathPluginsV); (AlignmentSubsystemMathPlugins.get() + i + 1)->s = ISS_ON; // Update client IDSetSwitch(&AlignmentSubsystemMathPluginsV, NULL); } else { IDLog("MathPluginManagement - cannot find %s in list of plugins\n", MathPluginFiles[i].c_str()); } } else { IDLog("MathPluginManagement - cannot get Create function - %s\n", dlerror()); } } else { IDLog("MathPluginManagement - cannot load plugin %s error %s\n", AlignmentSubsystemCurrentMathPlugin.text, dlerror()); } } else { // It is the inbuilt plugin // Unload old plugin if required if (NULL != LoadedMathPluginHandle) { typedef void Destroy_t(MathPlugin *); Destroy_t* Destroy = (Destroy_t*)dlsym(LoadedMathPluginHandle, "Destroy"); if (NULL != Destroy) { Destroy(pLoadedMathPlugin); pLoadedMathPlugin = NULL; if (0 == dlclose(LoadedMathPluginHandle)) { LoadedMathPluginHandle = NULL; } else { IDLog("MathPluginManagement - dlclose failed on loaded plugin - %s\n", dlerror()); AlignmentSubsystemMathPluginsV.s = IPS_ALERT; } } else { IDLog("MathPluginManagement - cannot get Destroy function - %s\n", dlerror()); AlignmentSubsystemMathPluginsV.s = IPS_ALERT; } } pLoadedMathPlugin = &BuiltInPlugin; IUResetSwitch(&AlignmentSubsystemMathPluginsV); AlignmentSubsystemMathPlugins.get()->s = ISS_ON; // Update client IDSetSwitch(&AlignmentSubsystemMathPluginsV, NULL); } } }