Esempio n. 1
0
 /// <summary>
 /// Called when a sensor mount is clicked in the analyzer.
 /// </summary>
 /// <param name="view">View.</param>
 /// <param name="analyzer">Analyzer.</param>
 /// <param name="index">Index.</param>
 private void OnSensorMountClicked(AnalyzerView view, Analyzer analyzer, int index)
 {
     if (analyzer.HasSensorAt(index))
     {
         var s = analyzer[index];
         if (s is GaugeDeviceSensor)
         {
             var side = Analyzer.ESide.Low;
             analyzer.GetSideOfIndex(index, out side);
             new ViewerDialog(this.Activity, analyzer, analyzer[index], side).Show();
         }
         else if (s is ManualSensor)
         {
             new ManualSensorEditDialog(Activity, s as ManualSensor).Show();
         }
     }
     else
     {
         if (!analyzer.isEditable)
         {
             return;
         }
         ShowAddFromDialog(analyzer, index);
     }
 }
Esempio n. 2
0
        /// <Docs>The LayoutInflater object that can be used to inflate
        ///  any views in the fragment,</Docs>
        /// <param name="savedInstanceState">If non-null, this fragment is being re-constructed
        ///  from a previous saved state as given here.</param>
        /// <returns>To be added.</returns>
        /// <summary>
        /// Raises the create view event.
        /// </summary>
        /// <param name="inflater">Inflater.</param>
        /// <param name="container">Container.</param>
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            analyzerView = new AnalyzerView(inflater.Context);

            analyzerView.onSensorMountClicked     += OnSensorMountClicked;
            analyzerView.onSensorMountLongClicked += OnSensorMountLongClicked;
            analyzerView.onManifoldClicked        += OnManifoldClicked;
            analyzerView.onSensorPropertyClicked  += OnSensorPropertyClicked;

            return(analyzerView);
        }
Esempio n. 3
0
 /// <summary>
 /// Called when a sensor mount is clicked in the analyzer.
 /// </summary>
 /// <param name="view">View.</param>
 /// <param name="analyzer">Analyzer.</param>
 /// <param name="index">Index.</param>
 private void OnSensorMountLongClicked(AnalyzerView view, Analyzer analyzer, int index)
 {
     if (!analyzer.isEditable)
     {
         return;
     }
     if (analyzer.HasSensorAt(index))
     {
         analyzerView.StartDraggingSensorMount(index);
     }
     else
     {
         ShowAddFromDialog(analyzer, index);
     }
     L.D(this, "Analyzer view callback sensor mount long clicked at index: " + index);
 }
Esempio n. 4
0
        public void CustomizeView(AnalyzerModel model, NodeView nodeView)
        {
            nodeModel     = nodeView.ViewModel.NodeModel;
            nodeViewModel = nodeView.ViewModel;
            convertModel  = model;

            exporterControl = new AnalyzerView(model, nodeView)
            {
                DataContext = new AnalyzerViewModel(model, nodeView),
            };

            exporterViewModel = exporterControl.DataContext as AnalyzerViewModel;
            nodeView.inputGrid.Children.Add(exporterControl);
            exporterControl.Loaded += converterControl_Loaded;
            //exporterControl.SelectExportedUnit.PreviewMouseUp += SelectExportedUnit_PreviewMouseUp;
        }
Esempio n. 5
0
        /// <summary>
        /// Called when a manifold is clicked in the analyzer view.
        /// </summary>
        /// <param name="view">View.</param>
        /// <param name="analyzer">Analyzer.</param>
        /// <param name="side">Side.</param>
        private void OnManifoldClicked(AnalyzerView view, Analyzer analyzer, Analyzer.ESide side)
        {
            if (!analyzer.isEditable)
            {
                return;
            }

            var manifold = analyzer.GetManifoldFromSide(side);

            if (manifold != null)
            {
                ShowManifoldContextDialog(manifold);
            }
            else
            {
                ShowAddFromDialog(analyzer, side);
            }
        }