Foros del Web » Programación para mayores de 30 ;) » C/C++ »

Intentar traducir este código a C++.

Estas en el tema de Intentar traducir este código a C++. en el foro de C/C++ en Foros del Web. Hola: Tengo este código dentro de un button para enviar tramas de bytes hecho con C#. Código: // Enviar tramas de bytes. byte[] miBuffer = ...
  #1 (permalink)  
Antiguo 24/02/2015, 04:39
 
Fecha de Ingreso: mayo-2007
Ubicación: PIC-16F84A
Mensajes: 727
Antigüedad: 16 años, 10 meses
Puntos: 8
Intentar traducir este código a C++.

Hola:

Tengo este código dentro de un button para enviar tramas de bytes hecho con C#.

Código:
            // Enviar tramas de bytes.
            byte[] miBuffer = new byte[9]; // Led_13_ON son 9 byte máximo.
            miBuffer[0] = 0x4C; // ASCII letra "L".
            miBuffer[1] = 0x65; // ASCII letra "e".
            miBuffer[2] = 0x64; // ASCII letra "d".
            miBuffer[3] = 0x5F; // ASCII letra "_".
            miBuffer[4] = 0x31; // ASCII letra "1".
            miBuffer[5] = 0x33; // ASCII letra "3".
            miBuffer[6] = 0x5F; // ASCII letra "_".
            miBuffer[7] = 0x4F; // ASCII letra "O".
            miBuffer[8] = 0x4E; // ASCII letra "N".
            serialPort1.Write(miBuffer, 0, miBuffer.Length); // Envia las tramas de bytes.
Da igual cuantras tramas hay que enviar, en C++ se hace así com indica abajo enviando la letra t.

Código:
cli::array<unsigned char> ^uno = gcnew cli::array<unsigned char> (1);
uno[0] = 0x74; // ASCII letra "t".
serialPort1->Write(uno, 0, 1);
Quiero hacer una cadena escrito más cómodamente como el ejemplo en C# hecho abajo.

Código:
 byte[] mBuffer = Encoding.ASCII.GetBytes("Led_8_ON");
            serialPort1.Write(mBuffer, 0, mBuffer.Length);

Los errores son estos.
Cita:
------ Operación Generar iniciada: proyecto: InterDuinoCPP, configuración: Debug Win32 ------
InterDuinoCPP.cpp
c:\users\meta\documents\visual studio 2010\projects\interduinocpp\interduinocpp\Form1.h( 195): error C2653: 'Enconding' : no es un nombre de clase o espacio de nombres
c:\users\meta\documents\visual studio 2010\projects\interduinocpp\interduinocpp\Form1.h( 195): error C2065: 'ASCII' : identificador no declarado
c:\users\meta\documents\visual studio 2010\projects\interduinocpp\interduinocpp\Form1.h( 195): error C2227: el operando izquierdo de '->GetBytes' debe señalar al tipo class/struct/union/generic
el tipo es ''unknown-type''
c:\users\meta\documents\visual studio 2010\projects\interduinocpp\interduinocpp\Form1.h( 196): error C2664: 'void System::IO::Ports::SerialPort::Write(System::Strin g ^)' : no se puede convertir el parámetro 1 de 'int' a 'System::String ^'
No hay un operador de conversión definida por el usuario disponible, o
No existe una conversión estándar del formulario al que se le aplica la conversión boxing del tipo aritmético al tipo de destino
========== Generar: 0 correctos, 1 incorrectos, 0 actualizados, 0 omitidos ==========
¿Cómo se hace en Visual C++ 2010?

Gracias.
__________________
Meta Shell, VERSIÓN 1.2.2
Descargar
  #2 (permalink)  
Antiguo 24/02/2015, 04:58
 
Fecha de Ingreso: octubre-2014
Ubicación: Madrid
Mensajes: 1.212
Antigüedad: 9 años, 5 meses
Puntos: 204
Respuesta: Intentar traducir este código a C++.

También has de tener en cuenta que C# usa una biblioteca de clases que depende de la versión de .NET con la que estés trabajando (así, el catálogo de clases disponibles y su uso en .Net 2.0 es distinto al que encuentras en .Net 3.5). En el caso de C++ ya estás en un lenguaje diferente, con su propio conjunto de librerías... lo que no aclaras es si estás intentando hacerlo con C++ nativo con la versión .Net.

