Пример #1
0
    public MouseSetup(String FileName)
      : base(FileName)
    {
      data = new MexFile(FileName);

      foreach (var n in data.MOUSE_NODES.Nodes)
      {
        Nodes.Add(n.NodeID, new MUNode(n));
      }

      foreach (var xsec in data.MOUSE_CROSS_SECTIONS.Cross_Sections)
      {
        Xsecs.Add(xsec.CRSID, xsec);
      }

      foreach (var l in data.MOUSE_LINKS.Links)
      {
        MULink newlink = new MULink(l);
        Links.Add(l.LinkID, newlink);

        newlink.UpstreamNode = Nodes[newlink.pfslink.FromNode];
        newlink.DownstreamNode = Nodes[newlink.pfslink.ToNode];

        Nodes[newlink.UpstreamNode.pfsnode.NodeID].Links.Add(newlink);
        Nodes[newlink.DownstreamNode.pfsnode.NodeID].Links.Add(newlink);

        Cross_Section xsec;
        if(Xsecs.TryGetValue(l.CrsID, out xsec))
          newlink.Xsec = xsec;
      }
    }
Пример #2
0
    public void MexFileConstructorTest()
    {
      string MexFileName = @"C:\Users\Jacob\Projekter\GEUS\Silkeborg\JacobGudbjerg\networkBase.mex";
      MexFile target = new MexFile(MexFileName);

      Assert.AreEqual(514, target.MOUSE_LINKS.Links.Count);

    }