#望远镜 #模拟 #光学 #演员 #动态 #接口 #客户端

gmt_dos-clients

巨型麦哲伦望远镜动态光学模拟演员客户端

GitHub repo (rconan)

4.3.0 首页 (github.io)
4.2.0 2024年5月3日
4.0.1 2024年3月20日
3.3.2 2024年2月22日
1.0.0 2024年1月15日

2023年10月

Download history 209/week @ 2024-05-03 10/week @ 2024-05-10 30/week @ 2024-05-17 26/week @ 2024-05-24 21/week @ 2024-05-31 22/week @ 2024-06-07 30/week @ 2024-06-14 22/week @ 2024-06-21 13/week @ 2024-06-28 2/week @ 2024-07-05 24/week @ 2024-07-12 38/week @ 2024-07-19 41/week @ 2024-07-26 20/week @ 2024-08-02 16/week @ 2024-08-09 5/week @ 2024-08-16

~106K SLoC
GitHub (rconan)

GMT_dos-clients

GMT_dos-clients
GMT_dos-clients

GMT_dos-clients

Crates.io Documentation

GMT_dos-clients

GMT_dos-clients

cargo add --no-default-features --features interface gmt_dos-clients

GMT_dos-clients:

GMT_dos-clients

GMT_dos-clients

GMT_dos-clients

GMT_dos-clients

GMT_dos-clients

GMT_dos-clients

use gmt_dos_clients::Logging;
let logging = Logging::<f64>::default();

GMT_dos-clients

use gmt_dos_clients::Logging;
let logging = Logging::<f64>::default().n_entry(2).capacity(1_000);

GMT_dos-clients

GMT_dos-clients

use gmt_dos_clients::{Signals, Signal};
let signal: Signals = Signals::new(1, 100).signals(Signal::Constant(3.14));

GMT_dos-clients

use gmt_dos_clients::{Signals, Signal};
let signal: Signals = Signals::new(2, 100)
.output_signal(0, Signal::Constant(3.14))
.output_signal(1, Signal::Sinusoid{
amplitude: 1f64,
sampling_frequency_hz: 1000f64,
frequency_hz: 20f64,
phase_s: 0f64
});

GMT_dos-clients

GMT_dos-clients

use gmt_dos_clients::Sampler;
#[derive(interface::UID)]
enum MyIO {};
let sampler = Sampler::<Vec<f64>, MyIO>::default();

GMT_dos-clients

GMT_dos-clients

use std::sync::Arc;
use interface::{Data, Write, UniqueIdentifier,Size, UID, Update};

// Original UID
#[derive(UID)]
#[uid(data = u8)]
pub enum A {}
pub struct Client {}
impl Update for Client {}
impl Write<A> for Client {
fn write(&mut self) -> Option<Data<A>> {
Some(Data::new(10u8))
}
}
impl Size<A> for Client {
fn len(&self) -> usize {
123
}
}

// A alias with `Write` and `Size` trait implementation for `Client`
#[derive(UID)]
#[uid(data = u8)]
#[alias(name = A, client = Client, traits = Write ,Size)]
pub enum B {}

let _: <A as UniqueIdentifier>::DataType = 1u8;
let _: <B as UniqueIdentifier>::DataType = 2u8;

let mut client = Client {};
println!(
"Client Write<B>: {:?}",
<Client as Write<B>>::write(&mut client)
);
println!(
"Client Size<B>: {:?}",
<Client as Size<B>>::len(&mut client)
);

GMT_dos-clients

GMT_dos-clients
GMT_dos-clients