mirror of
https://github.com/yoboujon/dumber.git
synced 2025-06-08 13:50:49 +02:00
localhost by default, reconnexion ok, panel control ok
This commit is contained in:
parent
57158cfaa7
commit
588ba2ecc9
4 changed files with 12 additions and 4 deletions
|
@ -35,7 +35,7 @@ namespace monitor
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default server name
|
/// Default server name
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const string defaultIP = "10.105.1.13";
|
public const string defaultIP = "localhost";
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Default server port number
|
/// Default server port number
|
||||||
|
|
|
@ -180,11 +180,16 @@ namespace monitor
|
||||||
isBusy = true;
|
isBusy = true;
|
||||||
|
|
||||||
// Send command to server
|
// Send command to server
|
||||||
|
if (timeout > 0) // Command request an acknowledge
|
||||||
|
{
|
||||||
|
waitForAcknowledge = true; // Flag used in OnMessageReception callback to avoid
|
||||||
|
// sending acknowledge message to upper level
|
||||||
|
}
|
||||||
|
|
||||||
Client.Write(cmd);
|
Client.Write(cmd);
|
||||||
|
|
||||||
if (timeout > 0) // Command request an acknowledge
|
if (timeout > 0) // Command request an acknowledge
|
||||||
{
|
{
|
||||||
|
|
||||||
waitForAcknowledge = true; // Flag used in OnMessageReception callback to avoid
|
waitForAcknowledge = true; // Flag used in OnMessageReception callback to avoid
|
||||||
// sending acknowledge message to upper level
|
// sending acknowledge message to upper level
|
||||||
waitTimer.Interval = timeout;
|
waitTimer.Interval = timeout;
|
||||||
|
|
|
@ -111,7 +111,8 @@ namespace monitor
|
||||||
InvalidAnswer,
|
InvalidAnswer,
|
||||||
Busy,
|
Busy,
|
||||||
CommunicationLostWithRobot,
|
CommunicationLostWithRobot,
|
||||||
CommunicationLostWithServer
|
CommunicationLostWithServer,
|
||||||
|
CommunicationError
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct Point {
|
public struct Point {
|
||||||
|
@ -259,6 +260,8 @@ namespace monitor
|
||||||
if (answer.ToUpper().Contains(DestijlCommandList.ANSWER_NACK)) status = CommandStatus.Rejected;
|
if (answer.ToUpper().Contains(DestijlCommandList.ANSWER_NACK)) status = CommandStatus.Rejected;
|
||||||
// if communication is lost with robot, return CommunicationLostWithRobot
|
// if communication is lost with robot, return CommunicationLostWithRobot
|
||||||
else if (answer.ToUpper().Contains(DestijlCommandList.ANSWER_TIMEOUT)) status = CommandStatus.CommunicationLostWithRobot;
|
else if (answer.ToUpper().Contains(DestijlCommandList.ANSWER_TIMEOUT)) status = CommandStatus.CommunicationLostWithRobot;
|
||||||
|
|
||||||
|
else if (answer.ToUpper().Contains(DestijlCommandList.ANSWER_COM_ERROR)) status = CommandStatus.CommunicationError;
|
||||||
// if answer is empty, communication with robot is lost
|
// if answer is empty, communication with robot is lost
|
||||||
else if (answer.Length == 0) status = CommandStatus.CommunicationLostWithServer;
|
else if (answer.Length == 0) status = CommandStatus.CommunicationLostWithServer;
|
||||||
//else status = CommandStatus.InvalidAnswer;
|
//else status = CommandStatus.InvalidAnswer;
|
||||||
|
|
Binary file not shown.
Loading…
Add table
Reference in a new issue