@@ -3,14 +3,14 @@ import * as fs from 'fs';
33import * as path from 'path' ;
44import { BaseTreeItem } from './BaseTreeItem' ;
55import { IotDevice } from './IotDevice' ;
6- import { IotLaunch } from './IotLaunch ' ;
6+ import { LaunchNode } from './LaunchNode ' ;
77import { IoTHelper } from './Helper/IoTHelper' ;
88import { IotResult , StatusResult } from './IotResult' ;
99import { IotConfiguration } from './Configuration/IotConfiguration' ;
1010import { IotTemplate } from './Templates/IotTemplate' ;
1111
1212export class TreeDataLaunchsProvider implements vscode . TreeDataProvider < BaseTreeItem > {
13- public RootItems :Array < IotLaunch > = [ ] ;
13+ public RootItems :Array < LaunchNode > = [ ] ;
1414
1515 public Config : IotConfiguration ;
1616
@@ -79,7 +79,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
7979 //fromJSON(jsonObj:any,devices: Array<IotDevice>,workspaceDirectory:string):any{
8080 //check folder .vscode with launch.json
8181 //launch.json
82- const launchBase = new IotLaunch ( this . _workspaceDirectory ) ;
82+ const launchBase = new LaunchNode ( this . _workspaceDirectory ) ;
8383 //fromJSON
8484 result = launchBase . GetJsonLaunch ( ) ;
8585 if ( result . Status == StatusResult . Error ) return result ;
@@ -93,7 +93,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
9393 if ( jsonLaunch . fastiotIdLaunch )
9494 {
9595 //parse
96- let launch = new IotLaunch ( this . _workspaceDirectory ) ;
96+ let launch = new LaunchNode ( this . _workspaceDirectory ) ;
9797 result = launch . FromJSON ( jsonLaunch , this . _devices ) ;
9898 if ( result . Status == StatusResult . Ok ) {
9999 launch . collapsibleState = vscode . TreeItemCollapsibleState . Collapsed ;
@@ -115,26 +115,26 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
115115 return result ;
116116 }
117117
118- public async RenameLaunch ( item :IotLaunch , newLabel :string ) : Promise < IotResult > {
118+ public async RenameLaunch ( item :LaunchNode , newLabel :string ) : Promise < IotResult > {
119119 let result :IotResult ;
120120 result = this . GetLaunchbyIdLaunch ( item . IdLaunch ) ;
121121 if ( result . Status != StatusResult . Ok ) return Promise . resolve ( result ) ;
122- let launch = < IotLaunch > result . returnObject ;
122+ let launch = < LaunchNode > result . returnObject ;
123123 if ( launch ) {
124124 result = launch . Rename ( newLabel ) ;
125125 } else result = new IotResult ( StatusResult . Error , `Launch not found IdLaunch:${ item . IdLaunch } ` ) ;
126126 //result
127127 return Promise . resolve ( result ) ;
128128 }
129129
130- public FindbyIdLaunchInTree ( idLaunch :string ) : IotLaunch | undefined {
130+ public FindbyIdLaunchInTree ( idLaunch :string ) : LaunchNode | undefined {
131131 let launch = this . RootItems . find ( x => x . IdLaunch == idLaunch ) ;
132132 return launch ;
133133 }
134134
135135 public GetLaunchbyIdLaunch ( idLaunch :string ) : IotResult {
136136 let result :IotResult ;
137- let launch = new IotLaunch ( this . _workspaceDirectory ) ;
137+ let launch = new LaunchNode ( this . _workspaceDirectory ) ;
138138 try {
139139 result = launch . GetJsonLaunch ( ) ;
140140 if ( result . Status == StatusResult . Error ) return result ;
@@ -160,7 +160,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
160160 let result :IotResult ;
161161 result = this . GetLaunchbyIdLaunch ( idLaunch ) ;
162162 if ( result . Status != StatusResult . Ok ) return Promise . resolve ( result ) ;
163- let launch = < IotLaunch > result . returnObject ;
163+ let launch = < LaunchNode > result . returnObject ;
164164 if ( launch ) {
165165 result = launch . Remove ( ) ;
166166 } else result = new IotResult ( StatusResult . Error , `Launch not found IdLaunch:${ idLaunch } ` ) ;
@@ -173,7 +173,7 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
173173 let result :IotResult ;
174174 result = this . GetLaunchbyIdLaunch ( idLaunch ) ;
175175 if ( result . Status != StatusResult . Ok ) return Promise . resolve ( result ) ;
176- let launch = < IotLaunch > result . returnObject ;
176+ let launch = < LaunchNode > result . returnObject ;
177177 //--------------Checks--------------
178178 //check device
179179 if ( ! launch . Device ) {
@@ -200,11 +200,11 @@ export class TreeDataLaunchsProvider implements vscode.TreeDataProvider<BaseTree
200200 let jsonLinkedLaunchs = jsonLaunch . configurations . filter ( ( e :any ) => e . fastiotIdLaunch ) ;
201201 jsonLinkedLaunchs = jsonLinkedLaunchs . filter ( ( e :any ) => e . fastiotIdLaunch . includes ( launch . IdLaunch . substring ( 0 , 8 ) ) ) ;
202202 //create a Message and get IotLaunch LinkedLaunchs
203- let LinkedLaunchs :Array < IotLaunch > = [ ] ;
203+ let LinkedLaunchs :Array < LaunchNode > = [ ] ;
204204 let msg = "\n" ;
205205 let index = 1 ;
206206 jsonLinkedLaunchs . forEach ( ( item :any ) => {
207- let launchItem = new IotLaunch ( this . _workspaceDirectory ) ;
207+ let launchItem = new LaunchNode ( this . _workspaceDirectory ) ;
208208 result = launchItem . FromJSON ( item , this . _devices ) ;
209209 if ( result . Status == StatusResult . Error ) return Promise . resolve ( result ) ;
210210 LinkedLaunchs . push ( launchItem ) ;
0 commit comments