Exemplo n.º 1
0
        private JupiterViewModel jvm; //Necessary to change between well list


        public MikeSheViewModel(Model Mshe, JupiterViewModel JVM)
        {
            jvm                 = JVM;
            mshe                = Mshe;
            Layers              = new ObservableCollection <MikeSheLayerViewModel>();
            ScreensToMove       = new ObservableCollection <MoveToChalkViewModel>();
            ScreensAboveTerrain = new ObservableCollection <MoveToChalkViewModel>();
            ScreensBelowBottom  = new ObservableCollection <MoveToChalkViewModel>();

            for (int i = 0; i < mshe.GridInfo.NumberOfLayers; i++)
            {
                MikeSheLayerViewModel msvm = new MikeSheLayerViewModel(i, mshe.GridInfo.NumberOfLayers);
//        if(mshe.Input.MIKESHE_FLOWMODEL.SaturatedZone.TypeOfVerDiscr==2)
                msvm.DisplayName = mshe.Input.MIKESHE_FLOWMODEL.SaturatedZone.CompLayersSZ.Layer_2s[mshe.GridInfo.NumberOfLayers - 1 - i].Name;
                //      else
                //      msvm.DisplayName = "Computational layer
                Layers.Add(msvm);
            }
            Layers.First().IsChalkLayer = true;

            Chalks = new SortedDictionary <string, string>();
            Clays  = new SortedDictionary <string, string>();
            string dir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
            var    doc = XDocument.Load(Path.Combine(dir, "LithologyGroups.xml")).Element("LithologyGroups");

            foreach (var el in doc.Element("Chalks").Elements())
            {
                Chalks.Add(el.Value, "");
            }

            foreach (var el in doc.Element("Clays").Elements())
            {
                Clays.Add(el.Value, "");
            }

            foreach (var msvm in Layers)
            {
                msvm.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(msvm_PropertyChanged);
            }


            RaisePropertyChanged("Layers");

            ShowExtractionWells = true;
        }
Exemplo n.º 2
0
    private JupiterViewModel jvm; //Necessary to change between well list


    public MikeSheViewModel(Model Mshe, JupiterViewModel JVM)
    {
      jvm = JVM;
      mshe = Mshe;
      Layers = new ObservableCollection<MikeSheLayerViewModel>();
      ScreensToMove = new ObservableCollection<MoveToChalkViewModel>();
      ScreensAboveTerrain = new ObservableCollection<MoveToChalkViewModel>();
      ScreensBelowBottom = new ObservableCollection<MoveToChalkViewModel>();

      for (int i = 0; i < mshe.GridInfo.NumberOfLayers; i++)
      {
        
        MikeSheLayerViewModel msvm = new MikeSheLayerViewModel(i, mshe.GridInfo.NumberOfLayers);
//        if(mshe.Input.MIKESHE_FLOWMODEL.SaturatedZone.TypeOfVerDiscr==2)
          msvm.DisplayName = mshe.Input.MIKESHE_FLOWMODEL.SaturatedZone.CompLayersSZ.Layer_2s[mshe.GridInfo.NumberOfLayers - 1 - i].Name;
  //      else 
    //      msvm.DisplayName = "Computational layer 
        Layers.Add(msvm);
      }
      Layers.First().IsChalkLayer = true;

      Chalks = new SortedDictionary<string, string>();
      Clays = new SortedDictionary<string, string>();
      string dir = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
      var doc = XDocument.Load(Path.Combine(dir,"LithologyGroups.xml")).Element("LithologyGroups");

      foreach (var el in doc.Element("Chalks").Elements())
        Chalks.Add(el.Value, "");

      foreach (var el in doc.Element("Clays").Elements())
        Clays.Add(el.Value, "");
 
      foreach(var msvm in Layers)
        msvm.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(msvm_PropertyChanged);


      RaisePropertyChanged("Layers");

      ShowExtractionWells = true;
    }