Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,18 @@ hdiutil create -volname SwiftNavConsole -srcfolder main.app -ov -format UDZO 'sw
'''

[tasks.qml-format]
env = { QT_APP = { script = ["conda run -n $CONDA_ENV python utils/echo-qt-dir.py"] } }
env = { QT_APP = { script = [
"conda run -n $CONDA_ENV python utils/echo-qt-dir.py",
] } }
script_runner = "@shell"
script = '''
${QT_APP}/Qt/bin/qmlformat -i $QML_FILES
'''

[tasks.qml-lint]
env = { QT_APP = { script = ["conda run -n $CONDA_ENV python utils/echo-qt-dir.py"] } }
env = { QT_APP = { script = [
"conda run -n $CONDA_ENV python utils/echo-qt-dir.py",
] } }
script_runner = "@shell"
script = '''
${QT_APP}/Qt/bin/qmllint -I ${QT_APP}/../PySide2/Qt/qml/ -I resources/ $QML_FILES
Expand Down
5 changes: 4 additions & 1 deletion console_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ chrono = { version = "0.4", features = ["serde"] }
csv = "1"
paste = "1"
pyo3 = { version = "0.13", features = ["extension-module"], optional = true }
sbp = { git = "https://github.com/swift-nav/libsbp.git", rev = "ce5e3d14ae4284c53982bc3fd79a2fa15976ff9f", features = ["json", "swiftnav-rs"] }
sbp = { git = "https://github.com/swift-nav/libsbp.git", rev = "ce5e3d14ae4284c53982bc3fd79a2fa15976ff9f", features = [
"json",
"swiftnav-rs",
] }
serde = { version = "1.0.123", features = ["derive"] }
tempfile = "3.2.0"
ordered-float = "2.0"
Expand Down
11 changes: 8 additions & 3 deletions console_backend/benches/cpu_benches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ use std::{

extern crate console_backend;
use console_backend::{
connection::Connection,
process_messages,
types::{ClientSender, Connection, RealtimeDelay, SharedState},
types::{ClientSender, RealtimeDelay, SharedState},
};

const BENCH_FILEPATH: &str = "./tests/data/piksi-relay.sbp";
Expand Down Expand Up @@ -61,8 +62,12 @@ fn run_process_messages(file_in_name: &str, failure: bool) {
inner: client_send_,
};
shared_state.set_running(true, client_send.clone());
let conn = Connection::file(file_in_name.into()).unwrap();
process_messages::process_messages(conn, shared_state, client_send, RealtimeDelay::Off);
let conn = Connection::file(
file_in_name.into(),
RealtimeDelay::Off,
/*close_when_done=*/ true,
);
process_messages::process_messages(conn, shared_state, client_send).unwrap();
}
recv_thread.join().expect("join should succeed");
}
Expand Down
8 changes: 4 additions & 4 deletions console_backend/src/bin/fileio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fn main() -> Result<()> {
dest,
input,
} => {
let (rdr, wtr) = input.into_conn()?.into_io();
let (rdr, wtr) = input.into_conn().try_connect(/*shared_state=*/ None)?;
let sender = MsgSender::new(wtr);
scope(|s| {
s.spawn(|_| run(rdr));
Expand All @@ -88,7 +88,7 @@ fn main() -> Result<()> {
dest,
input,
} => {
let (rdr, wtr) = input.into_conn()?.into_io();
let (rdr, wtr) = input.into_conn().try_connect(/*shared_state=*/ None)?;
let sender = MsgSender::new(wtr);
scope(|s| {
s.spawn(|_| run(rdr));
Expand All @@ -104,7 +104,7 @@ fn main() -> Result<()> {
.unwrap()
}
Opts::List { path, input } => {
let (rdr, wtr) = input.into_conn()?.into_io();
let (rdr, wtr) = input.into_conn().try_connect(/*shared_state=*/ None)?;
let sender = MsgSender::new(wtr);
scope(|s| {
s.spawn(|_| run(rdr));
Expand All @@ -117,7 +117,7 @@ fn main() -> Result<()> {
.unwrap()
}
Opts::Delete { path, input } => {
let (rdr, wtr) = input.into_conn()?.into_io();
let (rdr, wtr) = input.into_conn().try_connect(/*shared_state=*/ None)?;
let sender = MsgSender::new(wtr);
scope(|s| {
s.spawn(|_| run(rdr));
Expand Down
10 changes: 7 additions & 3 deletions console_backend/src/cli_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::log_panel::LogLevel;
use crate::types::FlowControl;
use crate::{
common_constants::{SbpLogging, Tabs},
types::Connection,
connection::Connection,
};

#[derive(Debug)]
Expand Down Expand Up @@ -177,15 +177,19 @@ pub enum Input {
}

impl Input {
pub fn into_conn(self) -> crate::types::Result<Connection> {
pub fn into_conn(self) -> Connection {
match self {
Input::Tcp { host, port } => Connection::tcp(host, port),
Input::Serial {
serialport,
baudrate,
flow_control,
} => Connection::serial(serialport.to_string_lossy().into(), baudrate, flow_control),
Input::File { file_in } => Connection::file(file_in.to_string_lossy().into()),
Input::File { file_in } => Connection::file(
file_in.to_string_lossy().into(),
crate::types::RealtimeDelay::On,
/*close_when_done=*/ false,
),
}
}
}
Expand Down
Loading