// ********** Functions ********** void CurveInput::main() { boolean choice = chooseCurve(); loadCurve(choice); smoothCurve(); sendTimesAndTemps(); }
void FunctionViewerPanel::onIoCurve(int type, TDoubleParam *curve, const std::string &name) { switch ((FunctionViewer::IoType)type) { case FunctionViewer::eSaveCurve: saveCurve(curve); break; case FunctionViewer::eLoadCurve: loadCurve(curve); break; case FunctionViewer::eExportCurve: exportCurve(curve, name); break; default: assert(false); break; } }
CurvePtr LazyGraph::getCurve(CurveId id) { if (id.id == NULL_ID) { return NULL; } map<CurveId, Curve *>::iterator i = curves.find(id); if (i != curves.end()) { // if the requested resource has already been loaded CurvePtr r = i->second; curveCache->remove(r);// we remove it from the unusedResources Cache //r->owner = this; // and we return the resource return r; } if (Logger::DEBUG_LOGGER != NULL) { ostringstream os; os << "Loading curve '" << id.id << "'"; Logger::DEBUG_LOGGER->log("GRAPH", os.str()); } // otherwise the resource is not already loaded; we first load its descriptor CurvePtr r = NULL; long int offset; map<CurveId, long int>::iterator j = curveOffsets.find(id); if (j != curveOffsets.end()) { offset = j->second; r = loadCurve(offset, id); curves.insert(make_pair(id, r.get())); return r; } if (Logger::ERROR_LOGGER != NULL) { ostringstream os; os << "Loading : Missing or invalid curve '" << id.id << "'"; Logger::ERROR_LOGGER->log("GRAPH", os.str()); } throw exception(); // return NULL; }