refactor(frontend) finish signal conversion, fix passing data to VM
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
@@ -191,7 +191,7 @@ pub fn generate_database(
|
||||
.join("www")
|
||||
.join("src")
|
||||
.join("ts")
|
||||
.join("virtual_machine");
|
||||
.join("virtualMachine");
|
||||
if !data_path.exists() {
|
||||
std::fs::create_dir(&data_path)?;
|
||||
}
|
||||
@@ -860,7 +860,7 @@ fn slot_inserts_to_info(slots: &[stationpedia::SlotInsert]) -> Vec<SlotInfo> {
|
||||
typ: slot
|
||||
.slot_type
|
||||
.parse()
|
||||
.unwrap_or_else(|err| panic!("faild to parse slot class: {err}")),
|
||||
.unwrap_or_else(|err| panic!("failed to parse slot class: {err}")),
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
@@ -891,7 +891,7 @@ pub struct ObjectDatabase {
|
||||
impl From<&stationpedia::SuitInfo> for SuitInfo {
|
||||
fn from(value: &stationpedia::SuitInfo) -> Self {
|
||||
SuitInfo {
|
||||
hygine_reduction_multiplier: value.hygine_reduction_multiplier,
|
||||
hygiene_reduction_multiplier: value.hygiene_reduction_multiplier,
|
||||
waste_max_pressure: value.waste_max_pressure,
|
||||
}
|
||||
}
|
||||
@@ -979,11 +979,17 @@ impl From<&stationpedia::Item> for ItemInfo {
|
||||
slot_class: item
|
||||
.slot_class
|
||||
.parse()
|
||||
.unwrap_or_else(|err| panic!("failed to parse slot class: {err}")),
|
||||
.unwrap_or_else(|err| {
|
||||
let slot_class = &item.slot_class;
|
||||
panic!("failed to parse slot class `{slot_class}`: {err}");
|
||||
}),
|
||||
sorting_class: item
|
||||
.sorting_class
|
||||
.parse()
|
||||
.unwrap_or_else(|err| panic!("failed to parse sorting class: {err}")),
|
||||
.unwrap_or_else(|err| {
|
||||
let sorting_class = &item.sorting_class;
|
||||
panic!("failed to parse sorting class `{sorting_class}`: {err}");
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -997,10 +1003,10 @@ impl From<&stationpedia::Device> for DeviceInfo {
|
||||
.map(|(typ, role)| ConnectionInfo {
|
||||
typ: typ
|
||||
.parse()
|
||||
.unwrap_or_else(|err| panic!("failed to parse connection type: {err}")),
|
||||
.unwrap_or_else(|err| panic!("failed to parse connection type `{typ}`: {err}")),
|
||||
role: role
|
||||
.parse()
|
||||
.unwrap_or_else(|err| panic!("failed to parse connection role: {err}")),
|
||||
.unwrap_or_else(|err| panic!("failed to parse connection role `{role}`: {err}")),
|
||||
})
|
||||
.collect(),
|
||||
device_pins_length: value.devices_length,
|
||||
@@ -1111,7 +1117,7 @@ impl From<&stationpedia::Memory> for MemoryInfo {
|
||||
impl From<&stationpedia::ResourceConsumer> for ConsumerInfo {
|
||||
fn from(value: &stationpedia::ResourceConsumer) -> Self {
|
||||
ConsumerInfo {
|
||||
consumed_resouces: value.consumed_resources.clone(),
|
||||
consumed_resources: value.consumed_resources.clone(),
|
||||
processed_reagents: value.processed_reagents.clone(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ pub struct Page {
|
||||
#[serde(rename = "SourceCode", default)]
|
||||
pub source_code: bool,
|
||||
#[serde(rename = "Chargeable")]
|
||||
pub chargeable: Option<Chargable>,
|
||||
pub chargeable: Option<Chargeable>,
|
||||
#[serde(rename = "ResourceConsumer")]
|
||||
pub resource_consumer: Option<ResourceConsumer>,
|
||||
#[serde(rename = "InternalAtmosphere")]
|
||||
@@ -257,8 +257,8 @@ pub struct Item {
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct SuitInfo {
|
||||
#[serde(rename = "HygineReductionMultiplier")]
|
||||
pub hygine_reduction_multiplier: f32,
|
||||
#[serde(rename = "HygieneReductionMultiplier")]
|
||||
pub hygiene_reduction_multiplier: f32,
|
||||
#[serde(rename = "WasteMaxPressure")]
|
||||
pub waste_max_pressure: f32,
|
||||
}
|
||||
@@ -269,9 +269,9 @@ pub struct Recipe {
|
||||
pub creator_prefab_name: String,
|
||||
#[serde(rename = "TierName")]
|
||||
pub tier_name: String,
|
||||
#[serde(rename = "Time")]
|
||||
#[serde(rename = "Time", default)]
|
||||
pub time: f64,
|
||||
#[serde(rename = "Energy")]
|
||||
#[serde(rename = "Energy", default)]
|
||||
pub energy: f64,
|
||||
#[serde(rename = "Temperature")]
|
||||
pub temperature: RecipeTemperature,
|
||||
@@ -279,7 +279,7 @@ pub struct Recipe {
|
||||
pub pressure: RecipePressure,
|
||||
#[serde(rename = "RequiredMix")]
|
||||
pub required_mix: RecipeGasMix,
|
||||
#[serde(rename = "CountTypes")]
|
||||
#[serde(rename = "CountTypes", default)]
|
||||
pub count_types: i64,
|
||||
#[serde(flatten)]
|
||||
pub reagents: indexmap::IndexMap<String, f64>,
|
||||
@@ -354,7 +354,7 @@ pub struct Fabricator {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, PartialOrd, Serialize, Deserialize)]
|
||||
pub struct Chargable {
|
||||
pub struct Chargeable {
|
||||
#[serde(rename = "PowerMaximum")]
|
||||
pub power_maximum: f32,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user