diff --git a/.gitignore b/.gitignore index e76c98c..2a5926b 100644 --- a/.gitignore +++ b/.gitignore @@ -62,4 +62,6 @@ GUI # Android *.apk -/software/raspberry/superviseur-robot/superviseur/dist/ \ No newline at end of file +/software/raspberry/superviseur-robot/superviseur/dist/ +/software/raspberry/testeur/testeur/build/ +/software/raspberry/testeur/testeur/dist/ \ No newline at end of file diff --git a/software/monitor/monitor/Client.cs b/software/monitor/monitor/Client.cs new file mode 100644 index 0000000..0f6fe01 --- /dev/null +++ b/software/monitor/monitor/Client.cs @@ -0,0 +1,156 @@ +using System; +using System.Net.Sockets; +using System.Threading; +using System.Text; + +namespace monitor +{ + public class ClientReadEvent + { + private static TcpClient myClient = null; + private static NetworkStream myStream = null; + private const int BufferMaxSize = 512; + private static byte[] buffer = new byte[BufferMaxSize]; + private static StringBuilder sb = new StringBuilder(); + private static int newLength = 1; + + public delegate void ReadEvent(string str); + public static ReadEvent readEvent = null; + + public static void Set(TcpClient client, NetworkStream stream) + { + myClient = client; + myStream = stream; + } + + public static void ReadThread() + { + while (true) + { + if (myClient.Connected) + { + myStream.BeginRead(buffer, 0, newLength, new AsyncCallback(ReadCallback), sb); + } + else Thread.Sleep(200); + } + } + + public static void ReadCallback(IAsyncResult ar) + { + + } + } + + public class Client + { + public const string defaultIP = "localhost"; + public const int defaultPort = 4500; + + private static TcpClient client = null; + private static NetworkStream stream = null; + + private const int BufferMaxSize = 512; + private static byte[] buffer = new byte[BufferMaxSize]; + private static StringBuilder message = new StringBuilder(); + private static int newLength = 1; + + public delegate void ReadEvent(string msg); + public static ReadEvent readEvent = null; + + public Client() + { + } + + public static bool Open(string host) + { + return Client.Open(host, defaultPort); + } + + public static bool Open(string host, int port) + { + bool status = true; + + try + { + client = new TcpClient(host, port); + + stream = client.GetStream(); + + stream.BeginRead(buffer, 0, newLength, new AsyncCallback(ReadCallback), message); + } + catch (ArgumentNullException e) + { + Console.WriteLine("ArgumentNullException: " + e); + status = false; + } + catch (SocketException e) + { + Console.WriteLine("SocketException: " + e.ToString()); + status = false; + } + catch (Exception e) + { + Console.WriteLine("Unknown Exception: " + e.ToString()); + status = false; + } + + return status; + } + + public static void Close() + { + if (stream!=null) stream.Close(); + if (client!=null) client.Close(); + } + + private static void ReadCallback(IAsyncResult ar) + { + if (client.Connected) + { + int bytesRead; + + try + { + bytesRead = stream.EndRead(ar); + } + catch (ObjectDisposedException e) + { + Console.WriteLine("Connection to server dropped: " + e.ToString()); + return; + } + + newLength = 1; + + if (bytesRead > 0) + { + message.Append(Encoding.ASCII.GetString(buffer, 0, bytesRead)); + } + + if (client.Available > 0) + { + newLength = client.Available; + if (newLength > BufferMaxSize) newLength = BufferMaxSize; + else newLength = client.Available; + } + else + { + readEvent?.Invoke(message.ToString()); + + message.Clear(); + } + + stream.BeginRead(buffer, 0, newLength, new AsyncCallback(ReadCallback), message); + } + } + + public static void Write(string mes) + { + if (client.Connected) + { + byte[] writeBuffer = Encoding.UTF8.GetBytes(mes); + + stream.Write(writeBuffer, 0, mes.Length); + } + } + } +} diff --git a/software/monitor/monitor/CommandManager.cs b/software/monitor/monitor/CommandManager.cs new file mode 100644 index 0000000..3a02bd8 --- /dev/null +++ b/software/monitor/monitor/CommandManager.cs @@ -0,0 +1,110 @@ +using System.Threading; + +namespace monitor +{ + public class CommandManager + { + public delegate void CommandReceivedEvent(string msg); + public CommandReceivedEvent commandReceivedEvent = null; + + private System.Timers.Timer waitTimer = new System.Timers.Timer(); + private ManualResetEvent waitEvent = new ManualResetEvent(false); + + private bool waitForAcknowledge = false; + + private string messageReceived = null; + private bool isBusy = false; + + public enum CommandManagerStatus + { + AnswerReceived, + Timeout, + Busy + }; + + public CommandManager(CommandReceivedEvent callback) + { + Client.readEvent += this.OnMessageReception; + + this.commandReceivedEvent += callback; + waitTimer.Elapsed += OnMessageTimeout; + } + + ~CommandManager() + { + Client.Close(); + } + + public bool Open(string hostname) + { + return this.Open(hostname, Client.defaultPort); + } + + public bool Open(string hostname, int port) + { + return Client.Open(hostname, port); + } + + public void Close() + { + Client.Close(); + } + + private void OnMessageReception(string message) + { + waitTimer.Stop(); + this.messageReceived = message; + isBusy = false; + + if (waitForAcknowledge) { + waitForAcknowledge = false; + waitEvent.Set(); // Envoi de l'evenement + } + else { + waitForAcknowledge = false; + this.commandReceivedEvent?.Invoke(message); + } + } + + private void OnMessageTimeout(object sender, System.Timers.ElapsedEventArgs e) + { + messageReceived = null; + OnMessageReception(messageReceived); + } + + public CommandManagerStatus SendCommand(string cmd, out string answer, double timeout) + { + CommandManagerStatus status = CommandManagerStatus.AnswerReceived; + answer = null; + + if (isBusy) status = CommandManagerStatus.Busy; + else + { + isBusy = true; + + Client.Write(cmd); + + if (timeout > 0) // la commande attend un acquitement + { + waitForAcknowledge = true; + waitTimer.Interval = timeout; + waitTimer.Start(); + + waitEvent.WaitOne(); + waitEvent.Reset(); // remise à zero pour une prochaine commande + + if (this.messageReceived == null) // timeout: connection au serveur defectueuse + { + status = CommandManagerStatus.Timeout; + } + } + else isBusy = false; + + answer = this.messageReceived; + this.messageReceived = null; + } + + return status; + } + } +} diff --git a/software/monitor/monitor/DestijlCommandManager.cs b/software/monitor/monitor/DestijlCommandManager.cs new file mode 100644 index 0000000..cfdb8c8 --- /dev/null +++ b/software/monitor/monitor/DestijlCommandManager.cs @@ -0,0 +1,420 @@ +using System; + +namespace monitor +{ + public class DestijlCommandList + { + public const string HeaderMtsComDmb = "COM"; + public const string HeaderMtsDmbOrder = "DMB"; + public const string HeaderMtsCamera = "CAM"; + public const string HeaderMtsMessage = "MSG"; + + public const string DataComOpen = "o"; + public const string DataComClose = "C"; + + public const string DataCamOpen = "A"; + public const string DataCamClose = "I"; + public const string DataCamAskArena = "y"; + public const string DataCamArenaConfirm = "x"; + public const string DataCamInfirm = "z"; + public const string DataCamComputePosition = "p"; + public const string DataCamStopComputePosition = "s"; + + public const string HeaderStmAck = "ACK"; + public const string HeaderStmNoAck = "NAK"; + public const string HeaderStmLostDmb = "LCD"; + public const string HeaderStmImage = "IMG"; + public const string HeaderStmPos = "POS"; + public const string HeaderStmMes = "MSG"; + public const string HeaderStmBat = "BAT"; + } + + public class RobotCommandList + { + public const string RobotPing = "p"; + public const string RobotReset = "r"; + public const string RobotStartWithoutWatchdog = "u"; + public const string RobotStartWithWatchdog = "W"; + public const string RobotGetBattery = "v"; + public const string RobotGetBusyState = "b"; + public const string RobotMove = "M"; + public const string RobotTurn = "T"; + public const string RobotGetVersion = "V"; + public const string RobotPowerOff = "z"; + } + + public class DestijlCommandManager + { + private CommandManager commandManager = null; + + private string receivedHeader = null; + private string receivedData = null; + + public delegate void CommandReceivedEvent(string header, string data); + public CommandReceivedEvent commandReceivedEvent = null; + + public double timeout = 100; // timeout pour les commandes avec acquitement + + public enum CommandStatus + { + Success, + Rejected, + InvalidAnswer, + Busy, + CommunicationLostWithRobot, + CommunicationLostWithServer + } + + public DestijlCommandManager(CommandReceivedEvent callback) + { + commandManager = new CommandManager(OnCommandReceived); + this.commandReceivedEvent += callback; + } + + ~DestijlCommandManager() + { + if (commandManager != null) commandManager.Close(); + } + + private void OnCommandReceived(string msg) + { + string[] msgs = msg.Split(':'); + + if (msgs.Length >= 1) receivedHeader = msgs[0]; + else receivedHeader = null; + + if (msgs.Length >= 2) receivedData = msgs[1]; + else receivedData = null; + + this.commandReceivedEvent?.Invoke(receivedHeader, receivedData); + } + + public bool Open(string hostname) + { + return this.Open(hostname, Client.defaultPort); + } + + public bool Open(string hostname, int port) + { + if (commandManager != null) return commandManager.Open(hostname, port); + else return false; + } + + public void Close() + { + if (commandManager != null) commandManager.Close(); + } + + private string CreateCommand(string header, string data) + { + return header + ":" + data; + } + + private void SplitCommand(string cmd, out string header, out string data) + { + string[] cmdParts = cmd.Split(':'); + + if (cmdParts.Length > 0) header = cmdParts[0]; + else header = null; + + if (cmdParts.Length > 1) data = cmdParts[1]; + else data = null; + } + + private CommandStatus DecodeStatus(CommandManager.CommandManagerStatus localStatus, string answer) + { + CommandStatus status = CommandStatus.Success; + + if (localStatus == CommandManager.CommandManagerStatus.Timeout) status = CommandStatus.CommunicationLostWithServer; + else if (localStatus == CommandManager.CommandManagerStatus.Busy) status = CommandStatus.Busy; + else + { + if (answer != null) + { + if (answer.ToUpper().Contains(DestijlCommandList.HeaderStmNoAck)) status = CommandStatus.Rejected; + else if (answer.ToUpper().Contains(DestijlCommandList.HeaderStmLostDmb)) status = CommandStatus.CommunicationLostWithRobot; + else if (answer.ToUpper().Contains(DestijlCommandList.HeaderStmAck)) status = CommandStatus.Success; + else if (answer.Length == 0) status = CommandStatus.CommunicationLostWithServer; + else status = CommandStatus.InvalidAnswer; + } + } + + return status; + } + + public CommandStatus RobotOpenCom() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsComDmb, DestijlCommandList.DataComOpen), + out answer, + this.timeout); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotCloseCom() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsComDmb, DestijlCommandList.DataComClose), + out answer, + this.timeout); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotPing() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotPing), + out answer, + this.timeout); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotReset() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotReset), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotStartWithWatchdog() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotStartWithWatchdog), + out answer, + this.timeout); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotStartWithoutWatchdog() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotStartWithoutWatchdog), + out answer, + this.timeout); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotMove(int distance) + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotMove + "=" + distance), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotTurn(int angle) + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotTurn + "=" + angle), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + //public CommandStatus RobotGetBattery(out int battery) + public CommandStatus RobotGetBattery() + { + CommandManager.CommandManagerStatus localStatus; + //CommandStatus status = CommandStatus.Success; + + //battery = -1; + + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotGetBattery), + out answer, + 0); + + //if (localStatus == CommandManager.CommandManagerStatus.AnswerReceived) { + // string[] msg = answer.Split(':'); + + // if (msg.Length > 1) + // { + // try + // { + // battery = Convert.ToInt32(msg[1]); + // } + // catch (Exception) { } + // } + //} + //else if (localStatus == CommandManager.CommandManagerStatus.Timeout) + //{ + // status = CommandStatus.CommunicationLostWithServer; + //} + + //return status; + return DecodeStatus(localStatus, answer); + } + + public CommandStatus RobotGetVersion(out string version) + { + CommandManager.CommandManagerStatus localStatus; + CommandStatus status = CommandStatus.Success; + + version = ""; + + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotGetVersion), + out answer, + this.timeout); + + if (localStatus == CommandManager.CommandManagerStatus.AnswerReceived) + { + string[] msg = answer.Split(':'); + + if (msg.Length > 1) + { + version = msg[1]; + } + } + else if (localStatus == CommandManager.CommandManagerStatus.Timeout) + { + status = CommandStatus.CommunicationLostWithServer; + } + + return status; + } + + public CommandStatus RobotPowerOff() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsDmbOrder, RobotCommandList.RobotPowerOff), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus CameraOpen() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsCamera, DestijlCommandList.DataCamOpen), + out answer, + this.timeout); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus CameraClose() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsCamera, DestijlCommandList.DataCamClose), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus CameraAskArena() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsCamera, DestijlCommandList.DataCamAskArena), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus CameraArenaConfirm() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsCamera, DestijlCommandList.DataCamArenaConfirm), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus CameraArenaInfirm() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsCamera, DestijlCommandList.DataCamInfirm), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus CameraComputePosition() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsCamera, DestijlCommandList.DataCamComputePosition), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + + public CommandStatus CameraStopComputePosition() + { + CommandManager.CommandManagerStatus localStatus; + string answer; + + localStatus = commandManager.SendCommand( + CreateCommand(DestijlCommandList.HeaderMtsCamera, DestijlCommandList.DataCamStopComputePosition), + out answer, + 0); + + return DecodeStatus(localStatus, answer); + } + } +} diff --git a/software/monitor/monitor/MonitorUI.cs b/software/monitor/monitor/MonitorUI.cs index 8aad94d..09e7a3a 100644 --- a/software/monitor/monitor/MonitorUI.cs +++ b/software/monitor/monitor/MonitorUI.cs @@ -1,16 +1,452 @@ using System; using Gtk; +using Gdk; + +using monitor; public partial class MainWindow : Gtk.Window { + private DestijlCommandManager cmdManager; + private Pixbuf drawingareaCameraPixbuf; + + enum SystemState + { + NotConnected, + ServerConnected, + RobotConnected + }; + + private SystemState systemState = SystemState.NotConnected; + private System.Timers.Timer batteryTimer; + public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); + + cmdManager = new DestijlCommandManager(OnCommandReceivedEvent); + + batteryTimer = new System.Timers.Timer(10000.0); + batteryTimer.Elapsed += OnBatteryTimerElapsed; + + AdjustControls(); + } + + public void AdjustControls() + { + ChangeState(SystemState.NotConnected); + + drawingareaCameraPixbuf = new Pixbuf((string)null); + drawingareaCameraPixbuf = Pixbuf.LoadFromResource("monitor.ressources.missing_picture.png"); + + entryServerName.Text = Client.defaultIP; + entryServerPort.Text = Client.defaultPort.ToString(); + entryTimeout.Text = "10000"; + } + + private void ChangeState(SystemState newState) + { + switch (newState) + { + case SystemState.NotConnected: + labelRobot.Sensitive = false; + gtkAlignmentRobot.Sensitive = false; + + labelRobotControl.Sensitive = false; + gtkAlignmentRobotControl.Sensitive = false; + boxCamera.Sensitive = false; + + buttonServerConnection.Label = "Connect"; + buttonRobotActivation.Label = "Activate"; + labelBatteryLevel.Text = "Unknown"; + + checkButtonCameraOn.Active = false; + checkButtonRobotPosition.Active = false; + if (cmdManager != null) cmdManager.Close(); + + batteryTimer.Stop(); + break; + case SystemState.ServerConnected: + buttonServerConnection.Label = "Disconnect"; + buttonRobotActivation.Label = "Activate"; + labelBatteryLevel.Text = "Unknown"; + + labelRobot.Sensitive = true; + gtkAlignmentRobot.Sensitive = true; + boxCamera.Sensitive = true; + + labelRobotControl.Sensitive = false; + gtkAlignmentRobotControl.Sensitive = false; + + batteryTimer.Stop(); + break; + case SystemState.RobotConnected: + buttonRobotActivation.Label = "Reset"; + labelRobotControl.Sensitive = true; + gtkAlignmentRobotControl.Sensitive = true; + + batteryTimer.Start(); + break; + default: + labelRobot.Sensitive = false; + gtkAlignmentRobot.Sensitive = false; + + labelRobotControl.Sensitive = false; + gtkAlignmentRobotControl.Sensitive = false; + boxCamera.Sensitive = false; + + buttonServerConnection.Label = "Connect"; + buttonRobotActivation.Label = "Activate"; + labelBatteryLevel.Text = "Unknown"; + + checkButtonCameraOn.Active = false; + checkButtonRobotPosition.Active = false; + + systemState = SystemState.NotConnected; + + return; + } + + systemState = newState; + } + + private void MessagePopup(MessageType type, ButtonsType buttons, string title, string message) + { + MessageDialog md = new MessageDialog(this, DialogFlags.DestroyWithParent, type, buttons, message) + { + Title = title + }; + + md.Run(); + md.Destroy(); } protected void OnDeleteEvent(object sender, DeleteEventArgs a) { + Console.WriteLine("Bye bye"); + + if (cmdManager != null) cmdManager.Close(); Application.Quit(); a.RetVal = true; } + + public void OnCommandReceivedEvent(string header, string data) + { + if (header != null) Console.WriteLine("Received header (" + header.Length + "): " + header); + if (data != null) Console.WriteLine("Received data (" + data.Length + "): " + data); + + if (header.ToUpper() == DestijlCommandList.HeaderStmBat) + { + switch (data[0]) + { + case '2': + labelBatteryLevel.Text = "High"; + break; + case '1': + labelBatteryLevel.Text = "Low"; + break; + case '0': + labelBatteryLevel.Text = "Empty"; + break; + default: + labelBatteryLevel.Text = "Invalid value"; + break; + } + } + } + + protected void OnQuitActionActivated(object sender, EventArgs e) + { + Console.WriteLine("Bye bye 2"); + if (cmdManager != null) cmdManager.Close(); + this.Destroy(); + Application.Quit(); + } + + protected void OnShowLogWindowActionActivated(object sender, EventArgs e) + { + MessagePopup(MessageType.Info, + ButtonsType.Ok, "Info", + "Logger not yet implemented"); + } + + protected void OnButtonServerConnectionClicked(object sender, EventArgs e) + { + DestijlCommandManager.CommandStatus statusCmd; + + if (buttonServerConnection.Label == "Disconnect") + { + ChangeState(SystemState.NotConnected); + } + else + { + if ((entryServerName.Text == "") || (entryServerPort.Text == "")) + { + MessagePopup(MessageType.Error, + ButtonsType.Ok, "Error", + "Server name or port is invalid"); + } + else + { + Console.WriteLine("Connecting to " + entryServerName.Text + ":" + entryServerPort.Text); + bool status = false; + + try + { + cmdManager.timeout = Convert.ToDouble(entryTimeout.Text); + } + catch (Exception) + { + cmdManager.timeout = 100; + entryTimeout.Text = cmdManager.timeout.ToString(); + } + + try + { + status = cmdManager.Open(entryServerName.Text, Convert.ToInt32(entryServerPort.Text)); + } + catch (Exception) + { + Console.WriteLine("Something went wrong during connection"); + return; + } + + if (status != true) + { + MessagePopup(MessageType.Error, + ButtonsType.Ok, "Error", + "Unable to connect to server " + entryServerName.Text + ":" + Convert.ToInt32(entryServerPort.Text)); + } + else + { + Console.Write("Send command RobotOpenCom: "); + statusCmd = cmdManager.RobotOpenCom(); + Console.WriteLine(statusCmd.ToString()); + + if (statusCmd == DestijlCommandManager.CommandStatus.Success) + { + ChangeState(SystemState.ServerConnected); + } + else + { + MessagePopup(MessageType.Error, + ButtonsType.Ok, "Error", + "Unable to open communication with robot.\nCheck that supervisor is accepting OPEN_COM_DMB command"); + + cmdManager.Close(); + } + } + } + } + } + + protected void OnButtonRobotActivationClicked(object sender, EventArgs e) + { + DestijlCommandManager.CommandStatus status; + + if (buttonRobotActivation.Label == "Activate") // activation du robot + { + if (radioButtonWithWatchdog.Active) // Demarrage avec watchdog + { + status = cmdManager.RobotStartWithWatchdog(); + } + else // Demarrage sans watchdog + { + status = cmdManager.RobotStartWithoutWatchdog(); + } + + if (status == DestijlCommandManager.CommandStatus.Success) + { + ChangeState(SystemState.RobotConnected); + } + else + { + if (status == DestijlCommandManager.CommandStatus.CommunicationLostWithServer) + { + MessagePopup(MessageType.Error, ButtonsType.Ok, "Error", "Connection lost with server"); + ChangeState(SystemState.NotConnected); + } + else + { + MessagePopup(MessageType.Error, ButtonsType.Ok, "Error", "Command rejected\nCheck that supervisor accept \nDMB_START_WITH_WD and/or DMB_START_WITHOUT_WD"); + } + } + } + else // Reset du robot + { + status = cmdManager.RobotReset(); + + if (status == DestijlCommandManager.CommandStatus.Success) + { + ChangeState(SystemState.ServerConnected); + } + else + { + if (status == DestijlCommandManager.CommandStatus.CommunicationLostWithServer) + { + MessagePopup(MessageType.Error, ButtonsType.Ok, "Error", "Connection lost with server"); + ChangeState(SystemState.NotConnected); + } + else + { + MessagePopup(MessageType.Error, ButtonsType.Ok, "Error", "Unknown error"); + } + } + } + } + + protected void OnButtonMouvClicked(object sender, EventArgs e) + { + if (sender == buttonRight) + { + cmdManager.RobotTurn(90); + + } + else if (sender == buttonLeft) + { + cmdManager.RobotTurn(-90); + } + else if (sender == buttonForward) + { + cmdManager.RobotMove(100); + } + else if (sender == buttonDown) + { + cmdManager.RobotMove(-100); + } + else + { + MessagePopup(MessageType.Warning, ButtonsType.Ok, "Abnormal behavior", "Callback OnButtonMouvClicked called by unknown sender"); + } + } + + void OnBatteryTimerElapsed(object sender, System.Timers.ElapsedEventArgs e) + { + DestijlCommandManager.CommandStatus status; + //int batteryLevel; + + batteryTimer.Stop(); + + if (checkButtonGetBattery.Active) + { + //status = cmdManager.RobotGetBattery(out batteryLevel); + status = cmdManager.RobotGetBattery(); + switch (status) + { + case DestijlCommandManager.CommandStatus.Success: + /*switch (batteryLevel) + { + case 2: + labelBatteryLevel.Text = "High"; + break; + case 1: + labelBatteryLevel.Text = "Low"; + break; + case 0: + labelBatteryLevel.Text = "Empty"; + break; + default: + labelBatteryLevel.Text = "Unknown"; + break; + }*/ + + batteryTimer.Start(); + break; + case DestijlCommandManager.CommandStatus.CommunicationLostWithServer: + //MessagePopup(MessageType.Error, ButtonsType.Ok, "Error", "Connection lost with server"); + Console.WriteLine("Error: Connection lost with server"); + batteryTimer.Stop(); + labelBatteryLevel.Text = "Unknown"; + + ChangeState(SystemState.NotConnected); + break; + case DestijlCommandManager.CommandStatus.CommunicationLostWithRobot: + //MessagePopup(MessageType.Error, ButtonsType.Ok, "Error", "Connection lost with robot"); + Console.WriteLine("Error: Connection lost with robot"); + batteryTimer.Stop(); + labelBatteryLevel.Text = "Unknown"; + + ChangeState(SystemState.ServerConnected); + break; + default: + labelBatteryLevel.Text = "Unknown"; + batteryTimer.Start(); + break; + } + } + else batteryTimer.Start(); + } + + protected void OnCheckButtonCameraOnClicked(object sender, EventArgs e) + { + if (!checkButtonCameraOn.Active) + { + if (cmdManager.CameraClose() != DestijlCommandManager.CommandStatus.Success) + { + MessagePopup(MessageType.Error, + ButtonsType.Ok, "Error", + "Error when closing camera: bad answer for supervisor or timeout"); + } + } + else + { + if (cmdManager.CameraOpen() != DestijlCommandManager.CommandStatus.Success) + { + MessagePopup(MessageType.Error, + ButtonsType.Ok, "Error", + "Error when opening camera: bad answer for supervisor or timeout"); + checkButtonCameraOn.Active = false; + } + } + } + + protected void OnCheckButtonRobotPositionClicked(object sender, EventArgs e) + { + if (!checkButtonRobotPosition.Active) + { + if (cmdManager.CameraStopComputePosition() != DestijlCommandManager.CommandStatus.Success) + { + MessagePopup(MessageType.Error, + ButtonsType.Ok, "Error", + "Error when stopping position reception: bad answer for supervisor or timeout"); + } + } + else + { + if (cmdManager.CameraComputePosition() != DestijlCommandManager.CommandStatus.Success) + { + MessagePopup(MessageType.Error, + ButtonsType.Ok, "Error", + "Error when starting getting robot position: bad answer for supervisor or timeout"); + + checkButtonRobotPosition.Active = false; + } + } + } + + protected void OnDrawingAreaCameraRealized(object sender, EventArgs e) + { + Console.WriteLine("Event realized. Args = " + e.ToString()); + } + + protected void OnDrawingAreaCameraExposeEvent(object o, ExposeEventArgs args) + { + //Console.WriteLine("Event expose. Args = " + args.ToString()); + + DrawingArea area = (DrawingArea)o; + Gdk.GC gc = area.Style.BackgroundGC(Gtk.StateType.Normal); + + area.GdkWindow.GetSize(out int areaWidth, out int areaHeight); + + area.GdkWindow.DrawPixbuf(gc, drawingareaCameraPixbuf, + 0, 0, + (areaWidth - drawingareaCameraPixbuf.Width) / 2, + (areaHeight - drawingareaCameraPixbuf.Height) / 2, + drawingareaCameraPixbuf.Width, drawingareaCameraPixbuf.Height, + RgbDither.Normal, 0, 0); + } + + protected void OnDrawingAreaCameraConfigureEvent(object o, ConfigureEventArgs args) + { + //Console.WriteLine("Event configure. Args = " + args.ToString()); + } } diff --git a/software/monitor/monitor/gtk-gui/MainWindow.cs b/software/monitor/monitor/gtk-gui/MainWindow.cs index 2397dbf..8200e46 100644 --- a/software/monitor/monitor/gtk-gui/MainWindow.cs +++ b/software/monitor/monitor/gtk-gui/MainWindow.cs @@ -5,27 +5,119 @@ public partial class MainWindow { private global::Gtk.UIManager UIManager; + private global::Gtk.Action FileAction; + + private global::Gtk.Action QuitAction; + + private global::Gtk.Action LogAction; + + private global::Gtk.Action ShowLogWindowAction; + private global::Gtk.VBox vbox1; - private global::Gtk.MenuBar menubar1; + private global::Gtk.MenuBar menuBar; private global::Gtk.HBox hbox1; - private global::Gtk.DrawingArea drawingarea1; + private global::Gtk.VBox boxCamera; + + private global::Gtk.DrawingArea drawingAreaCamera; private global::Gtk.Alignment alignment1; - private global::Gtk.ScrolledWindow GtkScrolledWindow; + private global::Gtk.HBox hbox2; - private global::Gtk.Frame frame1; + private global::Gtk.CheckButton checkButtonCameraOn; - private global::Gtk.Fixed fixed4; + private global::Gtk.CheckButton checkButtonRobotPosition; - private global::Gtk.Button button7; + private global::Gtk.HBox hbox3; - private global::Gtk.Label GtkLabel2; + private global::Gtk.VSeparator vseparator1; - private global::Gtk.Statusbar statusbar1; + private global::Gtk.Alignment alignment3; + + private global::Gtk.VBox vbox5; + + private global::Gtk.VBox vbox10; + + private global::Gtk.Label labelServer; + + private global::Gtk.Alignment gtkAlignmentServer; + + private global::Gtk.VBox vbox6; + + private global::Gtk.Table table1; + + private global::Gtk.Entry entryServerName; + + private global::Gtk.Entry entryServerPort; + + private global::Gtk.Entry entryTimeout; + + private global::Gtk.Label label1; + + private global::Gtk.Label label2; + + private global::Gtk.Label label5; + + private global::Gtk.Button buttonServerConnection; + + private global::Gtk.HSeparator hseparator1; + + private global::Gtk.VBox vbox11; + + private global::Gtk.Label labelRobot; + + private global::Gtk.Alignment alignment9; + + private global::Gtk.Alignment gtkAlignmentRobot; + + private global::Gtk.VBox vbox8; + + private global::Gtk.Alignment alignment6; + + private global::Gtk.HBox hbox4; + + private global::Gtk.RadioButton radioButtonWithWatchdog; + + private global::Gtk.RadioButton radioButtonWithoutWatchdog; + + private global::Gtk.Alignment alignment5; + + private global::Gtk.Alignment alignment7; + + private global::Gtk.Button buttonRobotActivation; + + private global::Gtk.HSeparator hseparator2; + + private global::Gtk.VBox vbox12; + + private global::Gtk.Label labelRobotControl; + + private global::Gtk.Alignment gtkAlignmentRobotControl; + + private global::Gtk.VBox vbox9; + + private global::Gtk.Alignment alignment8; + + private global::Gtk.Table table4; + + private global::Gtk.Button buttonDown; + + private global::Gtk.Button buttonForward; + + private global::Gtk.Button buttonLeft; + + private global::Gtk.Button buttonRight; + + private global::Gtk.Table table3; + + private global::Gtk.Label label3; + + private global::Gtk.Label labelBatteryLevel; + + private global::Gtk.CheckButton checkButtonGetBattery; protected virtual void Build() { @@ -33,21 +125,37 @@ public partial class MainWindow // Widget MainWindow this.UIManager = new global::Gtk.UIManager(); global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup("Default"); + this.FileAction = new global::Gtk.Action("FileAction", global::Mono.Unix.Catalog.GetString("File"), null, null); + this.FileAction.IsImportant = true; + this.FileAction.ShortLabel = global::Mono.Unix.Catalog.GetString("File"); + w1.Add(this.FileAction, null); + this.QuitAction = new global::Gtk.Action("QuitAction", global::Mono.Unix.Catalog.GetString("Quit..."), null, null); + this.QuitAction.IsImportant = true; + this.QuitAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Quit"); + w1.Add(this.QuitAction, "q"); + this.LogAction = new global::Gtk.Action("LogAction", global::Mono.Unix.Catalog.GetString("Log"), null, null); + this.LogAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Log"); + w1.Add(this.LogAction, null); + this.ShowLogWindowAction = new global::Gtk.Action("ShowLogWindowAction", global::Mono.Unix.Catalog.GetString("Show log window"), null, null); + this.ShowLogWindowAction.ShortLabel = global::Mono.Unix.Catalog.GetString("Show log window"); + w1.Add(this.ShowLogWindowAction, "s"); this.UIManager.InsertActionGroup(w1, 0); this.AddAccelGroup(this.UIManager.AccelGroup); this.Name = "MainWindow"; this.Title = global::Mono.Unix.Catalog.GetString("Monitor UI"); + this.Icon = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.robot-icon.resized.png"); this.WindowPosition = ((global::Gtk.WindowPosition)(4)); + this.BorderWidth = ((uint)(5)); // Container child MainWindow.Gtk.Container+ContainerChild this.vbox1 = new global::Gtk.VBox(); this.vbox1.Name = "vbox1"; this.vbox1.Spacing = 6; // Container child vbox1.Gtk.Box+BoxChild - this.UIManager.AddUiFromString(""); - this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1"))); - this.menubar1.Name = "menubar1"; - this.vbox1.Add(this.menubar1); - global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.menubar1])); + this.UIManager.AddUiFromString(@""); + this.menuBar = ((global::Gtk.MenuBar)(this.UIManager.GetWidget("/menuBar"))); + this.menuBar.Name = "menuBar"; + this.vbox1.Add(this.menuBar); + global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.menuBar])); w2.Position = 0; w2.Expand = false; w2.Fill = false; @@ -56,71 +164,486 @@ public partial class MainWindow this.hbox1.Name = "hbox1"; this.hbox1.Spacing = 6; // Container child hbox1.Gtk.Box+BoxChild - this.drawingarea1 = new global::Gtk.DrawingArea(); - this.drawingarea1.Name = "drawingarea1"; - this.hbox1.Add(this.drawingarea1); - global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.drawingarea1])); + this.boxCamera = new global::Gtk.VBox(); + this.boxCamera.Name = "boxCamera"; + this.boxCamera.Spacing = 6; + // Container child boxCamera.Gtk.Box+BoxChild + this.drawingAreaCamera = new global::Gtk.DrawingArea(); + this.drawingAreaCamera.Name = "drawingAreaCamera"; + this.boxCamera.Add(this.drawingAreaCamera); + global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.boxCamera[this.drawingAreaCamera])); w3.Position = 0; - // Container child hbox1.Gtk.Box+BoxChild - this.alignment1 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F); + // Container child boxCamera.Gtk.Box+BoxChild + this.alignment1 = new global::Gtk.Alignment(0F, 0.5F, 0F, 1F); this.alignment1.Name = "alignment1"; + this.alignment1.BorderWidth = ((uint)(6)); // Container child alignment1.Gtk.Container+ContainerChild - this.GtkScrolledWindow = new global::Gtk.ScrolledWindow(); - this.GtkScrolledWindow.Name = "GtkScrolledWindow"; - this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1)); - // Container child GtkScrolledWindow.Gtk.Container+ContainerChild - global::Gtk.Viewport w4 = new global::Gtk.Viewport(); - w4.ShadowType = ((global::Gtk.ShadowType)(0)); - // Container child GtkViewport.Gtk.Container+ContainerChild - this.frame1 = new global::Gtk.Frame(); - this.frame1.Name = "frame1"; - this.frame1.ShadowType = ((global::Gtk.ShadowType)(0)); - // Container child frame1.Gtk.Container+ContainerChild - this.fixed4 = new global::Gtk.Fixed(); - this.fixed4.Name = "fixed4"; - this.fixed4.HasWindow = false; - // Container child fixed4.Gtk.Fixed+FixedChild - this.button7 = new global::Gtk.Button(); - this.button7.CanFocus = true; - this.button7.Name = "button7"; - this.button7.UseUnderline = true; - this.button7.Label = global::Mono.Unix.Catalog.GetString("GtkButton"); - this.fixed4.Add(this.button7); - global::Gtk.Fixed.FixedChild w5 = ((global::Gtk.Fixed.FixedChild)(this.fixed4[this.button7])); - w5.X = 30; - w5.Y = 25; - this.frame1.Add(this.fixed4); - this.GtkLabel2 = new global::Gtk.Label(); - this.GtkLabel2.Name = "GtkLabel2"; - this.GtkLabel2.LabelProp = global::Mono.Unix.Catalog.GetString("Controls"); - this.GtkLabel2.UseMarkup = true; - this.frame1.LabelWidget = this.GtkLabel2; - w4.Add(this.frame1); - this.GtkScrolledWindow.Add(w4); - this.alignment1.Add(this.GtkScrolledWindow); - this.hbox1.Add(this.alignment1); - global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.alignment1])); - w10.Position = 1; + this.hbox2 = new global::Gtk.HBox(); + this.hbox2.Name = "hbox2"; + this.hbox2.Spacing = 6; + // Container child hbox2.Gtk.Box+BoxChild + this.checkButtonCameraOn = new global::Gtk.CheckButton(); + this.checkButtonCameraOn.CanFocus = true; + this.checkButtonCameraOn.Name = "checkButtonCameraOn"; + this.checkButtonCameraOn.Label = global::Mono.Unix.Catalog.GetString("Camera On"); + this.checkButtonCameraOn.DrawIndicator = true; + this.checkButtonCameraOn.UseUnderline = true; + this.hbox2.Add(this.checkButtonCameraOn); + global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.checkButtonCameraOn])); + w4.Position = 0; + // Container child hbox2.Gtk.Box+BoxChild + this.checkButtonRobotPosition = new global::Gtk.CheckButton(); + this.checkButtonRobotPosition.CanFocus = true; + this.checkButtonRobotPosition.Name = "checkButtonRobotPosition"; + this.checkButtonRobotPosition.Label = global::Mono.Unix.Catalog.GetString("Robot Position"); + this.checkButtonRobotPosition.DrawIndicator = true; + this.checkButtonRobotPosition.UseUnderline = true; + this.hbox2.Add(this.checkButtonRobotPosition); + global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.checkButtonRobotPosition])); + w5.Position = 1; + this.alignment1.Add(this.hbox2); + this.boxCamera.Add(this.alignment1); + global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.boxCamera[this.alignment1])); + w7.Position = 1; + w7.Expand = false; + w7.Fill = false; + this.hbox1.Add(this.boxCamera); + global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.boxCamera])); + w8.Position = 0; + // Container child hbox1.Gtk.Box+BoxChild + this.hbox3 = new global::Gtk.HBox(); + this.hbox3.Name = "hbox3"; + this.hbox3.Spacing = 6; + // Container child hbox3.Gtk.Box+BoxChild + this.vseparator1 = new global::Gtk.VSeparator(); + this.vseparator1.Name = "vseparator1"; + this.hbox3.Add(this.vseparator1); + global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.vseparator1])); + w9.Position = 0; + w9.Expand = false; + w9.Fill = false; + // Container child hbox3.Gtk.Box+BoxChild + this.alignment3 = new global::Gtk.Alignment(1F, 0F, 0F, 0F); + this.alignment3.Name = "alignment3"; + this.alignment3.BorderWidth = ((uint)(4)); + // Container child alignment3.Gtk.Container+ContainerChild + this.vbox5 = new global::Gtk.VBox(); + this.vbox5.Name = "vbox5"; + this.vbox5.Spacing = 6; + // Container child vbox5.Gtk.Box+BoxChild + this.vbox10 = new global::Gtk.VBox(); + this.vbox10.Name = "vbox10"; + this.vbox10.Spacing = 6; + // Container child vbox10.Gtk.Box+BoxChild + this.labelServer = new global::Gtk.Label(); + this.labelServer.HeightRequest = 36; + this.labelServer.Name = "labelServer"; + this.labelServer.LabelProp = global::Mono.Unix.Catalog.GetString("Server connection"); + this.labelServer.UseMarkup = true; + this.vbox10.Add(this.labelServer); + global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox10[this.labelServer])); + w10.Position = 0; + w10.Expand = false; + w10.Fill = false; + // Container child vbox10.Gtk.Box+BoxChild + this.gtkAlignmentServer = new global::Gtk.Alignment(0F, 0F, 1F, 1F); + this.gtkAlignmentServer.Name = "gtkAlignmentServer"; + this.gtkAlignmentServer.LeftPadding = ((uint)(12)); + // Container child gtkAlignmentServer.Gtk.Container+ContainerChild + this.vbox6 = new global::Gtk.VBox(); + this.vbox6.Name = "vbox6"; + this.vbox6.Spacing = 6; + // Container child vbox6.Gtk.Box+BoxChild + this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false); + this.table1.Name = "table1"; + this.table1.RowSpacing = ((uint)(6)); + this.table1.ColumnSpacing = ((uint)(6)); + // Container child table1.Gtk.Table+TableChild + this.entryServerName = new global::Gtk.Entry(); + this.entryServerName.CanFocus = true; + this.entryServerName.Name = "entryServerName"; + this.entryServerName.IsEditable = true; + this.entryServerName.InvisibleChar = '●'; + this.table1.Add(this.entryServerName); + global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.entryServerName])); + w11.LeftAttach = ((uint)(1)); + w11.RightAttach = ((uint)(2)); + w11.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild + this.entryServerPort = new global::Gtk.Entry(); + this.entryServerPort.CanFocus = true; + this.entryServerPort.Name = "entryServerPort"; + this.entryServerPort.IsEditable = true; + this.entryServerPort.InvisibleChar = '●'; + this.table1.Add(this.entryServerPort); + global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.entryServerPort])); + w12.TopAttach = ((uint)(1)); + w12.BottomAttach = ((uint)(2)); + w12.LeftAttach = ((uint)(1)); + w12.RightAttach = ((uint)(2)); + w12.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild + this.entryTimeout = new global::Gtk.Entry(); + this.entryTimeout.CanFocus = true; + this.entryTimeout.Name = "entryTimeout"; + this.entryTimeout.IsEditable = true; + this.entryTimeout.InvisibleChar = '●'; + this.table1.Add(this.entryTimeout); + global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.entryTimeout])); + w13.TopAttach = ((uint)(2)); + w13.BottomAttach = ((uint)(3)); + w13.LeftAttach = ((uint)(1)); + w13.RightAttach = ((uint)(2)); + w13.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild + this.label1 = new global::Gtk.Label(); + this.label1.Name = "label1"; + this.label1.Xalign = 1F; + this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("Server name:"); + this.label1.Justify = ((global::Gtk.Justification)(1)); + this.table1.Add(this.label1); + global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.label1])); + w14.XOptions = ((global::Gtk.AttachOptions)(4)); + w14.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild + this.label2 = new global::Gtk.Label(); + this.label2.Name = "label2"; + this.label2.Xalign = 1F; + this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("Server port:"); + this.label2.Justify = ((global::Gtk.Justification)(1)); + this.table1.Add(this.label2); + global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.label2])); + w15.TopAttach = ((uint)(1)); + w15.BottomAttach = ((uint)(2)); + w15.XOptions = ((global::Gtk.AttachOptions)(4)); + w15.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table1.Gtk.Table+TableChild + this.label5 = new global::Gtk.Label(); + this.label5.Name = "label5"; + this.label5.LabelProp = global::Mono.Unix.Catalog.GetString("Timeout (ms):"); + this.table1.Add(this.label5); + global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1[this.label5])); + w16.TopAttach = ((uint)(2)); + w16.BottomAttach = ((uint)(3)); + w16.XOptions = ((global::Gtk.AttachOptions)(4)); + w16.YOptions = ((global::Gtk.AttachOptions)(4)); + this.vbox6.Add(this.table1); + global::Gtk.Box.BoxChild w17 = ((global::Gtk.Box.BoxChild)(this.vbox6[this.table1])); + w17.Position = 0; + w17.Expand = false; + w17.Fill = false; + // Container child vbox6.Gtk.Box+BoxChild + this.buttonServerConnection = new global::Gtk.Button(); + this.buttonServerConnection.CanFocus = true; + this.buttonServerConnection.Name = "buttonServerConnection"; + this.buttonServerConnection.UseUnderline = true; + this.buttonServerConnection.Label = global::Mono.Unix.Catalog.GetString("Connect"); + this.vbox6.Add(this.buttonServerConnection); + global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.vbox6[this.buttonServerConnection])); + w18.PackType = ((global::Gtk.PackType)(1)); + w18.Position = 1; + w18.Expand = false; + w18.Fill = false; + this.gtkAlignmentServer.Add(this.vbox6); + this.vbox10.Add(this.gtkAlignmentServer); + global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox10[this.gtkAlignmentServer])); + w20.Position = 1; + w20.Expand = false; + w20.Fill = false; + this.vbox5.Add(this.vbox10); + global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.vbox10])); + w21.Position = 0; + w21.Expand = false; + w21.Fill = false; + // Container child vbox5.Gtk.Box+BoxChild + this.hseparator1 = new global::Gtk.HSeparator(); + this.hseparator1.Name = "hseparator1"; + this.vbox5.Add(this.hseparator1); + global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hseparator1])); + w22.Position = 1; + w22.Expand = false; + w22.Fill = false; + // Container child vbox5.Gtk.Box+BoxChild + this.vbox11 = new global::Gtk.VBox(); + this.vbox11.Name = "vbox11"; + this.vbox11.Spacing = 6; + // Container child vbox11.Gtk.Box+BoxChild + this.labelRobot = new global::Gtk.Label(); + this.labelRobot.HeightRequest = 36; + this.labelRobot.Name = "labelRobot"; + this.labelRobot.LabelProp = global::Mono.Unix.Catalog.GetString("Robot Activation"); + this.labelRobot.UseMarkup = true; + this.vbox11.Add(this.labelRobot); + global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.vbox11[this.labelRobot])); + w23.Position = 0; + w23.Expand = false; + w23.Fill = false; + // Container child vbox11.Gtk.Box+BoxChild + this.alignment9 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F); + this.alignment9.Name = "alignment9"; + // Container child alignment9.Gtk.Container+ContainerChild + this.gtkAlignmentRobot = new global::Gtk.Alignment(0F, 0F, 1F, 1F); + this.gtkAlignmentRobot.Name = "gtkAlignmentRobot"; + this.gtkAlignmentRobot.LeftPadding = ((uint)(12)); + // Container child gtkAlignmentRobot.Gtk.Container+ContainerChild + this.vbox8 = new global::Gtk.VBox(); + this.vbox8.Name = "vbox8"; + this.vbox8.Spacing = 6; + // Container child vbox8.Gtk.Box+BoxChild + this.alignment6 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F); + this.alignment6.Name = "alignment6"; + // Container child alignment6.Gtk.Container+ContainerChild + this.hbox4 = new global::Gtk.HBox(); + this.hbox4.Name = "hbox4"; + this.hbox4.Spacing = 6; + // Container child hbox4.Gtk.Box+BoxChild + this.radioButtonWithWatchdog = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("with watchdog")); + this.radioButtonWithWatchdog.CanFocus = true; + this.radioButtonWithWatchdog.Name = "radioButtonWithWatchdog"; + this.radioButtonWithWatchdog.DrawIndicator = true; + this.radioButtonWithWatchdog.UseUnderline = true; + this.radioButtonWithWatchdog.Group = new global::GLib.SList(global::System.IntPtr.Zero); + this.hbox4.Add(this.radioButtonWithWatchdog); + global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.radioButtonWithWatchdog])); + w24.Position = 0; + // Container child hbox4.Gtk.Box+BoxChild + this.radioButtonWithoutWatchdog = new global::Gtk.RadioButton(global::Mono.Unix.Catalog.GetString("without watchdog")); + this.radioButtonWithoutWatchdog.CanFocus = true; + this.radioButtonWithoutWatchdog.Name = "radioButtonWithoutWatchdog"; + this.radioButtonWithoutWatchdog.DrawIndicator = true; + this.radioButtonWithoutWatchdog.UseUnderline = true; + this.radioButtonWithoutWatchdog.Group = this.radioButtonWithWatchdog.Group; + this.hbox4.Add(this.radioButtonWithoutWatchdog); + global::Gtk.Box.BoxChild w25 = ((global::Gtk.Box.BoxChild)(this.hbox4[this.radioButtonWithoutWatchdog])); + w25.Position = 1; + this.alignment6.Add(this.hbox4); + this.vbox8.Add(this.alignment6); + global::Gtk.Box.BoxChild w27 = ((global::Gtk.Box.BoxChild)(this.vbox8[this.alignment6])); + w27.Position = 0; + w27.Expand = false; + w27.Fill = false; + // Container child vbox8.Gtk.Box+BoxChild + this.alignment5 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F); + this.alignment5.Name = "alignment5"; + // Container child alignment5.Gtk.Container+ContainerChild + this.alignment7 = new global::Gtk.Alignment(0.5F, 0.5F, 1F, 1F); + this.alignment7.Name = "alignment7"; + // Container child alignment7.Gtk.Container+ContainerChild + this.buttonRobotActivation = new global::Gtk.Button(); + this.buttonRobotActivation.CanFocus = true; + this.buttonRobotActivation.Name = "buttonRobotActivation"; + this.buttonRobotActivation.UseUnderline = true; + this.buttonRobotActivation.Label = global::Mono.Unix.Catalog.GetString("Activation"); + this.alignment7.Add(this.buttonRobotActivation); + this.alignment5.Add(this.alignment7); + this.vbox8.Add(this.alignment5); + global::Gtk.Box.BoxChild w30 = ((global::Gtk.Box.BoxChild)(this.vbox8[this.alignment5])); + w30.Position = 1; + w30.Expand = false; + w30.Fill = false; + this.gtkAlignmentRobot.Add(this.vbox8); + this.alignment9.Add(this.gtkAlignmentRobot); + this.vbox11.Add(this.alignment9); + global::Gtk.Box.BoxChild w33 = ((global::Gtk.Box.BoxChild)(this.vbox11[this.alignment9])); + w33.Position = 1; + w33.Expand = false; + w33.Fill = false; + this.vbox5.Add(this.vbox11); + global::Gtk.Box.BoxChild w34 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.vbox11])); + w34.Position = 2; + w34.Expand = false; + w34.Fill = false; + // Container child vbox5.Gtk.Box+BoxChild + this.hseparator2 = new global::Gtk.HSeparator(); + this.hseparator2.Name = "hseparator2"; + this.vbox5.Add(this.hseparator2); + global::Gtk.Box.BoxChild w35 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.hseparator2])); + w35.Position = 3; + w35.Expand = false; + w35.Fill = false; + // Container child vbox5.Gtk.Box+BoxChild + this.vbox12 = new global::Gtk.VBox(); + this.vbox12.Name = "vbox12"; + this.vbox12.Spacing = 6; + // Container child vbox12.Gtk.Box+BoxChild + this.labelRobotControl = new global::Gtk.Label(); + this.labelRobotControl.HeightRequest = 36; + this.labelRobotControl.Name = "labelRobotControl"; + this.labelRobotControl.LabelProp = global::Mono.Unix.Catalog.GetString("Robot Controls and Status"); + this.labelRobotControl.UseMarkup = true; + this.vbox12.Add(this.labelRobotControl); + global::Gtk.Box.BoxChild w36 = ((global::Gtk.Box.BoxChild)(this.vbox12[this.labelRobotControl])); + w36.Position = 0; + w36.Expand = false; + w36.Fill = false; + // Container child vbox12.Gtk.Box+BoxChild + this.gtkAlignmentRobotControl = new global::Gtk.Alignment(0F, 0F, 1F, 1F); + this.gtkAlignmentRobotControl.Name = "gtkAlignmentRobotControl"; + this.gtkAlignmentRobotControl.LeftPadding = ((uint)(12)); + // Container child gtkAlignmentRobotControl.Gtk.Container+ContainerChild + this.vbox9 = new global::Gtk.VBox(); + this.vbox9.Name = "vbox9"; + this.vbox9.Spacing = 6; + // Container child vbox9.Gtk.Box+BoxChild + this.alignment8 = new global::Gtk.Alignment(0.5F, 0.5F, 0F, 0F); + this.alignment8.Name = "alignment8"; + // Container child alignment8.Gtk.Container+ContainerChild + this.table4 = new global::Gtk.Table(((uint)(3)), ((uint)(3)), false); + this.table4.Name = "table4"; + this.table4.RowSpacing = ((uint)(6)); + this.table4.ColumnSpacing = ((uint)(6)); + // Container child table4.Gtk.Table+TableChild + this.buttonDown = new global::Gtk.Button(); + this.buttonDown.CanFocus = true; + this.buttonDown.Name = "buttonDown"; + this.buttonDown.UseUnderline = true; + global::Gtk.Image w37 = new global::Gtk.Image(); + w37.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-down-symbolic.symbolic.png"); + this.buttonDown.Image = w37; + this.table4.Add(this.buttonDown); + global::Gtk.Table.TableChild w38 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonDown])); + w38.TopAttach = ((uint)(2)); + w38.BottomAttach = ((uint)(3)); + w38.LeftAttach = ((uint)(1)); + w38.RightAttach = ((uint)(2)); + w38.XOptions = ((global::Gtk.AttachOptions)(4)); + w38.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table4.Gtk.Table+TableChild + this.buttonForward = new global::Gtk.Button(); + this.buttonForward.CanFocus = true; + this.buttonForward.Name = "buttonForward"; + this.buttonForward.UseUnderline = true; + global::Gtk.Image w39 = new global::Gtk.Image(); + w39.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-up-symbolic.symbolic.png"); + this.buttonForward.Image = w39; + this.table4.Add(this.buttonForward); + global::Gtk.Table.TableChild w40 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonForward])); + w40.LeftAttach = ((uint)(1)); + w40.RightAttach = ((uint)(2)); + w40.XOptions = ((global::Gtk.AttachOptions)(4)); + w40.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table4.Gtk.Table+TableChild + this.buttonLeft = new global::Gtk.Button(); + this.buttonLeft.CanFocus = true; + this.buttonLeft.Name = "buttonLeft"; + this.buttonLeft.UseUnderline = true; + global::Gtk.Image w41 = new global::Gtk.Image(); + w41.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-start-symbolic.symbolic.png"); + this.buttonLeft.Image = w41; + this.table4.Add(this.buttonLeft); + global::Gtk.Table.TableChild w42 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonLeft])); + w42.TopAttach = ((uint)(1)); + w42.BottomAttach = ((uint)(2)); + w42.XOptions = ((global::Gtk.AttachOptions)(4)); + w42.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table4.Gtk.Table+TableChild + this.buttonRight = new global::Gtk.Button(); + this.buttonRight.CanFocus = true; + this.buttonRight.Name = "buttonRight"; + this.buttonRight.UseUnderline = true; + global::Gtk.Image w43 = new global::Gtk.Image(); + w43.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("monitor.ressources.pan-end-symbolic.symbolic.png"); + this.buttonRight.Image = w43; + this.table4.Add(this.buttonRight); + global::Gtk.Table.TableChild w44 = ((global::Gtk.Table.TableChild)(this.table4[this.buttonRight])); + w44.TopAttach = ((uint)(1)); + w44.BottomAttach = ((uint)(2)); + w44.LeftAttach = ((uint)(2)); + w44.RightAttach = ((uint)(3)); + w44.XOptions = ((global::Gtk.AttachOptions)(4)); + w44.YOptions = ((global::Gtk.AttachOptions)(4)); + this.alignment8.Add(this.table4); + this.vbox9.Add(this.alignment8); + global::Gtk.Box.BoxChild w46 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.alignment8])); + w46.Position = 0; + w46.Expand = false; + w46.Fill = false; + // Container child vbox9.Gtk.Box+BoxChild + this.table3 = new global::Gtk.Table(((uint)(1)), ((uint)(2)), false); + this.table3.Name = "table3"; + this.table3.RowSpacing = ((uint)(6)); + this.table3.ColumnSpacing = ((uint)(6)); + // Container child table3.Gtk.Table+TableChild + this.label3 = new global::Gtk.Label(); + this.label3.Name = "label3"; + this.label3.Xalign = 1F; + this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("Battery level:"); + this.label3.Justify = ((global::Gtk.Justification)(1)); + this.table3.Add(this.label3); + global::Gtk.Table.TableChild w47 = ((global::Gtk.Table.TableChild)(this.table3[this.label3])); + w47.YPadding = ((uint)(10)); + w47.XOptions = ((global::Gtk.AttachOptions)(4)); + w47.YOptions = ((global::Gtk.AttachOptions)(4)); + // Container child table3.Gtk.Table+TableChild + this.labelBatteryLevel = new global::Gtk.Label(); + this.labelBatteryLevel.Name = "labelBatteryLevel"; + this.labelBatteryLevel.Xpad = 1; + this.labelBatteryLevel.Xalign = 0F; + this.labelBatteryLevel.LabelProp = global::Mono.Unix.Catalog.GetString("Unknown"); + this.table3.Add(this.labelBatteryLevel); + global::Gtk.Table.TableChild w48 = ((global::Gtk.Table.TableChild)(this.table3[this.labelBatteryLevel])); + w48.LeftAttach = ((uint)(1)); + w48.RightAttach = ((uint)(2)); + w48.YOptions = ((global::Gtk.AttachOptions)(4)); + this.vbox9.Add(this.table3); + global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.table3])); + w49.Position = 2; + w49.Expand = false; + w49.Fill = false; + // Container child vbox9.Gtk.Box+BoxChild + this.checkButtonGetBattery = new global::Gtk.CheckButton(); + this.checkButtonGetBattery.CanFocus = true; + this.checkButtonGetBattery.Name = "checkButtonGetBattery"; + this.checkButtonGetBattery.Label = global::Mono.Unix.Catalog.GetString("Get battery level"); + this.checkButtonGetBattery.DrawIndicator = true; + this.checkButtonGetBattery.UseUnderline = true; + this.vbox9.Add(this.checkButtonGetBattery); + global::Gtk.Box.BoxChild w50 = ((global::Gtk.Box.BoxChild)(this.vbox9[this.checkButtonGetBattery])); + w50.Position = 3; + w50.Expand = false; + w50.Fill = false; + this.gtkAlignmentRobotControl.Add(this.vbox9); + this.vbox12.Add(this.gtkAlignmentRobotControl); + global::Gtk.Box.BoxChild w52 = ((global::Gtk.Box.BoxChild)(this.vbox12[this.gtkAlignmentRobotControl])); + w52.Position = 1; + this.vbox5.Add(this.vbox12); + global::Gtk.Box.BoxChild w53 = ((global::Gtk.Box.BoxChild)(this.vbox5[this.vbox12])); + w53.Position = 4; + this.alignment3.Add(this.vbox5); + this.hbox3.Add(this.alignment3); + global::Gtk.Box.BoxChild w55 = ((global::Gtk.Box.BoxChild)(this.hbox3[this.alignment3])); + w55.Position = 1; + w55.Expand = false; + w55.Fill = false; + this.hbox1.Add(this.hbox3); + global::Gtk.Box.BoxChild w56 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.hbox3])); + w56.Position = 1; + w56.Expand = false; + w56.Fill = false; this.vbox1.Add(this.hbox1); - global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); - w11.Position = 1; - // Container child vbox1.Gtk.Box+BoxChild - this.statusbar1 = new global::Gtk.Statusbar(); - this.statusbar1.Name = "statusbar1"; - this.statusbar1.Spacing = 6; - this.vbox1.Add(this.statusbar1); - global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.statusbar1])); - w12.Position = 2; - w12.Expand = false; - w12.Fill = false; + global::Gtk.Box.BoxChild w57 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1])); + w57.Position = 1; this.Add(this.vbox1); if ((this.Child != null)) { this.Child.ShowAll(); } this.DefaultWidth = 1039; - this.DefaultHeight = 705; + this.DefaultHeight = 735; this.Show(); this.DeleteEvent += new global::Gtk.DeleteEventHandler(this.OnDeleteEvent); + this.QuitAction.Activated += new global::System.EventHandler(this.OnQuitActionActivated); + this.ShowLogWindowAction.Activated += new global::System.EventHandler(this.OnShowLogWindowActionActivated); + this.drawingAreaCamera.Realized += new global::System.EventHandler(this.OnDrawingAreaCameraRealized); + this.drawingAreaCamera.ExposeEvent += new global::Gtk.ExposeEventHandler(this.OnDrawingAreaCameraExposeEvent); + this.drawingAreaCamera.ConfigureEvent += new global::Gtk.ConfigureEventHandler(this.OnDrawingAreaCameraConfigureEvent); + this.checkButtonCameraOn.Clicked += new global::System.EventHandler(this.OnCheckButtonCameraOnClicked); + this.checkButtonRobotPosition.Clicked += new global::System.EventHandler(this.OnCheckButtonRobotPositionClicked); + this.buttonServerConnection.Clicked += new global::System.EventHandler(this.OnButtonServerConnectionClicked); + this.buttonRobotActivation.Clicked += new global::System.EventHandler(this.OnButtonRobotActivationClicked); + this.buttonRight.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); + this.buttonLeft.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); + this.buttonForward.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); + this.buttonDown.Clicked += new global::System.EventHandler(this.OnButtonMouvClicked); } } diff --git a/software/monitor/monitor/gtk-gui/gui.stetic b/software/monitor/monitor/gtk-gui/gui.stetic index c490966..adb6238 100644 --- a/software/monitor/monitor/gtk-gui/gui.stetic +++ b/software/monitor/monitor/gtk-gui/gui.stetic @@ -7,20 +7,56 @@ - - + + + + Action + True + File + File + + + Action + <Primary><Mod2>q + True + Quit... + Quit + + + + Action + Log + Log + + + Action + <Primary><Mod2>s + Show log window + Show log window + + + Monitor UI + resource:monitor.ressources.robot-icon.resized.png CenterOnParent + 5 6 - + - + + + + + + + + 0 @@ -34,8 +70,71 @@ 6 - + + 6 + + + + + + + + + 0 + True + + + + + + 0 + 0 + 6 + + + + 6 + + + + True + Camera On + True + True + True + + + + 0 + True + + + + + + True + Robot Position + True + True + True + + + + 1 + True + + + + + + + 1 + False + False + False + + 0 @@ -43,60 +142,648 @@ - + + 6 - + - In + + + 0 + True + False + False + + + + + + 0 + 0 + 1 + 0 + 4 - + - None + 6 - + - True - None + 6 - + - False - - - - True - TextOnly - GtkButton - True - - - 30 - 25 - - - - - - - - <b>Controls</b> + 36 + <b><u>Server connection</u></b> True - label_item + 0 + True + False + False + + + + + + 0 + 0 + 12 + + + + 6 + + + + 3 + 2 + 6 + 6 + + + + True + True + + + + 1 + 2 + True + Fill + True + True + False + False + True + False + + + + + + True + True + + + + 1 + 2 + 1 + 2 + True + Fill + True + True + False + False + True + False + + + + + + True + True + + + + 2 + 3 + 1 + 2 + True + Fill + True + True + False + False + True + False + + + + + + 1 + Server name: + Right + + + True + Fill + Fill + False + True + False + False + True + False + + + + + + 1 + Server port: + Right + + + 1 + 2 + True + Fill + Fill + False + True + False + False + True + False + + + + + + Timeout (ms): + + + 2 + 3 + True + Fill + Fill + False + True + False + False + True + False + + + + + 0 + True + False + False + + + + + + True + TextOnly + Connect + True + + + + End + 1 + True + False + False + + + + + + + 1 + True + False + False + + 0 + True + False + False + + + + + + + + 1 + True + False + False + + + + + + 6 + + + + 36 + <b><u>Robot Activation</u></b> + True + + + 0 + True + False + False + + + + + + + + + 0 + 0 + 12 + + + + 6 + + + + + + + 6 + + + + True + with watchdog + True + True + True + True + radioGroupRobotActivation + + + 0 + True + + + + + + True + without watchdog + True + True + True + radioGroupRobotActivation + + + 1 + True + + + + + + + 0 + True + False + False + + + + + + + + + + + + True + TextOnly + Activation + True + + + + + + + + 1 + True + False + False + + + + + + + + + 1 + True + False + False + + + + + 2 + True + False + False + + + + + + + + 3 + True + False + False + + + + + + 6 + + + + 36 + <b><u>Robot Controls and Status</u></b> + True + + + 0 + True + False + False + + + + + + 0 + 0 + 12 + + + + 6 + + + + 0 + 0 + + + + 3 + 3 + 6 + 6 + + + + + + + + + + + + + + + + + + + True + TextAndIcon + resource:monitor.ressources.pan-down-symbolic.symbolic.png + + True + + + + 2 + 3 + 1 + 2 + True + Fill + Fill + False + True + False + False + True + False + + + + + + True + TextAndIcon + resource:monitor.ressources.pan-up-symbolic.symbolic.png + + True + + + + 1 + 2 + True + Fill + Fill + False + True + False + False + True + False + + + + + + True + TextAndIcon + resource:monitor.ressources.pan-start-symbolic.symbolic.png + + True + + + + 1 + 2 + True + Fill + Fill + False + True + False + False + True + False + + + + + + True + TextAndIcon + resource:monitor.ressources.pan-end-symbolic.symbolic.png + + True + + + + 1 + 2 + 2 + 3 + True + Fill + Fill + False + True + False + False + True + False + + + + + + + 0 + True + False + False + + + + + + + + + 2 + 6 + 6 + + + + 1 + Battery level: + Right + + + 10 + True + Fill + Fill + False + True + False + False + True + False + + + + + + 1 + 0 + Unknown + + + 1 + 2 + False + Fill + True + True + False + False + True + False + + + + + 2 + True + False + False + + + + + + True + Get battery level + True + True + True + + + 3 + True + False + False + + + + + + + 1 + True + + + + + 4 + True + + + 1 + True + False + False + 1 True + False + False @@ -105,24 +792,6 @@ True - - - - 6 - - - - - - - - - 2 - True - False - False - - diff --git a/software/monitor/monitor/monitor.csproj b/software/monitor/monitor/monitor.csproj index bb09369..934b3be 100644 --- a/software/monitor/monitor/monitor.csproj +++ b/software/monitor/monitor/monitor.csproj @@ -47,11 +47,19 @@ False + gui.stetic + + + + + + + @@ -59,6 +67,9 @@ + + + \ No newline at end of file diff --git a/software/monitor/monitor/ressources/missing_picture.png b/software/monitor/monitor/ressources/missing_picture.png new file mode 100644 index 0000000..1ca7988 Binary files /dev/null and b/software/monitor/monitor/ressources/missing_picture.png differ diff --git a/software/monitor/monitor/ressources/pan-down-symbolic.symbolic.png b/software/monitor/monitor/ressources/pan-down-symbolic.symbolic.png new file mode 100644 index 0000000..3fd1063 Binary files /dev/null and b/software/monitor/monitor/ressources/pan-down-symbolic.symbolic.png differ diff --git a/software/monitor/monitor/ressources/pan-end-symbolic.symbolic.png b/software/monitor/monitor/ressources/pan-end-symbolic.symbolic.png new file mode 100644 index 0000000..a24b9c0 Binary files /dev/null and b/software/monitor/monitor/ressources/pan-end-symbolic.symbolic.png differ diff --git a/software/monitor/monitor/ressources/pan-start-symbolic.symbolic.png b/software/monitor/monitor/ressources/pan-start-symbolic.symbolic.png new file mode 100644 index 0000000..a03114c Binary files /dev/null and b/software/monitor/monitor/ressources/pan-start-symbolic.symbolic.png differ diff --git a/software/monitor/monitor/ressources/pan-up-symbolic.symbolic.png b/software/monitor/monitor/ressources/pan-up-symbolic.symbolic.png new file mode 100644 index 0000000..04a775a Binary files /dev/null and b/software/monitor/monitor/ressources/pan-up-symbolic.symbolic.png differ diff --git a/software/monitor/monitor/ressources/robot-icon.png b/software/monitor/monitor/ressources/robot-icon.png new file mode 100644 index 0000000..91d6a8f Binary files /dev/null and b/software/monitor/monitor/ressources/robot-icon.png differ diff --git a/software/monitor/monitor/ressources/robot-icon.resized.png b/software/monitor/monitor/ressources/robot-icon.resized.png new file mode 100644 index 0000000..e464bd0 Binary files /dev/null and b/software/monitor/monitor/ressources/robot-icon.resized.png differ diff --git a/software/raspberry/superviseur-robot/lib/definitions.h b/software/raspberry/superviseur-robot/lib/definitions.h index b016653..3fd9d3b 100644 --- a/software/raspberry/superviseur-robot/lib/definitions.h +++ b/software/raspberry/superviseur-robot/lib/definitions.h @@ -48,7 +48,7 @@ #define DMB_BAT_LOW 0 #define DMB_BAT_MEDIUM 1 -#define DMB_BAT_HIGHT 2 +#define DMB_BAT_HIGH 2 #define DMB_BUSY 1 #define DMB_DO_NOTHING 0 diff --git a/software/raspberry/superviseur-robot/lib/image.h b/software/raspberry/superviseur-robot/lib/image.h index 0cc8466..cc98313 100644 --- a/software/raspberry/superviseur-robot/lib/image.h +++ b/software/raspberry/superviseur-robot/lib/image.h @@ -14,12 +14,14 @@ #ifndef IMAGERIE_H #define IMAGERIE_H -#define __STUB__ - #ifndef __STUB__ +#ifndef __FOR_PC__ #include #else #include +#endif /* __FOR_PC__ */ +#else +#include #endif #include "opencv2/imgproc/imgproc.hpp" #include @@ -31,15 +33,22 @@ using namespace std; using namespace cv; #ifndef __STUB__ +#ifndef __FOR_PC__ using namespace raspicam; +#endif /* __FOR_PC__ */ #endif typedef Mat Image; #ifndef __STUB__ +#ifndef __FOR_PC__ typedef RaspiCam_Cv Camera; #else typedef int Camera; +#endif /* __FOR_PC__ */ +#else +typedef int Camera; #endif + typedef Rect Arene; typedef vector Jpg; diff --git a/software/raspberry/superviseur-robot/lib/robot.h b/software/raspberry/superviseur-robot/lib/robot.h index e095f27..df35c9f 100644 --- a/software/raspberry/superviseur-robot/lib/robot.h +++ b/software/raspberry/superviseur-robot/lib/robot.h @@ -60,5 +60,4 @@ int close_communication_robot(void); */ int send_command_to_robot(char cmd, const char * arg=NULL); - #endif //DUMBERC_SERIAL_H_H diff --git a/software/raspberry/superviseur-robot/lib/src/image.cpp b/software/raspberry/superviseur-robot/lib/src/image.cpp index 0cf8540..04357d8 100644 --- a/software/raspberry/superviseur-robot/lib/src/image.cpp +++ b/software/raspberry/superviseur-robot/lib/src/image.cpp @@ -15,9 +15,14 @@ using namespace cv; #ifndef __STUB__ +#ifdef __FOR_PC__ +VideoCapture cap; +#else using namespace raspicam; +#endif /* __FOR_PC__ */ #else Image stubImg; + #endif using namespace std; @@ -35,6 +40,16 @@ void draw_arena(Image *imgInput, Image *imgOutput, Arene *monArene) int open_camera(Camera *camera) { #ifndef __STUB__ +#ifdef __FOR_PC__ + // open the default camera, use something different from 0 otherwise; + // Check VideoCapture documentation. + printf("Opening Camera...\n"); + if(!cap.open(0)) + return -1; + + sleep(1); + return 0; +#else // for raspberry camera->set(CV_CAP_PROP_FORMAT, CV_8UC3); camera->set(CV_CAP_PROP_FRAME_WIDTH,WIDTH); camera->set(CV_CAP_PROP_FRAME_HEIGHT,HEIGHT); @@ -50,16 +65,26 @@ int open_camera(Camera *camera) sleep(2); printf("Start capture\n"); return 0; - } + } +#endif /* __FOR_PC__ */ +#else + return 0; #endif } void get_image(Camera *camera, Image * monImage, const char * fichier) // getImg(Camera, Image img); { #ifndef __STUB__ +#ifdef __FOR_PC__ + if (monImage != NULL) + { + cap>>*monImage; + } +#else // for raspberry camera->grab(); camera->retrieve(*monImage); cvtColor(*monImage,*monImage,CV_BGR2RGB); +#endif /* __FOR_PC__ */ #else stubImg = imread(fichier, CV_LOAD_IMAGE_COLOR); stubImg.copyTo(*monImage); @@ -69,7 +94,13 @@ void get_image(Camera *camera, Image * monImage, const char * fichier) // getIm void close_camera(Camera *camera) // closeCam(Camera) : camera Entrer { #ifndef __STUB__ +#ifdef __FOR_PC__ + cap.release(); +#else // for raspberry camera->release(); +#endif /* __FOR_PC__ */ +#else + #endif } diff --git a/software/raspberry/superviseur-robot/superviseur/nbproject/private/private.xml b/software/raspberry/superviseur-robot/superviseur/nbproject/private/private.xml index 68261fb..099aead 100644 --- a/software/raspberry/superviseur-robot/superviseur/nbproject/private/private.xml +++ b/software/raspberry/superviseur-robot/superviseur/nbproject/private/private.xml @@ -7,7 +7,7 @@ - file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/superviseur/src/functions.cpp + file:/home/dimercur/Documents/Travail/git/dumber/software/raspberry/superviseur-robot/lib/image.h diff --git a/software/raspberry/superviseur-robot/superviseur/src/main.cpp b/software/raspberry/superviseur-robot/superviseur/src/main.cpp index a12c146..ed03fbd 100644 --- a/software/raspberry/superviseur-robot/superviseur/src/main.cpp +++ b/software/raspberry/superviseur-robot/superviseur/src/main.cpp @@ -157,7 +157,7 @@ void initStruct(void) { void startTasks() { int err; - + if (err = rt_task_start(&th_startRobot, &f_startRobot, NULL)) { printf("Error task start: %s\n", strerror(-err)); exit(EXIT_FAILURE); diff --git a/software/raspberry/testeur/testeur/.dep.inc b/software/raspberry/testeur/testeur/.dep.inc new file mode 100644 index 0000000..38ba445 --- /dev/null +++ b/software/raspberry/testeur/testeur/.dep.inc @@ -0,0 +1,5 @@ +# This code depends on make tool being used +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES})) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/software/raspberry/testeur/testeur/Makefile b/software/raspberry/testeur/testeur/Makefile new file mode 100644 index 0000000..05de621 --- /dev/null +++ b/software/raspberry/testeur/testeur/Makefile @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: build-tests +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/software/raspberry/testeur/testeur/main.cpp b/software/raspberry/testeur/testeur/main.cpp new file mode 100644 index 0000000..4d2e1c0 --- /dev/null +++ b/software/raspberry/testeur/testeur/main.cpp @@ -0,0 +1,256 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/* + * File: main.cpp + * Author: dimercur + * + * Created on 6 novembre 2018, 10:54 + */ + +#include + +#include "image.h" +#include "server.h" +#include "robot.h" +#include "message.h" + +#include +#include + +#include + +#include "definitions.h" + +#define HEADER_STM_IMAGE "IMG" // Envoi d'une image +#define HEADER_STM_BAT "BAT" // Envoi de l'état de la batterie +#define HEADER_STM_POS "POS" // Envoi de la position +#define HEADER_STM_NO_ACK "NAK" // Acquittement d'un échec +#define HEADER_STM_ACK "ACK" // Acquittement d'un succès +#define HEADER_STM_MES "MSG" // Message textuel +#define HEADER_STM_LOST_DMB "LCD" // Perte de la communication avec le robot + +#define HEADER_MTS_MSG "MSG" // Message directe pour Console Dumber +#define HEADER_MTS_DMB_ORDER "DMB" // Message d'ordre pour le robot +#define HEADER_MTS_COM_DMB "COM" // Message de gestion de la communication avec le robot +#define HEADER_MTS_CAMERA "CAM" // Message de gestion de la camera +#define HEADER_MTS_STOP "STO" // Message d'arrêt du system + +int socketID; +char data[1000]; +int receivedLength; +bool disconnected = true; +bool dataReady = false; +bool sysTick = false; +bool sendImage = false; +bool sendPos = false; + +Image monImage; +Jpg imageCompressed; + +pthread_t thread; + +typedef struct { + char header[4]; + char data[500]; +} MessageFromMon; + +MessageFromMon *message; +MessageToMon messageAnswered; + +std::thread *threadTimer; +std::thread *threadServer; + +using namespace std; + +/* + * + */ +void ThreadServer(void) { + // Recuperation d'une evenutelle commande sur le serveur + while (1) { + receivedLength = receiveDataFromServer(data, 1000); + if (receivedLength > 0) dataReady = true; + } +} + +void ThreadTimer(void) { + + while (1) { + //std::this_thread::sleep_for(std::chrono::seconds ) + sleep(1); + sysTick = true; + } +} + +void printReceivedMessage(MessageFromMon *mes) { + cout << "Received " + to_string(receivedLength) + " data\n"; + cout << "Header: "; + + for (int i = 0; i < 4; i++) { + cout << mes->header[i]; + } + + cout << "\nData: "; + for (int i = 0; i < receivedLength - 4; i++) { + cout << mes->data[i]; + } + + cout << "\n"; +} + +int sendAnswer(string cmd, string data) { + int status = 0; + string msg; + + msg = cmd + ':' + data; + cout << "Answer: " + msg; + cout << "\n"; + sendDataToServer((char*) msg.c_str(), msg.length()); + + return status; +} + +int decodeMessage(MessageFromMon *mes, int dataLength) { + int status = 0; + string header(mes->header, 4); + string data(mes->data, dataLength); + + if (header.find(HEADER_MTS_COM_DMB) != std::string::npos) // Message pour la gestion du port de communication + { + if (data.find(OPEN_COM_DMB) != std::string::npos) sendAnswer(HEADER_STM_ACK, ""); + else if (data.find(CLOSE_COM_DMB) != std::string::npos) sendAnswer(HEADER_STM_ACK, ""); + } else if (header.find(HEADER_MTS_CAMERA) != std::string::npos) // Message pour la camera + { + if (data.find(CAM_OPEN) != std::string::npos) { + sendAnswer(HEADER_STM_ACK, ""); + sendImage = true; + } else if (data.find(CAM_CLOSE) != std::string::npos) { + sendImage = false; + } else if (data.find(CAM_COMPUTE_POSITION) != std::string::npos) { + sendPos = true; + } else if (data.find(CAM_STOP_COMPUTE_POSITION) != std::string::npos) { + sendPos = false; + } else { + + } + } else if (header.find(HEADER_MTS_DMB_ORDER) != std::string::npos) // Message de com pour le robot + { + if (data.find(DMB_START_WITHOUT_WD) != std::string::npos) { + sendAnswer(HEADER_STM_ACK, ""); + + } else if (data.find(DMB_START_WITH_WD) != std::string::npos) { + sendAnswer(HEADER_STM_ACK, ""); + + } else if (data.find(DMB_GET_VBAT) != std::string::npos) { + sendAnswer(HEADER_STM_BAT, to_string(DMB_BAT_HIGH)); + } else if (data.find(DMB_MOVE) != std::string::npos) { + + } else if (data.find(DMB_TURN) != std::string::npos) { + + } else { + + } + } else if (header.find(HEADER_MTS_STOP) != std::string::npos) // Message d'arret + { + sendAnswer(HEADER_STM_ACK, ""); + } else { + sendAnswer(HEADER_STM_NO_ACK, ""); + } + + return status; +} + +int main(int argc, char** argv) { + + namedWindow("Sortie Camera"); + + // Ouverture de la com robot + if (open_communication_robot("/dev/ttyUSB0") != 0) { + cerr << "Unable to open /dev/ttyUSB0: abort\n"; + return -1; + } + cout << "/dev/ttyUSB0 opened\n"; + + // Ouverture de la camera + if (open_camera(0) == -1) { + cerr << "Unable to open camera: abort\n"; + return -1; + } + cout << "Camera opened\n"; + + // Ouverture du serveur + socketID = openServer(5544); + cout << "Server opened on port 5544\n"; + + threadTimer = new std::thread(ThreadTimer); + + for (;;) { + cout << "Waiting for client to connect ...\n"; + acceptClient(); + disconnected = false; + dataReady = false; + cout << "Client connected\n"; + threadServer = new std::thread(ThreadServer); + + while (disconnected == false) { + + // Recuperation de l'image + get_image(0, &monImage, ""); + + if (dataReady == true) // des données ont été recu par le serveur + { + message = (MessageFromMon*) malloc(sizeof (MessageFromMon)); + memcpy((void*) message, (const void*) data, sizeof (MessageFromMon)); + dataReady = false; + + //if (message->header[4] == ':') message->header[4]; + printReceivedMessage(message); + decodeMessage(message, receivedLength - 4); + + free(message); + + + } + + if (sysTick) { + sysTick = false; + + if (sendImage) { + compress_image(&monImage, &imageCompressed); + sendAnswer(HEADER_STM_IMAGE, reinterpret_cast (imageCompressed.data())); + } + + if (sendPos) { + //sendAnswer(HEADER_STM_POS,) + } + } + } + } + + threadTimer->join(); + threadServer->join(); + + // test de la camera + if (open_camera(0) != -1) { + for (;;) { + get_image(0, &monImage, ""); + + if (monImage.empty()) printf("image vide"); + else { + imshow("Sortie Camera", monImage); + + waitKey(10); + } + } + } else { + printf("Echec ouverture de camera"); + return -1; + } + + return 0; +} + diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-Debug.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-Debug.mk new file mode 100644 index 0000000..65daf72 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/Makefile-Debug.mk @@ -0,0 +1,107 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=GNU-Linux +CND_DLIB_EXT=so +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/_ext/e4d40e25/image.o \ + ${OBJECTDIR}/_ext/e4d40e25/message.o \ + ${OBJECTDIR}/_ext/e4d40e25/robot.o \ + ${OBJECTDIR}/_ext/e4d40e25/server.o \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS=`pkg-config --libs opencv` -lpthread + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/_ext/e4d40e25/image.o: ../../superviseur-robot/lib/src/image.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -g -D__FOR_PC__ -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/image.o ../../superviseur-robot/lib/src/image.cpp + +${OBJECTDIR}/_ext/e4d40e25/message.o: ../../superviseur-robot/lib/src/message.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -g -D__FOR_PC__ -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/message.o ../../superviseur-robot/lib/src/message.cpp + +${OBJECTDIR}/_ext/e4d40e25/robot.o: ../../superviseur-robot/lib/src/robot.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -g -D__FOR_PC__ -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/robot.o ../../superviseur-robot/lib/src/robot.cpp + +${OBJECTDIR}/_ext/e4d40e25/server.o: ../../superviseur-robot/lib/src/server.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -g -D__FOR_PC__ -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/server.o ../../superviseur-robot/lib/src/server.cpp + +${OBJECTDIR}/main.o: main.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -g -D__FOR_PC__ -DD_REENTRANT -I../../superviseur-robot/lib `pkg-config --cflags opencv` -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-Release.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-Release.mk new file mode 100644 index 0000000..28c0602 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/Makefile-Release.mk @@ -0,0 +1,107 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC=gfortran +AS=as + +# Macros +CND_PLATFORM=GNU-Linux +CND_DLIB_EXT=so +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/_ext/e4d40e25/image.o \ + ${OBJECTDIR}/_ext/e4d40e25/message.o \ + ${OBJECTDIR}/_ext/e4d40e25/robot.o \ + ${OBJECTDIR}/_ext/e4d40e25/server.o \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur + +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur: ${OBJECTFILES} + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM} + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/_ext/e4d40e25/image.o: ../../superviseur-robot/lib/src/image.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/image.o ../../superviseur-robot/lib/src/image.cpp + +${OBJECTDIR}/_ext/e4d40e25/message.o: ../../superviseur-robot/lib/src/message.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/message.o ../../superviseur-robot/lib/src/message.cpp + +${OBJECTDIR}/_ext/e4d40e25/robot.o: ../../superviseur-robot/lib/src/robot.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/robot.o ../../superviseur-robot/lib/src/robot.cpp + +${OBJECTDIR}/_ext/e4d40e25/server.o: ../../superviseur-robot/lib/src/server.cpp + ${MKDIR} -p ${OBJECTDIR}/_ext/e4d40e25 + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/_ext/e4d40e25/server.o ../../superviseur-robot/lib/src/server.cpp + +${OBJECTDIR}/main.o: main.cpp + ${MKDIR} -p ${OBJECTDIR} + ${RM} "$@.d" + $(COMPILE.cc) -O2 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/main.o main.cpp + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r ${CND_BUILDDIR}/${CND_CONF} + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-impl.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..ae093b2 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/Makefile-impl.mk @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=testeur + +# Active Configuration +DEFAULTCONF=Debug +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Debug Release + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/software/raspberry/testeur/testeur/nbproject/Makefile-variables.mk b/software/raspberry/testeur/testeur/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..b5f92a2 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/Makefile-variables.mk @@ -0,0 +1,35 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=GNU-Linux +CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux +CND_ARTIFACT_NAME_Debug=testeur +CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux/testeur +CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux/package +CND_PACKAGE_NAME_Debug=testeur.tar +CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux/package/testeur.tar +# Release configuration +CND_PLATFORM_Release=GNU-Linux +CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux +CND_ARTIFACT_NAME_Release=testeur +CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux/testeur +CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux/package +CND_PACKAGE_NAME_Release=testeur.tar +CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux/package/testeur.tar +# +# include compiler specific variables +# +# dmake command +ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \ + (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk) +# +# gmake command +.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)) +# +include nbproject/private/Makefile-variables.mk diff --git a/software/raspberry/testeur/testeur/nbproject/Package-Debug.bash b/software/raspberry/testeur/testeur/nbproject/Package-Debug.bash new file mode 100644 index 0000000..460a865 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/Package-Debug.bash @@ -0,0 +1,76 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux +CND_CONF=Debug +CND_DISTDIR=dist +CND_BUILDDIR=build +CND_DLIB_EXT=so +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur +OUTPUT_BASENAME=testeur +PACKAGE_TOP_DIR=testeur/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/testeur/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/software/raspberry/testeur/testeur/nbproject/Package-Release.bash b/software/raspberry/testeur/testeur/nbproject/Package-Release.bash new file mode 100644 index 0000000..acbac81 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/Package-Release.bash @@ -0,0 +1,76 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux +CND_CONF=Release +CND_DISTDIR=dist +CND_BUILDDIR=build +CND_DLIB_EXT=so +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/testeur +OUTPUT_BASENAME=testeur +PACKAGE_TOP_DIR=testeur/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/testeur/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/testeur.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/software/raspberry/testeur/testeur/nbproject/configurations.xml b/software/raspberry/testeur/testeur/nbproject/configurations.xml new file mode 100644 index 0000000..2ead220 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/configurations.xml @@ -0,0 +1,180 @@ + + + + + ../../superviseur-robot/lib/image.h + ../../superviseur-robot/lib/message.h + ../../superviseur-robot/lib/robot.h + ../../superviseur-robot/lib/server.h + + + + + ../../superviseur-robot/lib/src/image.cpp + main.cpp + ../../superviseur-robot/lib/src/message.cpp + ../../superviseur-robot/lib/src/robot.cpp + ../../superviseur-robot/lib/src/server.cpp + + + + + Makefile + + + + ../../superviseur-robot/lib/src + + Makefile + + + + default + true + false + + + + + ../../superviseur-robot/lib + + + __FOR_PC__ + + + + + ../../superviseur-robot/lib + + + D_REENTRANT + __FOR_PC__ + + + + + `pkg-config --libs opencv` + PosixThreads + + + + + + + + + + + + + + + + + + + + + + + + + default + true + false + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/software/raspberry/testeur/testeur/nbproject/private/Makefile-variables.mk b/software/raspberry/testeur/testeur/nbproject/private/Makefile-variables.mk new file mode 100644 index 0000000..a64183e --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/private/Makefile-variables.mk @@ -0,0 +1,7 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +# Debug configuration +# Release configuration diff --git a/software/raspberry/testeur/testeur/nbproject/private/c_standard_headers_indexer.c b/software/raspberry/testeur/testeur/nbproject/private/c_standard_headers_indexer.c new file mode 100644 index 0000000..c2548d2 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/private/c_standard_headers_indexer.c @@ -0,0 +1,75 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + */ + +// List of standard headers was taken in http://en.cppreference.com/w/c/header + +#include // Conditionally compiled macro that compares its argument to zero +#include // Functions to determine the type contained in character data +#include // Macros reporting error conditions +#include // Limits of float types +#include // Sizes of basic types +#include // Localization utilities +#include // Common mathematics functions +#include // Nonlocal jumps +#include // Signal handling +#include // Variable arguments +#include // Common macro definitions +#include // Input/output +#include // String handling +#include // General utilities: memory management, program utilities, string conversions, random numbers +#include // Time/date utilities +#include // (since C95) Alternative operator spellings +#include // (since C95) Extended multibyte and wide character utilities +#include // (since C95) Wide character classification and mapping utilities +#ifdef _STDC_C99 +#include // (since C99) Complex number arithmetic +#include // (since C99) Floating-point environment +#include // (since C99) Format conversion of integer types +#include // (since C99) Boolean type +#include // (since C99) Fixed-width integer types +#include // (since C99) Type-generic math (macros wrapping math.h and complex.h) +#endif +#ifdef _STDC_C11 +#include // (since C11) alignas and alignof convenience macros +#include // (since C11) Atomic types +#include // (since C11) noreturn convenience macros +#include // (since C11) Thread library +#include // (since C11) UTF-16 and UTF-32 character utilities +#endif diff --git a/software/raspberry/testeur/testeur/nbproject/private/configurations.xml b/software/raspberry/testeur/testeur/nbproject/private/configurations.xml new file mode 100644 index 0000000..7560ded --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/private/configurations.xml @@ -0,0 +1,74 @@ + + + Makefile + + + + localhost + 2 + + + + + + + + + + + + + + + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 0 + 0 + + + + + + + localhost + 2 + + + + + + + + + + + + + + + gdb + + + + "${OUTPUT_PATH}" + + "${OUTPUT_PATH}" + + true + 0 + 0 + + + + + + diff --git a/software/raspberry/testeur/testeur/nbproject/private/cpp_standard_headers_indexer.cpp b/software/raspberry/testeur/testeur/nbproject/private/cpp_standard_headers_indexer.cpp new file mode 100644 index 0000000..04f6fa6 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/private/cpp_standard_headers_indexer.cpp @@ -0,0 +1,135 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved. + * + * Oracle and Java are registered trademarks of Oracle and/or its affiliates. + * Other names may be trademarks of their respective owners. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + */ + +// List of standard headers was taken in http://en.cppreference.com/w/cpp/header + +#include // General purpose utilities: program control, dynamic memory allocation, random numbers, sort and search +#include // Functions and macro constants for signal management +#include // Macro (and function) that saves (and jumps) to an execution context +#include // Handling of variable length argument lists +#include // Runtime type information utilities +#include // std::bitset class template +#include // Function objects, designed for use with the standard algorithms +#include // Various utility components +#include // C-style time/date utilites +#include // typedefs for types such as size_t, NULL and others +#include // Low-level memory management utilities +#include // Higher level memory management utilities +#include // limits of integral types +#include // limits of float types +#include // standardized way to query properties of arithmetic types +#include // Exception handling utilities +#include // Standard exception objects +#include // Conditionally compiled macro that compares its argument to zero +#include // Macro containing the last error number +#include // functions to determine the type contained in character data +#include // functions for determining the type of wide character data +#include // various narrow character string handling functions +#include // various wide and multibyte string handling functions +#include // std::basic_string class template +#include // std::vector container +#include // std::deque container +#include // std::list container +#include // std::set and std::multiset associative containers +#include // std::map and std::multimap associative containers +#include // std::stack container adaptor +#include // std::queue and std::priority_queue container adaptors +#include // Algorithms that operate on containers +#include // Container iterators +#include // Common mathematics functions +#include // Complex number type +#include // Class for representing and manipulating arrays of values +#include // Numeric operations on values in containers +#include // forward declarations of all classes in the input/output library +#include // std::ios_base class, std::basic_ios class template and several typedefs +#include // std::basic_istream class template and several typedefs +#include // std::basic_ostream, std::basic_iostream class templates and several typedefs +#include // several standard stream objects +#include // std::basic_fstream, std::basic_ifstream, std::basic_ofstream class templates and several typedefs +#include // std::basic_stringstream, std::basic_istringstream, std::basic_ostringstream class templates and several typedefs +#include // std::strstream, std::istrstream, std::ostrstream(deprecated) +#include // Helper functions to control the format or input and output +#include // std::basic_streambuf class template +#include // C-style input-output functions +#include // Localization utilities +#include // C localization utilities +#include // empty header. The macros that appear in iso646.h in C are keywords in C++ +#if __cplusplus >= 201103L +#include // (since C++11) std::type_index +#include // (since C++11) Compile-time type information +#include // (since C++11) C++ time utilites +#include // (since C++11) std::initializer_list class template +#include // (since C++11) std::tuple class template +#include // (since C++11) Nested allocator class +#include // (since C++11) fixed-size types and limits of other types +#include // (since C++11) formatting macros , intmax_t and uintmax_t math and conversions +#include // (since C++11) defines std::error_code, a platform-dependent error code +#include // (since C++11) C-style Unicode character conversion functions +#include // (since C++11) std::array container +#include // (since C++11) std::forward_list container +#include // (since C++11) std::unordered_set and std::unordered_multiset unordered associative containers +#include // (since C++11) std::unordered_map and std::unordered_multimap unordered associative containers +#include // (since C++11) Random number generators and distributions +#include // (since C++11) Compile-time rational arithmetic +#include // (since C++11) Floating-point environment access functions +#include // (since C++11) Unicode conversion facilities +#include // (since C++11) Classes, algorithms and iterators to support regular expression processing +#include // (since C++11) Atomic operations library +#include // (since C++11)(deprecated in C++17) simply includes the header +#include // (since C++11)(deprecated in C++17) simply includes the headers (until C++17) (since C++17) and : the overloads equivalent to the contents of the C header tgmath.h are already provided by those headers +#include // (since C++11)(deprecated in C++17) defines one compatibility macro constant +#include // (since C++11)(deprecated in C++17) defines one compatibility macro constant +#include // (since C++11) std::thread class and supporting functions +#include // (since C++11) mutual exclusion primitives +#include // (since C++11) primitives for asynchronous computations +#include // (since C++11) thread waiting conditions +#endif +#if __cplusplus >= 201300L +#include // (since C++14) shared mutual exclusion primitives +#endif +#if __cplusplus >= 201500L +#include // (since C++17) std::any class template +#include // (since C++17) std::optional class template +#include // (since C++17) std::variant class template +#include // (since C++17) Polymorphic allocators and memory resources +#include // (since C++17) std::basic_string_view class template +#include // (since C++17) Predefined execution policies for parallel versions of the algorithms +#include // (since C++17) std::path class and supporting functions +#endif diff --git a/software/raspberry/testeur/testeur/nbproject/private/launcher.properties b/software/raspberry/testeur/testeur/nbproject/private/launcher.properties new file mode 100644 index 0000000..3edc2d8 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/private/launcher.properties @@ -0,0 +1,42 @@ +# Launchers File syntax: +# +# [Must-have property line] +# launcher1.runCommand= +# [Optional extra properties] +# launcher1.displayName= +# launcher1.hide= +# launcher1.buildCommand= +# launcher1.runDir= +# launcher1.runInOwnTab= +# launcher1.symbolFiles= +# launcher1.env.= +# (If this value is quoted with ` it is handled as a native command which execution result will become the value) +# [Common launcher properties] +# common.runDir= +# (This value is overwritten by a launcher specific runDir value if the latter exists) +# common.env.= +# (Environment variables from common launcher are merged with launcher specific variables) +# common.symbolFiles= +# (This value is overwritten by a launcher specific symbolFiles value if the latter exists) +# +# In runDir, symbolFiles and env fields you can use these macroses: +# ${PROJECT_DIR} - project directory absolute path +# ${OUTPUT_PATH} - linker output path (relative to project directory path) +# ${OUTPUT_BASENAME}- linker output filename +# ${TESTDIR} - test files directory (relative to project directory path) +# ${OBJECTDIR} - object files directory (relative to project directory path) +# ${CND_DISTDIR} - distribution directory (relative to project directory path) +# ${CND_BUILDDIR} - build directory (relative to project directory path) +# ${CND_PLATFORM} - platform name +# ${CND_CONF} - configuration name +# ${CND_DLIB_EXT} - dynamic library extension +# +# All the project launchers must be listed in the file! +# +# launcher1.runCommand=... +# launcher2.runCommand=... +# ... +# common.runDir=... +# common.env.KEY=VALUE + +# launcher1.runCommand= \ No newline at end of file diff --git a/software/raspberry/testeur/testeur/nbproject/private/private.xml b/software/raspberry/testeur/testeur/nbproject/private/private.xml new file mode 100644 index 0000000..63a27a8 --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/private/private.xml @@ -0,0 +1,7 @@ + + + + 1 + 0 + + diff --git a/software/raspberry/testeur/testeur/nbproject/project.xml b/software/raspberry/testeur/testeur/nbproject/project.xml new file mode 100644 index 0000000..16a12bd --- /dev/null +++ b/software/raspberry/testeur/testeur/nbproject/project.xml @@ -0,0 +1,30 @@ + + + org.netbeans.modules.cnd.makeproject + + + testeur + + cpp + h + UTF-8 + + + ../../superviseur-robot/lib/src + + + + Debug + 1 + + + Release + 1 + + + + false + + + +