Merge pull request #11 from rnd-ash/egs51

Egs51
This commit is contained in:
Ashcon Mohseninia (RAND_ASH) 2022-09-10 20:58:21 +01:00 committed by GitHub
commit c63294e628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 139 additions and 21 deletions

BIN
case_models/case_v1.blend Normal file

Binary file not shown.

BIN
case_models/case_v1.blend1 Normal file

Binary file not shown.

BIN
case_models/v1.FCStd Normal file

Binary file not shown.

BIN
case_models/v1.FCStd1 Normal file

Binary file not shown.

BIN
case_models/v2.FCStd Normal file

Binary file not shown.

BIN
case_models/v2.FCStd1 Normal file

Binary file not shown.

8
config_app/.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/config_app.iml" filepath="$PROJECT_DIR$/.idea/config_app.iml" />
</modules>
</component>
</project>

6
config_app/.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

48
config_app/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'config_app'",
"cargo": {
"args": [
"build",
"--bin=config_app",
"--package=config_app"
],
"filter": {
"name": "config_app",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}",
"env": {
"RUST_LOG": "ecu_diagnostic"
}
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'config_app'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=config_app",
"--package=config_app"
],
"filter": {
"name": "config_app",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

19
config_app/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,19 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "cargo run",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"run",
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

View File

@ -8,18 +8,18 @@ resolver = "2"
[dependencies]
serde_json = { version = "1.0.79" }
serde = { version = "1.0.137", features = ["derive"] }
#ecu_diagnostics="0.90.41"
ecu_diagnostics = {path="../../ecu_diagnostics"}
ecu_diagnostics="0.90.51"
#ecu_diagnostics = {path="../../ecu_diagnostics"}
image = "0.24.1"
serial-rs = {git="https://github.com/rnd-ash/serial-rs"}
nfd="0.0.4"
egui_winit_platform = "0.14.0"
#egui_winit_platform = "0.14.0"
pollster = "0.2.5"
eframe = {git = "https://github.com/emilk/egui", features=["wgpu"] }
wgpu = "0.12"
winit = "0.26.1"
egui-wgpu = "0.18.0"
egui-winit = "0.18.0"
eframe = {git = "https://github.com/emilk/egui", features=["wgpu"], rev="cf591da1a0bdb57c9495a3dcf0448b3c0d8e64e0" }
#wgpu = "0.12"
#winit = "0.26.1"
#egui-wgpu = "0.18.0"
#egui-winit = "0.18.0"
modular-bitfield = "0.11.2"
static_assertions = "1.1.0"
env_logger="0.9.0"

Binary file not shown.

1
config_app/debug_crash.sh Executable file
View File

@ -0,0 +1 @@
~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gdb $1/.pio/build/esp-wrover-kit/firmware.elf dump.elf

BIN
config_app/dump.elf Normal file

Binary file not shown.

15
config_app/note Normal file
View File

@ -0,0 +1,15 @@
EspLogMessage { lvl: Info, timestamp: 121, tag: " esp_image", msg: "segment 0: paddr=00010020 vaddr=3f400020 size=10400h ( 66560) map" }
EspLogMessage { lvl: Info, timestamp: 128, tag: " esp_image", msg: "segment 1: paddr=00020428 vaddr=3ffbdb60 size=04a74h ( 19060) load" }
EspLogMessage { lvl: Info, timestamp: 137, tag: " esp_image", msg: "segment 2: paddr=00024ea4 vaddr=40080000 size=0b174h ( 45428) load" }
EspLogMessage { lvl: Info, timestamp: 147, tag: " esp_image", msg: "segment 3: paddr=00030020 vaddr=400d0020 size=33764h (210788) map" }
EspLogMessage { lvl: Info, timestamp: 151, tag: " esp_image", msg: "segment 4: paddr=0006378c vaddr=4008b174 size=07990h ( 31120) load" }
EspLogMessage { lvl: Info, timestamp: 161, tag: " esp_image", msg: "segment 5: paddr=0006b124 vaddr=50000000 size=00010h ( 16) load" }
EspLogMessage { lvl: Info, timestamp: 88887, tag: " esp_image", msg: "segment 0: paddr=00110020 vaddr=3f400020 size=0fd88h ( 64904) map" }
EspLogMessage { lvl: Info, timestamp: 88903, tag: " esp_image", msg: "segment 1: paddr=0011fdb0 vaddr=3ffbdb60 size=00268h ( 616) " }
EspLogMessage { lvl: Info, timestamp: 88909, tag: " esp_image", msg: "segment 2: paddr=00120020 vaddr=400d0020 size=32f58h (208728) map" }
EspLogMessage { lvl: Info, timestamp: 88948, tag: " esp_image", msg: "segment 3: paddr=00152f80 vaddr=3ffbddc8 size=04184h ( 16772) " }
EspLogMessage { lvl: Info, timestamp: 88956, tag: " esp_image", msg: "segment 4: paddr=0015710c vaddr=40080000 size=12aach ( 76460) " }
EspLogMessage { lvl: Info, timestamp: 88974, tag: " esp_image", msg: "segment 5: paddr=00169bc0 vaddr=50000000 size=00010h ( 16) " }
EspLogMessage { lvl: Error, timestamp: 88980, tag: " FLASHER", msg: "Set boot partition failed! ESP_ERR_OTA_VALIDATE_FAILED" }

View File

@ -5,10 +5,6 @@ use std::iter;
use eframe::{NativeOptions, Renderer};
use ui::launcher::Launcher;
use window::MainWindow;
use egui_wgpu::renderer::{RenderPass, ScreenDescriptor};
use egui_winit_platform::{Platform, PlatformDescriptor};
use winit::event::Event::*;
use winit::event_loop::ControlFlow;
mod ui;
mod usb_hw;

View File

@ -4,7 +4,7 @@ use std::hash::{Hash, Hasher};
use std::sync::{Arc, Mutex};
use std::time::Instant;
use ecu_diagnostics::kwp2000::Kwp2000DiagnosticServer;
use eframe::egui::plot::{Plot, Value, Line, Values, Legend};
use eframe::egui::plot::{Plot, Line, Legend, Values, Value};
use eframe::egui::{Ui, RichText, Color32};
use crate::ui::status_bar::MainStatusBar;
use crate::window::{PageAction, StatusBar};

View File

@ -343,7 +343,8 @@ pub struct DataCanDump {
pub right_rear_rpm: u16,
pub shift_profile_pressed: u8,
pub selector_position: ShifterPosition,
pub paddle_position: PaddlePosition
pub paddle_position: PaddlePosition,
pub engine_rpm: u16
}
impl DataCanDump {
@ -353,6 +354,10 @@ impl DataCanDump {
ui.label(if self.pedal_position() == u8::MAX { make_text("Signal not available", true) } else { make_text(format!("{:.1} %", self.pedal_position() as f32 / 250.0 * 100.0), false) });
ui.end_row();
ui.label("Engine RPM");
ui.label(if self.engine_rpm() == u16::MAX { make_text("Signal not available", true) } else { make_text(format!("{} RPM", self.engine_rpm() as f32), false) });
ui.end_row();
ui.label("Engine minimum torque");
ui.label(if self.min_torque_ms() == u16::MAX { make_text("Signal not available", true) } else { make_text(format!("{:.1} Nm", self.min_torque_ms() as f32 / 4.0 - 500.0), false) });
ui.end_row();
@ -365,11 +370,11 @@ impl DataCanDump {
ui.label(if self.static_torque() == u16::MAX { make_text("Signal not available", true) } else { make_text(format!("{:.1} Nm", self.static_torque() as f32 / 4.0 - 500.0), false) });
ui.end_row();
ui.label("Rear left wheel speed");
ui.label("Rear right wheel speed");
ui.label(if self.right_rear_rpm() == u16::MAX { make_text("Signal not available", true) } else { make_text(format!("{:.1} RPM", self.right_rear_rpm() as f32 / 2.0), false) });
ui.end_row();
ui.label("Left left wheel speed");
ui.label("Rear left wheel speed");
ui.label(if self.left_rear_rpm() == u16::MAX { make_text("Signal not available", true) } else { make_text(format!("{:.1} RPM", self.left_rear_rpm() as f32 / 2.0), false) });
ui.end_row();

View File

@ -1,7 +1,7 @@
use std::{sync::{Arc, atomic::{AtomicBool, Ordering}, RwLock, Mutex}, thread, time::Duration};
use ecu_diagnostics::{kwp2000::{Kwp2000DiagnosticServer, SessionType, KWP2000Error}, DiagnosticServer};
use eframe::{egui::{plot::{Plot, Points, Value, Line, Values, LinkedAxisGroup, VLine, Text, LineStyle, PlotUi, Corner}, RichText}, epaint::{Stroke, Color32}};
use eframe::{egui::{plot::{Plot, Points, Line, LinkedAxisGroup, VLine, Text, LineStyle, PlotUi, Corner, Value, Values}, RichText}, epaint::{Stroke, Color32}};
use modular_bitfield::bitfield;
use serde::{Serialize, Deserialize};

View File

@ -1,7 +1,7 @@
use std::{sync::{Arc, Mutex, atomic::{AtomicBool, Ordering, AtomicU64}, RwLock}, thread, time::{Duration, Instant}, char::MAX};
use ecu_diagnostics::kwp2000::{Kwp2000DiagnosticServer, SessionType};
use eframe::egui::plot::{Plot, Legend, Line, Values, Value};
use eframe::egui::plot::{Plot, Legend, Line};
use crate::{ui::status_bar::MainStatusBar, window::PageAction};

View File

@ -1,7 +1,7 @@
use std::{sync::{Arc, Mutex, atomic::{AtomicBool, Ordering, AtomicU64, AtomicU8}, RwLock}, thread, time::{Duration, Instant}, char::MAX, collections::btree_map::Range, ops::RangeInclusive};
use ecu_diagnostics::{kwp2000::{Kwp2000DiagnosticServer, SessionType}, DiagServerResult, DiagnosticServer, DiagError};
use eframe::egui::{plot::{Plot, Legend, Line, Values, Value}, widgets, Color32, RichText, self};
use eframe::egui::{plot::{Plot, Legend, Line}, widgets, Color32, RichText, self};
use crate::{ui::status_bar::MainStatusBar, window::PageAction};

View File

@ -77,10 +77,10 @@ impl Nag52USB {
let mut line = String::new();
loop {
line.clear();
if reader.read_line(&mut line).is_ok() {
if reader.read_line(&mut line).is_ok() {
line.pop();
println!("LINE: {}", line);
if line.is_empty() {continue;}
//println!("LINE: {}", line);
if line.starts_with("#") || line.starts_with("07E9") {
// First char is #, diag message
// Diag message
@ -102,6 +102,7 @@ impl Nag52USB {
}
}
} else {
println!("{}", line );
//read_tx_log.send(msg);
}
line.clear();