441 lines
21 KiB
C#
441 lines
21 KiB
C#
using AgroBase.Comum;
|
|
using AgroBase.Models;
|
|
using AgroBase.Models.Modules;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Forms.DataVisualization.Charting;
|
|
using static AgroBase.Models.Enuns;
|
|
|
|
namespace AgroBase.Forms
|
|
{
|
|
public partial class frmAcompanhamento : Form
|
|
{
|
|
public frmAcompanhamento()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void frmAcompanhamento_Load(object sender, EventArgs e)
|
|
{
|
|
picEF.Paint += pic_Paint;
|
|
picET.Paint += pic_Paint;
|
|
picDF.Paint += pic_Paint;
|
|
picDT.Paint += pic_Paint;
|
|
btnEFReferenciar.Click += btnReferenciar_Click;
|
|
btnETReferenciar.Click += btnReferenciar_Click;
|
|
btnDFReferenciar.Click += btnReferenciar_Click;
|
|
btnDTReferenciar.Click += btnReferenciar_Click;
|
|
btnEFReverter.Click += btnReverter_Click;
|
|
btnETReverter.Click += btnReverter_Click;
|
|
btnDFReverter.Click += btnReverter_Click;
|
|
btnDTReverter.Click += btnReverter_Click;
|
|
chbEFControlar.CheckedChanged += ChbControlar_CheckedChanged;
|
|
chbETControlar.CheckedChanged += ChbControlar_CheckedChanged;
|
|
chbDFControlar.CheckedChanged += ChbControlar_CheckedChanged;
|
|
chbDTControlar.CheckedChanged += ChbControlar_CheckedChanged;
|
|
chbEFLivre.CheckedChanged += ChbLivre_CheckedChanged;
|
|
chbETLivre.CheckedChanged += ChbLivre_CheckedChanged;
|
|
chbDFLivre.CheckedChanged += ChbLivre_CheckedChanged;
|
|
chbDTLivre.CheckedChanged += ChbLivre_CheckedChanged;
|
|
}
|
|
|
|
private void frmAcompanhamento_Shown(object sender, EventArgs e)
|
|
{
|
|
PreencherOpcoes();
|
|
}
|
|
|
|
private void frmAcompanhamento_FormClosing(object sender, FormClosingEventArgs e)
|
|
{
|
|
e.Cancel = true;
|
|
this.Hide();
|
|
}
|
|
|
|
|
|
private void PreencherOpcoes()
|
|
{
|
|
var DispCon = Variaveis.DispositivosConectados.Where(x => x.Dispositivo == T_Code.Dir).ToList();
|
|
foreach (var Dispositivo in DispCon)
|
|
{
|
|
foreach (var Motor in ((DirecionalModel)Dispositivo.Dados).Motores)
|
|
{
|
|
CheckBox chbControlar = pnlFundo.Controls.OfType<CheckBox>().FirstOrDefault(ctrl => ctrl.Name == "chb" + Motor.ID + "Controlar");
|
|
chbControlar.Checked = Motor.Controlar;
|
|
CheckBox chbLivre = pnlFundo.Controls.OfType<CheckBox>().FirstOrDefault(ctrl => ctrl.Name == "chb" + Motor.ID + "Livre");
|
|
chbLivre.Checked = Motor.Livre;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
public void AtualizaGrafico()
|
|
{
|
|
picET.Invalidate();
|
|
picEF.Invalidate();
|
|
picDT.Invalidate();
|
|
picDF.Invalidate();
|
|
|
|
try
|
|
{
|
|
AtualzarDadosMovimentacao();
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private void AtualzarDadosMovimentacao()
|
|
{
|
|
var DispMov = (DispositivosService<MovimentacaoModel>)Variaveis.DispositivosConectados.FirstOrDefault(x => x._Porta.IsOpen && x.Dispositivo == T_Code.Mov);
|
|
if (DispMov == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (chartEF.InvokeRequired)
|
|
{
|
|
chartEF.Invoke(new Action(AtualizaGrafico));
|
|
}
|
|
else
|
|
{
|
|
lblTempoConectado.Text = "Tempo conectado: " + TimeSpan.FromSeconds(DispMov.TempoConectado).ToString(@"hh\:mm\:ss") + " hrs";
|
|
lblTempoEmMovimento.Text = "Tempo em movimento: " + TimeSpan.FromSeconds(DispMov.Dados.TempoEmAtividade).ToString(@"hh\:mm\:ss") + " hrs";
|
|
lblDistanciaTotal.Text = "Distancia percorrida total: " + DispMov.Dados.DistanciaPercorridaTotal.ToString("0.00") + " m";
|
|
lblDistanciaParcial.Text = "Distancia percorrida parcial: " + DispMov.Dados.DistanciaPercorridaParcial.ToString("0.00") + " m";
|
|
|
|
foreach (var Motor in DispMov.Dados.Motores.Where(x => x.Comandar))
|
|
{
|
|
Label lblM_RPMSP = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_RPMSP");
|
|
lblM_RPMSP.Text = "RPM SP: " + Motor.RPM_SP.ToString("0.00");
|
|
Label lblM_RPM = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_RPM");
|
|
lblM_RPM.Text = "RPM: " + Motor.RPM.ToString("0.00");
|
|
Label lblM_Velocidade = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_Velocidade");
|
|
lblM_Velocidade.Text = "Velocidade: " + Motor.VelocidadeInstantanea.ToString("0.00") + " Km/h";
|
|
Label lblM_Potencia = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_Potencia");
|
|
lblM_Potencia.Text = "Potencia: " + Motor.Potencia.ToString("0.00") + "%";
|
|
Label lblM_SentidoSP = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_SentidoSP");
|
|
lblM_SentidoSP.Text = "Sentido SP: " + Enum.GetName(typeof(Sentido), Motor.Sentido_SP);
|
|
Label lblM_Sentido = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_Sentido");
|
|
lblM_Sentido.Text = "Sentido: " + Enum.GetName(typeof(Sentido), Motor.Sentido);
|
|
Label lblM_Temperatura = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_Temperatura");
|
|
lblM_Temperatura.Text = "Temperatura: " + Motor.Temperatura.ToString("0.00") + "ºC";
|
|
lblM_Temperatura.ForeColor = Motor.Alarmes.Any(x => x.Tipo == S_Code.sTMP && (x.Maximo || x.Minimo)) ? Color.Red : Color.Black;
|
|
Label lblM_Corrente = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + Motor.ID + "M_Corrente");
|
|
lblM_Corrente.Text = "Corrente: " + Motor.Corrente.ToString("0.00") + "A";
|
|
|
|
MovSensorimanetoGrafico Log = null;
|
|
if (Motor.LogGrafico.Count > 0)
|
|
{
|
|
Log = Motor.LogGrafico[Motor.LogGrafico.Count - 1];
|
|
}
|
|
|
|
double Minimo = 0;
|
|
double Maximo = 0;
|
|
|
|
|
|
try
|
|
{
|
|
Chart chart = (Chart)(pnlFundo.Controls.Find("chart" + Motor.ID, false).First());
|
|
chart.Titles.Clear();
|
|
chart.Titles.Add(Motor.Descricao);
|
|
var Logs = (Motor.LogGrafico.Count > MovimentacaoModel.LogsManter ? Motor.LogGrafico.Skip(Math.Max(0, Motor.LogGrafico.Count - MovimentacaoModel.LogsManter)).Take(MovimentacaoModel.LogsManter).ToList() : Motor.LogGrafico).Where(log => log.ComponenteID == Motor.ID).ToList();
|
|
chart.Series.Clear();
|
|
List<string> Momentos = Logs.Select(x => x.Momento.ToString("mm:ss:fff")).ToList();
|
|
|
|
var serieRPMsp = new Series("RPM SP: " + (Log != null ? Log.RPM_SP : 0));
|
|
serieRPMsp.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_SP).ToList());
|
|
serieRPMsp.ChartType = SeriesChartType.Line;
|
|
chart.Series.Add(serieRPMsp);
|
|
Minimo = Logs.Min(x => x.RPM_SP) < Minimo ? Logs.Min(x => x.RPM_SP) : Minimo;
|
|
Maximo = Logs.Min(x => x.RPM_SP) > Maximo ? Logs.Min(x => x.RPM_SP) : Maximo;
|
|
|
|
var serieRPM = new Series("RPM: " + (Log != null ? Log.RPM : 0));
|
|
serieRPM.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM).ToList());
|
|
serieRPM.ChartType = SeriesChartType.Spline;
|
|
chart.Series.Add(serieRPM);
|
|
Minimo = Logs.Min(x => x.RPM) < Minimo ? Logs.Min(x => x.RPM) : Minimo;
|
|
Maximo = Logs.Max(x => x.RPM) > Maximo ? Logs.Max(x => x.RPM) : Maximo;
|
|
|
|
var serieRPMOffset = new Series("RPM Offset: " + (Log != null ? Log.RPM_Offset : 0));
|
|
serieRPMOffset.Points.DataBindXY(Momentos, Logs.Select(x => x.RPM_Offset).ToList());
|
|
serieRPMOffset.ChartType = SeriesChartType.Spline;
|
|
chart.Series.Add(serieRPMOffset);
|
|
Minimo = Logs.Min(x => x.RPM_Offset) < Minimo ? Logs.Min(x => x.RPM_Offset) : Minimo;
|
|
Maximo = Logs.Max(x => x.RPM_Offset) > Maximo ? Logs.Max(x => x.RPM_Offset) : Maximo;
|
|
|
|
var seriePotencia = new Series("Potencia: " + (Log != null ? Log.Potencia : 0));
|
|
seriePotencia.Points.DataBindXY(Momentos, Logs.Select(x => x.Potencia).ToList());
|
|
seriePotencia.ChartType = SeriesChartType.Line;
|
|
chart.Series.Add(seriePotencia);
|
|
Minimo = Logs.Min(x => x.Potencia) < Minimo ? Logs.Min(x => x.Potencia) : Minimo;
|
|
Maximo = Logs.Max(x => x.Potencia) > Maximo ? Logs.Max(x => x.Potencia) : Maximo;
|
|
|
|
var serieTemperatura = new Series("Temperatura: " + (Log != null ? Log.Temperatura : 0));
|
|
serieTemperatura.Points.DataBindXY(Momentos, Logs.Select(x => x.Temperatura).ToList());
|
|
serieTemperatura.ChartType = SeriesChartType.Line;
|
|
chart.Series.Add(serieTemperatura);
|
|
Minimo = Logs.Min(x => x.Temperatura) < Minimo ? Logs.Min(x => x.Temperatura) : Minimo;
|
|
Maximo = Logs.Max(x => x.Temperatura) > Maximo ? Logs.Max(x => x.Temperatura) : Maximo;
|
|
|
|
foreach (var legend in chart.Legends)
|
|
{
|
|
legend.Docking = Docking.Bottom;
|
|
}
|
|
|
|
chart.ChartAreas[0].AxisY.Minimum = Minimo - 5;
|
|
chart.ChartAreas[0].AxisY.Maximum = Maximo + 5;
|
|
}
|
|
catch
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
private void pic_Paint(object sender, PaintEventArgs e)
|
|
{
|
|
DesenharGraficos(sender, e);
|
|
}
|
|
|
|
private void DesenharGraficos(object sender, PaintEventArgs e)
|
|
{
|
|
if (!Variaveis.DispositivosConectados.Any(d => d.Dispositivo == T_Code.Dir))
|
|
{
|
|
return;
|
|
}
|
|
|
|
PictureBox pic = (PictureBox)sender;
|
|
string ID = pic.Name.Replace("pic", "");
|
|
|
|
var Motor = ((DirecionalModel)Variaveis.DispositivosConectados.FirstOrDefault(d => d.Dispositivo == T_Code.Dir).Dados).Motores.FirstOrDefault(m => m.ID == ID);
|
|
Label lblA_SP = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + ID + "A_SP");
|
|
lblA_SP.Text = "Angulo SP: " + ((Motor.Sentido_SP == Sentido.Antihorario ? -1 : 1) * Motor.Angulo_SP).ToString("000") + "º";
|
|
Label lblA = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + ID + "A");
|
|
lblA.Text = "Angulo: " + Motor.Angulo.ToString("000") + "º";
|
|
Label lblA_SentidoSP = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + ID + "A_SentidoSP");
|
|
lblA_SentidoSP.Text = "Sentido SP: " + Enum.GetName(typeof(Sentido), Motor.Sentido_SP);
|
|
Label lblA_Sentido = pnlFundo.Controls.OfType<Label>().FirstOrDefault(ctrl => ctrl.Name == "lbl" + ID + "A_Sentido");
|
|
lblA_Sentido.Text = "Sentido: " + Enum.GetName(typeof(Sentido), Motor.Sentido);
|
|
|
|
// Use o objeto Graphics para desenhar a representação do motor
|
|
Graphics g = e.Graphics;
|
|
|
|
int centerX = pic.Width / 2;
|
|
int centerY = pic.Height / 2;
|
|
int radius = Math.Min(centerX, centerY) - 30;
|
|
|
|
// Desenhe o círculo para representar o motor
|
|
g.DrawEllipse(Pens.Black, centerX - radius, centerY - radius, 2 * radius, 2 * radius);
|
|
|
|
|
|
|
|
// Desenhe a linha externa (set point)
|
|
double setPointAngleInRadians = (Motor.Sentido_SP == Sentido.Antihorario ? -1 : 1) * ((Motor.Angulo_SP * Math.PI) / 180);
|
|
int setPointX = centerX + (int)((radius + 10) * Math.Sin(setPointAngleInRadians));
|
|
int setPointY = centerY - (int)((radius + 10) * Math.Cos(setPointAngleInRadians));
|
|
g.DrawLine(Pens.Green, centerX, centerY, setPointX, setPointY);
|
|
|
|
// Desenhe a seta que indica o sentido
|
|
int arrowLength = 15; // Comprimento da seta
|
|
|
|
if (Motor.Sentido_SP == Sentido.Horario)
|
|
{
|
|
// Desenhe uma seta para a direita (sentido horário)
|
|
Point arrowStart = new Point(setPointX, setPointY);
|
|
Point arrowEnd = new Point(setPointX + arrowLength, setPointY);
|
|
g.DrawLine(Pens.Green, arrowStart, arrowEnd);
|
|
|
|
// Desenhe a "ponta" da seta (triângulo) para a direita
|
|
Point arrowPoint1 = new Point(setPointX + arrowLength - 5, setPointY - 5);
|
|
Point arrowPoint2 = new Point(setPointX + arrowLength - 5, setPointY + 5);
|
|
g.DrawLine(Pens.Green, arrowEnd, arrowPoint1);
|
|
g.DrawLine(Pens.Green, arrowEnd, arrowPoint2);
|
|
}
|
|
else
|
|
{
|
|
// Desenhe uma seta para a esquerda (sentido anti-horário)
|
|
Point arrowStart = new Point(setPointX, setPointY);
|
|
Point arrowEnd = new Point(setPointX - arrowLength, setPointY);
|
|
g.DrawLine(Pens.Green, arrowStart, arrowEnd);
|
|
|
|
// Desenhe a "ponta" da seta (triângulo) para a esquerda
|
|
Point arrowPoint1 = new Point(setPointX - arrowLength + 5, setPointY - 5);
|
|
Point arrowPoint2 = new Point(setPointX - arrowLength + 5, setPointY + 5);
|
|
g.DrawLine(Pens.Green, arrowEnd, arrowPoint1);
|
|
g.DrawLine(Pens.Green, arrowEnd, arrowPoint2);
|
|
}
|
|
|
|
|
|
|
|
// Desenhe uma linha para representar a posição do eixo do motor
|
|
double angleInRadians = (Motor.Angulo * Math.PI) / 180;
|
|
int x = centerX + (int)(radius * Math.Sin(angleInRadians));
|
|
int y = centerY - (int)(radius * Math.Cos(angleInRadians));
|
|
g.DrawLine(Pens.Red, centerX, centerY, x, y);
|
|
|
|
// Desenhe a seta que indica o sentido
|
|
if (Motor.Sentido == Sentido.Horario)
|
|
{
|
|
// Desenhe uma seta para a direita (sentido horário)
|
|
Point arrowStart = new Point(x, y);
|
|
Point arrowEnd = new Point(x + arrowLength, y);
|
|
g.DrawLine(Pens.Red, arrowStart, arrowEnd);
|
|
|
|
// Desenhe a "ponta" da seta (triângulo) para a direita
|
|
Point arrowPoint1 = new Point(x + arrowLength - 5, y - 5);
|
|
Point arrowPoint2 = new Point(x + arrowLength - 5, y + 5);
|
|
g.DrawLine(Pens.Red, arrowEnd, arrowPoint1);
|
|
g.DrawLine(Pens.Red, arrowEnd, arrowPoint2);
|
|
}
|
|
else
|
|
{
|
|
// Desenhe uma seta para a esquerda (sentido anti-horário)
|
|
Point arrowStart = new Point(x, y);
|
|
Point arrowEnd = new Point(x - arrowLength, y);
|
|
g.DrawLine(Pens.Red, arrowStart, arrowEnd);
|
|
|
|
// Desenhe a "ponta" da seta (triângulo) para a esquerda
|
|
Point arrowPoint1 = new Point(x - arrowLength + 5, y - 5);
|
|
Point arrowPoint2 = new Point(x - arrowLength + 5, y + 5);
|
|
g.DrawLine(Pens.Red, arrowEnd, arrowPoint1);
|
|
g.DrawLine(Pens.Red, arrowEnd, arrowPoint2);
|
|
}
|
|
|
|
|
|
|
|
// Desenhe os pontos nos angulos fixos
|
|
int radiusCircle = 5;
|
|
for (int i = 0; i < 4; i++)
|
|
{
|
|
double angle = ((i * 90) * Math.PI) / 180;
|
|
int xA = centerX + (int)((radius) * Math.Sin(angle)); // Adicione 20 para afastar do círculo principal
|
|
int yA = centerY - (int)((radius) * Math.Cos(angle)); // Adicione 20 para afastar do círculo principal
|
|
|
|
Rectangle rect = new Rectangle(xA - radiusCircle, yA - radiusCircle, 2 * radiusCircle, 2 * radiusCircle);
|
|
bool Acionado =
|
|
Motor.Ref000 && i == 0 ||
|
|
Motor.Ref090 && i == 1 ||
|
|
Motor.Ref180 && i == 2 ||
|
|
Motor.Ref270 && i == 3;
|
|
using (SolidBrush brush = new SolidBrush(Acionado ? Color.Red : Color.DarkRed))
|
|
{
|
|
g.FillEllipse(brush, rect);
|
|
}
|
|
|
|
string angleText = ((i * 90).ToString() + "°");
|
|
SizeF textSize = g.MeasureString(angleText, Font);
|
|
|
|
float textX = xA;
|
|
float textY = yA;
|
|
float textOffset = 12;
|
|
|
|
// Ajuste as coordenadas do texto com base no ângulo
|
|
if (angle == 0)
|
|
{
|
|
textX -= textSize.Width / 2;
|
|
textY -= textSize.Height - (textOffset * 2);
|
|
}
|
|
else if (angle == Math.PI / 2)
|
|
{
|
|
textX -= textSize.Width + textOffset;
|
|
textY -= textSize.Height / 2;
|
|
}
|
|
else if (angle == Math.PI)
|
|
{
|
|
textX -= textSize.Width / 2;
|
|
textY -= (textOffset * 2);
|
|
}
|
|
else if (angle == 3 * Math.PI / 2)
|
|
{
|
|
textX += textOffset;
|
|
textY -= textSize.Height / 2;
|
|
}
|
|
|
|
g.DrawString(angleText, Font, Brushes.Black, textX, textY);
|
|
}
|
|
|
|
}
|
|
|
|
private void btnReferenciar_Click(object sender, EventArgs e)
|
|
{
|
|
string ID = ((Button)sender).Name.Substring(3, 2);
|
|
var DispCon = Variaveis.DispositivosConectados.Where(x => x._Porta.IsOpen && x.Dispositivo == T_Code.Dir).ToList();
|
|
foreach (var Dispositivo in DispCon)
|
|
{
|
|
var Motor = ((DirecionalModel)Dispositivo.Dados).Motores.FirstOrDefault(x => x.ID == ID);
|
|
string Comando = Motor.ProtocoloComando(Direcao.Parado, true);
|
|
Dispositivo.AdicionarMensagemFila(Comando);
|
|
}
|
|
}
|
|
|
|
private void btnReverter_Click(object sender, EventArgs e)
|
|
{
|
|
/*string ID = ((Button)sender).Name.Substring(3, 2);
|
|
var DispCon = Variaveis.DispositivosConectados.Where(x => x._Porta.IsOpen && x.Dispositivo == T_Code.Mov).ToList();
|
|
foreach (var Dispositivo in DispCon)
|
|
{
|
|
var Motor = ((MovimentacaoModel)Dispositivo.Dados).Motores.FirstOrDefault(x => x.ID == ID);
|
|
string Comando = Motor.ProtocoloComando(MovimentacaoModel.UltimaDirecao, true);
|
|
Dispositivo.EnviarDadosSerial(Comando);
|
|
}*/
|
|
}
|
|
|
|
private void ChbLivre_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
string ID = ((CheckBox)sender).Name.Substring(3, 2);
|
|
var DispCon = Variaveis.DispositivosConectados.Where(x => x._Porta.IsOpen && x.Dispositivo == T_Code.Dir).ToList();
|
|
foreach (var Dispositivo in DispCon)
|
|
{
|
|
var Motor = ((DirecionalModel)Dispositivo.Dados).Motores.FirstOrDefault(x => x.ID == ID);
|
|
Motor.Livre = ((CheckBox)sender).Checked;
|
|
}
|
|
}
|
|
|
|
private void ChbControlar_CheckedChanged(object sender, EventArgs e)
|
|
{
|
|
string ID = ((CheckBox)sender).Name.Substring(3, 2);
|
|
var DispCon = Variaveis.DispositivosConectados.Where(x => x._Porta.IsOpen && x.Dispositivo == T_Code.Dir).ToList();
|
|
foreach (var Dispositivo in DispCon)
|
|
{
|
|
var Motor = ((DirecionalModel)Dispositivo.Dados).Motores.FirstOrDefault(x => x.ID == ID);
|
|
Motor.Controlar = ((CheckBox)sender).Checked;
|
|
}
|
|
}
|
|
|
|
|
|
delegate void AtualizarSensoresDelegate(string Texto);
|
|
|
|
public void AtualizarSensores(string Texto)
|
|
{
|
|
Label lbl =
|
|
Texto.Contains("Bateria") ? lblTensao:
|
|
Texto.Contains("Temp") ? lblTemperatura:
|
|
Texto.Contains("3V") ? lblB3V :
|
|
Texto.Contains("5V") ? lblB5V :
|
|
Texto.Contains("7V2") ? lblB7V2 :
|
|
Texto.Contains("12V") ? lblB12V :
|
|
new Label();
|
|
if (lbl.InvokeRequired)
|
|
{
|
|
lbl.Invoke(new AtualizarSensoresDelegate(AtualizarSensores), Texto);
|
|
}
|
|
else
|
|
{
|
|
lbl.Text = Texto;
|
|
}
|
|
}
|
|
}
|
|
}
|