Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drillmotor-Robot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stephen D
Drillmotor-Robot
Commits
596741ad
Commit
596741ad
authored
8 years ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
Implemented disconnect button on Arrow Key version, may not work(Can't test)
parent
baf9b082
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Client Program/Arduino Robot - Arrow Keys/Form1.cs
+16
-4
16 additions, 4 deletions
Client Program/Arduino Robot - Arrow Keys/Form1.cs
with
16 additions
and
4 deletions
Client Program/Arduino Robot - Arrow Keys/Form1.cs
+
16
−
4
View file @
596741ad
...
...
@@ -143,6 +143,7 @@ namespace Arduino_Robot
this
.
Invoke
((
MethodInvoker
)
delegate
{
connectStatus
.
Text
=
"Connecting..."
;
retryConnection
.
Text
=
"Connect"
;
retryConnection
.
Enabled
=
false
;
});
}
...
...
@@ -158,6 +159,8 @@ namespace Arduino_Robot
this
.
Invoke
((
MethodInvoker
)
delegate
{
connectStatus
.
Text
=
"Connected"
;
retryConnection
.
Text
=
"Disconnect"
;
retryConnection
.
Enabled
=
true
;
});
}
catch
...
...
@@ -167,6 +170,7 @@ namespace Arduino_Robot
this
.
Invoke
((
MethodInvoker
)
delegate
{
connectStatus
.
Text
=
"Error connecting"
;
retryConnection
.
Text
=
"Connected"
;
retryConnection
.
Enabled
=
true
;
});
}
...
...
@@ -195,10 +199,18 @@ namespace Arduino_Robot
}
private
void
retryConnection_Click
(
object
sender
,
EventArgs
e
)
{
//Start connection thread
Thread
connector
=
new
Thread
(
new
ThreadStart
(
getConnection
));
connector
.
IsBackground
=
true
;
connector
.
Start
();
if
(
retryConnection
.
Text
=
"Connect"
)
{
//Start connection thread
Thread
connector
=
new
Thread
(
new
ThreadStart
(
getConnection
));
connector
.
IsBackground
=
true
;
connector
.
Start
();
}
else
if
(
retryConnection
.
Text
=
"Disconnect"
)
{
client
.
Close
();
retryConnection
.
Text
=
"Connect"
;
}
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment