Skip to content

Commit

Permalink
Merge branch 'main' into antoine/wheels-linux-aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
abey79 committed Mar 18, 2024
2 parents 0724ba2 + 61b5e9e commit c029b41
Show file tree
Hide file tree
Showing 11 changed files with 136 additions and 70 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,13 @@ debug = true
# As a last resport, patch with a commit to our own repository.
# ALWAYS document what PR the commit hash is part of, or when it was merged into the upstream trunk.

ecolor = { git = "https://github.com/emilk/egui.git", rev = "bf7ffb982a6e8c0a40d0871c38bccacef9ee8efb" } # egui master 2024-03-15
eframe = { git = "https://github.com/emilk/egui.git", rev = "bf7ffb982a6e8c0a40d0871c38bccacef9ee8efb" } # egui master 2024-03-15
egui = { git = "https://github.com/emilk/egui.git", rev = "bf7ffb982a6e8c0a40d0871c38bccacef9ee8efb" } # egui master 2024-03-15
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "bf7ffb982a6e8c0a40d0871c38bccacef9ee8efb" } # egui master 2024-03-15
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "bf7ffb982a6e8c0a40d0871c38bccacef9ee8efb" } # egui master 2024-03-15
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "bf7ffb982a6e8c0a40d0871c38bccacef9ee8efb" } # egui master 2024-03-15
emath = { git = "https://github.com/emilk/egui.git", rev = "bf7ffb982a6e8c0a40d0871c38bccacef9ee8efb" } # egui master 2024-03-15
ecolor = { git = "https://github.com/emilk/egui.git", rev = "820fa3c43a2d20e140bc4525e0a1405e7420bb66" } # egui master 2024-03-17
eframe = { git = "https://github.com/emilk/egui.git", rev = "820fa3c43a2d20e140bc4525e0a1405e7420bb66" } # egui master 2024-03-17
egui = { git = "https://github.com/emilk/egui.git", rev = "820fa3c43a2d20e140bc4525e0a1405e7420bb66" } # egui master 2024-03-17
egui_extras = { git = "https://github.com/emilk/egui.git", rev = "820fa3c43a2d20e140bc4525e0a1405e7420bb66" } # egui master 2024-03-17
egui_plot = { git = "https://github.com/emilk/egui.git", rev = "820fa3c43a2d20e140bc4525e0a1405e7420bb66" } # egui master 2024-03-17
egui-wgpu = { git = "https://github.com/emilk/egui.git", rev = "820fa3c43a2d20e140bc4525e0a1405e7420bb66" } # egui master 2024-03-17
emath = { git = "https://github.com/emilk/egui.git", rev = "820fa3c43a2d20e140bc4525e0a1405e7420bb66" } # egui master 2024-03-17

