@@ -66,7 +66,7 @@ function createWindow() {
6666 win . setMenu ( null ) ;
6767 win . loadFile ( "src/index.html" ) ;
6868 win . on ( "ready-to-show" , ( ) => {
69- // win.webContents.openDevTools({ mode: "detach" });
69+ win . webContents . openDevTools ( { mode : "detach" } ) ;
7070 win . webContents . send ( "ready" ) ;
7171 } ) ;
7272 ipcMain . on ( "sendAutoSave" , function ( event , content ) {
@@ -716,6 +716,25 @@ function createWindow() {
716716 win . webContents . send ( "errorOnEditedPath" , myRow ) ;
717717 } else if ( contents_type == "FUNCTION" ) {
718718 let fct_description = initialReq . contents . description ;
719+ if ( ! initialReq . contents . args ) {
720+ let function_cb = await (
721+ await eGet . invoke ( initialReq )
722+ ) . response ;
723+ // console.log(
724+ // "π : file: main.js:727 : main : function_cb.result[0]:",
725+ // function_cb
726+ // );
727+ win . webContents . send (
728+ "loginfo" ,
729+ "π : file: main.js:724 : main : function_cb:" +
730+ JSON . stringify ( function_cb . result )
731+ ) ;
732+ } else {
733+ // console.log(
734+ // "π : file: main.js:720 : main : initialReq.contents.args:",
735+ // initialReq.contents.args
736+ // );
737+ }
719738 win . webContents . send (
720739 "loginfo" ,
721740 "WARNING! : You're trying to connect to a FUNCTION ( " +
@@ -967,6 +986,15 @@ function createWindow() {
967986 }
968987 ) ;
969988
989+ ipcMain . on ( "mtx_connect" , async ( event , mtx_path , check_t , check_s ) => {
990+ // console.log(
991+ // "π : file: main.js:990 : ipcMain.on : mtx_path:",
992+ // mtx_path
993+ // );
994+ let mtx = await eGet . getElementByPath ( mtx_path ) ;
995+ await eGet . matrixSetConnection ( mtx , check_t , check_s ) ;
996+ } ) ;
997+
970998 ipcMain . on (
971999 "deleteConnection" ,
9721000 async ( event , ePath , oAddr , myRow , eVarType , sFactor ) => {
@@ -1101,40 +1129,66 @@ function createWindow() {
11011129 ) ;
11021130
11031131 ipcMain . on ( "expandNode" , async ( event , parentPath , currOpt_class ) => {
1104- console . log ( "π : file: main.js:1173 : parentPath,:" , parentPath ) ;
1105- console . log (
1106- "π : file: main.js:1173 : currOpt_class:" ,
1107- currOpt_class
1108- ) ;
1132+ // console.log("π : file: main.js:1173 : parentPath,:", parentPath);
1133+ // console.log(
1134+ // "π : file: main.js:1173 : currOpt_class:",
1135+ // currOpt_class
1136+ // );
11091137 if ( currOpt_class == "NODE" ) {
11101138 let childrenArray = [ ] ;
11111139 let expandReq = await eGet . getElementByPath ( parentPath . toString ( ) ) ;
1112- console . log ( "π : file: main.js:1178 : == : expandReq:" , expandReq ) ;
1140+ // console.log("π : file: main.js:1178 : == : expandReq:", expandReq);
11131141 let getDir = await eGet . getDirectory ( expandReq ) ;
11141142 try {
11151143 let getDirResponse = await getDir . response ;
11161144 } catch ( error ) {
1117- // console.log("π : file: main.js:1183 : == : error:", error)
1145+ // console.log("π : file: main.js:1183 : == : error:", error);
11181146 }
11191147 let nodeChildren = Object . keys ( expandReq . children ) ;
1120- // console.log("π : file: main.js:1187 : == : nodeChildren:", nodeChildren)
1148+ // console.log(
1149+ // "π : file: main.js:1187 : == : nodeChildren:",
1150+ // nodeChildren
1151+ // );
1152+
11211153 for ( i = 0 ; i < nodeChildren . length ; i ++ ) {
1122- let newChild = await eGet . getElementByPath (
1123- parentPath + "." + nodeChildren [ i ]
1124- ) ;
1125- console . log (
1126- "π : file: main.js:1113 : == : ipcMain.on : newChild:" ,
1127- newChild
1128- ) ;
1154+ let numb_of_child = nodeChildren [ i ] ;
1155+ // console.log(
1156+ // "π : file: main.js:1154 : == : ipcMain.on : numb_of_child:",
1157+ // numb_of_child
1158+ // );
1159+ let path_of_child =
1160+ parentPath . toString ( ) + "." + numb_of_child . toString ( ) ;
1161+ // console.log(
1162+ // "π : file: main.js:1154 : == : ipcMain.on : path_of_child:",
1163+ // path_of_child
1164+ // );
1165+ let newChild = await eGet . getElementByPath ( path_of_child ) ;
1166+ // console.log(
1167+ // "π : file: main.js:1113 : == : ipcMain.on : newChild:",
1168+ // newChild
1169+ // );
11291170 contents = newChild . contents ;
1130- // console.log("π : file: main.js:1193 : == : newChild.contents:", newChild.contents)
1171+ // console.log(
1172+ // "π : file: main.js:1193 : == : newChild.contents:",
1173+ // newChild.contents
1174+ // );
11311175 number = newChild . number ;
1132- parentPath = newChild . parent . path ;
1133- // console.log("π : file: main.js:1195 : == : newChild.number:", newChild.number)
1176+ if ( newChild . parent . path ) {
1177+ parentPath = newChild . parent . path ;
1178+ } else if ( newChild . parent . number ) {
1179+ parentPath = newChild . parent . number . toString ( ) ;
1180+ }
1181+ // console.log(
1182+ // "π : file: main.js:1195 : == : newChild.number:",
1183+ // newChild.number
1184+ // );
11341185 base_path = { contents, number, parentPath } ;
11351186 childrenArray . push ( base_path ) ;
11361187 }
1137- // console.log("π : file: main.js:1204 : == : childrenArray:", childrenArray)
1188+ // console.log(
1189+ // "π : file: main.js:1204 : == : childrenArray:",
1190+ // childrenArray
1191+ // );
11381192 win . webContents . send ( "expandedNode" , parentPath , childrenArray ) ;
11391193 win . webContents . send ( "expandedElement" , expandReq , false ) ;
11401194 } else if ( currOpt_class == "MATRIX" ) {
0 commit comments