cctw  0.2.1
Public Slots | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
CctwScriptEngine Class Reference

#include <cctwscriptengine.h>

Inheritance diagram for CctwScriptEngine:
Inheritance graph
Collaboration diagram for CctwScriptEngine:
Collaboration graph

Public Slots

void checkForExceptions ()
 

Public Member Functions

 CctwScriptEngine (CctwApplication *app, QObject *parent=0)
 
CctwApplicationapplication () const
 

Static Private Member Functions

static QScriptValue printFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue waitFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue loadPreferencesFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue executeScriptFileFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue showHelpFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue showVersionFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setThreadsFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setInputDataFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setInputChunksFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setInputDatasetFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setMaskFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setAnglesFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setOmegaFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setTwoThetaFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setPhiFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setChiFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setWeightsFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setOutputDataFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setOutputDimsFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setOutputChunksFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setOutputDatasetFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue transformFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setSubsetFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue dependenciesFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue noDependenciesFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue normalizationFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue compressionFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue inputProjectFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue outputProjectFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue setProjectOutputFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue mergeInputFunc (QScriptContext *context, QScriptEngine *engine)
 
static QScriptValue mergeOutputFunc (QScriptContext *context, QScriptEngine *engine)
 

Private Attributes

CctwApplicationm_Application
 

Detailed Description

Definition at line 7 of file cctwscriptengine.h.

Constructor & Destructor Documentation

CctwScriptEngine::CctwScriptEngine ( CctwApplication app,
QObject *  parent = 0 
)
explicit

Definition at line 8 of file cctwscriptengine.cpp.

References compressionFunc(), dependenciesFunc(), executeScriptFileFunc(), CctwDoubleVector3DProperty::fromScriptValue(), CctwIntVector3DProperty::fromScriptValue(), CctwDoubleMatrix3x3Property::fromScriptValue(), CctwUnitCellProperty::fromScriptValue(), inputProjectFunc(), loadPreferencesFunc(), m_Application, mergeInputFunc(), mergeOutputFunc(), noDependenciesFunc(), normalizationFunc(), outputProjectFunc(), printFunc(), setAnglesFunc(), setChiFunc(), setInputChunksFunc(), setInputDataFunc(), setInputDatasetFunc(), setMaskFunc(), setOmegaFunc(), setOutputChunksFunc(), setOutputDataFunc(), setOutputDatasetFunc(), setOutputDimsFunc(), setPhiFunc(), setProjectOutputFunc(), setSubsetFunc(), setThreadsFunc(), setTwoThetaFunc(), setWeightsFunc(), showHelpFunc(), showVersionFunc(), CctwDoubleVector3DProperty::toScriptValue(), CctwIntVector3DProperty::toScriptValue(), CctwDoubleMatrix3x3Property::toScriptValue(), CctwUnitCellProperty::toScriptValue(), transformFunc(), and waitFunc().

