File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 1111 "fields" : {
1212 "NAME" : " " ,
1313 "GROUP" : " " ,
14- "TYPE" : " Auto " ,
14+ "TYPE" : " Teleop " ,
1515 "ENABLED" : true
1616 }
1717 },
Original file line number Diff line number Diff line change @@ -240,9 +240,12 @@ class ClientSideStorage implements commonStorage.Storage {
240240 } ) ;
241241 }
242242
243- async createProject ( projectName : string , robotContent : string ) : Promise < void > {
243+ async createProject ( projectName : string , robotContent : string , opmodeContent : string ) : Promise < void > {
244244 const modulePath = commonStorage . makeRobotPath ( projectName ) ;
245- return this . _saveModule ( commonStorage . MODULE_TYPE_ROBOT , modulePath , robotContent ) ;
245+ const opmodePath = commonStorage . makeModulePath ( projectName , 'Teleop' ) ;
246+
247+ await this . _saveModule ( commonStorage . MODULE_TYPE_ROBOT , modulePath , robotContent ) ;
248+ await this . _saveModule ( commonStorage . MODULE_TYPE_OPMODE , opmodePath , opmodeContent ) ;
246249 }
247250
248251 async createModule ( moduleType : string , modulePath : string , moduleContent : string ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ export interface Storage {
106106 fetchEntry ( entryKey : string , defaultValue : string ) : Promise < string > ;
107107 listProjects ( ) : Promise < Project [ ] > ;
108108 fetchModuleContent ( modulePath : string ) : Promise < string > ;
109- createProject ( projectName : string , robotContent : string ) : Promise < void > ;
109+ createProject ( projectName : string , robotContent : string , opmodeContent : string ) : Promise < void > ;
110110 createModule ( moduleType : string , modulePath : string , moduleContent : string ) : Promise < void > ;
111111 saveModule ( modulePath : string , moduleContent : string ) : Promise < void > ;
112112 renameProject ( oldProjectName : string , newProjectName : string ) : Promise < void > ;
@@ -129,7 +129,8 @@ export async function createProject(
129129 storage : Storage , proposedUserVisibleName : string ) : Promise < void > {
130130 const newProjectName = pascalCaseToSnakeCase ( proposedUserVisibleName ) ;
131131 const robotContent = newRobotContent ( newProjectName ) ;
132- await storage . createProject ( newProjectName , robotContent ) ;
132+ const opmodeContent = newOpModeContent ( newProjectName , 'Teleop' ) ;
133+ await storage . createProject ( newProjectName , robotContent , opmodeContent ) ;
133134}
134135
135136/**
You can’t perform that action at this time.
0 commit comments