/// <summary> /// On robot message handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void robot_OnMesage(object sender, BytesEventArgs e) { // Get the data. byte[] byteData = e.Message; // Convert it to sensor structure. Struct6 sensros = iRobot.Utils.ByteArrayToStructure <Struct6>(byteData); // Dump all the data. this.sensrosDump = sensros; // Convert the structure to JSON. //string serialSensors = JsonConvert.SerializeObject(sensros); // Send text data to the server. //this.SendTextData(serialSensors); // Log the event. this.LogMessage("Send data to the server."); // Draw the SCADA. //this.DrawSCADA(); }
/// <summary> /// On message handler. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Communicator_OnMesage(object sender, BytesEventArgs e) { this.OnMesage?.Invoke(this, e); }