C++ nativo y C++ .Net son totalmente diferentes.

Si tu pregunta trata sobre C++ .Net deberías preguntar en el foro de .Net, en caso contrario necesitaríamos que aclarases un par de dudas:
¿qué tipo de objeto es "serialPort1" en la versión C++?
¿De qué librería lo has sacado?

Un saludo
  #3 (permalink)  
Antiguo 24/02/2015, 08:52
Avatar de razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años
Puntos: 1360
Respuesta: Intentar traducir este código a C++.

Haz intentado. Leer la documentación?
https://msdn.microsoft.com/en-us/lib...code-snippet-1

Porque existe un método Write donde le pasas el string y el se encarga de hacer la conversión.
  #4 (permalink)  
Antiguo 24/02/2015, 09:35
 
Fecha de Ingreso: mayo-2007
Ubicación: PIC-16F84A
Mensajes: 727
Antigüedad: 16 años, 10 meses
Puntos: 8
Respuesta: Intentar traducir este código a C++.

Hola Señor:

Aquí en español.
https://msdn.microsoft.com/es-es/lib...code-snippet-1

Aquí sobre Encoding y ASCCIEncoding, he puesto estos dos uses y nada.
https://msdn.microsoft.com/es-es/lib...vs.110%29.aspx

A pesar que parece que es así:
Código C++:
Ver original
  1. cli::array<unsigned char> ^mBuffer = Encoding::ASCII->GetBytes("Led_8_ON");
  2.     serialPort1->Write(mBuffer, 0, mBuffer->Length);

No lo es, todavía con los mismos errores que salen.

Lo que he hecho.


Paso 2.


Paso 3.



Paso 4.


Haces doble clic enun button y poner el código.

Este código C# quiero traducirlo a Visual C++ 2010.
Código:
private void button_b_Click(object sender, EventArgs e)
{
    byte[] mBuffer = Encoding.ASCII.GetBytes("Hello World");
    serialPort1.Write(mBuffer, 0, mBuffer.Length);
}
Saludos.
__________________
Meta Shell, VERSIÓN 1.2.2
Descargar
  #5 (permalink)  
Antiguo 24/02/2015, 09:52
 
Fecha de Ingreso: octubre-2014
Ubicación: Madrid
Mensajes: 1.212
Antigüedad: 9 años, 5 meses
Puntos: 204
Respuesta: Intentar traducir este código a C++.

Estás usando la versión .NET de C++. Este no es el foro correcto para exponer tu pregunta.

La duda que tengo ahora es si sabes realmente lo que estás haciendo... porque de cara al exterior no hay diferencias entre programar una aplicación .NET con C# o con C++ o con VB.NET o con cualquiera de los lenguajes de .NET... al final se va a generar código intermedio que es común a todo .NET.

Si tu idea pasa por generar código nativo estás empezando mal.

Un saludo.
  #6 (permalink)  
Antiguo 24/02/2015, 10:08
Avatar de razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años
Puntos: 1360
Respuesta: Intentar traducir este código a C++.

Intente hacer lo mismo en Visual Studio 2013, pero me tope con esto.

http://stackoverflow.com/questions/1...ation-template

Vas a tener problemas si tratas de migrar tu programa a versiones mas recientes.

Y mas abajo en el mismo link que te pase, esta todo un ejemplo completo.

https://msdn.microsoft.com/en-us/lib...#exampleToggle

Muy posiblemente tengas que tener un thread separado donde manejes la conexión, envió y recepción de datos.
  #7 (permalink)  
Antiguo 24/02/2015, 10:45
 
Fecha de Ingreso: mayo-2007
Ubicación: PIC-16F84A
Mensajes: 727
Antigüedad: 16 años, 10 meses
Puntos: 8
Respuesta: Intentar traducir este código a C++.

Buenas:

Pues si voy a tener problemas, sea .net o no, quiero hacer cosas con ventanas de Windows y ser capaz de manejar estos datos. Ya tengo instalado el Visual C# Express 2013. Vi la Preview Visual Studio 2015 y en español, pero es Preview y puede haber muchos cambios en la versión final.