8  :
9  QScriptEngine(parent),
10  m_Application(app)
11 {
12  globalObject().setProperty("cctw", newQObject(m_Application, QScriptEngine::QtOwnership));
13  globalObject().setProperty("print", newFunction(printFunc));
14  globalObject().setProperty("wait", newFunction(waitFunc));
15  globalObject().setProperty("loadPreferences", newFunction(loadPreferencesFunc));
16  globalObject().setProperty("executeScriptFile", newFunction(executeScriptFileFunc));
17  globalObject().setProperty("showHelp", newFunction(showHelpFunc));
18  globalObject().setProperty("showVersion", newFunction(showVersionFunc));
19  globalObject().setProperty("setThreads", newFunction(setThreadsFunc));
20  globalObject().setProperty("setInputData", newFunction(setInputDataFunc));
21  globalObject().setProperty("setInputChunks", newFunction(setInputChunksFunc));
22  globalObject().setProperty("setInputDataset", newFunction(setInputDatasetFunc));
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));
30  globalObject().setProperty("setOutputData", newFunction(setOutputDataFunc));
31  globalObject().setProperty("setOutputDims", newFunction(setOutputDimsFunc));
32  globalObject().setProperty("setOutputChunks", newFunction(setOutputChunksFunc));
33  globalObject().setProperty("setOutputDataset", newFunction(setOutputDatasetFunc));
34  globalObject().setProperty("setSubset", newFunction(setSubsetFunc));
35  globalObject().setProperty("doTransform", newFunction(transformFunc));
36  globalObject().setProperty("dependencies", newFunction(dependenciesFunc));
37  globalObject().setProperty("noDependencies", newFunction(noDependenciesFunc));
38  globalObject().setProperty("normalization", newFunction(normalizationFunc));
39  globalObject().setProperty("compression", newFunction(compressionFunc));
40  globalObject().setProperty("inputProject", newFunction(inputProjectFunc));
41  globalObject().setProperty("outputProject", newFunction(outputProjectFunc));
42  globalObject().setProperty("setProjectOutput", newFunction(setProjectOutputFunc));
43  globalObject().setProperty("mergeInput", newFunction(mergeInputFunc));
44  globalObject().setProperty("mergeOutput", newFunction(mergeOutputFunc));
45 
50 // qScriptRegisterMetaType(this, CctwScriptEngine::QObjectToScriptValue, CctwScriptEngine::QObjectFromScriptValue);
51 
52  qRegisterMetaType< QVector<int> >("QVector<int>");
53  qRegisterMetaType< QVector<double> >("QVector<double>");
54 
55  qScriptRegisterSequenceMetaType< QVector<int> >(this);
56  qScriptRegisterSequenceMetaType< QVector<double> >(this);
57 }
static void fromScriptValue(const QScriptValue &obj, CctwDoubleMatrix3x3 &mat)
static QScriptValue mergeOutputFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue inputProjectFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue transformFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue showVersionFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setOutputDataFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue mergeInputFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue waitFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setChiFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue dependenciesFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setPhiFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue outputProjectFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue toScriptValue(QScriptEngine *engine, const CctwUnitCell &cell)
static QScriptValue setOutputDimsFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue toScriptValue(QScriptEngine *engine, const CctwDoubleVector3D &vec)
static void fromScriptValue(const QScriptValue &obj, CctwDoubleVector3D &vec)
CctwApplication * m_Application
static QScriptValue executeScriptFileFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setWeightsFunc(QScriptContext *context, QScriptEngine *engine)
static void fromScriptValue(const QScriptValue &obj, CctwIntVector3D &vec)
static QScriptValue setInputChunksFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setInputDatasetFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setOutputChunksFunc(QScriptContext *context, QScriptEngine *engine)
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)
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)
static QScriptValue setAnglesFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue loadPreferencesFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue setTwoThetaFunc(QScriptContext *context, QScriptEngine *engine)
static QScriptValue noDependenciesFunc(QScriptContext *context, QScriptEngine *engine)
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)
static QScriptValue showHelpFunc(QScriptContext *context, QScriptEngine *engine)

Member Function Documentation

CctwApplication * CctwScriptEngine::application ( ) const
void CctwScriptEngine::checkForExceptions ( )
slot

Definition at line 899 of file cctwscriptengine.cpp.

References m_Application.

Referenced by CctwApplication::evaluate(), CctwApplication::evaluateCommand(), CctwApplication::evaluateStartupCommand(), and CctwApplication::executeScriptFile().

900 {
901  if (hasUncaughtException())
902  {
903  QScriptValue exception = uncaughtException();
904  int exceptionLine = uncaughtExceptionLineNumber();
905 
906  if (m_Application) {
907  m_Application -> printMessage(tr("Script resulted in exception!"));
908  m_Application -> printMessage(tr("Line %1: %2").arg(exceptionLine).arg(exception.toString()));
909  }
910  }
911 }
CctwApplication * m_Application
QScriptValue CctwScriptEngine::compressionFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 741 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setCompression().

Referenced by CctwScriptEngine().

