|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
mod verilog;
|
|
|
|
|
|
|
|
|
|
use std::f32::consts::PI;
|
|
|
|
|
use std::io;
|
|
|
|
|
use std::path::Path;
|
|
|
|
|
|
|
|
|
|
use logicworld_subassembly::create_subassembly;
|
|
|
|
|
use logicworld_subassembly::lw;
|
|
|
|
|
use logicworld_subassembly::lw::PegAddress;
|
|
|
|
|
use logicworld_subassembly::COMPONENT_MAP;
|
|
|
|
|
use verilog::compile_module;
|
|
|
|
|
use verilog::get_modules;
|
|
|
|
@ -22,14 +22,14 @@ fn write_subassembly() -> io::Result<()> {
|
|
|
|
|
outputs: vec![],
|
|
|
|
|
custom_data: lw::CircuitBoard::default()
|
|
|
|
|
.with_color(0, 100, 50)
|
|
|
|
|
.with_size(5, 10)
|
|
|
|
|
.with_size(5, 13)
|
|
|
|
|
.custom_data(),
|
|
|
|
|
},
|
|
|
|
|
lw::Component {
|
|
|
|
|
address: 2,
|
|
|
|
|
parent: 1,
|
|
|
|
|
numeric_id: COMPONENT_MAP["MHG.AndGate"],
|
|
|
|
|
position: [150+1*300, 150, 150+2*300],
|
|
|
|
|
position: [150 + 1 * 300, 150, 150 + 7 * 300],
|
|
|
|
|
rotation: quaternion::id(),
|
|
|
|
|
inputs: vec![lw::Input::new(1), lw::Input::new(2), lw::Input::new(3)],
|
|
|
|
|
outputs: vec![lw::Output::new(4)],
|
|
|
|
@ -39,16 +39,32 @@ fn write_subassembly() -> io::Result<()> {
|
|
|
|
|
address: 3,
|
|
|
|
|
parent: 1,
|
|
|
|
|
numeric_id: COMPONENT_MAP["MHG.XorGate"],
|
|
|
|
|
position: [150+1*300, 150, 150+5*300],
|
|
|
|
|
position: [150 + 1 * 300, 150, 150 + 10 * 300],
|
|
|
|
|
rotation: quaternion::id(),
|
|
|
|
|
inputs: vec![lw::Input::new(5), lw::Input::new(4)],
|
|
|
|
|
outputs: vec![lw::Output::new(6)],
|
|
|
|
|
custom_data: vec![],
|
|
|
|
|
},
|
|
|
|
|
lw::Component {
|
|
|
|
|
address: 4,
|
|
|
|
|
parent: 1,
|
|
|
|
|
numeric_id: COMPONENT_MAP["MHG.PanelLabel"],
|
|
|
|
|
position: [150 + 3 * 300, 150, 150 + 1 * 300],
|
|
|
|
|
rotation: quaternion::euler_angles(0.0, -PI / 2.0, 0.0),
|
|
|
|
|
inputs: vec![],
|
|
|
|
|
outputs: vec![],
|
|
|
|
|
custom_data: lw::Label::new("Lmao")
|
|
|
|
|
.mono()
|
|
|
|
|
.with_size(2.5)
|
|
|
|
|
.with_color(0, 100, 250)
|
|
|
|
|
.with_align(lw::HorizontalAlign::Right, lw::VerticalAlign::Bottom)
|
|
|
|
|
.with_dimensions(4, 3)
|
|
|
|
|
.custom_data(),
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
let wires = vec![lw::Wire {
|
|
|
|
|
first_point: PegAddress::output(2, 0),
|
|
|
|
|
second_point: PegAddress::input(3, 1),
|
|
|
|
|
first_point: lw::PegAddress::output(2, 0),
|
|
|
|
|
second_point: lw::PegAddress::input(3, 1),
|
|
|
|
|
circuit_state_id: 4,
|
|
|
|
|
wire_rotation: 0.0,
|
|
|
|
|
}];
|
|
|
|
@ -78,6 +94,6 @@ fn main() {
|
|
|
|
|
println!("{}: {:?}", module, result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// let result = write_subassembly();
|
|
|
|
|
// println!("{:?}", result);
|
|
|
|
|
let result = write_subassembly();
|
|
|
|
|
println!("{:?}", result);
|
|
|
|
|
}
|
|
|
|
|