2 #include <QScriptEngine>
16 set_Type(
"Data Group");
42 }
else if (nm ==
".") {
43 return sharedFromThis();
44 }
else if (info.fileName() == nm) {
46 if (p && (p->get_Name() == nm)) {
51 QDir dir = info.dir();
59 return grp->item(info.fileName());
75 return qSharedPointerDynamicCast<QcepDataGroup>(obj);
82 return qSharedPointerDynamicCast<QcepDataGroup>(obj);
89 return qSharedPointerDynamicCast<QcepDataArray>(obj);
96 return qSharedPointerDynamicCast<QcepDataArray>(obj);
103 return qSharedPointerDynamicCast<QcepDataColumn>(obj);
110 return qSharedPointerDynamicCast<QcepDataColumn>(obj);
117 return qSharedPointerDynamicCast<QcepDataColumnScan>(obj);
124 return qSharedPointerDynamicCast<QcepDataColumnScan>(obj);
131 return qSharedPointerDynamicCast<QcepDoubleImageData>(obj);
138 return qSharedPointerDynamicCast<QcepDoubleImageData>(obj);
145 return qSharedPointerDynamicCast<QcepIntegratedData>(obj);
152 return qSharedPointerDynamicCast<QcepIntegratedData>(obj);
157 QFileInfo info(path);
159 if (info.isAbsolute()) {
160 return info.dir().absolutePath();
162 return info.dir().path();
168 QFileInfo info(path);
170 return info.fileName();
175 QFileInfo info(path);
177 if (info.isAbsolute()) {
179 return rootItem()->containingGroup(path);
183 return qSharedPointerDynamicCast<QcepDataGroup>(obj);
188 return qSharedPointerDynamicCast<QcepDataGroup>(obj);
194 QFileInfo info(path);
196 if (info.isAbsolute()) {
228 QcepDataGroupPtr me = qSharedPointerDynamicCast<QcepDataGroup>(sharedFromThis());
233 printf(
"Can't cast to QcepDataGroupPtr");
290 printMessage(tr(
"Item %1 exists and is not a data group").arg(path));
338 group->append(array);
357 group->append(column);
395 group->append(image);
427 return engine->newQObject(data.data());
432 QObject *qobj = obj.toQObject();
QcepDataObjectPtr item(QString nm)
QSharedPointer< QcepDataArray > QcepDataArrayPtr
QcepDataColumnScanPtr columnScan(QString path)
QcepDataGroup(QcepSettingsSaverWPtr saver, QString name, QcepObject *parent)
void append(QcepDataObjectPtr obj)
static void fromGroupScriptValue(const QScriptValue &obj, QcepDataGroupPtr &data)
QSharedPointer< QcepDataGroup > QcepDataGroupPtr
QcepIntegratedDataPtr integratedData(QString path)
static QSharedPointer< QcepImageData< T > > newImage(QcepSettingsSaverWPtr saver, QString name, int width, int height, QcepObject *parent)
QSharedPointer< QcepDataColumnScan > QcepDataColumnScanPtr
QSharedPointer< QcepDataColumn > QcepDataColumnPtr
virtual QcepDataGroupPtr parentItem() const
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
QcepDataColumnScanPtr newColumnScan(QString path, int nrow, QStringList cols)
QcepDataColumnPtr column(QString path)
QcepIntegratedDataPtr newIntegratedData(QString path, int sz)
QString object(QString path)
QcepDataColumnPtr newColumn(QString path, int nrow)
QcepDataGroupPtr group(QString path)
virtual void setParentItem(QcepDataGroupWPtr parent)
QcepDataObjectPtr referencedObject(QString path)
QString directoryName(QString path)
void insert(int atRow, QcepDataObjectPtr obj)
QcepDataGroupPtr newGroup(QString path)
QcepDataArrayPtr newArray(QString path, QVector< int > dims)
virtual void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime()) const
static QcepDataColumnScanPtr newDataColumnScan(QcepSettingsSaverWPtr sav, QString name, QStringList cols, int npts, QcepObject *parent)
QcepDataGroupPtr rootItem()
static QcepIntegratedDataPtr newIntegratedData(QcepSettingsSaverWPtr saver, QString name, int sz, QcepObject *parent)
QcepDoubleImageDataPtr image(QString path)
QSharedPointer< QcepDataObject > QcepDataObjectPtr
static QScriptValue toGroupScriptValue(QScriptEngine *engine, const QcepDataGroupPtr &data)
QVector< QcepDataObjectPtr > m_Objects
QcepDoubleImageDataPtr newImage(QString path, int width=0, int height=0)
static QcepDataGroupPtr newDataGroup(QcepSettingsSaverWPtr saver, QString name, QcepObject *parent)
QcepDataGroupPtr createGroup(QString path)
QcepDataArrayPtr array(QString path)
virtual QString description() const
QcepDataGroupPtr containingGroup(QString path)
QWeakPointer< QcepSettingsSaver > QcepSettingsSaverWPtr
QcepSettingsSaverWPtr saver()
QSharedPointer< QcepDoubleImageData > QcepDoubleImageDataPtr