diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/34f9307d-9155-43a5-b124-6f052ceb6442.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/34f9307d-9155-43a5-b124-6f052ceb6442.vsidx deleted file mode 100644 index 8781fb6f9..000000000 Binary files a/AgroBase/.vs/AgroBase/FileContentIndex/34f9307d-9155-43a5-b124-6f052ceb6442.vsidx and /dev/null differ diff --git a/AgroBase/.vs/AgroBase/FileContentIndex/542ab826-54a5-4f88-b6ad-acb0017dfe8d.vsidx b/AgroBase/.vs/AgroBase/FileContentIndex/542ab826-54a5-4f88-b6ad-acb0017dfe8d.vsidx new file mode 100644 index 000000000..1a21bdeb6 Binary files /dev/null and b/AgroBase/.vs/AgroBase/FileContentIndex/542ab826-54a5-4f88-b6ad-acb0017dfe8d.vsidx differ diff --git a/AgroBase/.vs/AgroBase/v17/.suo b/AgroBase/.vs/AgroBase/v17/.suo index f98e3b509..7001c14a9 100644 Binary files a/AgroBase/.vs/AgroBase/v17/.suo and b/AgroBase/.vs/AgroBase/v17/.suo differ diff --git a/AgroBase/AgroBase/Forms/IHM/frmDiagnosticos.cs b/AgroBase/AgroBase/Forms/IHM/frmDiagnosticos.cs index 646b8993a..30957c23a 100644 --- a/AgroBase/AgroBase/Forms/IHM/frmDiagnosticos.cs +++ b/AgroBase/AgroBase/Forms/IHM/frmDiagnosticos.cs @@ -771,7 +771,7 @@ namespace AgroBase.Forms.IHM idx = PreencheDadosLinha(grid, Testes, idx, ServoFreio != null ? Testes[idx].ValorAferido : -1); var SensorAB7V2 = Modulo_Sen.DadosLeitura.SensoresCorrente.FirstOrDefault(x => x.ID == "AB7V2"); - double CorrenteFreio = SensorAB7V2 != null ? SensorAB7V2.Current ?? 0 : -1; + double CorrenteFreio = SensorAB7V2 != null ? SensorAB7V2.Current : -1; double TensaoFreio = SensorAB7V2 != null ? SensorAB7V2.BusVoltage : -1; (bool desatuar, int angDesativar) = Modulo.MovMotor.ConfigFreio.AtualizarDadosFreio(false); @@ -1214,23 +1214,24 @@ namespace AgroBase.Forms.IHM var grid = Diagnostico.grid; var Testes = Diagnostico.Testes; + var Modulo_Sen = Variaveis.OperacaoEmAndamento.DispSen.Dados; + bool PzmConectado = SerialService.DispositivosMapeados.Any(x => x.Dispositivo == Enums.T_Code.Pzm); idx = PreencheDadosLinha(grid, Testes, idx, PzmConectado ? 1 : 0); - bool PzmInicializado = PZEMService.Iniciado; - idx = PreencheDadosLinha(grid, Testes, idx, PzmInicializado ? 1 : 0); + var S36V = ((FirmwareSensorCorrente)Modulo_Sen.Sensores.FirstOrDefault(x => x.ID == "AB36V").Leitura); + bool S36VInicializado = S36V?.Iniciado ?? false; + idx = PreencheDadosLinha(grid, Testes, idx, S36VInicializado ? 1 : 0); - double Tensao = PzmInicializado ? PZEMService.UltimaLeitura.Tensao : -1; + double Tensao = S36VInicializado ? S36V.BusVoltage : -1; idx = PreencheDadosLinha(grid, Testes, idx, Tensao); - double Corrente = PzmInicializado ? PZEMService.UltimaLeitura.Corrente : -1; + double Corrente = S36VInicializado ? S36V.Current : -1; idx = PreencheDadosLinha(grid, Testes, idx, Corrente); bool SenConectado = SerialService.DispositivosMapeados.Any(x => x.Dispositivo == T_Code.Sen); idx = PreencheDadosLinha(grid, Testes, idx, SenConectado ? 1 : 0); - var Modulo_Sen = Variaveis.OperacaoEmAndamento.DispSen.Dados; - bool SenIniciado = Modulo_Sen.Conectado; idx = PreencheDadosLinha(grid, Testes, idx, SenIniciado ? 1 : 0); diff --git a/AgroBase/AgroBase/Forms/Operacoes/frmOperacaoManual.cs b/AgroBase/AgroBase/Forms/Operacoes/frmOperacaoManual.cs index 8c328bf94..8d8c678cd 100644 --- a/AgroBase/AgroBase/Forms/Operacoes/frmOperacaoManual.cs +++ b/AgroBase/AgroBase/Forms/Operacoes/frmOperacaoManual.cs @@ -416,6 +416,7 @@ namespace AgroBase.Forms.Operacoes gridDados.Rows.Add("Nível de Bateria", "", "%"); gridDados.Rows.Add("Tensão da Bateria", "", "v"); gridDados.Rows.Add("Corrente da Bateria", "", "A"); + gridDados.Rows.Add("Tempo Estimado Restante", "", "Min"); gridDados.Rows.Add("Barramento 3V", "", "V"); gridDados.Rows.Add("Barramento 3V", "", "mA"); gridDados.Rows.Add("Barramento 5V", "", "V"); @@ -424,6 +425,10 @@ namespace AgroBase.Forms.Operacoes gridDados.Rows.Add("Barramento 7,2V", "", "mA"); gridDados.Rows.Add("Barramento 12V", "", "V"); gridDados.Rows.Add("Barramento 12V", "", "mA"); + gridDados.Rows.Add("Barramento 19V", "", "V"); + gridDados.Rows.Add("Barramento 19V", "", "mA"); + gridDados.Rows.Add("Barramento 24V", "", "V"); + gridDados.Rows.Add("Barramento 24V", "", "mA"); gridDados.Rows.Add("Nível do Reservatório", "", "%"); gridDados.Rows.Add("Volume do Reservatório", "", "L"); gridDados.Rows.Add("Pressão da Linha", "", "psi"); @@ -449,6 +454,8 @@ namespace AgroBase.Forms.Operacoes var AB5V = _SensoresCorrente.FirstOrDefault(x => x.ID == "AB5V"); var AB7V2 = _SensoresCorrente.FirstOrDefault(x => x.ID == "AB7V2"); var AB12V = _SensoresCorrente.FirstOrDefault(x => x.ID == "AB12V"); + var AB19V = _SensoresCorrente.FirstOrDefault(x => x.ID == "AB19V"); + var AB24V = _SensoresCorrente.FirstOrDefault(x => x.ID == "AB24V"); var _Sensoriamento = Variaveis.OperacaoEmAndamento.Sensoriamento; var _SensorIMU = Variaveis.OperacaoEmAndamento.DispSen.Dados.DadosLeitura.SensoresIMU.FirstOrDefault(); @@ -459,28 +466,33 @@ namespace AgroBase.Forms.Operacoes gridDados.Rows[4].Cells[1].Value = (_Sensoriamento.Bateria.PorcentagemBateria.ToString("00.00")); gridDados.Rows[5].Cells[1].Value = (_Sensoriamento.Bateria.TensaoInstantanea.ToString("0.00")); gridDados.Rows[6].Cells[1].Value = (_Sensoriamento.Bateria.CorrenteInstantanea.ToString("0.00")); - gridDados.Rows[7].Cells[1].Value = (AB3V != null ? AB3V.BusVoltage : 0).ToString("0.00"); - gridDados.Rows[8].Cells[1].Value = (AB3V != null ? (double)AB3V.Current : 0).ToString("0.00"); - gridDados.Rows[9].Cells[1].Value = (AB5V != null ? AB5V.BusVoltage : 0).ToString("0.00"); - gridDados.Rows[10].Cells[1].Value = (AB5V != null ? (double)AB5V.Current : 0).ToString("0.00"); - gridDados.Rows[11].Cells[1].Value = (AB7V2 != null ? AB7V2.BusVoltage : 0).ToString("0.00"); - gridDados.Rows[12].Cells[1].Value = (AB7V2 != null ? (double)AB7V2.Current : 0).ToString("0.00"); - gridDados.Rows[13].Cells[1].Value = (AB12V != null ? AB12V.BusVoltage : 0).ToString("0.00"); - gridDados.Rows[14].Cells[1].Value = (AB12V != null ? (double)AB12V.Current : 0).ToString("0.00"); - gridDados.Rows[15].Cells[1].Value = _Sensoriamento.Atuador.PercentualReservatorio.ToString("00.00"); - gridDados.Rows[16].Cells[1].Value = _Sensoriamento.Atuador.VolumeReservatorio.ToString("0.000"); - gridDados.Rows[17].Cells[1].Value = _Sensoriamento.Atuador.PressaoLinha.ToString("0.00"); - gridDados.Rows[18].Cells[1].Value = _Sensoriamento.Atuador.LeituraPotenciaBomba.ToString("0.00"); - gridDados.Rows[19].Cells[1].Value = _Sensoriamento.Atuador.VazaoInstantanea.ToString("0.00"); - gridDados.Rows[20].Cells[1].Value = _Sensoriamento.Atuador.VazaoMedia.ToString("0.00"); - gridDados.Rows[21].Cells[1].Value = _Sensoriamento.Atuador.VolumeVazaoMl.ToString("0.00"); - gridDados.Rows[22].Cells[1].Value = ""; - gridDados.Rows[23].Cells[1].Value = (_SensorIMU?.Roll ?? 0).ToString("0.00"); - gridDados.Rows[24].Cells[1].Value = (_SensorIMU?.Pitch ?? 0).ToString("0.00"); - gridDados.Rows[25].Cells[1].Value = (_SensorIMU?.Yaw ?? 0).ToString("0.00"); - gridDados.Rows[26].Cells[1].Value = (_SensorIMU?.Temperatura ?? 0).ToString("0.00"); - gridDados.Rows[27].Cells[1].Value = (_SensorIMU?.Pressao ?? 0).ToString("0.00"); - gridDados.Rows[28].Cells[1].Value = (_SensorIMU?.Altitude ?? 0).ToString("0.00"); + gridDados.Rows[7].Cells[1].Value = (_Sensoriamento.Bateria.TempoEstimadoRestanteMinutos.ToString("0.00")); + gridDados.Rows[8].Cells[1].Value = (AB3V != null ? AB3V.BusVoltage : 0).ToString("0.00"); + gridDados.Rows[9].Cells[1].Value = (AB3V != null ? (double)AB3V.Current : 0).ToString("0.00"); + gridDados.Rows[10].Cells[1].Value = (AB5V != null ? AB5V.BusVoltage : 0).ToString("0.00"); + gridDados.Rows[11].Cells[1].Value = (AB5V != null ? (double)AB5V.Current : 0).ToString("0.00"); + gridDados.Rows[12].Cells[1].Value = (AB7V2 != null ? AB7V2.BusVoltage : 0).ToString("0.00"); + gridDados.Rows[13].Cells[1].Value = (AB7V2 != null ? (double)AB7V2.Current : 0).ToString("0.00"); + gridDados.Rows[14].Cells[1].Value = (AB12V != null ? AB12V.BusVoltage : 0).ToString("0.00"); + gridDados.Rows[15].Cells[1].Value = (AB12V != null ? (double)AB12V.Current : 0).ToString("0.00"); + gridDados.Rows[16].Cells[1].Value = (AB19V != null ? AB19V.BusVoltage : 0).ToString("0.00"); + gridDados.Rows[17].Cells[1].Value = (AB19V != null ? (double)AB19V.Current : 0).ToString("0.00"); + gridDados.Rows[18].Cells[1].Value = (AB24V != null ? AB24V.BusVoltage : 0).ToString("0.00"); + gridDados.Rows[19].Cells[1].Value = (AB24V != null ? (double)AB24V.Current : 0).ToString("0.00"); + gridDados.Rows[20].Cells[1].Value = _Sensoriamento.Atuador.PercentualReservatorio.ToString("00.00"); + gridDados.Rows[21].Cells[1].Value = _Sensoriamento.Atuador.VolumeReservatorio.ToString("0.000"); + gridDados.Rows[22].Cells[1].Value = _Sensoriamento.Atuador.PressaoLinha.ToString("0.00"); + gridDados.Rows[23].Cells[1].Value = _Sensoriamento.Atuador.LeituraPotenciaBomba.ToString("0.00"); + gridDados.Rows[24].Cells[1].Value = _Sensoriamento.Atuador.VazaoInstantanea.ToString("0.00"); + gridDados.Rows[25].Cells[1].Value = _Sensoriamento.Atuador.VazaoMedia.ToString("0.00"); + gridDados.Rows[26].Cells[1].Value = _Sensoriamento.Atuador.VolumeVazaoMl.ToString("0.00"); + gridDados.Rows[27].Cells[1].Value = ""; + gridDados.Rows[28].Cells[1].Value = (_SensorIMU?.Roll ?? 0).ToString("0.00"); + gridDados.Rows[29].Cells[1].Value = (_SensorIMU?.Pitch ?? 0).ToString("0.00"); + gridDados.Rows[30].Cells[1].Value = (_SensorIMU?.Yaw ?? 0).ToString("0.00"); + gridDados.Rows[31].Cells[1].Value = (_SensorIMU?.Temperatura ?? 0).ToString("0.00"); + gridDados.Rows[32].Cells[1].Value = (_SensorIMU?.Pressao ?? 0).ToString("0.00"); + gridDados.Rows[33].Cells[1].Value = (_SensorIMU?.Altitude ?? 0).ToString("0.00"); } #endregion diff --git a/AgroBase/AgroBase/Forms/Operacoes/frmResultadosOperacao.cs b/AgroBase/AgroBase/Forms/Operacoes/frmResultadosOperacao.cs index 36274c20c..20b550194 100644 --- a/AgroBase/AgroBase/Forms/Operacoes/frmResultadosOperacao.cs +++ b/AgroBase/AgroBase/Forms/Operacoes/frmResultadosOperacao.cs @@ -23,7 +23,6 @@ namespace AgroBase.Forms.Operacoes List LogsMovimentacao = new List(); List LogsAtuador = new List(); List LogsSensoriamento = new List(); - List LogsPzem = new List(); List LogsA05 = new List(); List LogsSonar = new List(); List> LogsCam_Solo = new List>(); @@ -131,7 +130,6 @@ namespace AgroBase.Forms.Operacoes LogsMovimentacao = JsonConvert.DeserializeObject(OperacaoModel.DeserializarDadosOperacao(ofd.FileName, data.mov ?? Enums.T_Code.Mov.ToString())).ToList(); LogsAtuador = JsonConvert.DeserializeObject(OperacaoModel.DeserializarDadosOperacao(ofd.FileName, data.atu ?? Enums.T_Code.Atu.ToString())).ToList(); LogsSensoriamento = JsonConvert.DeserializeObject(OperacaoModel.DeserializarDadosOperacao(ofd.FileName, data.sen ?? Enums.T_Code.Sen.ToString())).ToList(); - LogsPzem = JsonConvert.DeserializeObject(OperacaoModel.DeserializarDadosOperacao(ofd.FileName, data.pzm ?? Enums.T_Code.Pzm.ToString())).ToList(); LogsA05 = JsonConvert.DeserializeObject(OperacaoModel.DeserializarDadosOperacao(ofd.FileName, data.a05 ?? Enums.T_Code.A05.ToString())).ToList(); LogsSonar = JsonConvert.DeserializeObject(OperacaoModel.DeserializarDadosOperacao(ofd.FileName, data.snr ?? Enums.T_Code.Snr.ToString())).ToList(); LogsCam_Caminho = JsonConvert.DeserializeObject(OperacaoModel.DeserializarDadosOperacao(ofd.FileName, data.cam_caminho)).ToList(); @@ -628,18 +626,32 @@ namespace AgroBase.Forms.Operacoes }, new GraficoInterativoSerieModel() { - Titulo = "V Bat", - Valores = LogsPzem.Select(x => x?.Tensao ?? 0).ToList(), + Titulo = "V 24v", + Valores = LogsSensoriamento.Select(x => x?.SensoresCorrente?.FirstOrDefault(y => y.ID.Contains("24V"))?.BusVoltage ?? 0).ToList(), Visivel = true, MostrarValor = true }, new GraficoInterativoSerieModel() { - Titulo = "A Bat", - Valores = LogsPzem.Select(x => x?.Corrente ?? 0).ToList(), + Titulo = "A 24v", + Valores = LogsSensoriamento.Select(x => x?.SensoresCorrente?.FirstOrDefault(y => y.ID.Contains("24V"))?.Current ?? 0).ToList(), Visivel = true, MostrarValor = true - } + }, + new GraficoInterativoSerieModel() + { + Titulo = "V 36v", + Valores = LogsSensoriamento.Select(x => x?.SensoresCorrente?.FirstOrDefault(y => y.ID.Contains("36V"))?.BusVoltage ?? 0).ToList(), + Visivel = true, + MostrarValor = true + }, + new GraficoInterativoSerieModel() + { + Titulo = "A 36v", + Valores = LogsSensoriamento.Select(x => x?.SensoresCorrente?.FirstOrDefault(y => y.ID.Contains("36V"))?.Current ?? 0).ToList(), + Visivel = true, + MostrarValor = true + }, }); graficoCpu = new GraficoInterativoModel(chartCpu, Momentos, new List() @@ -1121,7 +1133,6 @@ namespace AgroBase.Forms.Operacoes noModulos.Nodes.Add(AtualizarTextoStatusModulo(Enums.T_Code.Sen, LogsSensoriamento[idxMomentoAtual].Conectado, LogsSensoriamento[idxMomentoAtual].UltimoComandoRespondido)); noModulos.Nodes.Add(AtualizarTextoStatusModulo(Enums.T_Code.Mov, LogsMovimentacao[idxMomentoAtual].Inicializado, LogsMovimentacao[idxMomentoAtual].UltimoComandoRespondido)); noModulos.Nodes.Add(AtualizarTextoStatusModulo(Enums.T_Code.Dir, LogsDirecional[idxMomentoAtual].Inicializado, LogsDirecional[idxMomentoAtual].UltimoComandoRespondido)); - noModulos.Nodes.Add(AtualizarTextoStatusModulo(Enums.T_Code.Pzm, LogsPzem[idxMomentoAtual].Inicializado, LogsPzem[idxMomentoAtual].UltimoComandoRespondido)); noModulos.Nodes.Add(AtualizarTextoStatusModulo(Enums.T_Code.A05, LogsA05[idxMomentoAtual].Conectado, LogsA05[idxMomentoAtual].UltimoComandoRespondido)); noModulos.Nodes.Add(AtualizarTextoStatusModulo(Enums.T_Code.Gps, LogsGPS[idxMomentoAtual].Inicializado, LogsGPS[idxMomentoAtual].UltimoComandoRespondido)); //noModulos.Nodes.Add(AtualizarTextoStatusModulo(Enums.T_Code.Knt, LogsCam_Caminho[idxMomentoAtual].Inicializado, LogsCam_Caminho[idxMomentoAtual].UltimaMensagemRecebida)); diff --git a/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs b/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs index 381c099ef..c41a65961 100644 --- a/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs +++ b/AgroBase/AgroBase/Forms/Sensoriamento/frmSenConfig.cs @@ -58,10 +58,10 @@ namespace AgroBase.Forms.Sensoriamento PreencheParametrosSensores(); - cmbBateriaParametro.Items.Clear(); + /*cmbBateriaParametro.Items.Clear(); cmbBateriaParametro.Items.Add("Carga Consumida"); cmbBateriaParametro.Items.AddRange(PZEMService.Parametros.Keys.ToArray()); - cmbBateriaParametro.SelectedIndex = 0; + cmbBateriaParametro.SelectedIndex = 0;*/ } private void AtualizarCameras() @@ -220,7 +220,7 @@ namespace AgroBase.Forms.Sensoriamento private void btnBateriaVer_Click(object sender, EventArgs e) { - if (cmbBateriaParametro.SelectedIndex == 0) + /*if (cmbBateriaParametro.SelectedIndex == 0) { MessageBox.Show("Carga consumida da bateria: " + PZEMService.ContadorCarga.PercentualConsumido + "%"); } @@ -241,12 +241,12 @@ namespace AgroBase.Forms.Sensoriamento await Task.Delay(1000); PZEMService.ModoLeitura = false; }); - } + }*/ } private void btnBateriaDefinir_Click(object sender, EventArgs e) { - if (cmbBateriaParametro.SelectedIndex == 0) + /*if (cmbBateriaParametro.SelectedIndex == 0) { double consumidoAtual = Convert.ToDouble(nudBateriaValor.Value); PZEMService.ContadorCarga.AtualizarValorConsumido(consumidoAtual); @@ -261,18 +261,18 @@ namespace AgroBase.Forms.Sensoriamento Comando = PZEMService.ComandoSetParametro(PZEMService.Parametros[cmbBateriaParametro.Text], Convert.ToInt32(nudBateriaValor.Value)) }; ModbusService.AdicionarComandoNaFila(Comando); - } + }*/ } private void btnBateriaCalibrar_Click(object sender, EventArgs e) { - var Comando = new ModbusComandoModel() + /*var Comando = new ModbusComandoModel() { Dispositivo = T_Code.Pzm, Endereco = PZEMService.slaveAddress, Comando = PZEMService.ComandoCalibragem() }; - ModbusService.AdicionarComandoNaFila(Comando); + ModbusService.AdicionarComandoNaFila(Comando);*/ } } diff --git a/AgroBase/AgroBase/Forms/frmAcompanhamento.Designer.cs b/AgroBase/AgroBase/Forms/frmAcompanhamento.Designer.cs index d383e2d37..f93caacf0 100644 --- a/AgroBase/AgroBase/Forms/frmAcompanhamento.Designer.cs +++ b/AgroBase/AgroBase/Forms/frmAcompanhamento.Designer.cs @@ -43,6 +43,8 @@ namespace AgroBase.Forms System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmAcompanhamento)); this.pnlFundo = new System.Windows.Forms.Panel(); + this.lblB24V = new System.Windows.Forms.Label(); + this.lblGPSDetalhes = new System.Windows.Forms.Label(); this.lblPerformance = new System.Windows.Forms.Label(); this.lblMagnetometro = new System.Windows.Forms.Label(); this.lblGPS = new System.Windows.Forms.Label(); @@ -52,15 +54,12 @@ namespace AgroBase.Forms this.lblU1 = new System.Windows.Forms.Label(); this.lblU4 = new System.Windows.Forms.Label(); this.lblU3 = new System.Windows.Forms.Label(); - this.lblUL_A05 = new System.Windows.Forms.Label(); - this.lblUL_Wit = new System.Windows.Forms.Label(); - this.lblUL_Pzm = new System.Windows.Forms.Label(); this.lblB12V = new System.Windows.Forms.Label(); this.lblB7V2 = new System.Windows.Forms.Label(); this.lblB5V = new System.Windows.Forms.Label(); this.lblB3V = new System.Windows.Forms.Label(); this.lblTemperatura = new System.Windows.Forms.Label(); - this.lblTensao = new System.Windows.Forms.Label(); + this.lblB36V = new System.Windows.Forms.Label(); this.lblDistanciaParcial = new System.Windows.Forms.Label(); this.lblDistanciaTotal = new System.Windows.Forms.Label(); this.lblTempoEmMovimento = new System.Windows.Forms.Label(); @@ -126,7 +125,7 @@ namespace AgroBase.Forms this.lblEFA_SP = new System.Windows.Forms.Label(); this.lblM_EF = new System.Windows.Forms.Label(); this.picEF = new System.Windows.Forms.PictureBox(); - this.lblGPSDetalhes = new System.Windows.Forms.Label(); + this.lblB19V = new System.Windows.Forms.Label(); this.pnlFundo.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.chartET)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.chartDT)).BeginInit(); @@ -143,6 +142,8 @@ namespace AgroBase.Forms // this.pnlFundo.AutoScroll = true; this.pnlFundo.BackColor = System.Drawing.Color.White; + this.pnlFundo.Controls.Add(this.lblB19V); + this.pnlFundo.Controls.Add(this.lblB24V); this.pnlFundo.Controls.Add(this.lblGPSDetalhes); this.pnlFundo.Controls.Add(this.lblPerformance); this.pnlFundo.Controls.Add(this.lblMagnetometro); @@ -153,15 +154,12 @@ namespace AgroBase.Forms this.pnlFundo.Controls.Add(this.lblU1); this.pnlFundo.Controls.Add(this.lblU4); this.pnlFundo.Controls.Add(this.lblU3); - this.pnlFundo.Controls.Add(this.lblUL_A05); - this.pnlFundo.Controls.Add(this.lblUL_Wit); - this.pnlFundo.Controls.Add(this.lblUL_Pzm); this.pnlFundo.Controls.Add(this.lblB12V); this.pnlFundo.Controls.Add(this.lblB7V2); this.pnlFundo.Controls.Add(this.lblB5V); this.pnlFundo.Controls.Add(this.lblB3V); this.pnlFundo.Controls.Add(this.lblTemperatura); - this.pnlFundo.Controls.Add(this.lblTensao); + this.pnlFundo.Controls.Add(this.lblB36V); this.pnlFundo.Controls.Add(this.lblDistanciaParcial); this.pnlFundo.Controls.Add(this.lblDistanciaTotal); this.pnlFundo.Controls.Add(this.lblTempoEmMovimento); @@ -234,6 +232,27 @@ namespace AgroBase.Forms this.pnlFundo.Size = new System.Drawing.Size(1473, 811); this.pnlFundo.TabIndex = 0; // + // lblB24V + // + this.lblB24V.AutoSize = true; + this.lblB24V.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblB24V.Location = new System.Drawing.Point(656, 708); + this.lblB24V.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblB24V.Name = "lblB24V"; + this.lblB24V.Size = new System.Drawing.Size(129, 12); + this.lblB24V.TabIndex = 191; + this.lblB24V.Text = "Barramento 24V: 0,00V 0,00A"; + // + // lblGPSDetalhes + // + this.lblGPSDetalhes.AutoSize = true; + this.lblGPSDetalhes.Location = new System.Drawing.Point(674, 115); + this.lblGPSDetalhes.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblGPSDetalhes.Name = "lblGPSDetalhes"; + this.lblGPSDetalhes.Size = new System.Drawing.Size(118, 13); + this.lblGPSDetalhes.TabIndex = 190; + this.lblGPSDetalhes.Text = "SemCorrecao - 0,00 cm"; + // // lblPerformance // this.lblPerformance.AutoSize = true; @@ -331,39 +350,6 @@ namespace AgroBase.Forms this.lblU3.TabIndex = 181; this.lblU3.Text = "U3: 0 mm"; // - // lblUL_A05 - // - this.lblUL_A05.AutoSize = true; - this.lblUL_A05.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblUL_A05.Location = new System.Drawing.Point(656, 755); - this.lblUL_A05.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblUL_A05.Name = "lblUL_A05"; - this.lblUL_A05.Size = new System.Drawing.Size(122, 12); - this.lblUL_A05.TabIndex = 180; - this.lblUL_A05.Text = "Ultima Leitura A05: 00:00:00"; - // - // lblUL_Wit - // - this.lblUL_Wit.AutoSize = true; - this.lblUL_Wit.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblUL_Wit.Location = new System.Drawing.Point(656, 743); - this.lblUL_Wit.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblUL_Wit.Name = "lblUL_Wit"; - this.lblUL_Wit.Size = new System.Drawing.Size(122, 12); - this.lblUL_Wit.TabIndex = 179; - this.lblUL_Wit.Text = "Ultima Leitura WIT: 00:00:00"; - // - // lblUL_Pzm - // - this.lblUL_Pzm.AutoSize = true; - this.lblUL_Pzm.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblUL_Pzm.Location = new System.Drawing.Point(656, 731); - this.lblUL_Pzm.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblUL_Pzm.Name = "lblUL_Pzm"; - this.lblUL_Pzm.Size = new System.Drawing.Size(126, 12); - this.lblUL_Pzm.TabIndex = 178; - this.lblUL_Pzm.Text = "Ultima Leitura PZM: 00:00:00"; - // // lblB12V // this.lblB12V.AutoSize = true; @@ -412,23 +398,23 @@ namespace AgroBase.Forms // this.lblTemperatura.AutoSize = true; this.lblTemperatura.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTemperatura.Location = new System.Drawing.Point(656, 692); + this.lblTemperatura.Location = new System.Drawing.Point(656, 758); this.lblTemperatura.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); this.lblTemperatura.Name = "lblTemperatura"; this.lblTemperatura.Size = new System.Drawing.Size(33, 12); this.lblTemperatura.TabIndex = 173; this.lblTemperatura.Text = "0,00ºC"; // - // lblTensao + // lblB36V // - this.lblTensao.AutoSize = true; - this.lblTensao.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.lblTensao.Location = new System.Drawing.Point(656, 611); - this.lblTensao.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblTensao.Name = "lblTensao"; - this.lblTensao.Size = new System.Drawing.Size(136, 12); - this.lblTensao.TabIndex = 171; - this.lblTensao.Text = "Bateria: 0,00 V - 0,00 A - 0,00 W"; + this.lblB36V.AutoSize = true; + this.lblB36V.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblB36V.Location = new System.Drawing.Point(656, 724); + this.lblB36V.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblB36V.Name = "lblB36V"; + this.lblB36V.Size = new System.Drawing.Size(129, 12); + this.lblB36V.TabIndex = 171; + this.lblB36V.Text = "Barramento 36V: 0,00V 0,00A"; // // lblDistanciaParcial // @@ -1109,15 +1095,16 @@ namespace AgroBase.Forms this.picEF.TabIndex = 90; this.picEF.TabStop = false; // - // lblGPSDetalhes + // lblB19V // - this.lblGPSDetalhes.AutoSize = true; - this.lblGPSDetalhes.Location = new System.Drawing.Point(674, 115); - this.lblGPSDetalhes.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.lblGPSDetalhes.Name = "lblGPSDetalhes"; - this.lblGPSDetalhes.Size = new System.Drawing.Size(118, 13); - this.lblGPSDetalhes.TabIndex = 190; - this.lblGPSDetalhes.Text = "SemCorrecao - 0,00 cm"; + this.lblB19V.AutoSize = true; + this.lblB19V.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblB19V.Location = new System.Drawing.Point(656, 692); + this.lblB19V.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.lblB19V.Name = "lblB19V"; + this.lblB19V.Size = new System.Drawing.Size(129, 12); + this.lblB19V.TabIndex = 192; + this.lblB19V.Text = "Barramento 19V: 0,00V 0,00A"; // // frmAcompanhamento // @@ -1214,16 +1201,13 @@ namespace AgroBase.Forms private System.Windows.Forms.Label lblDistanciaTotal; private System.Windows.Forms.Label lblTempoEmMovimento; private System.Windows.Forms.Label lblTempoConectado; - public System.Windows.Forms.Label lblTensao; + public System.Windows.Forms.Label lblB36V; public System.Windows.Forms.Label lblTemperatura; public System.Windows.Forms.Label lblB12V; public System.Windows.Forms.Label lblB7V2; public System.Windows.Forms.Label lblB5V; public System.Windows.Forms.Label lblB3V; private System.Windows.Forms.Label lblEFM_Tensao; - public System.Windows.Forms.Label lblUL_Wit; - public System.Windows.Forms.Label lblUL_Pzm; - public System.Windows.Forms.Label lblUL_A05; private System.Windows.Forms.Label lblU4; private System.Windows.Forms.Label lblU3; private System.Windows.Forms.Label lblU2; @@ -1234,5 +1218,7 @@ namespace AgroBase.Forms private System.Windows.Forms.Panel pnlOrientacaoGPS; private System.Windows.Forms.Label lblPerformance; private System.Windows.Forms.Label lblGPSDetalhes; + public System.Windows.Forms.Label lblB24V; + public System.Windows.Forms.Label lblB19V; } } \ No newline at end of file diff --git a/AgroBase/AgroBase/Forms/frmAcompanhamento.cs b/AgroBase/AgroBase/Forms/frmAcompanhamento.cs index f0b36526b..c1addb3ae 100644 --- a/AgroBase/AgroBase/Forms/frmAcompanhamento.cs +++ b/AgroBase/AgroBase/Forms/frmAcompanhamento.cs @@ -50,16 +50,9 @@ namespace AgroBase.Forms AtualzarDadosMovimentacao(); - lblUL_Pzm.ForeColor = PZEMService.Iniciado ? Color.Green : Color.Red; - if (PZEMService.Iniciado) - { - lblUL_Pzm.Text = "Ultima Leitura PZM: " + PZEMService.UltimaLeitura.DataHora.ToString("HH:mm:ss"); - lblTensao.Text = "Bateria: " + PZEMService.UltimaLeitura.Tensao.ToString("0.00") + " V - " + PZEMService.UltimaLeitura.Corrente.ToString("0.00") + " A - " + PZEMService.UltimaLeitura.Potencia.ToString("0.00") + " W"; - } - lblUL_A05.ForeColor = UltrasonicA05Service.Iniciado ? Color.Green : Color.Red; if (UltrasonicA05Service.Iniciado) { - lblUL_A05.Text = "Ultima Leitura A05: " + UltrasonicA05Service.DadosLeitura.Momento.ToString("HH:mm:ss"); + //lblUL_A05.Text = "Ultima Leitura A05: " + UltrasonicA05Service.DadosLeitura.Momento.ToString("HH:mm:ss"); lblU1.Text = "U1: " + UltrasonicA05Service.DadosLeitura.Configuracao.Sensores[0].LeituraCm.ToString("") + " cm"; lblU2.Text = "U2: " + UltrasonicA05Service.DadosLeitura.Configuracao.Sensores[1].LeituraCm.ToString("") + " cm"; lblU3.Text = "U3: " + UltrasonicA05Service.DadosLeitura.Configuracao.Sensores[2].LeituraCm.ToString("") + " cm"; @@ -71,7 +64,9 @@ namespace AgroBase.Forms AtualizarDadosSensorCorrente("AB5V", lblB5V); AtualizarDadosSensorCorrente("AB7V2", lblB7V2); AtualizarDadosSensorCorrente("AB12V", lblB12V); - AtualizarDadosSensorCorrente("AB36V", lblTensao); + AtualizarDadosSensorCorrente("AB19V", lblB19V); + AtualizarDadosSensorCorrente("AB24V", lblB24V); + AtualizarDadosSensorCorrente("AB36V", lblB36V); } lblMagnetometro.ForeColor = (Variaveis.OperacaoEmAndamento.DispSen?.Dados?.DadosLeitura?.SensoresIMU?.DefaultIfEmpty()?.FirstOrDefault()?.Iniciado ?? false) ? Color.Green : Color.Red; @@ -91,7 +86,7 @@ namespace AgroBase.Forms var sensor = Variaveis.OperacaoEmAndamento.DispSen.Dados.DadosLeitura.SensoresCorrente.FirstOrDefault(x => x.ID == id); if (sensor != null) { - lbl.Text = $"{id.Replace("AB", "Barramento ")}: {sensor.BusVoltage.ToString("0.00")} V, {(sensor.Current ?? -1).ToString("0.00")} mA, {sensor.Power.ToString("0.00")} W, {sensor.Temperature.ToString("0.00")} ºC, {sensor.Energy.ToString("0.00")} Wh"; + lbl.Text = $"{id.Replace("AB", "Barramento ")}: {sensor.BusVoltage.ToString("0.00")} V, {sensor.Current.ToString("0.00")} mA, {sensor.Power.ToString("0.00")} W, {sensor.Temperature.ToString("0.00")} ºC, {sensor.Energy.ToString("0.00")} Wh"; lbl.ForeColor = sensor.Iniciado ? Color.Green : Color.Red; } } diff --git a/AgroBase/AgroBase/Models/Enums.cs b/AgroBase/AgroBase/Models/Enums.cs index 739faf567..15aacaa7f 100644 --- a/AgroBase/AgroBase/Models/Enums.cs +++ b/AgroBase/AgroBase/Models/Enums.cs @@ -301,6 +301,13 @@ Corredores = 3 } + public enum TiposShuntCorrente + { + INA219_3A2 = 0, + INA228_10A = 1, + INA228_50A = 2, + INA228_100A = 3, + } } } diff --git a/AgroBase/AgroBase/Models/Modules/AtuadorModel.cs b/AgroBase/AgroBase/Models/Modules/AtuadorModel.cs index 9ab552b64..9281ba485 100644 --- a/AgroBase/AgroBase/Models/Modules/AtuadorModel.cs +++ b/AgroBase/AgroBase/Models/Modules/AtuadorModel.cs @@ -1,5 +1,6 @@ using AgroBase.Forms.IHM; using AgroBase.Services; +using OpenHardwareMonitor.Hardware; using System; using System.Collections.Generic; using System.Drawing; @@ -441,16 +442,18 @@ namespace AgroBase.Models.Modules config.AddRange(protocoloMOD); } + bool configurarTodos = !DadosLeitura.Conectado && Conectar; + // Adicionar configurações dos Sensores que devem ser aferidos - List sensoresConfig = SensoresConfig(Conectar); + List sensoresConfig = SensoresConfig(Conectar, configurarTodos); config.AddRange(sensoresConfig); // Adicionar configurações dos Bicos - List bicosConfig = BicosConfig(Conectar); + List bicosConfig = BicosConfig(Conectar, configurarTodos); config.AddRange(bicosConfig); // Adicionar configurações das Bombas - List bombasConfig = BombasConfig(Conectar); + List bombasConfig = BombasConfig(Conectar, configurarTodos); config.AddRange(bombasConfig); return config; @@ -483,12 +486,16 @@ namespace AgroBase.Models.Modules }; } - private List SensoresConfig(bool Conectar) + private List SensoresConfig(bool Conectar, bool ConfigurarTodos) { var config = new List(); - foreach (var sensor in Sensores.Where(x => x.Aferir && x.Inicializado != Conectar)) + foreach (var sensor in Sensores.Where(x => (x.Aferir && (ConfigurarTodos ? true : x.Inicializado != Conectar)) || (!x.Aferir && x.Inicializado))) { + if (!sensor.Aferir && sensor.Inicializado) + { + Conectar = false; + } byte[] payload = sensor.ProtocoloConfiguracao(Pinout, Conectar, Dispositivo); if (payload != null) { @@ -499,12 +506,16 @@ namespace AgroBase.Models.Modules return config; } - private List BicosConfig(bool Conectar) + private List BicosConfig(bool Conectar, bool ConfigurarTodos) { var config = new List(); - foreach (var bico in BicosPulverizadores.Where(x => x.Comandar && x.Inicializado != Conectar)) + foreach (var bico in BicosPulverizadores.Where(x => (x.Comandar && (ConfigurarTodos ? true : x.Inicializado != Conectar)) || (!x.Comandar && x.Inicializado))) { + if (!bico.Comandar && bico.Inicializado) + { + Conectar = false; + } var payload = bico.ProtocoloConfiguracao(Pinout, Conectar); if (payload != null) { @@ -515,12 +526,16 @@ namespace AgroBase.Models.Modules return config; } - private List BombasConfig(bool Conectar) + private List BombasConfig(bool Conectar, bool ConfigurarTodos) { var config = new List(); - foreach (var bomba in BombasPressurizadoras.Where(x => x.Comandar && x.Inicializado != Conectar)) + foreach (var bomba in BombasPressurizadoras.Where(x => (x.Comandar && (ConfigurarTodos ? true : x.Inicializado != Conectar)) || (!x.Comandar && x.Inicializado))) { + if (!bomba.Comandar && bomba.Inicializado) + { + Conectar = false; + } var payload = bomba.ProtocoloConfiguracao(Pinout, Conectar); if (payload != null) { diff --git a/AgroBase/AgroBase/Models/Modules/SensoriamentoModel.cs b/AgroBase/AgroBase/Models/Modules/SensoriamentoModel.cs index 4532c02ca..239d5393e 100644 --- a/AgroBase/AgroBase/Models/Modules/SensoriamentoModel.cs +++ b/AgroBase/AgroBase/Models/Modules/SensoriamentoModel.cs @@ -47,7 +47,6 @@ namespace AgroBase.Models.Modules public string CameraID_Caminho { get; set; } = ""; public List CameraID_Solo { get; set; } = new List(); public UltrasonicA05Configuracoes ConfiguracaoSensorUltrassom { get; set; } - public double BateriaCargaConsumida { get; set; } public SensoriamentoMensagemJsonModel DadosLeitura { get; set; } = new SensoriamentoMensagemJsonModel(); private SenHandler _SenHandler = new SenHandler(); public LoRaParametrosModel LoRaParametrosBase { get; set; } = new LoRaParametrosModel() @@ -61,7 +60,7 @@ namespace AgroBase.Models.Modules worCycle = LoRaService.CodigosWorCycles[4000], power = LoRaService.CodigosPowers[22], }; - + public CoulombCounterService ContadorCarga = new CoulombCounterService(VariaveisEquipamento.CorrenteMaximaBateria); public AsyncTaskTimerModel tmrRegistrador; private int _TempoReconexaoComponentes = 5; private int _VezesLeituraReconexao = 0; @@ -253,17 +252,25 @@ namespace AgroBase.Models.Modules new SensorParametroModel() { Descricao = "Endereço I2C", - Valor = "0x45", + Valor = "0x40", QtdBytes = 1, Escalar = false, Enviar = true }, new SensorParametroModel() { - Descricao = "Corrente Máx", - Valor = (3.2).ToString(), - QtdBytes = 2, - Escalar = true, + Descricao = "Shunt", + Valor = ((int)TiposShuntCorrente.INA219_3A2).ToString(), + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Canal MUX", + Valor = "0", + QtdBytes = 1, + Escalar = false, Enviar = true }, } @@ -285,17 +292,25 @@ namespace AgroBase.Models.Modules new SensorParametroModel() { Descricao = "Endereço I2C", - Valor = "0x41", + Valor = "0x40", QtdBytes = 1, Escalar = false, Enviar = true }, new SensorParametroModel() { - Descricao = "Corrente Máx", - Valor = (3.2).ToString(), - QtdBytes = 2, - Escalar = true, + Descricao = "Shunt", + Valor = ((int)TiposShuntCorrente.INA219_3A2).ToString(), + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Canal MUX", + Valor = "1", + QtdBytes = 1, + Escalar = false, Enviar = true }, } @@ -317,17 +332,25 @@ namespace AgroBase.Models.Modules new SensorParametroModel() { Descricao = "Endereço I2C", - Valor = "0x44", + Valor = "0x40", QtdBytes = 1, Escalar = false, Enviar = true }, new SensorParametroModel() { - Descricao = "Corrente Máx", - Valor = (50).ToString(), - QtdBytes = 2, - Escalar = true, + Descricao = "Shunt", + Valor = ((int)TiposShuntCorrente.INA219_3A2).ToString(), + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Canal MUX", + Valor = "2", + QtdBytes = 1, + Escalar = false, Enviar = true }, } @@ -356,10 +379,98 @@ namespace AgroBase.Models.Modules }, new SensorParametroModel() { - Descricao = "Corrente Máx", - Valor = (100).ToString(), - QtdBytes = 2, - Escalar = true, + Descricao = "Shunt", + Valor = ((int)TiposShuntCorrente.INA228_50A).ToString(), + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Canal MUX", + Valor = "3", + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + } + }, + new SensorModel() + { + ID = "AB19V", + Descricao = "Corrente no Barramento 19V", + ID_Num = 15, + Componente = S_Code.sCOR, + Aferir = true, + Funcoes = new List() + { + FuncoesPinout.I2C, + }, + UnidadeMedida = "mA", + Parametros = new List() + { + new SensorParametroModel() + { + Descricao = "Endereço I2C", + Valor = "0x40", + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Shunt", + Valor = ((int)TiposShuntCorrente.INA228_10A).ToString(), + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Canal MUX", + Valor = "4", + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + } + }, + new SensorModel() + { + ID = "AB24V", + Descricao = "Corrente no Barramento 24V", + ID_Num = 16, + Componente = S_Code.sCOR, + Aferir = true, + Funcoes = new List() + { + FuncoesPinout.I2C, + }, + UnidadeMedida = "mA", + Parametros = new List() + { + new SensorParametroModel() + { + Descricao = "Endereço I2C", + Valor = "0x40", + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Shunt", + Valor = ((int)TiposShuntCorrente.INA228_50A).ToString(), + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Canal MUX", + Valor = "5", + QtdBytes = 1, + Escalar = false, Enviar = true }, } @@ -368,7 +479,7 @@ namespace AgroBase.Models.Modules { ID = "AB36V", Descricao = "Corrente no Barramento 36V", - ID_Num = 15, + ID_Num = 17, Componente = S_Code.sCOR, Aferir = true, Funcoes = new List() @@ -388,10 +499,18 @@ namespace AgroBase.Models.Modules }, new SensorParametroModel() { - Descricao = "Corrente Máx", - Valor = (100).ToString(), - QtdBytes = 2, - Escalar = true, + Descricao = "Shunt", + Valor = ((int)TiposShuntCorrente.INA228_100A).ToString(), + QtdBytes = 1, + Escalar = false, + Enviar = true + }, + new SensorParametroModel() + { + Descricao = "Canal MUX", + Valor = "6", + QtdBytes = 1, + Escalar = false, Enviar = true }, } @@ -695,20 +814,22 @@ namespace AgroBase.Models.Modules config.AddRange(protocoloMOD); } + bool configurarTodos = !DadosLeitura.Conectado && Conectar; + // Adicionar configurações dos Sinaleiros - List sinaleirosConfig = SinaleirosConfig(Conectar); + List sinaleirosConfig = SinaleirosConfig(Conectar, configurarTodos); config.AddRange(sinaleirosConfig); // Adicionar configurações dos Servos - List servosConfig = ServosConfig(Conectar); + List servosConfig = ServosConfig(Conectar, configurarTodos); config.AddRange(servosConfig); // Adicionar configurações dos Reles - List relesConfig = RelesConfig(Conectar); + List relesConfig = RelesConfig(Conectar, configurarTodos); config.AddRange(relesConfig); // Adicionar configurações dos Sensores que devem ser aferidos - List sensoresConfig = SensoresConfig(Conectar); + List sensoresConfig = SensoresConfig(Conectar, configurarTodos); config.AddRange(sensoresConfig); return config; @@ -741,12 +862,16 @@ namespace AgroBase.Models.Modules }; } - public List SensoresConfig(bool Conectar) + public List SensoresConfig(bool Conectar, bool ConfigurarTodos) { var config = new List(); - foreach (var sensor in Sensores.Where(x => x.Aferir && x.Inicializado != Conectar)) + foreach (var sensor in Sensores.Where(x => (x.Aferir && (ConfigurarTodos ? true : x.Inicializado != Conectar)) || (!x.Aferir && x.Inicializado))) { + if (!sensor.Aferir && sensor.Inicializado) + { + Conectar = false; + } byte[] payload = sensor.ProtocoloConfiguracao(Pinout, Conectar, Dispositivo); if (payload != null) { @@ -757,11 +882,11 @@ namespace AgroBase.Models.Modules return config; } - private List SinaleirosConfig(bool Conectar) + private List SinaleirosConfig(bool Conectar, bool ConfigurarTodos) { var config = new List(); - foreach (var sinaleiro in Sinaleiros.Where(x => x.Inicializado != Conectar)) + foreach (var sinaleiro in Sinaleiros.Where(x => (ConfigurarTodos ? true : x.Inicializado != Conectar))) { var payload = sinaleiro.ProtocoloConfiguracao(Pinout, Conectar); if (payload != null) @@ -773,12 +898,16 @@ namespace AgroBase.Models.Modules return config; } - private List RelesConfig(bool Conectar) + private List RelesConfig(bool Conectar, bool ConfigurarTodos) { var config = new List(); - foreach (var rele in Reles.Where(x => x.Controlar && x.Inicializado != Conectar)) + foreach (var rele in Reles.Where(x => (x.Controlar && (ConfigurarTodos ? true : x.Inicializado != Conectar)) || (!x.Controlar && x.Inicializado))) { + if (!rele.Controlar && rele.Inicializado) + { + Conectar = false; + } var payload = rele.ProtocoloConfiguracao(Pinout, Conectar); if (payload != null) { @@ -789,12 +918,16 @@ namespace AgroBase.Models.Modules return config; } - private List ServosConfig(bool Conectar) + private List ServosConfig(bool Conectar, bool ConfigurarTodos) { var config = new List(); - foreach (var servo in Servos.Where(x => x.Controlar && x.Inicializado != Conectar)) + foreach (var servo in Servos.Where(x => (x.Controlar && (ConfigurarTodos ? true : x.Inicializado != Conectar)) || (!x.Controlar && x.Inicializado))) { + if (!servo.Controlar && servo.Inicializado) + { + Conectar = false; + } var payload = servo.ProtocoloConfiguracao(Pinout, Conectar); if (payload != null) { @@ -1360,7 +1493,7 @@ namespace AgroBase.Models.Modules public byte[] InterpretarParametro() { - string valor = Valor.Trim(); + string valor = Valor.Replace(",", ".").Trim(); // HEX direto if (valor.StartsWith("0x", StringComparison.OrdinalIgnoreCase)) @@ -1444,21 +1577,42 @@ namespace AgroBase.Models.Modules public class FirmwareSensorCorrente : IFirmwareSensorBase { - public DateTime Momento { get; set; } + private DateTime _momento; + public DateTime Momento + { + get + { + return _momento; + } + set + { + double dt = (value - _momento).TotalSeconds; + if (dt > 0) + { + _dt = dt; + } + _momento = value; + } + } public string ID { get; set; } public int ID_Num { get; set; } public bool Iniciado { get; set; } public double BusVoltage { get; set; } public double ShuntVoltage { get; set; } - public double? Current - { + public double Current + { get { return _atual; } set { - _atual = value ?? 0; + _atual = value; + + if (ID == "AB36V") + { + Variaveis.OperacaoEmAndamento.DispSen?.Dados?.ContadorCarga?.AtualizarConsumo(); + } AtualizarExtremos(); } @@ -1494,6 +1648,7 @@ namespace AgroBase.Models.Modules } } + public double _dt { get; set; } private double _atual = 0; private void AtualizarExtremos() diff --git a/AgroBase/AgroBase/Models/Operacoes/OperacaoModel.cs b/AgroBase/AgroBase/Models/Operacoes/OperacaoModel.cs index e17a093c6..45cbcb32a 100644 --- a/AgroBase/AgroBase/Models/Operacoes/OperacaoModel.cs +++ b/AgroBase/AgroBase/Models/Operacoes/OperacaoModel.cs @@ -612,16 +612,6 @@ namespace AgroBase.Models { Dispositivo = T_Code.Sen, Mandatorio = true, - }, - new OperacaoModulosMandatoriosModel() - { - Dispositivo = T_Code.Wit, - Mandatorio = false, - }, - new OperacaoModulosMandatoriosModel() - { - Dispositivo = T_Code.Pzm, - Mandatorio = true, }, new OperacaoModulosMandatoriosModel() { @@ -2003,7 +1993,7 @@ namespace AgroBase.Models }; SalvarLog(T_Code.Sen.ToString(), logSen, false); - PzmSensoriamentoLogModel logPzm = new PzmSensoriamentoLogModel() + /*PzmSensoriamentoLogModel logPzm = new PzmSensoriamentoLogModel() { Momento = Agora, Inicializado = PZEMService.Iniciado, @@ -2019,7 +2009,7 @@ namespace AgroBase.Models CargaConsumidaPercentual = PZEMService.ContadorCarga.PercentualConsumido, UltimoComandoRespondido = PZEMService.UltimaLeitura.DataHora, }; - SalvarLog(T_Code.Pzm.ToString(), logPzm, Fim); + SalvarLog(T_Code.Pzm.ToString(), logPzm, Fim);*/ UltrasonicA05Model logA05 = new UltrasonicA05Model() { @@ -3009,6 +2999,7 @@ namespace AgroBase.Models var _OpMapaGPS = Variaveis.OperacaoEmAndamento.OpMapaGPS; var _DispMvd = Variaveis.OperacaoEmAndamento.DispMvd; var _DispAtu = Variaveis.OperacaoEmAndamento.DispAtu; + var _DispSen = Variaveis.OperacaoEmAndamento.DispSen; var _Controle = Variaveis.OperacaoEmAndamento.Controle; Variaveis.OperacaoEmAndamento.AtualizarDispositiviosIndividuaisConectados(); @@ -3054,13 +3045,18 @@ namespace AgroBase.Models MovDir_Status = _DispMvd.Dados.StatusModulosMOV(Direcao.Direita) } : new OperacaoSensoriamentoLogMvdModel(); - var dadosBateria = new OperacaoSensoriamentoLogBateriaModel() + var S36V = _DispSen?.Dados?.DadosLeitura?.SensoresCorrente?.FirstOrDefault(x => x.ID == "AB36V"); + var dadosBateria = S36V != null ? new OperacaoSensoriamentoLogBateriaModel() { - PorcentagemBateria = FuncoesMatematicas.Clamp(PZEMService.ContadorCarga.PercentualBateria, 0, 100), - BateriaConsumida = FuncoesMatematicas.Clamp(PZEMService.ContadorCarga.PercentualConsumido, 0, 100), - CorrenteInstantanea = PZEMService.UltimaLeitura.Corrente, - TensaoInstantanea = PZEMService.UltimaLeitura.Tensao - }; + _dt = S36V?._dt ?? 0, + PorcentagemBateria = FuncoesMatematicas.Clamp(_DispSen.Dados.ContadorCarga.PercentualBateria, 0, 100), + BateriaConsumida = FuncoesMatematicas.Clamp(_DispSen.Dados.ContadorCarga.PercentualConsumido, 0, 100), + TempoEstimadoRestanteMinutos = _DispSen.Dados.ContadorCarga.TempoEstimadoMinutos, + CorrenteInstantanea = (S36V?.Current ?? 0) / 1000.0, + TensaoInstantanea = S36V?.BusVoltage ?? 0, + PotenciaInstantanea = S36V?.Power ?? 0, + PotenciaAcumulada = S36V?.Energy ?? 0 + } : new OperacaoSensoriamentoLogBateriaModel(); var dadosTrajetoria = new OperacaoSensoriamentoLogTrajetoriaModel() { @@ -3226,19 +3222,27 @@ namespace AgroBase.Models public class OperacaoSensoriamentoLogBateriaModel { + public double _dt { get; set; } public double PorcentagemBateria { get; set; } public double BateriaConsumida { get; set; } public double CorrenteInstantanea { get; set; } public double TensaoInstantanea { get; set; } + public double PotenciaInstantanea { get; set; } + public double PotenciaAcumulada { get; set; } + public double TempoEstimadoRestanteMinutos { get; set; } public OperacaoSensoriamentoLogBateriaModel Clone() { return new OperacaoSensoriamentoLogBateriaModel() { + _dt = _dt, BateriaConsumida = BateriaConsumida, PorcentagemBateria = PorcentagemBateria, CorrenteInstantanea = CorrenteInstantanea, - TensaoInstantanea = TensaoInstantanea + TensaoInstantanea = TensaoInstantanea, + PotenciaInstantanea = PotenciaInstantanea, + PotenciaAcumulada = PotenciaAcumulada, + TempoEstimadoRestanteMinutos = TempoEstimadoRestanteMinutos }; } } diff --git a/AgroBase/AgroBase/Models/Variaveis.cs b/AgroBase/AgroBase/Models/Variaveis.cs index c1dabcb80..bbe5dd043 100644 --- a/AgroBase/AgroBase/Models/Variaveis.cs +++ b/AgroBase/AgroBase/Models/Variaveis.cs @@ -93,6 +93,9 @@ namespace AgroBase.Models return ((LarguraEsquerda + LarguraDireita + 20.0) * 10.0); } } + public static double TensaoMinimaBateria { get; set; } = 20.0; + public static double TensaoMaximaBateria { get; set; } = 20.0; + public static double CorrenteMaximaBateria { get; set; } = 20.0; public static double PercentualTensaoBateriaMin { get; set; } = 25.0; public static double PercentualReservatorioMin { get; set; } = 5.0; public static double PercentualToleranciaPressaoLinha { get; set; } = 0.15; diff --git a/AgroBase/AgroBase/Services/CoulombCounterService.cs b/AgroBase/AgroBase/Services/CoulombCounterService.cs index c99e8ac04..95d797d2c 100644 --- a/AgroBase/AgroBase/Services/CoulombCounterService.cs +++ b/AgroBase/AgroBase/Services/CoulombCounterService.cs @@ -1,5 +1,7 @@ using AgroBase.Models; using System; +using System.Collections.Generic; +using System.Linq; namespace AgroBase.Services { @@ -9,11 +11,18 @@ namespace AgroBase.Services { double coulombsMax = _max_Amp * 3600; CargaMaxima = coulombsMax; - double consumo = (Variaveis.OperacaoEmAndamento.DispSen?.Dados?.BateriaCargaConsumida ?? 0); - Consumido = consumo < CargaMaxima ? consumo : 0; + //double consumo = (Variaveis.OperacaoEmAndamento.DispSen?.Dados?.BateriaCargaConsumida ?? 0); + //Consumido = consumo < CargaMaxima ? consumo : 0; + Consumido = 0; CargaAtual = CargaMaxima - Consumido; + //double consumoW = (Variaveis.OperacaoEmAndamento.DispSen?.Dados?.BateriaCargaConsumidaWatts ?? 0); + //ConsumidoWatts = consumoW; } + public double TempoEstimadoMinutos { get; private set; } + private const int BufferSize = 30; // últimos 3 segundos se chamada a cada 100ms + private readonly Queue _historicoCorrente = new Queue(); + private double CargaMaxima { get; set; } private double CargaAtual { get; set; } public double CargaAtualAmp @@ -53,39 +62,47 @@ namespace AgroBase.Services } } public double PercentualBateria { get; private set; } + public double ConsumidoWatts { get; set; } public void AtualizarConsumo() { - PercentualBateria = Math.Round(FuncoesMatematicas.Map(PZEMService.UltimaLeitura.Tensao, PZEMService.TensaoMinima, PZEMService.TensaoMaxima, 0.0, 100.0), 2); + var Bateria = Variaveis.OperacaoEmAndamento.Sensoriamento.Bateria; - // Obtenha as datas das leituras - DateTime ultimaLeitura = PZEMService.UltimaLeitura.DataHora; - DateTime penultimaLeitura = PZEMService.PenultimaLeitura.DataHora; + PercentualBateria = Math.Round(FuncoesMatematicas.Map(Bateria.TensaoInstantanea, VariaveisEquipamento.TensaoMinimaBateria, VariaveisEquipamento.TensaoMaximaBateria, 0.0, 100.0), 2); // Verifique se as datas são válidas (não MinValue, MaxValue ou valores anômalos) - if (ultimaLeitura == DateTime.MinValue || ultimaLeitura == DateTime.MaxValue || - penultimaLeitura == DateTime.MinValue || penultimaLeitura == DateTime.MaxValue) + if (Bateria._dt == 0 || Bateria._dt > 10) { Console.WriteLine("Erro: Leitura inválida detectada."); return; } - // Calcule a diferença de tempo em segundos - double DifTempo = (ultimaLeitura - penultimaLeitura).TotalSeconds; - - // Defina um limite para a diferença de tempo (por exemplo, 3600 segundos = 1 hora) - double limiteTempo = 3600; // Ajuste conforme necessário - if (DifTempo <= 0 || DifTempo > limiteTempo) - { - Console.WriteLine($"Erro: Diferença de tempo inválida detectada: {DifTempo} segundos."); - return; - } - // Calcule os coulombs e atualize os valores - double coulombsLeitura = (PZEMService.UltimaLeitura.Corrente) * DifTempo; + double coulombsLeitura = Bateria.CorrenteInstantanea * Bateria._dt; Consumido += coulombsLeitura; CargaAtual -= coulombsLeitura; + + ConsumidoWatts += Bateria.PotenciaAcumulada - ConsumidoWatts; + + // Armazena a corrente instantânea + _historicoCorrente.Enqueue(Bateria.CorrenteInstantanea); + + if (_historicoCorrente.Count > BufferSize) + _historicoCorrente.Dequeue(); + + // Calcular corrente média (em A) + double correnteMedia = _historicoCorrente.Average(); + + // Verifica se a tensão está acima da mínima + if (Bateria.TensaoInstantanea > VariaveisEquipamento.TensaoMinimaBateria && correnteMedia > 0) + { + TempoEstimadoMinutos = (CargaAtualAmp / correnteMedia) * 60; + } + else + { + TempoEstimadoMinutos = 0; + } } public void AtualizarValorConsumido(double _consumo_Amp) diff --git a/AgroBase/AgroBase/bin/Debug/AgroBase.pdb b/AgroBase/AgroBase/bin/Debug/AgroBase.pdb index a71eb82f0..42910d017 100644 Binary files a/AgroBase/AgroBase/bin/Debug/AgroBase.pdb and b/AgroBase/AgroBase/bin/Debug/AgroBase.pdb differ diff --git a/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 b/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 index 14271d775..45144e398 100644 Binary files a/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 and b/AgroBase/AgroBase/bin/Debug/DawnCache/data_1 differ diff --git a/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 b/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 index c120d75a0..dcdd7ad60 100644 Binary files a/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 and b/AgroBase/AgroBase/bin/Debug/GPUCache/data_1 differ diff --git a/AgroBase/AgroBase/bin/Debug/Parametros/parametersSen-1_2.par b/AgroBase/AgroBase/bin/Debug/Parametros/parametersSen-1_2.par index 9c18b71b6..f59fe9f90 100644 --- a/AgroBase/AgroBase/bin/Debug/Parametros/parametersSen-1_2.par +++ b/AgroBase/AgroBase/bin/Debug/Parametros/parametersSen-1_2.par @@ -1 +1 @@ -{"tmrRegistrador":{"_uiControl":null,"State":2,"IsRunning":false,"IsStopped":true,"IsCreated":false,"Interval":1000,"StackTrace":"SensoriamentoModel.IniciarRegistrador","Id":"tmrRegistrador_Sen","TimeTick":"00:00:00"},"Dispositivo":102,"Modulo_ID":"Sen","_EnderecoCAN":17,"_TaxaAmostragem":1000,"RequisitarDados":true,"Conectado":false,"Sensores":[{"LogGrafico":[],"ID":"TMVET","ID_Num":1,"Descricao":"Temperatura Motor Esquerdo Trás","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TMVEF","ID_Num":2,"Descricao":"Temperatura Motor Esquerdo Frente","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TMVDT","ID_Num":3,"Descricao":"Temperatura Motor Direito Trás","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TMVDF","ID_Num":4,"Descricao":"Temperatura Motor Direito Frente","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TBAT","ID_Num":5,"Descricao":"Temperatura da bateria","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB3V","ID_Num":11,"Descricao":"Corrente no Barramento 3V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[27],"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x45","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Corrente Máx","Valor":"3,2","QtdBytes":2,"Escalar":true,"Enviar":true}],"UnidadeMedida":"mA","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB5V","ID_Num":12,"Descricao":"Corrente no Barramento 5V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[27],"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x41","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Corrente Máx","Valor":"3,2","QtdBytes":2,"Escalar":true,"Enviar":true}],"UnidadeMedida":"mA","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB7V2","ID_Num":13,"Descricao":"Corrente no Barramento 7,2V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[27],"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x44","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Corrente Máx","Valor":"50","QtdBytes":2,"Escalar":true,"Enviar":true}],"UnidadeMedida":"mA","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB12V","ID_Num":14,"Descricao":"Corrente no Barramento 12V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[27],"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Corrente Máx","Valor":"100","QtdBytes":2,"Escalar":true,"Enviar":true}],"UnidadeMedida":"mA","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB36V","ID_Num":15,"Descricao":"Corrente no Barramento 36V","Componente":6,"Aferir":true,"Leitura":null,"Inicializado":false,"Funcoes":[27],"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Corrente Máx","Valor":"10","QtdBytes":2,"Escalar":true,"Enviar":true}],"UnidadeMedida":"A","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"GY91","ID_Num":20,"Descricao":"Inclinometro","Componente":25,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[27],"Parametros":[{"Descricao":"Endereço MPU","Valor":"0x68","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Endereço BMP","Valor":"0x76","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":"","LimiteMaximo":0.0,"LimiteMinimo":0.0}],"Sinaleiros":[{"ID":"LEDMN","ID_Num":21,"Descricao":"Sinaleiro indicação de modo Manual ativo","Componente":15,"Funcoes":[38],"Comportamento":{"statusLED":1,"QtdPiscadas":1,"TempoMs":1000,"PausaMs":1000},"Leitura":null,"Inicializado":false,"LeituraComando":0,"LeituraStatus":0},{"ID":"LEDAT","ID_Num":22,"Descricao":"Sinaleiro indicação de modo Automático ativo","Componente":15,"Funcoes":[38],"Comportamento":{"statusLED":0,"QtdPiscadas":1,"TempoMs":1000,"PausaMs":1000},"Leitura":null,"Inicializado":false,"LeituraComando":0,"LeituraStatus":0},{"ID":"LEDOP","ID_Num":23,"Descricao":"Sinaleiro indicação do status da operação ativa","Componente":15,"Funcoes":[38],"Comportamento":{"statusLED":2,"QtdPiscadas":2,"TempoMs":500,"PausaMs":2000},"Leitura":null,"Inicializado":false,"LeituraComando":0,"LeituraStatus":0}],"Reles":[{"ID":"RLLRA","ID_Num":31,"Descricao":"Relé modo operação LoRa","Componente":21,"Funcoes":[26],"ControleExterno":false,"Controlar":false,"AtuacaoNivelAlto":true,"StatusControle":0,"Leitura":null,"Inicializado":false,"LeituraEstado":0}],"Servos":[{"ID":"FRO_ET","ID_Num":41,"Descricao":"Freio Motor ET","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0},{"ID":"FRO_EF","ID_Num":42,"Descricao":"Freio Motor EF","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0},{"ID":"FRO_DT","ID_Num":43,"Descricao":"Freio Motor DT","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0},{"ID":"FRO_DF","ID_Num":44,"Descricao":"Freio Motor DF","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0}],"CameraID_Caminho":"","CameraID_Solo":["",""],"ConfiguracaoSensorUltrassom":{"Configuracao":0,"Sensores":[{"ID":1,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false},{"ID":2,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false},{"ID":3,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false},{"ID":4,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false}],"_paradaFrontal":false,"_paradaTraseira":false,"_paradaEsquerda":false,"_paradaDireita":false,"DesvioNecessario":false,"ParadaNecessaria":false,"DirecoesObstaculos":[],"DirecaoDesvio":1},"BateriaCargaConsumida":0.0,"DadosLeitura":{"Momento":"0001-01-01T00:00:00","Conectado":false,"Dispositivo":0,"Versao":0,"Mod_ID":null,"QualidadeWifi":0,"LatenciaLoop":0,"SensoresTemperatura":[],"SensoresCorrente":[],"Sinaleiros":[],"Reles":[],"ServoFreios":[],"SensoresIMU":[],"UltimoComandoRespondido":"0001-01-01T00:00:00"},"LoRaParametrosBase":{"UltimaLeitura":"0001-01-01T00:00:00","PortaCOM":"","baudRate":96,"airRate":2,"baudAndAirRate":98,"parity":0,"packetSize":0,"power":0,"packetSizeAndPower":0,"tranMode":64,"worCycle":7,"tranModeAndWorCycle":71,"channelRssi":0,"lbt":0,"packetRssi":0,"address":1,"channel":23,"key":0}} \ No newline at end of file +{"ContadorCarga":{"TempoEstimadoMinutos":0.0,"CargaAtualAmp":20.0,"_Consumido":0.0,"ConsumidoAmp":0.0,"PercentualAtual":100.0,"PercentualConsumido":0.0,"PercentualBateria":0.0,"ConsumidoWatts":203.2},"tmrRegistrador":{"_uiControl":null,"State":2,"IsRunning":false,"IsStopped":true,"IsCreated":false,"Interval":1000,"StackTrace":"SensoriamentoModel.IniciarRegistrador","Id":"tmrRegistrador_Sen","TimeTick":"00:00:00"},"Dispositivo":102,"Modulo_ID":"Sen","_EnderecoCAN":17,"_TaxaAmostragem":1000,"RequisitarDados":true,"Conectado":false,"Sensores":[{"LogGrafico":[],"ID":"TMVET","ID_Num":1,"Descricao":"Temperatura Motor Esquerdo Trás","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TMVEF","ID_Num":2,"Descricao":"Temperatura Motor Esquerdo Frente","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TMVDT","ID_Num":3,"Descricao":"Temperatura Motor Direito Trás","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TMVDF","ID_Num":4,"Descricao":"Temperatura Motor Direito Frente","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"TBAT","ID_Num":5,"Descricao":"Temperatura da bateria","Componente":4,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":[12],"Parametros":[{"Descricao":"Offset","Valor":"0","QtdBytes":2,"Escalar":false,"Enviar":false}],"UnidadeMedida":"ºC","LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB3V","ID_Num":11,"Descricao":"Corrente no Barramento 3V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":null,"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Shunt","Valor":"0","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Canal MUX","Valor":"0","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":null,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB5V","ID_Num":12,"Descricao":"Corrente no Barramento 5V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":null,"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Shunt","Valor":"0","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Canal MUX","Valor":"1","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":null,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB7V2","ID_Num":13,"Descricao":"Corrente no Barramento 7,2V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":null,"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Shunt","Valor":"1","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Canal MUX","Valor":"2","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":null,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB12V","ID_Num":14,"Descricao":"Corrente no Barramento 12V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":null,"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Shunt","Valor":"2","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Canal MUX","Valor":"3","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":null,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB19V","ID_Num":15,"Descricao":"Corrente no Barramento 19V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":null,"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Shunt","Valor":"1","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Canal MUX","Valor":"4","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":null,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB24V","ID_Num":16,"Descricao":"Corrente no Barramento 24V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":null,"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Shunt","Valor":"2","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Canal MUX","Valor":"5","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":null,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"AB36V","ID_Num":17,"Descricao":"Corrente no Barramento 36V","Componente":6,"Aferir":false,"Leitura":null,"Inicializado":false,"Funcoes":null,"Parametros":[{"Descricao":"Endereço I2C","Valor":"0x40","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Shunt","Valor":"3","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Canal MUX","Valor":"6","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":null,"LimiteMaximo":0.0,"LimiteMinimo":0.0},{"LogGrafico":[],"ID":"GY91","ID_Num":20,"Descricao":"Inclinometro","Componente":25,"Aferir":true,"Leitura":null,"Inicializado":false,"Funcoes":[27],"Parametros":[{"Descricao":"Endereço MPU","Valor":"0x68","QtdBytes":1,"Escalar":false,"Enviar":true},{"Descricao":"Endereço BMP","Valor":"0x76","QtdBytes":1,"Escalar":false,"Enviar":true}],"UnidadeMedida":"","LimiteMaximo":0.0,"LimiteMinimo":0.0}],"Sinaleiros":[{"ID":"LEDMN","ID_Num":21,"Descricao":"Sinaleiro indicação de modo Manual ativo","Componente":15,"Funcoes":[38],"Comportamento":{"statusLED":1,"QtdPiscadas":1,"TempoMs":1000,"PausaMs":1000},"Leitura":null,"Inicializado":false,"LeituraComando":0,"LeituraStatus":0},{"ID":"LEDAT","ID_Num":22,"Descricao":"Sinaleiro indicação de modo Automático ativo","Componente":15,"Funcoes":[38],"Comportamento":{"statusLED":0,"QtdPiscadas":1,"TempoMs":1000,"PausaMs":1000},"Leitura":null,"Inicializado":false,"LeituraComando":0,"LeituraStatus":0},{"ID":"LEDOP","ID_Num":23,"Descricao":"Sinaleiro indicação do status da operação ativa","Componente":15,"Funcoes":[38],"Comportamento":{"statusLED":2,"QtdPiscadas":2,"TempoMs":500,"PausaMs":2000},"Leitura":null,"Inicializado":false,"LeituraComando":0,"LeituraStatus":0}],"Reles":[{"ID":"RLLRA","ID_Num":31,"Descricao":"Relé modo operação LoRa","Componente":21,"Funcoes":[26],"ControleExterno":false,"Controlar":false,"AtuacaoNivelAlto":true,"StatusControle":0,"Leitura":null,"Inicializado":false,"LeituraEstado":0}],"Servos":[{"ID":"FRO_ET","ID_Num":41,"Descricao":"Freio Motor ET","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0},{"ID":"FRO_EF","ID_Num":42,"Descricao":"Freio Motor EF","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0},{"ID":"FRO_DT","ID_Num":43,"Descricao":"Freio Motor DT","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0},{"ID":"FRO_DF","ID_Num":44,"Descricao":"Freio Motor DF","Componente":22,"Funcoes":[45],"Incremental":false,"Controlar":false,"_AnguloControle":180,"Leitura":null,"Inicializado":false,"LeituraAngulo":0.0}],"CameraID_Caminho":"","CameraID_Solo":["",""],"ConfiguracaoSensorUltrassom":{"Configuracao":0,"Sensores":[{"ID":1,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false},{"ID":2,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false},{"ID":3,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false},{"ID":4,"Posicao":0,"LimiteMinimo":false,"LimiteMinimoVal":0.0,"MargemMinimo":0.0,"LimiteMaximo":false,"LimiteMaximoVal":0.0,"MargemMaximo":0.0,"Desvio":false,"Parada":false,"DistanciaIdeal":0.0,"EmUso":false,"LeituraCm":0.0,"SensorAtuado":false}],"_paradaFrontal":false,"_paradaTraseira":false,"_paradaEsquerda":false,"_paradaDireita":false,"DesvioNecessario":false,"ParadaNecessaria":false,"DirecoesObstaculos":[],"DirecaoDesvio":1},"DadosLeitura":{"Momento":"0001-01-01T00:00:00","Conectado":false,"Dispositivo":0,"Versao":0,"Mod_ID":null,"QualidadeWifi":0,"LatenciaLoop":0,"SensoresTemperatura":[],"SensoresCorrente":[],"Sinaleiros":[],"Reles":[],"ServoFreios":[],"SensoresIMU":[],"UltimoComandoRespondido":"0001-01-01T00:00:00"},"LoRaParametrosBase":{"UltimaLeitura":"0001-01-01T00:00:00","PortaCOM":"","baudRate":96,"airRate":2,"baudAndAirRate":98,"parity":0,"packetSize":0,"power":0,"packetSizeAndPower":0,"tranMode":64,"worCycle":7,"tranModeAndWorCycle":71,"channelRssi":0,"lbt":0,"packetRssi":0,"address":1,"channel":23,"key":0}} \ No newline at end of file diff --git a/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_gps.html b/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_gps.html index 0db8e38f0..6cdc7ca7b 100644 --- a/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_gps.html +++ b/AgroBase/AgroBase/bin/Debug/Python/Output/mapa_gps.html @@ -25,7 +25,7 @@