Exemple #1
0
        private bool ColumnIsLocationNameColumn(int columnIndex)
        {
            int firstIndexOfNetworkLocationArgument = DiscretizationBindingList.GetIndexOfNetworkLocationArgument(owner.Function);

            if (columnIndex == firstIndexOfNetworkLocationArgument + 2)
            {
                return(true);
            }

            return(false);
        }
Exemple #2
0
        private int BaseIndexToColumnIndex(int baseColumnIndex)
        {
            int firstIndexOfNetworkLocationArgument = DiscretizationBindingList.GetIndexOfNetworkLocationArgument(owner.Function);

            if (baseColumnIndex > firstIndexOfNetworkLocationArgument + 1)
            {
                return(baseColumnIndex + 2);
            }

            if (baseColumnIndex > firstIndexOfNetworkLocationArgument)
            {
                return(baseColumnIndex + 1);
            }

            return(baseColumnIndex);
        }
Exemple #3
0
        protected override int GetColumnIndex(string columnName)
        {
            int firstIndex = DiscretizationBindingList.GetIndexOfNetworkLocationArgument(owner.Function);

            if (columnName.Equals(DiscretizationBindingList.ColumnNameBranch))
            {
                return(firstIndex);
            }
            if (columnName.Equals(DiscretizationBindingList.ColumnNameChainage))
            {
                return(firstIndex + 1);
            }
            if (columnName.Equals(DiscretizationBindingList.ColumnNameLocationName))
            {
                return(firstIndex + 2);
            }
            return(BaseIndexToColumnIndex(base.GetColumnIndex(columnName)));
        }
        public void DiscretizationBinding()
        {
            var network = RouteHelperTest.GetSnakeNetwork(false, new Point(0, 0), new Point(100, 0), new Point(100, 100));
            var discretization = new Discretization {Network = network};

            var discretizationBindingList = new DiscretizationBindingList(discretization);

            Assert.AreEqual(4, discretizationBindingList.ColumnNames.Count());
            Assert.AreEqual(DiscretizationBindingList.ColumnNameLocationName, discretizationBindingList.ColumnNames[2]);

            Assert.AreEqual(0, discretizationBindingList.Count());

            discretization[new NetworkLocation(network.Branches.First(), 0.0) { Name = "haha" }] = 1.0;

            Assert.AreEqual(1, discretizationBindingList.Count());

            Assert.AreEqual("haha", discretizationBindingList.First()[2].ToString());


        }
Exemple #5
0
        public INetworkLocation GetNetworkLocation()
        {
            int indexOfNetworkLocationInBase = DiscretizationBindingList.GetIndexOfNetworkLocationArgument(owner.Function);

            return((INetworkLocation) base[indexOfNetworkLocationInBase]);
        }
Exemple #6
0
 public DiscretizationBindingListRow(DiscretizationBindingList owner) : base(owner)
 {
 }
 public DiscretizationBindingListRow(DiscretizationBindingList owner) : base(owner)
 {
 }