Skip to main content

pio_normalize

Function pio_normalize 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pio_normalize( net: *const PioNetwork, errbuf: *mut c_char, errlen: usize, ) -> *mut PioNetwork
Expand description

Normalize net into a NEW network handle: per unit, radians, out-of-service filtered, source bus ids preserved, bus types canonicalized (see Network::to_normalized). A value transform, not a serialization, hence the verb, while the to_* family re-encodes unchanged data. The result is independent of net; free both with pio_network_free. Every extractor and serializer works on it unchanged (the handle is per unit, not MW). Returns NULL on error (no reference bus can be chosen, or a non-positive base MVA) and writes the message into errbuf.