Entonces. ¿Qué consejos me pueden dar?

Saludos.
__________________
Meta Shell, VERSIÓN 1.2.2
Descargar
  #8 (permalink)  
Antiguo 24/02/2015, 15:04
Avatar de razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años
Puntos: 1360
Respuesta: Intentar traducir este código a C++.

¿Tienes alguna razón por la que no te puedas mover de C++ a C#? Porque de hecho parece que te quieres mover de C# a C++.

Digo, esta en C# funciona y todo entonces porque moverse de lenguaje?

Obviamente te puedes quedar en C++, incluso el ejemplo que te dan es muy completo. Inicias la conexión al puerto serial, mandas y recibes datos.

Obviamente en el código C# también tiene una parte donde inicia la conexión al puerto serial, envía y recibe datos.

De hecho el mismo link que pase, también esta el código en C#

https://msdn.microsoft.com/en-us/lib...code-snippet-2

Ahora si que la re-interpretación C++ -> C# lo haces tu.
  #9 (permalink)  
Antiguo 24/02/2015, 17:38
 
Fecha de Ingreso: mayo-2007
Ubicación: PIC-16F84A
Mensajes: 727
Antigüedad: 16 años, 10 meses
Puntos: 8
Respuesta: Intentar traducir este código a C++.

Hola:

Quiero tenerlo en las dos versiones funcionando, tanto en C# como en C++.
Aquí parece ser que me deja crear el formulario Windows con Visual C++ 2013.
https://www.youtube.com/watch?v=AP8Tz9RfbxE

Aquí otro.
https://www.youtube.com/watch?v=Htvm22GKuuY

Saludo.

Edito.
Código:
	private: System::Void button_Led_8_OFF_Click(System::Object^  sender, System::EventArgs^  e) {
		array<Byte> ^mBuffer = Encoding::ASCII->GetBytes("Led_8_OFF");
		serialPort1->Write(mBuffer, 0, mBuffer->Length);
	}
Por fin ya me funciona y en el Visual C++ 2013. Gracias a ustedes. Y me quedan más códigos que descifrar...

Más tarde lo pongo por aquí haber si acierto.
__________________
Meta Shell, VERSIÓN 1.2.2
Descargar

Última edición por REHome; 24/02/2015 a las 17:57
  #10 (permalink)  
Antiguo 26/02/2015, 08:20
 
Fecha de Ingreso: mayo-2007
Ubicación: PIC-16F84A
Mensajes: 727
Antigüedad: 16 años, 10 meses
Puntos: 8
Respuesta: Intentar traducir este código a C++.

Ya lo conseguí.

Les dejo el código completo por si alguien le pueda ayudar o interesar.

