@@ -30,15 +30,15 @@ public DeployManager(DTE dte)
30
30
31
31
32
32
//Uploads code to the robot and then runs it.
33
- public async Task DeployCode ( string teamNumber , SettingsPageGrid page , bool debug , Project robotProject )
33
+ public async Task < bool > DeployCode ( string teamNumber , SettingsPageGrid page , bool debug , Project robotProject )
34
34
{
35
35
36
36
var writer = OutputWriter . Instance ;
37
37
38
38
if ( robotProject == null )
39
39
{
40
40
writer . WriteLine ( "Robot Project not valid. Contact RobotDotNet for support." ) ;
41
- return ;
41
+ return false ;
42
42
}
43
43
44
44
//Connect to Robot Async
@@ -48,7 +48,7 @@ public async Task DeployCode(string teamNumber, SettingsPageGrid page, bool debu
48
48
49
49
CodeReturnStruct codeReturn = await BuildAndPrepareCode ( debug , robotProject ) ;
50
50
51
- if ( codeReturn == null ) return ;
51
+ if ( codeReturn == null ) return false ;
52
52
53
53
writer . WriteLine ( "Waiting for Connection to Finish" ) ;
54
54
if ( await Task . WhenAny ( rioConnectionTask , delayTask ) == rioConnectionTask )
@@ -63,7 +63,7 @@ public async Task DeployCode(string teamNumber, SettingsPageGrid page, bool debu
63
63
{
64
64
//TODO: Make this error message better
65
65
OutputWriter . Instance . WriteLine ( "Mono not properly installed. Please try reinstalling to Mono Runtime." ) ;
66
- return ;
66
+ return false ;
67
67
}
68
68
OutputWriter . Instance . WriteLine ( "Mono correctly installed" ) ;
69
69
@@ -72,7 +72,7 @@ public async Task DeployCode(string teamNumber, SettingsPageGrid page, bool debu
72
72
{
73
73
OutputWriter . Instance . WriteLine ( "RoboRIO Image does not match plugin, allowed image versions: " + string . Join ( ", " , DeployProperties . RoboRioAllowedImages . ToArray ( ) ) ) ;
74
74
OutputWriter . Instance . WriteLine ( "Please follow FIRST's instructions on imaging your RoboRIO, and try again." ) ;
75
- return ;
75
+ return false ;
76
76
}
77
77
OutputWriter . Instance . WriteLine ( "RoboRIO Image Correct" ) ;
78
78
//Force making mono directory
@@ -83,22 +83,25 @@ public async Task DeployCode(string teamNumber, SettingsPageGrid page, bool debu
83
83
if ( ! retVal )
84
84
{
85
85
OutputWriter . Instance . WriteLine ( "File deploy failed." ) ;
86
- return ;
86
+ return false ;
87
87
}
88
88
OutputWriter . Instance . WriteLine ( "Successfully Deployed Files. Starting Code." ) ;
89
89
await UploadCode ( codeReturn . RobotExe , page , debug , robotProject ) ;
90
90
OutputWriter . Instance . WriteLine ( "Successfully started robot code." ) ;
91
+ return true ;
91
92
}
92
93
else
93
94
{
94
95
//Failed to connect
95
96
writer . WriteLine ( "Failed to Connect to RoboRIO. Exiting." ) ;
97
+ return false ;
96
98
}
97
99
}
98
100
else
99
101
{
100
102
//Timedout
101
103
writer . WriteLine ( "Failed to Connect to RoboRIO. Exiting." ) ;
104
+ return false ;
102
105
}
103
106
}
104
107
0 commit comments