# Useful while developing:
# ecolor = { path = "../../egui/crates/ecolor" }
Expand Down
7 changes: 5 additions & 2 deletions crates/re_data_source/src/data_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ use anyhow::Context as _;
#[derive(Debug, Clone)]
pub enum DataSource {
/// A remote RRD file, served over http.
///
/// Could be either an `.rrd` recording or a `.rbl` blueprint.
RrdHttpUrl(String),

/// A path to a local file.
Expand Down Expand Up @@ -86,7 +88,7 @@ impl DataSource {
DataSource::FilePath(file_source, path)
} else if uri.starts_with("http://")
|| uri.starts_with("https://")
|| (uri.starts_with("www.") && uri.ends_with(".rrd"))
|| (uri.starts_with("www.") && (uri.ends_with(".rrd") || uri.ends_with(".rbl")))
{
DataSource::RrdHttpUrl(uri)
} else if uri.starts_with("ws://") || uri.starts_with("wss://") {
Expand All @@ -95,7 +97,7 @@ impl DataSource {
// Now we are into heuristics territory:
} else if looks_like_a_file_path(&uri) {
DataSource::FilePath(file_source, path)
} else if uri.ends_with(".rrd") {
} else if uri.ends_with(".rrd") || uri.ends_with(".rbl") {
DataSource::RrdHttpUrl(uri)
} else {
// If this is sometyhing like `foo.com` we can't know what it is until we connect to it.
Expand Down Expand Up @@ -234,6 +236,7 @@ fn test_data_source_from_uri() {
"https://foo.zip",
"example.zip/foo.rrd",
"www.foo.zip/foo.rrd",
"www.foo.zip/blueprint.rbl",
];
let ws = ["ws://foo.zip", "wss://foo.zip", "127.0.0.1"];

Expand Down
3 changes: 3 additions & 0 deletions crates/re_data_ui/src/log_msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ impl DataUi for LogMsg {
match self {
LogMsg::SetStoreInfo(msg) => msg.data_ui(ctx, ui, verbosity, query, store),
LogMsg::ArrowMsg(_, msg) => msg.data_ui(ctx, ui, verbosity, query, store),
LogMsg::ActivateStore(store_id) => {
ui.label(format!("ActivateStore({store_id})"));
}
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions crates/re_entity_db/src/entity_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ impl EntityDb {
let table = DataTable::from_arrow_msg(arrow_msg)?;
self.add_data_table(table)?;
}

LogMsg::ActivateStore(_) => {
// Not for us to handle
}
}

Ok(())
Expand Down
11 changes: 9 additions & 2 deletions crates/re_log_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,20 @@ pub enum LogMsg {

/// Log an entity using an [`ArrowMsg`].
ArrowMsg(StoreId, ArrowMsg),

/// Send after all messages in a blueprint to signal that the blueprint is complete.
///
/// This is so that the viewer can wait with activating the blueprint until it is
/// fully transmitted. Showing a half-transmitted blueprint can cause confusion,
/// and also lead to problems with space-view heuristics.
ActivateStore(StoreId),
}

impl LogMsg {
pub fn store_id(&self) -> &StoreId {
match self {
Self::SetStoreInfo(msg) => &msg.info.store_id,
Self::ArrowMsg(store_id, _) => store_id,
Self::ArrowMsg(store_id, _) | Self::ActivateStore(store_id) => store_id,
}
}

Expand All @@ -233,7 +240,7 @@ impl LogMsg {
LogMsg::SetStoreInfo(store_info) => {
store_info.info.store_id = new_store_id;
}
LogMsg::ArrowMsg(msg_store_id, _) => {
LogMsg::ArrowMsg(msg_store_id, _) | LogMsg::ActivateStore(msg_store_id) => {
*msg_store_id = new_store_id;
}
}
Expand Down
27 changes: 19 additions & 8 deletions crates/re_sdk/src/recording_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1554,9 +1554,20 @@ impl RecordingStream {

// If a blueprint was provided, send it first.
if let Some(blueprint) = blueprint {
let mut store_id = None;
for msg in blueprint {
if store_id.is_none() {
store_id = Some(msg.store_id().clone());
}
sink.send(msg);
}
if let Some(store_id) = store_id {
// Let the viewer know that the blueprint has been fully received,
// and that it can now be activated.
// We don't want to activate half-loaded blueprints, because that can be confusing,
// and can also lead to problems with space-view heuristics.
sink.send(LogMsg::ActivateStore(store_id));
}
}

self.set_sink(Box::new(sink));
Expand Down Expand Up @@ -2048,7 +2059,7 @@ mod tests {
assert!(msg.row_id != RowId::ZERO);
similar_asserts::assert_eq!(store_info, msg.info);
}
LogMsg::ArrowMsg { .. } => panic!("expected SetStoreInfo"),
_ => panic!("expected SetStoreInfo"),
}

// Second message should be a set_store_info resulting from the later sink swap from
Expand All @@ -2059,7 +2070,7 @@ mod tests {
assert!(msg.row_id != RowId::ZERO);
similar_asserts::assert_eq!(store_info, msg.info);
}
LogMsg::ArrowMsg { .. } => panic!("expected SetStoreInfo"),
_ => panic!("expected SetStoreInfo"),
}

// Third message is the batched table itself, which was sent as a result of the implicit
Expand All @@ -2076,7 +2087,7 @@ mod tests {

similar_asserts::assert_eq!(table, got);
}
LogMsg::SetStoreInfo { .. } => panic!("expected ArrowMsg"),
_ => panic!("expected ArrowMsg"),
}

// That's all.
Expand Down Expand Up @@ -2115,7 +2126,7 @@ mod tests {
assert!(msg.row_id != RowId::ZERO);
similar_asserts::assert_eq!(store_info, msg.info);
}
LogMsg::ArrowMsg { .. } => panic!("expected SetStoreInfo"),
_ => panic!("expected SetStoreInfo"),
}

// Second message should be a set_store_info resulting from the later sink swap from
Expand All @@ -2126,7 +2137,7 @@ mod tests {
assert!(msg.row_id != RowId::ZERO);
similar_asserts::assert_eq!(store_info, msg.info);
}
LogMsg::ArrowMsg { .. } => panic!("expected SetStoreInfo"),
_ => panic!("expected SetStoreInfo"),
}

let mut rows = {
Expand All @@ -2150,7 +2161,7 @@ mod tests {

similar_asserts::assert_eq!(expected, got);
}
LogMsg::SetStoreInfo { .. } => panic!("expected ArrowMsg"),
_ => panic!("expected ArrowMsg"),
}
};

Expand Down Expand Up @@ -2195,7 +2206,7 @@ mod tests {
assert!(msg.row_id != RowId::ZERO);
similar_asserts::assert_eq!(store_info, msg.info);
}
LogMsg::ArrowMsg { .. } => panic!("expected SetStoreInfo"),
_ => panic!("expected SetStoreInfo"),
}

