OSDN Git Service

[Develop] Command directive submit() assemble ExecObj v0.3.0p0032
authorhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 3 Feb 2016 07:45:45 +0000 (16:45 +0900)
committerhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 3 Feb 2016 07:45:45 +0000 (16:45 +0900)
 On branch master
 Changes to be committed:
modified:   front-end/app/scripts/directives/Command.ts
modified:   front-end/dist/bundle.js

front-end/app/scripts/directives/Command.ts
front-end/dist/bundle.js

index 5f7daee..040c5f7 100644 (file)
@@ -91,22 +91,32 @@ namespace app.directives {
         }
 
         public submit() {
-            var params = {};
+            var opt = [];
             angular.forEach(this.options, (option) => {
 
-                var inputs = [];
+                var obj = {
+                    name: option.option,
+                    arguments: []
+                };
 
                 angular.forEach(option.arg, (arg) => {
                     if(arg.input) {
-                        inputs.push(arg.input);
+                        obj.arguments.push(arg.input);
                     }
                 });
 
-                if(inputs.length > 0) {
-                    params[option.option] = inputs;
+                if(obj.arguments.length > 0) {
+                   opt.push(obj);
                 }
             });
-            console.log(params);
+
+            var execObj = {
+                command: this.name,
+                workspace: this.workspace.fileId,
+                option: opt
+            };
+
+            console.log(execObj);
         }
 
         public removeMySelf(index:number) {
index efb7398..0e28727 100644 (file)
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);
                        });
                    }
                    CommandController.prototype.submit = function () {
-                       var params = {};
+                       var opt = [];
                        angular.forEach(this.options, function (option) {
-                           var inputs = [];
+                           var obj = {
+                               name: option.option,
+                               arguments: []
+                           };
                            angular.forEach(option.arg, function (arg) {
                                if (arg.input) {
-                                   inputs.push(arg.input);
+                                   obj.arguments.push(arg.input);
                                }
                            });
-                           if (inputs.length > 0) {
-                               params[option.option] = inputs;
+                           if (obj.arguments.length > 0) {
+                               opt.push(obj);
                            }
                        });
-                       console.log(params);
+                       var execObj = {
+                           command: this.name,
+                           workspace: this.workspace.fileId,
+                           option: opt
+                       };
+                       console.log(execObj);
                    };
                    CommandController.prototype.removeMySelf = function (index) {
                        this.remove()(index, this.list);