I resolved.

it was necessary to create a istance of MainWindow in the Diagnostics.cpp (Mainwindow *Main).

At this point I need to write Main->Read_Ambiente();