import typing, clr, abc
from SIMULTAN.Data.SimNetworks import INetwork
from SIMULTAN.Data import IReferenceLocation, GeometricReference, SimManagedCollection_1, IReference
from SIMULTAN.Data.SimMath import SimPoint
from SIMULTAN.Data.Users import SimUserRole
from System.Collections.ObjectModel import ObservableCollection_1
from System.Collections.Generic import List_1, IDictionary_2, Dictionary_2, IEnumerable_1
from SIMULTAN.Utils.Collections import ObservableDictionary_2
from SIMULTAN.Data.Components import SimComponentInstance, SimComponent, SimInstanceSize
from System import Guid, MulticastDelegate, IAsyncResult, AsyncCallback, DateTime, IComparable, ValueTuple_3
from System.Globalization import CultureInfo
from System.Reflection import MethodInfo
from SIMULTAN.Projects import ProjectData
from System.ComponentModel import INotifyPropertyChanged

class SimFlowNetwork(SimFlowNetworkNode, INetwork):
    def __init__(self, _location: IReferenceLocation, _position: SimPoint, _name: str, _description: str, _manager: SimUserRole) -> None: ...
    @property
    def CalculationRules(self) -> ObservableCollection_1[SimFlowNetworkCalcRule]: ...
    @CalculationRules.setter
    def CalculationRules(self, value: ObservableCollection_1[SimFlowNetworkCalcRule]) -> ObservableCollection_1[SimFlowNetworkCalcRule]: ...
    @property
    def Children(self) -> List_1[typing.Any]: ...
    @property
    def ConnectionToParentEntryNode(self) -> SimFlowNetworkNode: ...
    @property
    def ConnectionToParentExitNode(self) -> SimFlowNetworkNode: ...
    @property
    def ContainedEdges(self) -> ObservableDictionary_2[int, SimFlowNetworkEdge]: ...
    @ContainedEdges.setter
    def ContainedEdges(self, value: ObservableDictionary_2[int, SimFlowNetworkEdge]) -> ObservableDictionary_2[int, SimFlowNetworkEdge]: ...
    @property
    def ContainedFlowNetworks(self) -> ObservableDictionary_2[int, SimFlowNetwork]: ...
    @ContainedFlowNetworks.setter
    def ContainedFlowNetworks(self, value: ObservableDictionary_2[int, SimFlowNetwork]) -> ObservableDictionary_2[int, SimFlowNetwork]: ...
    @property
    def ContainedNodes(self) -> ObservableDictionary_2[int, SimFlowNetworkNode]: ...
    @ContainedNodes.setter
    def ContainedNodes(self, value: ObservableDictionary_2[int, SimFlowNetworkNode]) -> ObservableDictionary_2[int, SimFlowNetworkNode]: ...
    @property
    def Content(self) -> SimComponentInstance: ...
    @Content.setter
    def Content(self, value: SimComponentInstance) -> SimComponentInstance: ...
    @property
    def Description(self) -> str: ...
    @Description.setter
    def Description(self, value: str) -> str: ...
    @property
    def Edges_In(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_In.setter
    def Edges_In(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def Edges_In_Nested(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_In_Nested.setter
    def Edges_In_Nested(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def Edges_Out(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_Out.setter
    def Edges_Out(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def Edges_Out_Nested(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_Out_Nested.setter
    def Edges_Out_Nested(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def GlobalID(self) -> Guid: ...
    @property
    def HasParent(self) -> bool: ...
    @property
    def ID(self) -> SimObjectId: ...
    @ID.setter
    def ID(self, value: SimObjectId) -> SimObjectId: ...
    @property
    def IndexOfGeometricRepFile(self) -> int: ...
    @IndexOfGeometricRepFile.setter
    def IndexOfGeometricRepFile(self, value: int) -> int: ...
    @property
    def IsDirected(self) -> bool: ...
    @IsDirected.setter
    def IsDirected(self, value: bool) -> bool: ...
    @property
    def IsInConsistentState(self) -> bool: ...
    @IsInConsistentState.setter
    def IsInConsistentState(self, value: bool) -> bool: ...
    @property
    def IsValid(self) -> bool: ...
    @IsValid.setter
    def IsValid(self, value: bool) -> bool: ...
    @property
    def LocalID(self) -> int: ...
    @property
    def Manager(self) -> SimUserRole: ...
    @Manager.setter
    def Manager(self, value: SimUserRole) -> SimUserRole: ...
    @property
    def Name(self) -> str: ...
    @Name.setter
    def Name(self, value: str) -> str: ...
    @property
    def Network(self) -> SimFlowNetwork: ...
    @Network.setter
    def Network(self, value: SimFlowNetwork) -> SimFlowNetwork: ...
    @property
    def NodeEnd_ID(self) -> int: ...
    @NodeEnd_ID.setter
    def NodeEnd_ID(self, value: int) -> int: ...
    @property
    def NodeStart_ID(self) -> int: ...
    @NodeStart_ID.setter
    def NodeStart_ID(self, value: int) -> int: ...
    @property
    def Parent(self) -> SimFlowNetworkElement: ...
    @Parent.setter
    def Parent(self, value: SimFlowNetworkElement) -> SimFlowNetworkElement: ...
    @property
    def ParentNetwork(self) -> SimFlowNetwork: ...
    @ParentNetwork.setter
    def ParentNetwork(self, value: SimFlowNetwork) -> SimFlowNetwork: ...
    @property
    def Position(self) -> SimPoint: ...
    @Position.setter
    def Position(self, value: SimPoint) -> SimPoint: ...
    @property
    def RepresentationReference(self) -> GeometricReference: ...
    @RepresentationReference.setter
    def RepresentationReference(self, value: GeometricReference) -> GeometricReference: ...
    def AddEdge(self, _start: SimFlowNetworkNode, _end: SimFlowNetworkNode) -> int: ...
    def AddNode(self, _pos: SimPoint) -> int: ...
    def CalculateAllFlows(self, _in_flow_dir: bool, culture: CultureInfo) -> None: ...
    def CalculateFlowStep(self, _sorted_nodes: List_1[SimFlowNetworkNode], _in_flow_dir: bool, _step_index: int, _show_only_changes: bool, _current_node: clr.Reference[SimFlowNetworkNode], culture: CultureInfo) -> str: ...
    def GetAllContainersOf(self, _comp: SimComponent) -> List_1[SimFlowNetworkElement]: ...
    def GetAllContent(self) -> List_1[SimComponent]: ...
    def GetNestedEdges(self) -> List_1[SimFlowNetworkEdge]: ...
    def GetNestedNodes(self) -> List_1[SimFlowNetworkNode]: ...
    def GetUniqueParamNamesInContent(self, culture: CultureInfo) -> List_1[str]: ...
    def OnEdgeRedirected(self, redirectedEdge: SimFlowNetworkEdge) -> None: ...
    def OnElementAdded(self, addedElement: SimFlowNetworkElement) -> None: ...
    def OnElementDeleted(self, deletedElement: SimFlowNetworkElement) -> None: ...
    def OnElementTopologyChanged(self, oldElement: SimFlowNetworkElement, newElement: SimFlowNetworkElement, changedElements: List_1[SimFlowNetworkElement]) -> None: ...
    def PrepareToCalculateFlowStepByStep(self, _in_flow_dir: bool) -> List_1[SimFlowNetworkNode]: ...
    def PropagateCalculationRulesToAllInstances(self, _source: SimFlowNetworkNode) -> None: ...
    def PropagateSizeToInstances(self, _source: SimFlowNetworkElement, _targets: List_1[SimFlowNetworkElement]) -> None: ...
    def RedirectEdge(self, _edge: SimFlowNetworkEdge, _rerout_start: bool, _to_node: SimFlowNetworkNode) -> bool: ...
    def RemoveEdge(self, _edge: SimFlowNetworkEdge) -> bool: ...
    def RemoveNodeOrNetwork(self, _node: SimFlowNetworkNode) -> bool: ...
    def ResetAllContentInstances(self, _offse_parent: SimPoint) -> None: ...
    def ToString(self) -> str: ...
    def UpdateChildrenContainer(self) -> None: ...

    class EdgeRedirectedEventHandler(MulticastDelegate):
        def __init__(self, object: typing.Any, method: int) -> None: ...
        @property
        def Method(self) -> MethodInfo: ...
        @property
        def Target(self) -> typing.Any: ...
        def BeginInvoke(self, sender: typing.Any, redirectedEdge: SimFlowNetworkEdge, callback: AsyncCallback, object: typing.Any) -> IAsyncResult: ...
        def EndInvoke(self, result: IAsyncResult) -> None: ...
        def Invoke(self, sender: typing.Any, redirectedEdge: SimFlowNetworkEdge) -> None: ...


    class ElementAddedEventHandler(MulticastDelegate):
        def __init__(self, object: typing.Any, method: int) -> None: ...
        @property
        def Method(self) -> MethodInfo: ...
        @property
        def Target(self) -> typing.Any: ...
        def BeginInvoke(self, sender: typing.Any, addedElement: SimFlowNetworkElement, callback: AsyncCallback, object: typing.Any) -> IAsyncResult: ...
        def EndInvoke(self, result: IAsyncResult) -> None: ...
        def Invoke(self, sender: typing.Any, addedElement: SimFlowNetworkElement) -> None: ...


    class ElementDeletedEventHandler(MulticastDelegate):
        def __init__(self, object: typing.Any, method: int) -> None: ...
        @property
        def Method(self) -> MethodInfo: ...
        @property
        def Target(self) -> typing.Any: ...
        def BeginInvoke(self, sender: typing.Any, deletedElement: SimFlowNetworkElement, callback: AsyncCallback, object: typing.Any) -> IAsyncResult: ...
        def EndInvoke(self, result: IAsyncResult) -> None: ...
        def Invoke(self, sender: typing.Any, deletedElement: SimFlowNetworkElement) -> None: ...


    class ElementTopologyChangedEventHandler(MulticastDelegate):
        def __init__(self, object: typing.Any, method: int) -> None: ...
        @property
        def Method(self) -> MethodInfo: ...
        @property
        def Target(self) -> typing.Any: ...
        def BeginInvoke(self, sender: typing.Any, oldElement: SimFlowNetworkElement, newElement: SimFlowNetworkElement, changedElements: List_1[SimFlowNetworkElement], callback: AsyncCallback, object: typing.Any) -> IAsyncResult: ...
        def EndInvoke(self, result: IAsyncResult) -> None: ...
        def Invoke(self, sender: typing.Any, oldElement: SimFlowNetworkElement, newElement: SimFlowNetworkElement, changedElements: List_1[SimFlowNetworkElement]) -> None: ...



class SimFlowNetworkCalcDirection(typing.SupportsInt):
    @typing.overload
    def __init__(self, value : int) -> None: ...
    @typing.overload
    def __init__(self, value : int, force_if_true: bool) -> None: ...
    def __int__(self) -> int: ...
    
    # Values:
    Forward : SimFlowNetworkCalcDirection # 0
    Backward : SimFlowNetworkCalcDirection # 1


class SimFlowNetworkCalcRule:
    @property
    def Direction(self) -> SimFlowNetworkCalcDirection: ...
    @Direction.setter
    def Direction(self, value: SimFlowNetworkCalcDirection) -> SimFlowNetworkCalcDirection: ...
    @property
    def Operator(self) -> SimFlowNetworkOperator: ...
    @Operator.setter
    def Operator(self, value: SimFlowNetworkOperator) -> SimFlowNetworkOperator: ...
    @property
    def Suffix_Operands(self) -> str: ...
    @Suffix_Operands.setter
    def Suffix_Operands(self, value: str) -> str: ...
    @property
    def Suffix_Result(self) -> str: ...
    @Suffix_Result.setter
    def Suffix_Result(self, value: str) -> str: ...
    def Calculate(self, _v1: float, _v2: float) -> float: ...
    @staticmethod
    def OperatorToString(_op: SimFlowNetworkOperator) -> str: ...
    @staticmethod
    def StringToOperator(_op_as_str: str) -> SimFlowNetworkOperator: ...


class SimFlowNetworkEdge(SimFlowNetworkElement):
    @property
    def Content(self) -> SimComponentInstance: ...
    @Content.setter
    def Content(self, value: SimComponentInstance) -> SimComponentInstance: ...
    @property
    def Description(self) -> str: ...
    @Description.setter
    def Description(self, value: str) -> str: ...
    @property
    def End(self) -> SimFlowNetworkNode: ...
    @End.setter
    def End(self, value: SimFlowNetworkNode) -> SimFlowNetworkNode: ...
    @property
    def GlobalID(self) -> Guid: ...
    @property
    def ID(self) -> SimObjectId: ...
    @ID.setter
    def ID(self, value: SimObjectId) -> SimObjectId: ...
    @property
    def IsValid(self) -> bool: ...
    @IsValid.setter
    def IsValid(self, value: bool) -> bool: ...
    @property
    def LocalID(self) -> int: ...
    @property
    def Name(self) -> str: ...
    @Name.setter
    def Name(self, value: str) -> str: ...
    @property
    def Network(self) -> SimFlowNetwork: ...
    @Network.setter
    def Network(self, value: SimFlowNetwork) -> SimFlowNetwork: ...
    @property
    def Parent(self) -> SimFlowNetworkElement: ...
    @Parent.setter
    def Parent(self, value: SimFlowNetworkElement) -> SimFlowNetworkElement: ...
    @property
    def RepresentationReference(self) -> GeometricReference: ...
    @RepresentationReference.setter
    def RepresentationReference(self, value: GeometricReference) -> GeometricReference: ...
    @property
    def Start(self) -> SimFlowNetworkNode: ...
    @Start.setter
    def Start(self, value: SimFlowNetworkNode) -> SimFlowNetworkNode: ...
    def RestoreReferences(self, nodes: IDictionary_2[int, SimFlowNetworkNode], networks: IDictionary_2[int, SimFlowNetwork]) -> None: ...
    def ToString(self) -> str: ...


class SimFlowNetworkElement(SimObject):
    @property
    def Content(self) -> SimComponentInstance: ...
    @Content.setter
    def Content(self, value: SimComponentInstance) -> SimComponentInstance: ...
    @property
    def Description(self) -> str: ...
    @Description.setter
    def Description(self, value: str) -> str: ...
    @property
    def GlobalID(self) -> Guid: ...
    @property
    def ID(self) -> SimObjectId: ...
    @ID.setter
    def ID(self, value: SimObjectId) -> SimObjectId: ...
    @property
    def IsValid(self) -> bool: ...
    @IsValid.setter
    def IsValid(self, value: bool) -> bool: ...
    @property
    def LocalID(self) -> int: ...
    @property
    def Name(self) -> str: ...
    @Name.setter
    def Name(self, value: str) -> str: ...
    @property
    def Network(self) -> SimFlowNetwork: ...
    @Network.setter
    def Network(self, value: SimFlowNetwork) -> SimFlowNetwork: ...
    @property
    def Parent(self) -> SimFlowNetworkElement: ...
    @Parent.setter
    def Parent(self, value: SimFlowNetworkElement) -> SimFlowNetworkElement: ...
    @property
    def RepresentationReference(self) -> GeometricReference: ...
    @RepresentationReference.setter
    def RepresentationReference(self, value: GeometricReference) -> GeometricReference: ...
    def GetBoundInstanceRealizedStatus(self) -> bool: ...
    def GetInstanceSize(self) -> SimInstanceSize: ...
    def InstanceHasPath(self) -> bool: ...
    def InstanceHasValidPath(self) -> bool: ...


class SimFlowNetworkNode(SimFlowNetworkElement):
    @property
    def CalculationRules(self) -> ObservableCollection_1[SimFlowNetworkCalcRule]: ...
    @CalculationRules.setter
    def CalculationRules(self, value: ObservableCollection_1[SimFlowNetworkCalcRule]) -> ObservableCollection_1[SimFlowNetworkCalcRule]: ...
    @property
    def Content(self) -> SimComponentInstance: ...
    @Content.setter
    def Content(self, value: SimComponentInstance) -> SimComponentInstance: ...
    @property
    def Description(self) -> str: ...
    @Description.setter
    def Description(self, value: str) -> str: ...
    @property
    def Edges_In(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_In.setter
    def Edges_In(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def Edges_In_Nested(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_In_Nested.setter
    def Edges_In_Nested(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def Edges_Out(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_Out.setter
    def Edges_Out(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def Edges_Out_Nested(self) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @Edges_Out_Nested.setter
    def Edges_Out_Nested(self, value: ObservableCollection_1[SimFlowNetworkEdge]) -> ObservableCollection_1[SimFlowNetworkEdge]: ...
    @property
    def GlobalID(self) -> Guid: ...
    @property
    def ID(self) -> SimObjectId: ...
    @ID.setter
    def ID(self, value: SimObjectId) -> SimObjectId: ...
    @property
    def IsValid(self) -> bool: ...
    @IsValid.setter
    def IsValid(self, value: bool) -> bool: ...
    @property
    def LocalID(self) -> int: ...
    @property
    def Name(self) -> str: ...
    @Name.setter
    def Name(self, value: str) -> str: ...
    @property
    def Network(self) -> SimFlowNetwork: ...
    @Network.setter
    def Network(self, value: SimFlowNetwork) -> SimFlowNetwork: ...
    @property
    def Parent(self) -> SimFlowNetworkElement: ...
    @Parent.setter
    def Parent(self, value: SimFlowNetworkElement) -> SimFlowNetworkElement: ...
    @property
    def Position(self) -> SimPoint: ...
    @Position.setter
    def Position(self, value: SimPoint) -> SimPoint: ...
    @property
    def RepresentationReference(self) -> GeometricReference: ...
    @RepresentationReference.setter
    def RepresentationReference(self, value: GeometricReference) -> GeometricReference: ...
    def ToString(self) -> str: ...


class SimFlowNetworkOperator(typing.SupportsInt):
    @typing.overload
    def __init__(self, value : int) -> None: ...
    @typing.overload
    def __init__(self, value : int, force_if_true: bool) -> None: ...
    def __int__(self) -> int: ...
    
    # Values:
    Addition : SimFlowNetworkOperator # 0
    Subtraction : SimFlowNetworkOperator # 1
    Multiplication : SimFlowNetworkOperator # 2
    Division : SimFlowNetworkOperator # 3
    Minimum : SimFlowNetworkOperator # 4
    Maximum : SimFlowNetworkOperator # 5
    Assignment : SimFlowNetworkOperator # 6


class SimNetworkFactory(SimManagedCollection_1[int]):
    def __init__(self, owner: ProjectData) -> None: ...
    @property
    def CalledFromLocation(self) -> IReferenceLocation: ...
    @property
    def Count(self) -> int: ...
    @property
    def HasChanges(self) -> bool: ...
    @property
    def Item(self) -> int: ...
    @Item.setter
    def Item(self, value: int) -> int: ...
    @property
    def LastChange(self) -> DateTime: ...
    @property
    def NetworkRecord(self) -> ObservableCollection_1[SimFlowNetwork]: ...
    @NetworkRecord.setter
    def NetworkRecord(self, value: ObservableCollection_1[SimFlowNetwork]) -> ObservableCollection_1[SimFlowNetwork]: ...
    @property
    def ProjectData(self) -> ProjectData: ...
    def CreateEmptyNetwork(self, name: str, _user: SimUserRole) -> SimFlowNetwork: ...
    def GetAllNetworkElements(self) -> Dictionary_2[SimObjectId, SimFlowNetworkElement]: ...
    def OnNetworkAdded(self, addedNetworks: IEnumerable_1[SimFlowNetwork]) -> None: ...
    def OnNetworkDeleted(self, deletedNetworks: IEnumerable_1[SimFlowNetwork]) -> None: ...
    def RemoveReferencesToGeometryWithinRecord(self) -> None: ...

    class NetworkAddedEventHandler(MulticastDelegate):
        def __init__(self, object: typing.Any, method: int) -> None: ...
        @property
        def Method(self) -> MethodInfo: ...
        @property
        def Target(self) -> typing.Any: ...
        def BeginInvoke(self, sender: typing.Any, addedNetworks: IEnumerable_1[SimFlowNetwork], callback: AsyncCallback, object: typing.Any) -> IAsyncResult: ...
        def EndInvoke(self, result: IAsyncResult) -> None: ...
        def Invoke(self, sender: typing.Any, addedNetworks: IEnumerable_1[SimFlowNetwork]) -> None: ...


    class NetworkDeletedEventHandler(MulticastDelegate):
        def __init__(self, object: typing.Any, method: int) -> None: ...
        @property
        def Method(self) -> MethodInfo: ...
        @property
        def Target(self) -> typing.Any: ...
        def BeginInvoke(self, sender: typing.Any, deletedNetworks: IEnumerable_1[SimFlowNetwork], callback: AsyncCallback, object: typing.Any) -> IAsyncResult: ...
        def EndInvoke(self, result: IAsyncResult) -> None: ...
        def Invoke(self, sender: typing.Any, deletedNetworks: IEnumerable_1[SimFlowNetwork]) -> None: ...



class SimObject(IReference, INotifyPropertyChanged, abc.ABC):
    @property
    def Description(self) -> str: ...
    @Description.setter
    def Description(self, value: str) -> str: ...
    @property
    def GlobalID(self) -> Guid: ...
    @property
    def ID(self) -> SimObjectId: ...
    @ID.setter
    def ID(self, value: SimObjectId) -> SimObjectId: ...
    @property
    def LocalID(self) -> int: ...
    @property
    def Name(self) -> str: ...
    @Name.setter
    def Name(self, value: str) -> str: ...


class SimObjectId(IComparable, INotifyPropertyChanged):
    @typing.overload
    def __init__(self, globalId: Guid, localId: int) -> None: ...
    @typing.overload
    def __init__(self, globalLocation: IReferenceLocation, localId: int) -> None: ...
    @typing.overload
    def __init__(self, localId: int) -> None: ...
    Empty : SimObjectId
    @property
    def GlobalId(self) -> Guid: ...
    @GlobalId.setter
    def GlobalId(self, value: Guid) -> Guid: ...
    @property
    def GlobalLocation(self) -> IReferenceLocation: ...
    @GlobalLocation.setter
    def GlobalLocation(self, value: IReferenceLocation) -> IReferenceLocation: ...
    @property
    def LocalId(self) -> int: ...
    @LocalId.setter
    def LocalId(self, value: int) -> int: ...
    def CompareTo(self, obj: typing.Any) -> int: ...
    def Equals(self, obj: typing.Any) -> bool: ...
    @staticmethod
    def FromString(simObjectString: str) -> ValueTuple_3[Guid, int, int]: ...
    def GetHashCode(self) -> int: ...
    def __eq__(self, pid1: SimObjectId, pid2: SimObjectId) -> bool: ...
    def __ne__(self, pid1: SimObjectId, pid2: SimObjectId) -> bool: ...
    def ToString(self) -> str: ...

