OSDN Git Service

Merge branch 'master' of git.osdn.net:/gitroot/eos/zephyr
[eos/zephyr.git] / server / class / Eos.js
old mode 100644 (file)
new mode 100755 (executable)
index a5efe08..6254e40
@@ -1,7 +1,15 @@
-/** * * Class variables */ 
-// include all Eos command's info.  
-// For seaching with O(n), the object key name is command name.  
-var db = require('./DB.js').instance; 
+<<<<<<< HEAD
+/**
+ *
+ * Class variables
+ */
+
+=======
+/** * * Class variables */
+>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
+// include all Eos command's info.
+// For seaching with O(n), the object key name is command name.
+var db = require('./DB.js').instance;
 var commandList = require(__dirname + '/../../user-specific-files/OptionControlFile/command_list.json');
 var ocfReference = {};
 
@@ -26,7 +34,7 @@ function matchOption(options, ocf) {
     return new Promise(function(resolve, reject) {
         var ok = {};
         var notIncludingRequiredOptions = [];
-        options.forEach(function(o) { 
+        options.forEach(function(o) {
             ok[o.name] = o.arguments;
         });
         ocf.forEach(function(o) {
@@ -35,7 +43,7 @@ function matchOption(options, ocf) {
             }
         });
 
-        // check whether all required option exist 
+        // check whether all required option exist
         if(notIncludingRequiredOptions.length > 0) {
             var errorMsg = 'Option ' + notIncludingRequiredOptions.toString() + ' are required';
             reject(new Error(errorMsg));
@@ -103,7 +111,7 @@ function validOutfileName(options, ocfObj, workspace) {
 }
 
 /**
- * validate 
+ * validate
  * コマンドとオプションのバリデーション
  * @param command
  * @param params
@@ -178,7 +186,10 @@ function validate(command, options, workspaceId) {
 function toExecString(command, options, workspaceId) {
     var ocf = ocfReference[command]; // Array
     var finalOptions = {};
+<<<<<<< HEAD
+=======
     //var execStr = '/Users/hiratakengo/Eos/bin/X86MAC64/'+command + ' ';
+>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
     var execStr = command + ' ';
     var ocfObj = {};
     ocf.forEach(function(o) {
@@ -235,7 +246,7 @@ function toExecString(command, options, workspaceId) {
 /**
  * toExecArray
  *
- * @param {fileId} 
+ * @param {fileId}
  * @returns {string}
  */
 function toExecArray(command, options, workspaceId) {
@@ -269,7 +280,14 @@ function toExecArray(command, options, workspaceId) {
                 var outRegExp = /out|append/;
                 o.arguments.forEach(function(arg, i) {
                     if(ocfObj[o.name].arg[i].formType === 'select') {
+<<<<<<< HEAD
                         s.push(uuids[arg]);
+                        //s.push(arg);
+                        console.log('input:' + uuids[arg]);
+=======
+                        //s.push(uuids[arg]);
+                        s.push(arg);
+>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
                     } else {
                         s.push(arg);
                     }
@@ -297,16 +315,25 @@ function toExecArray(command, options, workspaceId) {
  */
 function execute(command, optionsArray) {
     return new Promise(function(resolve, reject) {
-        var workspace; 
+        var workspace;
         if(process.env.NODE_ENV === 'debug') {
             workspace = __dirname + '/../../user-specific-files/workspace.debug';
         } else {
+<<<<<<< HEAD
+            workspace = __dirname + '/../../user-specific-files/workspace';
+=======
             workspace = _dirname + '/../../user-specific-files/workspace';
+>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
         }
-        
+
         var config = {
             cwd: workspace
         };
+<<<<<<< HEAD
+        var runner = spawn(command,optionsArray,config);
+        //var runner = spawn(command,optionsArray,'/');
+        console.log('spawn');
+=======
         //var runner = spawn('/Users/hiratakengo/Eos/bin/X86MAC64/'+command,optionsArray,config);
         var runner = spawn(command,optionsArray,config);
         //var runner = spawn(command,optionsArray);
@@ -322,6 +349,7 @@ function execute(command, optionsArray) {
        commandRet.stderr.on('data', function (data) {
          console.log('stderr: ' + data);
        });
+>>>>>>> 6b2b2b88511733893d2c6e7848c389abfcd53ba6
 
         runner.on('close', function() {
             resolve();
@@ -350,7 +378,7 @@ function getFiles(fileId) {
 
 /**
  * getUUID
- * @param fileId 
+ * @param fileId
  * @returns {object} key: filename, value: uuid
  */
 function getUUIDs(fileId) {
@@ -367,7 +395,7 @@ function getUUIDs(fileId) {
 }
 
 /**
- * Eosコマンドをエミュレートするクラス 
+ * Eosコマンドをエミュレートするクラス
  * @varructor
  * @returns {object}
  * function execute(command, params) {