12 globalObject().setProperty(
"cctw", newQObject(
m_Application, QScriptEngine::QtOwnership));
13 globalObject().setProperty(
"print", newFunction(
printFunc));
14 globalObject().setProperty(
"wait", newFunction(
waitFunc));
17 globalObject().setProperty(
"showHelp", newFunction(
showHelpFunc));
18 globalObject().setProperty(
"showVersion", newFunction(
showVersionFunc));
19 globalObject().setProperty(
"setThreads", newFunction(
setThreadsFunc));
23 globalObject().setProperty(
"setMask", newFunction(
setMaskFunc));
24 globalObject().setProperty(
"setAngles", newFunction(
setAnglesFunc));
25 globalObject().setProperty(
"setOmega", newFunction(
setOmegaFunc));
26 globalObject().setProperty(
"setTwoTheta", newFunction(
setTwoThetaFunc));
27 globalObject().setProperty(
"setPhi", newFunction(
setPhiFunc));
28 globalObject().setProperty(
"setChi", newFunction(
setChiFunc));
29 globalObject().setProperty(
"setWeights", newFunction(
setWeightsFunc));
34 globalObject().setProperty(
"setSubset", newFunction(
setSubsetFunc));
35 globalObject().setProperty(
"doTransform", newFunction(
transformFunc));
39 globalObject().setProperty(
"compression", newFunction(
compressionFunc));
43 globalObject().setProperty(
"mergeInput", newFunction(
mergeInputFunc));
44 globalObject().setProperty(
"mergeOutput", newFunction(
mergeOutputFunc));
52 qRegisterMetaType< QVector<int> >(
"QVector<int>");
53 qRegisterMetaType< QVector<double> >(
"QVector<double>");
55 qScriptRegisterSequenceMetaType< QVector<int> >(
this);
56 qScriptRegisterSequenceMetaType< QVector<double> >(
this);
69 int nArgs = context->argumentCount();
72 for (
int i=0; i<nArgs; i++) {
77 msg += context -> argument(i).toString();
87 return QScriptValue(engine,
"");
95 int nArgs = context->argumentCount();
98 for (
int i=0; i<nArgs; i++) {
103 msg += context -> argument(i).toString();
113 return QScriptValue(engine,
"");
121 int nArgs = context->argumentCount();
124 for (
int i=0; i<nArgs; i++) {
129 msg += context -> argument(i).toString();
139 return QScriptValue(engine,
"");
147 int nArgs = context->argumentCount();
150 for (
int i=0; i<nArgs; i++) {
155 msg += context -> argument(i).toString();
165 return QScriptValue(engine,
"");
173 int nArgs = context->argumentCount();
176 for (
int i=0; i<nArgs; i++) {
181 msg += context -> argument(i).toString();
191 return QScriptValue(engine,
"");
199 int nArgs = context->argumentCount();
202 for (
int i=0; i<nArgs; i++) {
207 msg += context -> argument(i).toString();
217 return QScriptValue(engine,
"");
225 int nArgs = context->argumentCount();
228 for (
int i=0; i<nArgs; i++) {
233 msg += context -> argument(i).toString();
243 return QScriptValue(engine,
"");
251 int nArgs = context->argumentCount();
254 for (
int i=0; i<nArgs; i++) {
259 msg += context -> argument(i).toString();
269 return QScriptValue(engine,
"");
277 int nArgs = context->argumentCount();
280 for (
int i=0; i<nArgs; i++) {
285 msg += context -> argument(i).toString();
295 return QScriptValue(engine,
"");
303 int nArgs = context->argumentCount();
306 for (
int i=0; i<nArgs; i++) {
311 msg += context -> argument(i).toString();
321 return QScriptValue(engine,
"");
329 int nArgs = context->argumentCount();
332 for (
int i=0; i<nArgs; i++) {
337 msg += context -> argument(i).toString();
343 app->set_MaskFile(msg);
347 return QScriptValue(engine,
"");
355 int nArgs = context->argumentCount();
358 for (
int i=0; i<nArgs; i++) {
363 msg += context -> argument(i).toString();
369 app->set_AnglesFile(msg);
373 return QScriptValue(engine,
"");
381 int nArgs = context->argumentCount();
384 for (
int i=0; i<nArgs; i++) {
389 msg += context -> argument(i).toString();
399 return QScriptValue(engine,
"");
407 int nArgs = context->argumentCount();
410 for (
int i=0; i<nArgs; i++) {
415 msg += context -> argument(i).toString();
425 return QScriptValue(engine,
"");
433 int nArgs = context->argumentCount();
436 for (
int i=0; i<nArgs; i++) {
441 msg += context -> argument(i).toString();
451 return QScriptValue(engine,
"");
459 int nArgs = context->argumentCount();
462 for (
int i=0; i<nArgs; i++) {
467 msg += context -> argument(i).toString();
477 return QScriptValue(engine,
"");
486 int nArgs = context->argumentCount();
489 for (
int i=0; i<nArgs; i++) {
494 msg += context -> argument(i).toString();
500 app->set_WeightsFile(msg);
504 return QScriptValue(engine,
"");
512 int nArgs = context->argumentCount();
515 for (
int i=0; i<nArgs; i++) {
520 msg += context -> argument(i).toString();
530 return QScriptValue(engine,
"");
538 int nArgs = context->argumentCount();
541 for (
int i=0; i<nArgs; i++) {
546 msg += context -> argument(i).toString();
556 return QScriptValue(engine,
"");
564 int nArgs = context->argumentCount();
567 for (
int i=0; i<nArgs; i++) {
572 msg += context -> argument(i).toString();
582 return QScriptValue(engine,
"");
590 int nArgs = context->argumentCount();
593 for (
int i=0; i<nArgs; i++) {
598 msg += context -> argument(i).toString();
608 return QScriptValue(engine,
"");
616 int nArgs = context->argumentCount();
619 for (
int i=0; i<nArgs; i++) {
624 msg += context -> argument(i).toString();
634 return QScriptValue(engine,
"");
642 int nArgs = context->argumentCount();
645 for (
int i=0; i<nArgs; i++) {
650 msg += context -> argument(i).toString();
660 return QScriptValue(engine,
"");
668 int nArgs = context->argumentCount();
671 for (
int i=0; i<nArgs; i++) {
676 msg += context -> argument(i).toString();
686 return QScriptValue(engine,
"");
694 int nArgs = context->argumentCount();
697 for (
int i=0; i<nArgs; i++) {
702 msg += context -> argument(i).toString();
712 return QScriptValue(engine,
"");
720 int nArgs = context->argumentCount();
723 for (
int i=0; i<nArgs; i++) {
728 msg += context -> argument(i).toString();
738 return QScriptValue(engine,
"");
746 int nArgs = context->argumentCount();
749 for (
int i=0; i<nArgs; i++) {
754 msg += context -> argument(i).toString();
764 return QScriptValue(engine,
"");
772 int nArgs = context->argumentCount();
775 for (
int i=0; i<nArgs; i++) {
776 arg = context -> argument(i).toInteger();
786 return QScriptValue(engine,
"");
794 int nArgs = context->argumentCount();
797 for (
int i=0; i<nArgs; i++) {
798 arg = context -> argument(i).toInteger();
808 return QScriptValue(engine,
"");
816 int nArgs = context->argumentCount();
819 for (
int i=0; i<nArgs; i++) {
824 msg += context -> argument(i).toString();
834 return QScriptValue(engine,
"");
842 int nArgs = context->argumentCount();
845 for (
int i=0; i<nArgs; i++) {
850 msg += context -> argument(i).toString();
860 return QScriptValue(engine,
"");
868 int nArgs = context->argumentCount();
871 for (
int i=0; i<nArgs; i++) {
876 msg += context -> argument(i).toString();
886 return QScriptValue(engine,
"");
901 if (hasUncaughtException())
903 QScriptValue exception = uncaughtException();
904 int exceptionLine = uncaughtExceptionLineNumber();
907 m_Application -> printMessage(tr(
"Script resulted in exception!"));
908 m_Application -> printMessage(tr(
"Line %1: %2").arg(exceptionLine).arg(exception.toString()));
void outputProject(int axes)
static void fromScriptValue(const QScriptValue &obj, CctwDoubleMatrix3x3 &mat)
static QScriptValue mergeOutputFunc(QScriptContext *context, QScriptEngine *engine)
void inputProject(int axes)
static QScriptValue inputProjectFunc(QScriptContext *context, QScriptEngine *engine)
void setOmega(QString data)
static QScriptValue transformFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue showVersionFunc(QScriptContext *context, QScriptEngine *engine)
void setOutputChunks(QString data)
static QScriptValue setOutputDataFunc(QScriptContext *context, QScriptEngine *engine)
void setProjectOutput(QString dir)
static QScriptValue mergeInputFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue waitFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setChiFunc(QScriptContext *context, QScriptEngine *engine)
void setCompression(QString data)
static QScriptValue dependenciesFunc(QScriptContext *context, QScriptEngine *engine)
void executeScriptFile(QString path)
void setOutputDims(QString data)
static QScriptValue setPhiFunc(QScriptContext *context, QScriptEngine *engine)
CctwScriptEngine(CctwApplication *app, QObject *parent=0)
static QScriptValue outputProjectFunc(QScriptContext *context, QScriptEngine *engine)
void setPhi(QString data)
void transform(QString desc)
void setOutputData(QString data)
static QScriptValue toScriptValue(QScriptEngine *engine, const CctwUnitCell &cell)
static QScriptValue setOutputDimsFunc(QScriptContext *context, QScriptEngine *engine)
void setNormalization(QString data)
static QScriptValue toScriptValue(QScriptEngine *engine, const CctwDoubleVector3D &vec)
static void fromScriptValue(const QScriptValue &obj, CctwDoubleVector3D &vec)
void setSubset(QString desc)
CctwApplication * m_Application
static QScriptValue executeScriptFileFunc(QScriptContext *context, QScriptEngine *engine)
void setThreads(QString desc)
static QScriptValue setWeightsFunc(QScriptContext *context, QScriptEngine *engine)
static void fromScriptValue(const QScriptValue &obj, CctwIntVector3D &vec)
static QScriptValue setInputChunksFunc(QScriptContext *context, QScriptEngine *engine)
void mergeInput(QString path)
static QScriptValue setInputDatasetFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setOutputChunksFunc(QScriptContext *context, QScriptEngine *engine)
void setTwoTheta(QString data)
void setOutputDataset(QString data)
static QScriptValue setThreadsFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setProjectOutputFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue toScriptValue(QScriptEngine *engine, const CctwIntVector3D &vec)
static QScriptValue setMaskFunc(QScriptContext *context, QScriptEngine *engine)
void setChi(QString data)
static QScriptValue setSubsetFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setOmegaFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue toScriptValue(QScriptEngine *engine, const CctwDoubleMatrix3x3 &mat)
static QScriptValue setOutputDatasetFunc(QScriptContext *context, QScriptEngine *engine)
CctwApplication * application() const
static QScriptValue setAnglesFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue loadPreferencesFunc(QScriptContext *context, QScriptEngine *engine)
void setInputDataset(QString data)
void showHelp(QString about)
void checkForExceptions()
static QScriptValue setTwoThetaFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue noDependenciesFunc(QScriptContext *context, QScriptEngine *engine)
void mergeOutput(QString path)
void partialDependencies(QString desc)
static QScriptValue printFunc(QScriptContext *context, QScriptEngine *engine)
static void fromScriptValue(const QScriptValue &obj, CctwUnitCell &cell)
static QScriptValue setInputDataFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue compressionFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue normalizationFunc(QScriptContext *context, QScriptEngine *engine)
void setInputData(QString data)
void setInputChunks(QString data)
void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
static QScriptValue showHelpFunc(QScriptContext *context, QScriptEngine *engine)