Código C++:
Ver original
  1. #pragma once
  2.  
  3. namespace InterDuinoCPP {
  4.  
  5.     using namespace System;
  6.     using namespace System::ComponentModel;
  7.     using namespace System::Collections;
  8.     using namespace System::Windows::Forms;
  9.     using namespace System::Data;
  10.     using namespace System::Drawing;
  11.  
  12.     using namespace System::IO::Ports; // No olvidar.
  13.     using namespace System::Text;
  14.  
  15.     /// <summary>
  16.     /// Resumen de Form_Principal
  17.     /// </summary>
  18.     public ref class Form_Principal : public System::Windows::Forms::Form
  19.     {
  20.     public:
  21.         Form_Principal(void)
  22.         {
  23.             InitializeComponent();
  24.             //
  25.             //TODO: agregar código de constructor aquí
  26.             //
  27.  
  28.             // Abrir puerto miestras se ejecuta la aplicación.
  29.             if (!serialPort1->IsOpen)
  30.             {
  31.                 try
  32.                 {
  33.                     serialPort1->Open();
  34.                 }
  35.                 catch (Exception^ex)
  36.                 {
  37.                     MessageBox::Show(ex->ToString());
  38.                 }
  39.             }
  40.         }
  41.  
  42.     protected:
  43.         /// <summary>
  44.         /// Limpiar los recursos que se estén utilizando.
  45.         /// </summary>
  46.         ~Form_Principal()
  47.         {
  48.             if (components)
  49.             {
  50.                 delete components;
  51.             }
  52.         }
  53.     private: System::Windows::Forms::Button^  button_Led_8_ON;
  54.     private: System::Windows::Forms::Button^  button_Led_8_OFF;
  55.     protected:
  56.  
  57.     protected:
  58.  
  59.     private: System::Windows::Forms::Label^  label1;
  60.     private: System::Windows::Forms::Button^  button_Led_13_ON;
  61.     private: System::Windows::Forms::Button^  button_Led_13_OFF;
  62.  
  63.  
  64.     private: System::Windows::Forms::Label^  label2;
  65.     private: System::Windows::Forms::RichTextBox^  richTextBox_Mensajes;
  66.  
  67.     private: System::Windows::Forms::Label^  label3;
  68.     private: System::IO::Ports::SerialPort^  serialPort1;
  69.     private: System::ComponentModel::IContainer^  components;
  70.  
  71.     private:
  72.         /// <summary>
  73.         /// Variable del diseñador requerida.
  74.         /// </summary>
  75.  
  76.  
  77. #pragma region Windows Form Designer generated code
  78.         /// <summary>
  79.         /// Método necesario para admitir el Diseñador. No se puede modificar
  80.         /// el contenido del método con el editor de código.
  81.         /// </summary>
  82.         void InitializeComponent(void)
  83.         {
  84.             this->components = (gcnew System::ComponentModel::Container());
  85.             this->button_Led_8_ON = (gcnew System::Windows::Forms::Button());
  86.             this->button_Led_8_OFF = (gcnew System::Windows::Forms::Button());
  87.             this->label1 = (gcnew System::Windows::Forms::Label());
  88.             this->button_Led_13_ON = (gcnew System::Windows::Forms::Button());
  89.             this->button_Led_13_OFF = (gcnew System::Windows::Forms::Button());
  90.             this->label2 = (gcnew System::Windows::Forms::Label());
  91.             this->richTextBox_Mensajes = (gcnew System::Windows::Forms::RichTextBox());
  92.             this->label3 = (gcnew System::Windows::Forms::Label());
  93.             this->serialPort1 = (gcnew System::IO::Ports::SerialPort(this->components));
  94.             this->SuspendLayout();
  95.             //
  96.             // button_Led_8_ON
  97.             //
  98.             this->button_Led_8_ON->Location = System::Drawing::Point(43, 37);
  99.             this->button_Led_8_ON->Name = L"button_Led_8_ON";
  100.             this->button_Led_8_ON->Size = System::Drawing::Size(75, 23);
  101.             this->button_Led_8_ON->TabIndex = 0;
  102.             this->button_Led_8_ON->Text = L"ON";
  103.             this->button_Led_8_ON->UseVisualStyleBackColor = true;
  104.             this->button_Led_8_ON->Click += gcnew System::EventHandler(this, &Form_Principal::button_Led_8_ON_Click);
  105.             //
  106.             // button_Led_8_OFF
  107.             //
  108.             this->button_Led_8_OFF->Location = System::Drawing::Point(43, 77);
  109.             this->button_Led_8_OFF->Name = L"button_Led_8_OFF";
  110.             this->button_Led_8_OFF->Size = System::Drawing::Size(75, 23);
  111.             this->button_Led_8_OFF->TabIndex = 1;
  112.             this->button_Led_8_OFF->Text = L"OFF";
  113.             this->button_Led_8_OFF->UseVisualStyleBackColor = true;
  114.             this->button_Led_8_OFF->Click += gcnew System::EventHandler(this, &Form_Principal::button_Led_8_OFF_Click);
  115.             //
  116.             // label1
  117.             //
  118.             this->label1->AutoSize = true;
  119.             this->label1->Location = System::Drawing::Point(62, 21);
  120.             this->label1->Name = L"label1";
  121.             this->label1->Size = System::Drawing::Size(34, 13);
  122.             this->label1->TabIndex = 2;
  123.             this->label1->Text = L"Led 8";
  124.             //
  125.             // button_Led_13_ON
  126.             //
  127.             this->button_Led_13_ON->Location = System::Drawing::Point(166, 37);
  128.             this->button_Led_13_ON->Name = L"button_Led_13_ON";
  129.             this->button_Led_13_ON->Size = System::Drawing::Size(75, 23);
  130.             this->button_Led_13_ON->TabIndex = 3;
  131.             this->button_Led_13_ON->Text = L"ON";
  132.             this->button_Led_13_ON->UseVisualStyleBackColor = true;
  133.             this->button_Led_13_ON->Click += gcnew System::EventHandler(this, &Form_Principal::button_Led_13_ON_Click);
  134.             //
  135.             // button_Led_13_OFF
  136.             //
  137.             this->button_Led_13_OFF->Location = System::Drawing::Point(166, 77);
  138.             this->button_Led_13_OFF->Name = L"button_Led_13_OFF";
  139.             this->button_Led_13_OFF->Size = System::Drawing::Size(75, 23);
  140.             this->button_Led_13_OFF->TabIndex = 4;
  141.             this->button_Led_13_OFF->Text = L"OFF";
  142.             this->button_Led_13_OFF->UseVisualStyleBackColor = true;
  143.             this->button_Led_13_OFF->Click += gcnew System::EventHandler(this, &Form_Principal::button_Led_13_OFF_Click);
  144.             //
  145.             // label2
  146.             //
  147.             this->label2->AutoSize = true;
  148.             this->label2->Location = System::Drawing::Point(186, 21);
  149.             this->label2->Name = L"label2";
  150.             this->label2->Size = System::Drawing::Size(40, 13);
  151.             this->label2->TabIndex = 5;
  152.             this->label2->Text = L"Led 13";
  153.             //
  154.             // richTextBox_Mensajes
  155.             //
  156.             this->richTextBox_Mensajes->Dock = System::Windows::Forms::DockStyle::Bottom;
  157.             this->richTextBox_Mensajes->Location = System::Drawing::Point(0, 129);
  158.             this->richTextBox_Mensajes->Name = L"richTextBox_Mensajes";
  159.             this->richTextBox_Mensajes->Size = System::Drawing::Size(284, 133);
  160.             this->richTextBox_Mensajes->TabIndex = 6;
  161.             this->richTextBox_Mensajes->Text = L"";
  162.             //
  163.             // label3
  164.             //
  165.             this->label3->AutoSize = true;
  166.             this->label3->Location = System::Drawing::Point(12, 113);
  167.             this->label3->Name = L"label3";
  168.             this->label3->Size = System::Drawing::Size(121, 13);
  169.             this->label3->TabIndex = 7;
  170.             this->label3->Text = L"Mensaje desde Arduino:";
  171.             //
  172.             // serialPort1
  173.             //
  174.             this->serialPort1->BaudRate = 115200;
  175.             this->serialPort1->PortName = L"COM4";
  176.             this->serialPort1->DataReceived += gcnew System::IO::Ports::SerialDataReceivedEventHandler(this, &Form_Principal::serialPort1_DataReceived);
  177.             //
  178.             // Form_Principal
  179.             //
  180.             this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
  181.             this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
  182.             this->ClientSize = System::Drawing::Size(284, 262);
  183.             this->Controls->Add(this->label3);
  184.             this->Controls->Add(this->richTextBox_Mensajes);
  185.             this->Controls->Add(this->label2);
  186.             this->Controls->Add(this->button_Led_13_OFF);
  187.             this->Controls->Add(this->button_Led_13_ON);
  188.             this->Controls->Add(this->label1);
  189.             this->Controls->Add(this->button_Led_8_OFF);
  190.             this->Controls->Add(this->button_Led_8_ON);
  191.             this->Name = L"Form_Principal";
  192.             this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
  193.             this->Text = L"Mini Interfaz C++";
  194.             this->ResumeLayout(false);
  195.             this->PerformLayout();
  196.  
  197.         }
  198. #pragma endregion
  199.     private: System::Void button_Led_8_ON_Click(System::Object^  sender, System::EventArgs^  e) {
  200.         array<Byte> ^miBuffer = Encoding::ASCII->GetBytes("Led_8_ON");
  201.         serialPort1->Write(miBuffer, 0, miBuffer->Length);
  202.     }
  203. private: System::Void button_Led_8_OFF_Click(System::Object^  sender, System::EventArgs^  e) {
  204.     array<Byte> ^miBuffer = Encoding::ASCII->GetBytes("Led_8_OFF");
  205.     serialPort1->Write(miBuffer, 0, miBuffer->Length);
  206. }
  207.  
  208. private: System::Void button_Led_13_ON_Click(System::Object^  sender, System::EventArgs^  e) {
  209.     cli::array<unsigned char> ^miBuffer = gcnew cli::array<unsigned char>(9);
  210.     miBuffer[0] = 0x4C; // ASCII letra "L".
  211.     miBuffer[1] = 0x65; // ASCII letra "e".
  212.     miBuffer[2] = 0x64; // ASCII letra "d".
  213.     miBuffer[3] = 0x5F; // ASCII letra "_".
  214.     miBuffer[4] = 0x31; // ASCII letra "1".
  215.     miBuffer[5] = 0x33; // ASCII letra "3".
  216.     miBuffer[6] = 0x5F; // ASCII letra "_".
  217.     miBuffer[7] = 0x4F; // ASCII letra "O".
  218.     miBuffer[8] = 0x4E; // ASCII letra "N".
  219.     serialPort1->Write(miBuffer, 0, miBuffer->Length);
  220. }
  221.  
  222. private: System::Void button_Led_13_OFF_Click(System::Object^  sender, System::EventArgs^  e) {
  223.     cli::array<unsigned char> ^miBuffer = gcnew cli::array<unsigned char>(10);
  224.     miBuffer[0] = 0x4C; // ASCII letra "L".
  225.     miBuffer[1] = 0x65; // ASCII letra "e".
  226.     miBuffer[2] = 0x64; // ASCII letra "d".
  227.     miBuffer[3] = 0x5F; // ASCII letra "_".
  228.     miBuffer[4] = 0x31; // ASCII letra "1".
  229.     miBuffer[5] = 0x33; // ASCII letra "3".
  230.     miBuffer[6] = 0x5F; // ASCII letra "_".
  231.     miBuffer[7] = 0x4F; // ASCII letra "O".
  232.     miBuffer[8] = 0x46; // ASCII letra "F".
  233.     miBuffer[9] = 0x46; // ASCII letra "F".
  234.     serialPort1->Write(miBuffer, 0, miBuffer->Length);
  235. }
  236.  
  237.          // Declaramos un delegado.
  238.          delegate void Delegado(String ^ Recibidos);
  239.  
  240. private: Void serialPort1_DataReceived(Object^  sender, SerialDataReceivedEventArgs^  e) {
  241.     // Utilizremos un string como buffer de recepción.
  242.     String ^ Recibidos;
  243.  
  244.     if (serialPort1->BytesToRead > 0){ // Si hay carácter que leer...
  245.  
  246.         Recibidos = serialPort1->ReadExisting(); // Acumula los carácteres recibido.
  247.  
  248.         // Invocamos y cargamos los bytes en rictTextBox_Mensajes.
  249.         Delegado ^ Actualizar = gcnew Delegado(this, &Form_Principal::ByteRecibidos);
  250.  
  251.         this->Invoke(Actualizar, Recibidos);
  252.     }
  253. }
  254.  
  255.          void ByteRecibidos(String ^ Data){
  256.              // Los carácteres almacenado en 'Data' se depositan en richTextBox_Mensaje.
  257.              richTextBox_Mensajes->Text += Data;
  258.  
  259.              // Selecciona la posición final para leer los mensajes entrantes.
  260.              richTextBox_Mensajes->SelectionStart = richTextBox_Mensajes->Text->Length;
  261.  
  262.              // Mantiene el scroll en la entrada de cada mensaje.
  263.              richTextBox_Mensajes->ScrollToCaret();
  264.          }
  265.  
  266. };
  267. }

Saludos y gracias por todo.
__________________
Meta Shell, VERSIÓN 1.2.2
Descargar

Etiquetas: char, int, traducir
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 12:00.