// MemorySinkStorage transparently handles flushing during `take()`!
Expand All @@ -2213,7 +2224,7 @@ mod tests {

similar_asserts::assert_eq!(table, got);
}
LogMsg::SetStoreInfo { .. } => panic!("expected ArrowMsg"),
_ => panic!("expected ArrowMsg"),
}

// That's all.
Expand Down
2 changes: 1 addition & 1 deletion crates/re_sdk_comms/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl CongestionManager {
#[allow(clippy::match_same_arms)]
match msg {
// we don't want to drop any of these
LogMsg::SetStoreInfo(_) => true,
LogMsg::SetStoreInfo(_) | LogMsg::ActivateStore(_) => true,

LogMsg::ArrowMsg(_, arrow_msg) => self.should_send_time_point(&arrow_msg.timepoint_max),
}
Expand Down
54 changes: 40 additions & 14 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ impl App {
}

pub fn set_examples_manifest_url(&mut self, url: String) {
re_log::info!("Using manifest_url={url:?}");
self.state
.set_examples_manifest_url(&self.re_ui.egui_ctx, url);
}
Expand Down Expand Up @@ -948,6 +949,7 @@ impl App {
// In that case, we want to make it the default.
// We wait with activaing blueprints until they are fully loaded,
// so that we don't run heuristics on half-loaded blueprints.
// This is a fallback in case `LogMsg::ActivateStore` isn't sent (for whatever reason).

let blueprints = store_hub
.entity_dbs_from_channel_source(&channel_source)
Expand Down Expand Up @@ -997,21 +999,45 @@ impl App {
re_log::error_once!("Failed to add incoming msg: {err}");
};

// Set the recording-id after potentially creating the store in the hub.
// This ordering is important because the `StoreHub` internally
// updates the app-id when changing the recording.
if let LogMsg::SetStoreInfo(msg) = &msg {
match msg.info.store_id.kind {
StoreKind::Recording => {
re_log::debug!("Opening a new recording: {:?}", msg.info);
store_hub.set_recording_id(store_id.clone());
match &msg {
LogMsg::SetStoreInfo(_) => {
// Set the recording-id after potentially creating the store in the hub.
// This ordering is important because the `StoreHub` internally
// updates the app-id when changing the recording.
match store_id.kind {
StoreKind::Recording => {
re_log::debug!("Opening a new recording: {store_id}");
store_hub.set_recording_id(store_id.clone());
}
StoreKind::Blueprint => {
// We wait with activaing blueprints until they are fully loaded,
// so that we don't run heuristics on half-loaded blueprints.
// TODO(#5297): heed special "end-of-blueprint" message to activate blueprint.
// Otherwise on a mixed connection (SDK sending both blueprint and recording)
// the blueprint won't be activated until the whole _recording_ has finished loading.
}
}
StoreKind::Blueprint => {
// We wait with activaing blueprints until they are fully loaded,
// so that we don't run heuristics on half-loaded blueprints.
// TODO(#5297): heed special "end-of-blueprint" message to activate blueprint.
// Otherwise on a mixed connection (SDK sending both blueprint and recording)
// the blueprint won't be activated until the whole _recording_ has finished loading.
}

LogMsg::ArrowMsg(_, _) => {
// Andled by EntityDb::add
}

LogMsg::ActivateStore(store_id) => {
match store_id.kind {
StoreKind::Recording => {
re_log::debug!("Opening a new recording: {store_id}");
store_hub.set_recording_id(store_id.clone());
}
StoreKind::Blueprint => {
re_log::debug!("Activating newly loaded blueprint");
if let Some(info) = entity_db.store_info() {
let app_id = info.application_id.clone();
store_hub.set_blueprint_for_app_id(store_id.clone(), app_id);
} else {
re_log::warn!("Got ActivateStore message without first receiving a SetStoreInfo");
}
}
}
}
}
Expand Down

0 comments on commit c029b41

Please sign in to comment.