Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
telemersion
Telemersive Gateway
Commits
752505b2
Commit
752505b2
authored
Apr 16, 2021
by
maybites
Browse files
new windows shell execution logic
parent
be214cf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
code/shellHelper.js
View file @
752505b2
...
...
@@ -43,7 +43,7 @@ function testRunning(){
function
pkill
(){
if
(
isRunning
){
outlet
(
1
,
'
pkill
'
);
outlet
(
2
,
'
pkill
'
);
if
(
myOS
===
'
windows
'
){
outlet
(
1
,
'
taskkill
'
,
'
/IM
'
,
myWinTask
,
'
/F
'
);
del
();
...
...
@@ -59,10 +59,10 @@ function notifydeleted(){
function
execute
(){
//post("execute: " + myCommands + "\n");
if
(
myOS
===
'
windows
'
){
outlet
(
0
,
'
"
'
,
myCommands
,
'
"
'
);
outlet
(
2
,
'
"
'
,
myCommands
,
'
"
'
);
//outlet(0, 'start', myTitle, '/min', myCommands);
}
else
{
outlet
(
0
,
myCommands
);
outlet
(
2
,
myCommands
);
}
isRunning
=
true
;
}
...
...
@@ -85,8 +85,6 @@ function start(){
myNewPath
=
myWinPath
.
replace
(
'
.exe
'
,
'
_tb
'
+
myIndex
+
'
.exe
'
);
myCommands
[
0
]
=
myPath
.
replace
(
'
.exe
'
,
'
_tb
'
+
myIndex
+
'
.exe
'
);
myWinTask
=
myCommands
[
0
].
substring
(
myCommands
[
0
].
lastIndexOf
(
'
/
'
)
+
1
);
// setting the routepass filter for myWinTask
outlet
(
2
,
myWinTask
);
// on windows we have to replace apostrophes with quotation marks:
for
(
var
i
=
1
;
i
<
myCommands
.
length
;
i
++
){
if
((
typeof
myCommands
[
i
])
===
'
string
'
){
...
...
patchers/utils/tg.shell.maxpat
View file @
752505b2
...
...
@@ -10,7 +10,7 @@
}
,
"classnamespace" : "box",
"rect" : [ 766.0, 367.0,
640
.0, 480.0 ],
"rect" : [ 766.0, 367.0,
787
.0, 480.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
...
...
@@ -39,26 +39,56 @@
"subpatcher_template" : "",
"assistshowspatchername" : 0,
"boxes" : [ {
"box" : {
"id" : "obj-4",
"maxclass" : "button",
"numinlets" : 1,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"parameter_enable" : 0,
"patching_rect" : [ 39.0, 147.5, 24.0, 24.0 ]
}
}
, {
"box" : {
"id" : "obj-5",
"maxclass" : "newobj",
"numinlets" : 1,
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [ 39.0, 187.5, 61.0, 22.0 ],
"text" : "delay 500"
}
}
, {
"box" : {
"id" : "obj-7",
"maxclass" : "message",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [ 68.0, 377.0, 19.0, 22.0 ],
"text" : "t l"
"patching_rect" : [ 39.0, 233.0, 120.0, 22.0 ]
}
}
, {
"box" : {
"id" : "obj-4",
"fontname" : "Geneva",
"fontsize" : 9.0,
"id" : "obj-6",
"maxclass" : "newobj",
"numinlets" : 3,
"numoutlets" : 3,
"outlettype" : [ "", "", "" ],
"patching_rect" : [ 68.0, 331.0, 110.0, 22.0 ],
"text" : "routepass task Exit"
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ],
"patching_rect" : [ 362.0, 287.5, 77.0, 19.0 ],
"saved_object_attributes" : {
"shell" : "(default)",
"stderr" : 1
}
,
"text" : "shell @stderr 1"
}
}
...
...
@@ -69,7 +99,7 @@
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "", "" ],
"patching_rect" : [
415
.0, 10
3
.0, 63.0, 22.0 ],
"patching_rect" : [
386
.0, 10
2
.0, 63.0, 22.0 ],
"text" : "route start"
}
...
...
@@ -83,7 +113,7 @@
"numinlets" : 0,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [
68
.0, 2
2
.0, 30.0, 30.0 ]
"patching_rect" : [
39
.0, 2
1
.0, 30.0, 30.0 ]
}
}
...
...
@@ -95,7 +125,7 @@
"maxclass" : "outlet",
"numinlets" : 1,
"numoutlets" : 0,
"patching_rect" : [
158
.0, 3
77
.0, 30.0, 30.0 ]
"patching_rect" : [
362
.0, 3
43
.0, 30.0, 30.0 ]
}
}
...
...
@@ -107,7 +137,7 @@
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"parameter_enable" : 0,
"patching_rect" : [
68
.0, 1
4
4.
0
, 24.0, 24.0 ]
"patching_rect" : [
362
.0, 1
5
4.
5
, 24.0, 24.0 ]
}
}
...
...
@@ -118,7 +148,7 @@
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "bang" ],
"patching_rect" : [
68
.0, 1
8
4.
0
, 61.0, 22.0 ],
"patching_rect" : [
362
.0, 1
9
4.
5
, 61.0, 22.0 ],
"text" : "delay 500"
}
...
...
@@ -130,7 +160,7 @@
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "" ],
"patching_rect" : [
68
.0, 2
29.5
, 556.0, 22.0 ]
"patching_rect" : [
362
.0, 2
40.0
, 556.0, 22.0 ]
}
}
...
...
@@ -143,7 +173,7 @@
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "", "bang" ],
"patching_rect" : [
68
.0, 28
9.0
, 77.0,
20
.0 ],
"patching_rect" : [
39
.0, 28
0.5
, 77.0,
19
.0 ],
"saved_object_attributes" : {
"shell" : "(default)",
"stderr" : 1
...
...
@@ -160,7 +190,7 @@
"numinlets" : 1,
"numoutlets" : 3,
"outlettype" : [ "", "", "" ],
"patching_rect" : [
68
.0, 10
4
.0, 342.0, 22.0 ],
"patching_rect" : [
39
.0, 10
3
.0, 342.0, 22.0 ],
"saved_object_attributes" : {
"filename" : "shellHelper.js",
"parameter_enable" : 0
...
...
@@ -189,14 +219,15 @@
}
, {
"patchline" : {
"destination" : [ "obj-4", 0 ],
"destination" : [ "obj-9", 0 ],
"midpoints" : [ 48.5, 316.5, 24.5, 316.5, 24.5, 92.0, 48.5, 92.0 ],
"source" : [ "obj-21", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-
21
", 0 ],
"destination" : [ "obj-
6
", 0 ],
"source" : [ "obj-25", 0 ]
}
...
...
@@ -224,30 +255,29 @@
}
, {
"patchline" : {
"destination" : [ "obj-
1
", 0 ],
"source" : [ "obj-4",
2
]
"destination" : [ "obj-
5
", 0 ],
"source" : [ "obj-4",
0
]
}
}
, {
"patchline" : {
"destination" : [ "obj-
5
", 0 ],
"source" : [ "obj-
4
",
1
]
"destination" : [ "obj-
7
", 0 ],
"source" : [ "obj-
5
",
0
]
}
}
, {
"patchline" : {
"destination" : [ "obj-
5
", 0 ],
"source" : [ "obj-
4
", 0 ]
"destination" : [ "obj-
1
", 0 ],
"source" : [ "obj-
6
", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-9", 0 ],
"midpoints" : [ 77.5, 417.0, 15.5, 417.0, 15.5, 89.0, 77.5, 89.0 ],
"source" : [ "obj-5", 0 ]
"destination" : [ "obj-21", 0 ],
"source" : [ "obj-7", 0 ]
}
}
...
...
@@ -262,7 +292,7 @@
"patchline" : {
"destination" : [ "obj-25", 1 ],
"order" : 0,
"source" : [ "obj-9",
0
]
"source" : [ "obj-9",
2
]
}
}
...
...
@@ -270,35 +300,43 @@
"patchline" : {
"destination" : [ "obj-31", 0 ],
"order" : 1,
"source" : [ "obj-9", 2 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-4", 0 ],
"order" : 1,
"source" : [ "obj-9", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-4", 1 ],
"source" : [ "obj-9", 2 ]
"destination" : [ "obj-7", 1 ],
"order" : 0,
"source" : [ "obj-9", 0 ]
}
}
],
"dependency_cache" : [ {
"name" : "shellHelper.js",
"bootpath" : "~/
Arbeiten/01_projekte/181111_IASpace/01_projekte/20xx_Telematik/01_dev
/telemersive-gateway/code",
"bootpath" : "~/
Documents
/telemersive-gateway/code",
"patcherrelativepath" : "../../code",
"type" : "TEXT",
"implicit" : 1
}
, {
"name" : "shell.mx
o
",
"type" : "
iLaX
"
"name" : "shell.mx
e64
",
"type" : "
mx64
"
}
],
"autosave" : 0,
"styles" : [ {
"name" : "rnbodefault",
"default" : {
"fontname" : [ "Lato" ],
"bgfillcolor" : {
"type" : "color",
"color" : [ 0.031372549019608, 0.125490196078431, 0.211764705882353, 1.0 ],
...
...
@@ -309,12 +347,13 @@
"autogradient" : 0.0
}
,
"
stripecolor" : [ 0.258338063955307, 0.352425158023834, 0.511919498443604, 1
.0 ],
"
fontsize" : [ 12
.0 ],
"bgcolor" : [ 0.031372549019608, 0.125490196078431, 0.211764705882353, 1.0 ],
"accentcolor" : [ 0.343034118413925, 0.506230533123016, 0.86220508813858, 1.0 ],
"font
siz
e" : [
12.0
],
"font
nam
e" : [
"Lato"
],
"color" : [ 0.929412, 0.929412, 0.352941, 1.0 ],
"elementcolor" : [ 0.357540726661682, 0.515565991401672, 0.861786782741547, 1.0 ]
"elementcolor" : [ 0.357540726661682, 0.515565991401672, 0.861786782741547, 1.0 ],
"stripecolor" : [ 0.258338063955307, 0.352425158023834, 0.511919498443604, 1.0 ]
}
,
"parentstyle" : "",
...
...
@@ -323,10 +362,6 @@
, {
"name" : "rnbohighcontrast",
"default" : {
"selectioncolor" : [ 0.301960784313725, 0.694117647058824, 0.949019607843137, 1.0 ],
"textcolor_inverse" : [ 1.0, 1.0, 1.0, 1.0 ],
"locked_bgcolor" : [ 0.258823529411765, 0.258823529411765, 0.258823529411765, 1.0 ],
"textcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
"bgfillcolor" : {
"type" : "color",
"color" : [ 0.0, 0.0, 0.0, 1.0 ],
...
...
@@ -337,14 +372,18 @@
"autogradient" : 0.0
}
,
"
editing_bg
color" : [ 0.
258823529411765, 0.258823529411765, 0.258823529411765
, 1.0 ],
"
stripecolor" : [ 0.258823529411765, 0.258823529411765, 0.258823529411765, 1
.0 ],
"
selection
color" : [ 0.
301960784313725, 0.694117647058824, 0.949019607843137
, 1.0 ],
"
fontsize" : [ 13
.0 ],
"bgcolor" : [ 0.0, 0.0, 0.0, 1.0 ],
"clearcolor" : [ 1.0, 1.0, 1.0, 0.0 ],
"accentcolor" : [ 0.666666666666667, 0.666666666666667, 0.666666666666667, 1.0 ],
"
fontsize" : [ 13
.0 ],
"
locked_bgcolor" : [ 0.258823529411765, 0.258823529411765, 0.258823529411765, 1
.0 ],
"color" : [ 1.0, 0.874509803921569, 0.141176470588235, 1.0 ],
"elementcolor" : [ 0.223386004567146, 0.254748553037643, 0.998085916042328, 1.0 ]
"elementcolor" : [ 0.223386004567146, 0.254748553037643, 0.998085916042328, 1.0 ],
"stripecolor" : [ 0.258823529411765, 0.258823529411765, 0.258823529411765, 1.0 ],
"clearcolor" : [ 1.0, 1.0, 1.0, 0.0 ],
"textcolor" : [ 1.0, 1.0, 1.0, 1.0 ],
"textcolor_inverse" : [ 1.0, 1.0, 1.0, 1.0 ],
"editing_bgcolor" : [ 0.258823529411765, 0.258823529411765, 0.258823529411765, 1.0 ]
}
,
"parentstyle" : "",
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment