Exemple #1
0
        public void Add(SimulateDataChartModel sdcmodel, int id)
        {
            if (id == sdcmodels.Count())
            {
                AddLast(sdcmodel);
                return;
            }
            sdcmodel.ActualWidth = ActualWidth;
            RowDefinition rdef = new RowDefinition();

            rdef.Height = new GridLength(40);
            MainGrid.RowDefinitions.Add(rdef);
            SimulateDataChartModel _sdcmodel = sdcmodels.ElementAt(id);
            LinkedListNode <SimulateDataChartModel> nodestart = sdcmodels.Find(_sdcmodel);
            LinkedListNode <SimulateDataChartModel> node      = nodestart;

            while (node != null)
            {
                _sdcmodel = node.Value;
                int row = Grid.GetRow(_sdcmodel);
                Grid.SetRow(_sdcmodel, row + 1);
                node = node.Next;
            }
            Grid.SetRow(sdcmodel, id);
            sdcmodels.AddBefore(nodestart, sdcmodel);
            MainGrid.Children.Add(sdcmodel);
        }
Exemple #2
0
        private void OnSDModelPaste(object sender, SimulateDataModelEventArgs e)
        {
            int id = e.ID;

            foreach (SimulateDataModel sdmodel in copysdmodels)
            {
                SimulateDataChartModel sdcmodel = VChart.SDCModels.ElementAt(id);
                VChart.SetValue(sdmodel, sdcmodel.SDModel, (int)(copystart), (int)(copyend), (int)(e.TimeStart), (int)(e.TimeEnd));
            }
        }
Exemple #3
0
 public SimulateDataModelEventArgs()
 {
     ID          = 0;
     SDModel_old = null;
     SDModel_new = null;
     SDModels    = null;
     TimeStart   = 0;
     TimeEnd     = 0;
     SDVModel    = null;
     SDCModel    = null;
 }
Exemple #4
0
        private LinkedListNode <SimulateDataChartModel> CursorNodeEnd()
        {
            int id = (int)(Math.Max(cssy, csey) / 40);

            if (id >= SDCModels.Count())
            {
                id = SDCModels.Count() - 1;
            }
            SimulateDataChartModel sdcmodel = SDCModels.ElementAt(id);
            LinkedListNode <SimulateDataChartModel> node = SDCModels.Find(sdcmodel);

            return(node);
        }
Exemple #5
0
 public SimuViewChartModel(IEnumerable <SimulateDataModel> sdmodels)
 {
     InitializeComponent();
     sdvmodels = new LinkedList <SimulateDataViewModel>();
     sdcmodels = new LinkedList <SimulateDataChartModel>();
     foreach (SimulateDataModel sdmodel in sdmodels)
     {
         SimulateDataViewModel  sdvmodel = new SimulateDataViewModel(sdmodel);
         SimulateDataChartModel sdcmodel = new SimulateDataChartModel(sdmodel, TRuler);
         sdvmodels.AddLast(sdvmodel);
         sdcmodels.AddLast(sdcmodel);
     }
     ReinitializeComponent();
 }
Exemple #6
0
        public void AddLast(SimulateDataChartModel sdcmodel)
        {
            sdcmodel.ActualWidth = ActualWidth;
            RowDefinition rdef = new RowDefinition();

            rdef.Height = new GridLength(40);
            MainGrid.RowDefinitions.Add(rdef);
            int count = sdcmodels.Count();

            Grid.SetRow(sdcmodel, count);
            Grid.SetColumn(sdcmodel, 0);
            SDCModels.AddLast(sdcmodel);
            MainGrid.Children.Add(sdcmodel);
        }
Exemple #7
0
        public void Remove(SimulateDataChartModel sdcmodel)
        {
            LinkedListNode <SimulateDataChartModel> node = sdcmodels.Find(sdcmodel);

            if (node == null)
            {
                return;
            }
            MainGrid.RowDefinitions.RemoveAt(0);
            node = node.Next;
            while (node != null)
            {
                SimulateDataChartModel _sdcmodel = node.Value;
                int row = Grid.GetRow(_sdcmodel);
                Grid.SetRow(_sdcmodel, row - 1);
                node = node.Next;
            }
            sdcmodels.Remove(sdcmodel);
            MainGrid.Children.Remove(sdcmodel);
        }
 public SimulateDataModelEventArgs()
 {
     SDModel  = null;
     SDVModel = null;
     SDCModel = null;
 }
Exemple #9
0
        public void AddLast(SimulateDataModel sdmodel)
        {
            SimulateDataChartModel sdcmodel = new SimulateDataChartModel(sdmodel, truler);

            AddLast(sdcmodel);
        }
Exemple #10
0
        public void Add(SimulateDataModel sdmodel, int id)
        {
            SimulateDataChartModel sdcmodel = new SimulateDataChartModel(sdmodel, truler);

            Add(sdcmodel, id);
        }