742 {
743  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
744 
745  if (eng) {
746  int nArgs = context->argumentCount();
747  QString msg;
748 
749  for (int i=0; i<nArgs; i++) {
750  if (i != 0) {
751  msg += " ";
752  }
753 
754  msg += context -> argument(i).toString();
755  }
756 
757  CctwApplication *app = eng->application();
758 
759  if (app) {
760  app->setCompression(msg);
761  }
762  }
763 
764  return QScriptValue(engine, "");
765 }
void setCompression(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::dependenciesFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 663 of file cctwscriptengine.cpp.

References application(), and CctwApplication::partialDependencies().

Referenced by CctwScriptEngine().

664 {
665  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
666 
667  if (eng) {
668  int nArgs = context->argumentCount();
669  QString msg;
670 
671  for (int i=0; i<nArgs; i++) {
672  if (i != 0) {
673  msg += " ";
674  }
675 
676  msg += context -> argument(i).toString();
677  }
678 
679  CctwApplication *app = eng->application();
680 
681  if (app) {
682  app->partialDependencies(msg);
683  }
684  }
685 
686  return QScriptValue(engine, "");
687 }
CctwApplication * application() const
void partialDependencies(QString desc)
QScriptValue CctwScriptEngine::executeScriptFileFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 142 of file cctwscriptengine.cpp.

References application(), and CctwApplication::executeScriptFile().

Referenced by CctwScriptEngine().

143 {
144  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
145 
146  if (eng) {
147  int nArgs = context->argumentCount();
148  QString msg;
149 
150  for (int i=0; i<nArgs; i++) {
151  if (i != 0) {
152  msg += " ";
153  }
154 
155  msg += context -> argument(i).toString();
156  }
157 
158  CctwApplication *app = eng->application();
159 
160  if (app) {
161  app->executeScriptFile(msg);
162  }
163  }
164 
165  return QScriptValue(engine, "");
166 }
void executeScriptFile(QString path)
CctwApplication * application() const
QScriptValue CctwScriptEngine::inputProjectFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 767 of file cctwscriptengine.cpp.

References application(), and CctwApplication::inputProject().

Referenced by CctwScriptEngine().

768 {
769  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
770 
771  if (eng) {
772  int nArgs = context->argumentCount();
773  int arg = 7;
774 
775  for (int i=0; i<nArgs; i++) {
776  arg = context -> argument(i).toInteger();
777  }
778 
779  CctwApplication *app = eng->application();
780 
781  if (app) {
782  app->inputProject(arg);
783  }
784  }
785 
786  return QScriptValue(engine, "");
787 }
void inputProject(int axes)
CctwApplication * application() const
QScriptValue CctwScriptEngine::loadPreferencesFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 116 of file cctwscriptengine.cpp.

References application(), and CctwApplication::readSettings().

Referenced by CctwScriptEngine().

117 {
118  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
119 
120  if (eng) {
121  int nArgs = context->argumentCount();
122  QString msg;
123 
124  for (int i=0; i<nArgs; i++) {
125  if (i != 0) {
126  msg += " ";
127  }
128 
129  msg += context -> argument(i).toString();
130  }
131 
132  CctwApplication *app = eng->application();
133 
134  if (app) {
135  app->readSettings(msg);
136  }
137  }
138 
139  return QScriptValue(engine, "");
140 }
CctwApplication * application() const
QScriptValue CctwScriptEngine::mergeInputFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 837 of file cctwscriptengine.cpp.

References application(), and CctwApplication::mergeInput().

Referenced by CctwScriptEngine().

838 {
839  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
840 
841  if (eng) {
842  int nArgs = context->argumentCount();
843  QString msg;
844 
845  for (int i=0; i<nArgs; i++) {
846  if (i != 0) {
847  msg += " ";
848  }
849 
850  msg += context -> argument(i).toString();
851  }
852 
853  CctwApplication *app = eng->application();
854 
855  if (app) {
856  app->mergeInput(msg);
857  }
858  }
859 
860  return QScriptValue(engine, "");
861 }
void mergeInput(QString path)
CctwApplication * application() const
QScriptValue CctwScriptEngine::mergeOutputFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 863 of file cctwscriptengine.cpp.

References application(), and CctwApplication::mergeOutput().

Referenced by CctwScriptEngine().

864 {
865  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
866 
867  if (eng) {
868  int nArgs = context->argumentCount();
869  QString msg;
870 
871  for (int i=0; i<nArgs; i++) {
872  if (i != 0) {
873  msg += " ";
874  }
875 
876  msg += context -> argument(i).toString();
877  }
878 
879  CctwApplication *app = eng->application();
880 
881  if (app) {
882  app->mergeOutput(msg);
883  }
884  }
885 
886  return QScriptValue(engine, "");
887 }
CctwApplication * application() const
void mergeOutput(QString path)
QScriptValue CctwScriptEngine::noDependenciesFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 689 of file cctwscriptengine.cpp.

References application(), and CctwApplication::noDependencies().

Referenced by CctwScriptEngine().

690 {
691  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
692 
693  if (eng) {
694  int nArgs = context->argumentCount();
695  QString msg;
696 
697  for (int i=0; i<nArgs; i++) {
698  if (i != 0) {
699  msg += " ";
700  }
701 
702  msg += context -> argument(i).toString();
703  }
704 
705  CctwApplication *app = eng->application();
706 
707  if (app) {
708  app->noDependencies();
709  }
710  }
711 
712  return QScriptValue(engine, "");
713 }
CctwApplication * application() const
QScriptValue CctwScriptEngine::normalizationFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 715 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setNormalization().

Referenced by CctwScriptEngine().

716 {
717  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
718 
719  if (eng) {
720  int nArgs = context->argumentCount();
721  QString msg;
722 
723  for (int i=0; i<nArgs; i++) {
724  if (i != 0) {
725  msg += " ";
726  }
727 
728  msg += context -> argument(i).toString();
729  }
730 
731  CctwApplication *app = eng->application();
732 
733  if (app) {
734  app->setNormalization(msg);
735  }
736  }
737 
738  return QScriptValue(engine, "");
739 }
void setNormalization(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::outputProjectFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 789 of file cctwscriptengine.cpp.

References application(), and CctwApplication::outputProject().

Referenced by CctwScriptEngine().

790 {
791  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
792 
793  if (eng) {
794  int nArgs = context->argumentCount();
795  int arg = 7;
796 
797  for (int i=0; i<nArgs; i++) {
798  arg = context -> argument(i).toInteger();
799  }
800 
801  CctwApplication *app = eng->application();
802 
803  if (app) {
804  app->outputProject(arg);
805  }
806  }
807 
808  return QScriptValue(engine, "");
809 }
void outputProject(int axes)
CctwApplication * application() const
QScriptValue CctwScriptEngine::printFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 64 of file cctwscriptengine.cpp.

References application(), and CctwApplication::printMessage().

Referenced by CctwScriptEngine().

65 {
66  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
67 
68  if (eng) {
69  int nArgs = context->argumentCount();
70  QString msg;
71 
72  for (int i=0; i<nArgs; i++) {
73  if (i != 0) {
74  msg += " ";
75  }
76 
77  msg += context -> argument(i).toString();
78  }
79 
80  CctwApplication *app = eng->application();
81 
82  if (app) {
83  app->printMessage(msg);
84  }
85  }
86 
87  return QScriptValue(engine, "");
88 }
CctwApplication * application() const
void printMessage(QString msg, QDateTime dt=QDateTime::currentDateTime())
QScriptValue CctwScriptEngine::setAnglesFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 350 of file cctwscriptengine.cpp.

References application().

Referenced by CctwScriptEngine().

351 {
352  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
353 
354  if (eng) {
355  int nArgs = context->argumentCount();
356  QString msg;
357 
358  for (int i=0; i<nArgs; i++) {
359  if (i != 0) {
360  msg += " ";
361  }
362 
363  msg += context -> argument(i).toString();
364  }
365 
366  CctwApplication *app = eng->application();
367 
368  if (app) {
369  app->set_AnglesFile(msg);
370  }
371  }
372 
373  return QScriptValue(engine, "");
374 }
CctwApplication * application() const
QScriptValue CctwScriptEngine::setChiFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 428 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setChi().

Referenced by CctwScriptEngine().

429 {
430  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
431 
432  if (eng) {
433  int nArgs = context->argumentCount();
434  QString msg;
435 
436  for (int i=0; i<nArgs; i++) {
437  if (i != 0) {
438  msg += " ";
439  }
440 
441  msg += context -> argument(i).toString();
442  }
443 
444  CctwApplication *app = eng->application();
445 
446  if (app) {
447  app->setChi(msg);
448  }
449  }
450 
451  return QScriptValue(engine, "");
452 }
void setChi(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setInputChunksFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 272 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setInputChunks().

Referenced by CctwScriptEngine().

273 {
274  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
275 
276  if (eng) {
277  int nArgs = context->argumentCount();
278  QString msg;
279 
280  for (int i=0; i<nArgs; i++) {
281  if (i != 0) {
282  msg += " ";
283  }
284 
285  msg += context -> argument(i).toString();
286  }
287 
288  CctwApplication *app = eng->application();
289 
290  if (app) {
291  app->setInputChunks(msg);
292  }
293  }
294 
295  return QScriptValue(engine, "");
296 }
CctwApplication * application() const
void setInputChunks(QString data)
QScriptValue CctwScriptEngine::setInputDataFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 246 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setInputData().

Referenced by CctwScriptEngine().

247 {
248  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
249 
250  if (eng) {
251  int nArgs = context->argumentCount();
252  QString msg;
253 
254  for (int i=0; i<nArgs; i++) {
255  if (i != 0) {
256  msg += " ";
257  }
258 
259  msg += context -> argument(i).toString();
260  }
261 
262  CctwApplication *app = eng->application();
263 
264  if (app) {
265  app->setInputData(msg);
266  }
267  }
268 
269  return QScriptValue(engine, "");
270 }
CctwApplication * application() const
void setInputData(QString data)
QScriptValue CctwScriptEngine::setInputDatasetFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 298 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setInputDataset().

Referenced by CctwScriptEngine().

299 {
300  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
301 
302  if (eng) {
303  int nArgs = context->argumentCount();
304  QString msg;
305 
306  for (int i=0; i<nArgs; i++) {
307  if (i != 0) {
308  msg += " ";
309  }
310 
311  msg += context -> argument(i).toString();
312  }
313 
314  CctwApplication *app = eng->application();
315 
316  if (app) {
317  app->setInputDataset(msg);
318  }
319  }
320 
321  return QScriptValue(engine, "");
322 }
CctwApplication * application() const
void setInputDataset(QString data)
QScriptValue CctwScriptEngine::setMaskFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 324 of file cctwscriptengine.cpp.

References application().

Referenced by CctwScriptEngine().

325 {
326  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
327 
328  if (eng) {
329  int nArgs = context->argumentCount();
330  QString msg;
331 
332  for (int i=0; i<nArgs; i++) {
333  if (i != 0) {
334  msg += " ";
335  }
336 
337  msg += context -> argument(i).toString();
338  }
339 
340  CctwApplication *app = eng->application();
341 
342  if (app) {
343  app->set_MaskFile(msg);
344  }
345  }
346 
347  return QScriptValue(engine, "");
348 }
CctwApplication * application() const
QScriptValue CctwScriptEngine::setOmegaFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 376 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setOmega().

Referenced by CctwScriptEngine().

377 {
378  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
379 
380  if (eng) {
381  int nArgs = context->argumentCount();
382  QString msg;
383 
384  for (int i=0; i<nArgs; i++) {
385  if (i != 0) {
386  msg += " ";
387  }
388 
389  msg += context -> argument(i).toString();
390  }
391 
392  CctwApplication *app = eng->application();
393 
394  if (app) {
395  app->setOmega(msg);
396  }
397  }
398 
399  return QScriptValue(engine, "");
400 }
void setOmega(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setOutputChunksFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 559 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setOutputChunks().

Referenced by CctwScriptEngine().

560 {
561  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
562 
563  if (eng) {
564  int nArgs = context->argumentCount();
565  QString msg;
566 
567  for (int i=0; i<nArgs; i++) {
568  if (i != 0) {
569  msg += " ";
570  }
571 
572  msg += context -> argument(i).toString();
573  }
574 
575  CctwApplication *app = eng->application();
576 
577  if (app) {
578  app->setOutputChunks(msg);
579  }
580  }
581 
582  return QScriptValue(engine, "");
583 }
void setOutputChunks(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setOutputDataFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 507 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setOutputData().

Referenced by CctwScriptEngine().

508 {
509  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
510 
511  if (eng) {
512  int nArgs = context->argumentCount();
513  QString msg;
514 
515  for (int i=0; i<nArgs; i++) {
516  if (i != 0) {
517  msg += " ";
518  }
519 
520  msg += context -> argument(i).toString();
521  }
522 
523  CctwApplication *app = eng->application();
524 
525  if (app) {
526  app->setOutputData(msg);
527  }
528  }
529 
530  return QScriptValue(engine, "");
531 }
void setOutputData(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setOutputDatasetFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 585 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setOutputDataset().

Referenced by CctwScriptEngine().

586 {
587  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
588 
589  if (eng) {
590  int nArgs = context->argumentCount();
591  QString msg;
592 
593  for (int i=0; i<nArgs; i++) {
594  if (i != 0) {
595  msg += " ";
596  }
597 
598  msg += context -> argument(i).toString();
599  }
600 
601  CctwApplication *app = eng->application();
602 
603  if (app) {
604  app->setOutputDataset(msg);
605  }
606  }
607 
608  return QScriptValue(engine, "");
609 }
void setOutputDataset(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setOutputDimsFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 533 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setOutputDims().

Referenced by CctwScriptEngine().

534 {
535  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
536 
537  if (eng) {
538  int nArgs = context->argumentCount();
539  QString msg;
540 
541  for (int i=0; i<nArgs; i++) {
542  if (i != 0) {
543  msg += " ";
544  }
545 
546  msg += context -> argument(i).toString();
547  }
548 
549  CctwApplication *app = eng->application();
550 
551  if (app) {
552  app->setOutputDims(msg);
553  }
554  }
555 
556  return QScriptValue(engine, "");
557 }
void setOutputDims(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setPhiFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 454 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setPhi().

Referenced by CctwScriptEngine().

455 {
456  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
457 
458  if (eng) {
459  int nArgs = context->argumentCount();
460  QString msg;
461 
462  for (int i=0; i<nArgs; i++) {
463  if (i != 0) {
464  msg += " ";
465  }
466 
467  msg += context -> argument(i).toString();
468  }
469 
470  CctwApplication *app = eng->application();
471 
472  if (app) {
473  app->setPhi(msg);
474  }
475  }
476 
477  return QScriptValue(engine, "");
478 }
void setPhi(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setProjectOutputFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 811 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setProjectOutput().

Referenced by CctwScriptEngine().

812 {
813  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
814 
815  if (eng) {
816  int nArgs = context->argumentCount();
817  QString msg;
818 
819  for (int i=0; i<nArgs; i++) {
820  if (i != 0) {
821  msg += " ";
822  }
823 
824  msg += context -> argument(i).toString();
825  }
826 
827  CctwApplication *app = eng->application();
828 
829  if (app) {
830  app->setProjectOutput(msg);
831  }
832  }
833 
834  return QScriptValue(engine, "");
835 }
void setProjectOutput(QString dir)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setSubsetFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 637 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setSubset().

Referenced by CctwScriptEngine().

638 {
639  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
640 
641  if (eng) {
642  int nArgs = context->argumentCount();
643  QString msg;
644 
645  for (int i=0; i<nArgs; i++) {
646  if (i != 0) {
647  msg += " ";
648  }
649 
650  msg += context -> argument(i).toString();
651  }
652 
653  CctwApplication *app = eng->application();
654 
655  if (app) {
656  app->setSubset(msg);
657  }
658  }
659 
660  return QScriptValue(engine, "");
661 }
void setSubset(QString desc)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setThreadsFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 168 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setThreads().

Referenced by CctwScriptEngine().

169 {
170  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
171 
172  if (eng) {
173  int nArgs = context->argumentCount();
174  QString msg;
175 
176  for (int i=0; i<nArgs; i++) {
177  if (i != 0) {
178  msg += " ";
179  }
180 
181  msg += context -> argument(i).toString();
182  }
183 
184  CctwApplication *app = eng->application();
185 
186  if (app) {
187  app->setThreads(msg);
188  }
189  }
190 
191  return QScriptValue(engine, "");
192 }
void setThreads(QString desc)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setTwoThetaFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 402 of file cctwscriptengine.cpp.

References application(), and CctwApplication::setTwoTheta().

Referenced by CctwScriptEngine().

403 {
404  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
405 
406  if (eng) {
407  int nArgs = context->argumentCount();
408  QString msg;
409 
410  for (int i=0; i<nArgs; i++) {
411  if (i != 0) {
412  msg += " ";
413  }
414 
415  msg += context -> argument(i).toString();
416  }
417 
418  CctwApplication *app = eng->application();
419 
420  if (app) {
421  app->setTwoTheta(msg);
422  }
423  }
424 
425  return QScriptValue(engine, "");
426 }
void setTwoTheta(QString data)
CctwApplication * application() const
QScriptValue CctwScriptEngine::setWeightsFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 481 of file cctwscriptengine.cpp.

References application().

Referenced by CctwScriptEngine().

482 {
483  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
484 
485  if (eng) {
486  int nArgs = context->argumentCount();
487  QString msg;
488 
489  for (int i=0; i<nArgs; i++) {
490  if (i != 0) {
491  msg += " ";
492  }
493 
494  msg += context -> argument(i).toString();
495  }
496 
497  CctwApplication *app = eng->application();
498 
499  if (app) {
500  app->set_WeightsFile(msg);
501  }
502  }
503 
504  return QScriptValue(engine, "");
505 }
CctwApplication * application() const
QScriptValue CctwScriptEngine::showHelpFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 194 of file cctwscriptengine.cpp.

References application(), and CctwApplication::showHelp().

Referenced by CctwScriptEngine().

195 {
196  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
197 
198  if (eng) {
199  int nArgs = context->argumentCount();
200  QString msg;
201 
202  for (int i=0; i<nArgs; i++) {
203  if (i != 0) {
204  msg += " ";
205  }
206 
207  msg += context -> argument(i).toString();
208  }
209 
210  CctwApplication *app = eng->application();
211 
212  if (app) {
213  app->showHelp(msg);
214  }
215  }
216 
217  return QScriptValue(engine, "");
218 }
CctwApplication * application() const
void showHelp(QString about)
QScriptValue CctwScriptEngine::showVersionFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 220 of file cctwscriptengine.cpp.

References application(), and CctwApplication::showVersion().

Referenced by CctwScriptEngine().

221 {
222  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
223 
224  if (eng) {
225  int nArgs = context->argumentCount();
226  QString msg;
227 
228  for (int i=0; i<nArgs; i++) {
229  if (i != 0) {
230  msg += " ";
231  }
232 
233  msg += context -> argument(i).toString();
234  }
235 
236  CctwApplication *app = eng->application();
237 
238  if (app) {
239  app->showVersion();
240  }
241  }
242 
243  return QScriptValue(engine, "");
244 }
CctwApplication * application() const
QScriptValue CctwScriptEngine::transformFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 611 of file cctwscriptengine.cpp.

References application(), and CctwApplication::transform().

Referenced by CctwScriptEngine().

612 {
613  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
614 
615  if (eng) {
616  int nArgs = context->argumentCount();
617  QString msg;
618 
619  for (int i=0; i<nArgs; i++) {
620  if (i != 0) {
621  msg += " ";
622  }
623 
624  msg += context -> argument(i).toString();
625  }
626 
627  CctwApplication *app = eng->application();
628 
629  if (app) {
630  app->transform(msg);
631  }
632  }
633 
634  return QScriptValue(engine, "");
635 }
void transform(QString desc)
CctwApplication * application() const
QScriptValue CctwScriptEngine::waitFunc ( QScriptContext *  context,
QScriptEngine *  engine 
)
staticprivate

Definition at line 90 of file cctwscriptengine.cpp.

References application(), and CctwApplication::wait().

Referenced by CctwScriptEngine().

91 {
92  CctwScriptEngine *eng = qobject_cast<CctwScriptEngine*>(engine);
93 
94  if (eng) {
95  int nArgs = context->argumentCount();
96  QString msg;
97 
98  for (int i=0; i<nArgs; i++) {
99  if (i != 0) {
100  msg += " ";
101  }
102 
103  msg += context -> argument(i).toString();
104  }
105 
106  CctwApplication *app = eng->application();
107 
108  if (app) {
109  app->wait(msg);
110  }
111  }
112 
113  return QScriptValue(engine, "");
114 }
CctwApplication * application() const
void wait(QString msg)

Member Data Documentation

CctwApplication* CctwScriptEngine::m_Application
private

Definition at line 61 of file cctwscriptengine.h.

Referenced by application(), CctwScriptEngine(), and checkForExceptions().


The documentation for this class was generated from the following files: