Example #1
0
 public TimeBaseControl()
 {
     InitializeComponent();
     Type = PlotType.TimeBase;
     tChart_timeBase.Axes.Bottom.Automatic = false;
     tChart_timeBase.Axes.Bottom.Maximum   = 1;
 }
Example #2
0
        private void btnCalculate_Click(object sender, EventArgs e)
        {
            plotView.Series.Clear();

            InputConfig inputConfig = ReadInputConfig();

            PlotType plotType = GetPlotType();

            if (plotType == PlotType.Undefined)
            {
                MessageBox.Show("Please, select plot type", "Information", MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
            else
            {
                IDictionary <string, PointF[]> data = _reliabilityAssessor.CalculatePlot(plotType, inputConfig);

                DrawPlot(data, plotType);
                if (plotType == PlotType.SimulationModeling)
                {
                    rtbSimulationOutput.Text = _reliabilityAssessor.Output;
                }
                else
                {
                    rtbOutput.Text = _reliabilityAssessor.Output;
                }
            }
        }
Example #3
0
    //  =================================================================================
    /// <summary>
    /// This method initialiseas the class with parameters.
    /// </summary>
    /// <param name="Values">List of Float Array</param>
    /// <param name="Label">String: the series label</param>
    /// <param name="Color">String: the color </param>
    /// <param name="Type">PlotType: the color </param>
    //  ---------------------------------------------------------------------------------
    public PlotData ( List<float [ ]> Values, String Label, String Color, PlotType Type )
    {
      this.Label = Label;
      this.Color = Color;
      this.Type = Type;

      if ( Values.Count == 0 )
      {
        return;
      }

      //
      // load the data list array for correctly formatted values.
      //
      foreach ( float [ ] value in Values )
      {
        if ( value.Length < 2 )
        {
          continue;
        }
        float [ ] value1 = new float [ 2 ];

        value1 [ 0 ] = value [ 0 ];
        value1 [ 1 ] = value [ 1 ];

        this._Values.Add ( value1 );
      }//END data iteration loop.

    }
Example #4
0
 private short GetPlotStatus(UserPlotInfo userPlot, PlotType plotType)
 {
     if (userPlot != null)
     {
         if (plotType == PlotType.Normal)
         {
             var plotInfo = new ConfigCacheSet <PlotInfo>().FindKey(userPlot.PlotID);
             if (plotInfo.PrePlotID > 0)
             {
                 var preUserPlot = UserPlotHelper.GetUserPlotInfo(ContextUser.UserID, plotInfo.PrePlotID);
                 if (preUserPlot == null || preUserPlot.PlotStatus != PlotStatus.Completed)
                 {
                     return((short)PlotStatus.Locked);
                 }
             }
         }
         else
         {
             if (plotType == PlotType.Elite)
             {
                 var plotInfo = new ConfigCacheSet <PlotInfo>().FindKey(userPlot.PlotID);
                 if (plotInfo.PrePlotID > 0 && plotInfo.JYPrePlotID > 0)
                 {
                     var preUserPlot = UserPlotHelper.GetUserPlotInfo(ContextUser.UserID, plotInfo.JYPrePlotID);
                     if (preUserPlot == null || preUserPlot.PlotStatus != PlotStatus.Completed)
                     {
                         return((short)PlotStatus.Locked);
                     }
                 }
             }
         }
         return((short)userPlot.PlotStatus);
     }
     return((short)PlotStatus.Locked);
 }
Example #5
0
        static string TranslateAuxType(PlotType at)
        {
            string str = "";

            switch (at)
            {
            case PlotType.None:
                str = "None";
                break;

            case PlotType.DeltaLaserFrequencyFixed:
                str = "Laser frequency relative to target; using set repetition rate.";
                break;

            case PlotType.DeltaLaserFrequency:
                str = "Laser frequency relative to target; using measured repetition rate.";
                break;

            case PlotType.LaserFrequencyFixed:
                str = "Laser frequency; using set repetition rate.";
                break;

            case PlotType.LaserFrequency:
                str = "Laser frequency; using set measured rate.";
                break;

            default:
                str = "None";
                break;
            }
            return(str);
        }
Example #6
0
        /// <summary>
        /// Initializes a new instance of <c>PlotSettings</c>.
        /// </summary>
        public PlotSettings()
        {
            pageSetupName     = string.Empty;
            plotterName       = "none_device";
            paperSizeName     = "ISO_A4_(210.00_x_297.00_MM)";
            viewName          = string.Empty;
            currentStyleSheet = string.Empty;

            paperMargin = new PaperMargin(7.5, 20.0, 7.5, 20.0);

            paperSize        = new Vector2(210.0, 297.0);
            origin           = Vector2.Zero;
            windowUpRight    = Vector2.Zero;
            windowBottomLeft = Vector2.Zero;

            scaleToFit       = true;
            numeratorScale   = 1.0;
            denominatorScale = 1.0;
            flags            = PlotFlags.DrawViewportsFirst | PlotFlags.PrintLineweights | PlotFlags.PlotPlotStyles | PlotFlags.UseStandardScale;
            plotType         = PlotType.DrawingExtents;

            paperUnits = PlotPaperUnits.Milimeters;
            rotation   = PlotRotation.Degrees90;

            shadePlotMode           = ShadePlotMode.AsDisplayed;
            shadePlotResolutionMode = ShadePlotResolutionMode.Normal;
            shadePlotDPI            = 300;
            paperImageOrigin        = Vector2.Zero;
        }
Example #7
0
        /*! \brief Return information on a string.
         * \param [in] fontHandle Handle of font to use (0 for current handle) if
         * \b PlotType.GivenFont (bit 8) of flags set.
         * \param [in] str String to scan
         * \param [in] flags Plot type
         * \param [in] offset Offset of mouse click
         * \param [in,out] coordBlock Coordinate block for input if \b Font.PlotType.GivenBlock (bit 5)
         * of flags set and output if \b PlotType.ReturnBBox (bit 18) set, otherwise \b null.
         * \param [in,out] matrix Transformation matrix for input if \b PlotType.GivenMatrix (bit 6)
         * of flags set and output if \b PlotType.ReturnMatrix (bit 19) set, otherwise \b null.
         * \param [in] length Length of string to scan - if \b PlotType.GivenLength (bit 7) of flags set
         * \param [out] offsetReturn x,y coordinate offset to caret position -
         * if \b PlotType.ReturnCaretPos (bit 17) of flags set; else to split point,
         * or end of string if splitting not required
         * \param [out] splitCount Number of split characters encountered -
         * if \b PlotType.ReturnSplitCount (bit 20) of flags set
         * \return Index of point in string of caret position - if \b PlotType.ReturnCaretPos
         * (bit 17) of flags is set; else of split point, or of end of string if splitting
         * not required.  */
        public static int ScanString(IntPtr fontHandle,
                                     string str,
                                     PlotType flags,
                                     OS.Coord offset,
                                     Font.ScanCoordBlock coordBlock,
                                     OS.Matrix matrix,
                                     int length,
                                     OS.Coord offsetReturn,
                                     out int splitCount)
        {
            int result_index;

            OS.ThrowOnError(NativeMethods.Font_ScanString(fontHandle,
                                                          str,
                                                          flags,
                                                          offset.X,
                                                          offset.Y,
                                                          coordBlock,
                                                          matrix,
                                                          length,
                                                          out result_index,
                                                          out offsetReturn.X,
                                                          out offsetReturn.Y,
                                                          out splitCount));
            return(result_index);
        }
Example #8
0
        public static PlotBuilder With(PlotType type)
        {
            PlotBuilder plot = new PlotBuilder();

            plot.With(type);
            return(plot);
        }
        public override List <ChartData> OnPlot(ReportNode rp)
        {
            List <ChartData> cds = new List <ChartData>();

            PlotType = "Plot (";
            foreach (string s in selectedkeys)
            {
                PlotType += s + ",";
            }
            PlotType  = PlotType.Remove(PlotType.Length - 1);
            PlotType += ")";


            if (selectedkeys == null || selectedkeys.Count < 1)
            {
                return(null);
            }
            ChartData cd = ChartData.GetInstance();

            cd.Title   = "";
            cd.TitlesY = selectedkeys.ToArray();
            cd.TitleX  = "Sample";

            double[][] yval      = new double[selectedkeys.Count][];
            int        maxlength = int.MinValue;

            for (int i = 0; i < selectedkeys.Count; i++)
            {
                yval[i] = rp.GetPlot(selectedkeys[i]).ToArray();// plots[selectedkeys[i]].ToArray();
                if (maxlength < yval[i].Length)
                {
                    maxlength = yval[i].Length;
                }
            }
            cd.Y = yval;

            List <double> time = rp.GetPlot("Time");

            if (time != null && time.Count == maxlength)
            {
                cd.TitleX     = "Time";
                cd.AxisLabelX = "[s]";
                cd.X          = time.ToArray();
            }
            else
            {
                cd.TitleX = "Sample";
                double[] x = new double[maxlength];
                for (int i = 0; i < x.Length; i++)
                {
                    x[i] = i;
                }
                cd.AxisLabelX = "[n]";
                cd.X          = x;
            }
            cds.Add(cd);

            return(cds);
        }
Example #10
0
 public Curve(Color color, PlotType plottingType)
 {
     CurveColor   = color;
     PlottingType = plottingType;
     LineWidth    = 1.0f;
     PointSize    = 2.0f;
     Points       = new List <PointF>(800);
 }
Example #11
0
        private PlotType GetPlotType()
        {
            sbyte selectedIndex = (sbyte)cmbPlotType.SelectedIndex;

            PlotType plotType = (PlotType)selectedIndex;

            return(plotType);
        }
Example #12
0
        public SignalBuffer GetPlot(double durationSeconds, PlotType type)
        {
            Check();
            IntPtr ___ret_abi;

            Native.Throw(_vt.GetPlot(IPtr, durationSeconds, type, out ___ret_abi));
            return(GluonObject.Of <SignalBuffer>(___ret_abi));
        }
Example #13
0
 private void inputPowerRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     if (inputPowerRadioButton.Checked)
     {
         plotType = PlotType.INPUT_POWER;
         plotCooler();
     }
 }
Example #14
0
 public TabularControl(PlotType type)
 {
     InitializeComponent();
     this.Type  = type;
     LowFreq    = 90;
     HighFreq   = 110;
     ParamQueue = new Queue <object[]>();
 }
Example #15
0
        public IDictionary <string, PointF[]> CalculatePlot(PlotType plotType, InputConfig inputConfig)
        {
            switch (plotType)
            {
            case PlotType.NormalConditionsSoftFaults:
                PlotCalculator = new NormalConditionsSoftFaultsCalculator(inputConfig);
                break;

            case PlotType.NormalConditionsHardFaults:
                PlotCalculator = new NormalConditionsHardFaultsCalculator(inputConfig);
                break;

            case PlotType.NormalConditionsErrors:
                PlotCalculator = new NormalConditionsErrorsCalculator(inputConfig);
                break;

            case PlotType.CriticalConditionsHardFaults:
                PlotCalculator = new CriticalConditionsHardFaultsCalculator(inputConfig);
                break;

            case PlotType.CyclingWordHardFaults:
                PlotCalculator = new CyclingWordHardFaultsCalculator(inputConfig);
                break;

            case PlotType.ComparisonHardFaults:
                PlotCalculator = new ComparisonHardFaultsCalculator(inputConfig);
                break;

            case PlotType.Undefined:
                PlotCalculator = new L2Task1PassiveRedundancy(inputConfig);
                break;

            case PlotType.L2PassiveRedundancy:
                PlotCalculator = new L2Task1PassiveRedundancy(inputConfig);
                break;

            case PlotType.L2MajorRedundancy:
                PlotCalculator = new L2Task2MajorRedundanty(inputConfig);
                break;

            case PlotType.L2DynamicRedundancy:
                PlotCalculator = new L2Task3DynamicRedundancy(inputConfig);
                break;

            case PlotType.SimulationModeling:
                PlotCalculator = new SimulationCalculator(inputConfig);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(plotType), plotType, null);
            }

            var result = PlotCalculator.Calculate();

            Output = PlotCalculator.Output;

            return(result);
        }
Example #16
0
            /*! \brief Write a string to the screen.
             * \param[in] str String to write
             * \param[in] flags Plot type
             * \param[in] xPos Start x coordinate (flags bit 4 set = OS units, clear = millipoints)
             * \param[in] yPos Start y coordinate (flags bit 4 set = OS units, clear = millipoints)
             * \param[in] length Length of string to write (if bit 7 of flags set)
             * \return Nothing
             *
             * \note
             * Automatically:
             * \li Sets flag bit 8 to indicate font handle in use
             * \li Clears flag bit 5 to indicate coordinate block not in use
             * \li Clears flag bit 6 to indicate matrix not in use
             */
            public void Paint(string str,
                              PlotType flags,
                              int xPos,
                              int yPos,
                              int length)
            {
                flags |= PlotType.GivenFont;
                flags &= ~(PlotType.GivenBlock | PlotType.GivenMatrix);

                Font.Paint(Handle, str, flags, xPos, yPos,
                           null, null, length);
            }
Example #17
0
        private void comboBoxPlotAreaType_SelectedIndexChanged(object sender, EventArgs e)
        {
            String newViewType = comboBoxPlotAreaType.SelectedItem.ToString();

            PlotType pt = PlotType.Display;

            if (newViewType != "Display")
            {
                if (newViewType == "Limits")
                {
                    pt = PlotType.Limits;
                }
                else if (newViewType == "View")
                {
                    pt = PlotType.View;
                }
                else if (newViewType == "Window")
                {
                    pt = PlotType.Window;
                }
                else if (newViewType == "Extents")
                {
                    pt = PlotType.Extents;
                }
                else if (newViewType == "Layout")
                {
                    pt = PlotType.Layout;
                }
            }

            m_plotSettingVal.SetPlotType(m_plotStg, pt);
            FillPlotAreaCombo(false);

            if (pt == PlotType.Layout)
            {
                // This is differences between dialog and validator. Validator doesn't
                // change UseStandardScale to false. Example is kExtents, kFit2Paper -> kLayout ->kExtents
                // Dialog has kFit2Paper disabled, but validator don't clear kFit2Paper flag.
                // Validator also don't change PlotOrigin to 0,0, if plotsenteres was true, but it change scale to 1:1 if fittopaper was true

                if (checkBoxCenterPlot.Enabled)
                {
                    m_plotSettingVal.SetPlotOrigin(m_plotStg, new Point2d(0, 0));
                }
                if (checkBoxPlotScaleFitToPaper.Enabled)
                {
                    m_plotSettingVal.SetUseStandardScale(m_plotStg, false);
                }
            }
            FillPaperOrientation();
            FillScaleValues(false);
            FillPlotOffset();
        }
Example #18
0
            /*! \brief Get the bounding box of a character.
             * \param[in] charCode ASCII character code
             * \param[in] flags bit 4 set => return in OS units, else millipoints
             * \returns The character bounding box in the form of a new OS.Rect */
            public OS.Rect CharBBox(int charCode, PlotType flags)
            {
                int min_x, min_y, max_x, max_y;

                OS.ThrowOnError(NativeMethods.Font_CharBBox(Handle,
                                                            charCode,
                                                            flags,
                                                            out min_x,
                                                            out min_y,
                                                            out max_x,
                                                            out max_y));
                return(new OS.Rect(min_x, min_y, max_x, max_y));
            }
Example #19
0
        public void SetPlotType(PlotType plotType)
        {
            switch (plotType)
            {
            case PlotType.XYPlotTimeDepth:
                XYPlot1 = new XYPlotTimeDepth(null, this, ClientRectangle);
                break;

            default:
                XYPlot1 = new XYPlot(null, this, ClientRectangle);
                break;
            }
        }
Example #20
0
        /**
         * Initializer
         */
        public GraphPanel(PlotType PlotType)
        {
            InitializeComponent(PlotType);

            if (this.PlotType == PlotType.Line)
            {
                LineGraph.DataSavingFinished += new EventHandler(LineGraph_DataSavingFinished);
            }

            ValueUpdateTimer          = new Timer();
            ValueUpdateTimer.Interval = 200; //In milliseconds.
            ValueUpdateTimer.Tick    += new EventHandler(ValueUpdateTimer_Tick);
        }
Example #21
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="type">Тип графика.</param>
        /// <param name="paint">Краска для линий.</param>
        /// <param name="frame">Рамка.</param>
        /// <param name="lineThickness">Толщина линий.</param>
        public Plot(PlotType type, RestrictiveFrame frame, float lineThickness)
        {
            Type         = type;
            Frame        = frame;
            FirstPointX  = Frame.GetFirstPointX();
            FirstPointY  = Frame.GetFirstPointY();
            SecondPointX = Frame.GetSecondPointX();
            SecondPointY = Frame.GetSecondPointY();

            RedPaint  = PaintsKeeper.paints["Red Paint"];
            BluePaint = PaintsKeeper.paints["Blue Paint"];
            GrayPaint = PaintsKeeper.paints["Gray Paint"];
            TextPaint = PaintsKeeper.paints["Text Paint"];
        }
Example #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        public MainViewModel()
        {
            _booksReadFromDatabase   = new ObservableCollection <BookRead>();
            _nationsReadFromDatabase = new ObservableCollection <Nation>();

            _booksReadDatabase   = new BooksReadDatabase(DatabaseConnectionString);
            _nationsReadDatabase = new NationDatabase(DatabaseConnectionString);

            _selectedPlot = PlotType.AverageDaysPerBook;

            _oxyPlotChart = new OxyPlotViewModel(_selectedPlot);

            SetupPlotTypesByTitle();
        }
Example #23
0
File: Plotter.cs Project: dqdv/DqDv
        public Chart Plot(PlotType plotType, PlotParameters parameters, int[] projects, string trace)
        {
            var forcedEveryNthCycle = CalcForcedEveryNthCycle(plotType, projects, parameters, trace);
            var param = MakeParameters(parameters, forcedEveryNthCycle);

            var chart = CreateChart(plotType, param);

            chart.ForcedEveryNthCycle = forcedEveryNthCycle;

            foreach (var pid in projects)
            {
                Plot(chart, pid, plotType, param, trace);
            }
            return(chart);
        }
Example #24
0
            /*! \brief Write a string to the screen.
             * \param[in] str String to write
             * \param[in] flags Plot type
             * \param[in] xPos Start x coordinate (Must be in millipoints)
             * \param[in] yPos Start y coordinate (Must be in millipoints)
             * \param[in] coordBlock Coordinate block
             * \param[in] length Length of string to write (if bit 7 of flags set)
             * \return Nothing
             *
             * \note
             * Automatically:
             * \li Sets flag bit 5 to indicate coordinate block in use
             * \li Sets flag bit 8 to indicate font handle in use
             * \li Clears flag bit 0 because coordinate block in use
             * \li Clears flag bit 4 - millipoints must be used if coordinate block is used
             * \li Clears flag bit 6 to indicate transformation matrix not in use
             */
            public void Paint(string str,
                              PlotType flags,
                              int xPos,
                              int yPos,
                              Font.PaintCoordBlock coordBlock,
                              int length)
            {
                flags |= PlotType.GivenBlock | PlotType.GivenFont;
                flags &= ~(PlotType.GivenMatrix |
                           PlotType.OSUnits |
                           PlotType.Justify);

                Font.Paint(Handle, str, flags, xPos, yPos,
                           coordBlock, null, length);
            }
        private void PlotType_2_Click(object sender, RoutedEventArgs e)
        {
            resetPlotTypeButton();
            LastClickedPlotType = 2;

            (sender as Button).Background = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 204, 17));
            (sender as Button).Foreground = System.Windows.Media.Brushes.Black;
            this.plotType = "제 2종 일반 주거지역";
            plotType2     = PlotType.제2종일반주거지역;
            this.maxFloorAreaRatio.Text   = "200";
            this.maxBuildingCoverage.Text = "60";
            this.maxFloors.Text           = "7";
            RhinoApp.WriteLine(plotType2.ToString());
            SpecialCase.IsChecked = true;
        }
Example #26
0
        public Plot(Game game, PlotType type, CrystiteLevel crystite)
        {
            this.game     = game;
            this.type     = type;
            this.crystite = crystite;
            mountains     = new Mountain[0];
            resource      = PlotResource.None;
            player        = -1;
            goods         = 0;

            if (type == PlotType.Mountains)
            {
                generateMountains();
            }
        }
Example #27
0
        public string GetPlot(PlotType plotType, IPlotParameters plotParameters)
        {
            switch (plotType)
            {
            case PlotType.SolutionDomain:
                var plotSolutionDomainResultsService = _serviceProvider.GetService <PlotSolutionDomainResultsService>();
                return(plotSolutionDomainResultsService.Plot((SolutionDomainPlotParameters)plotParameters));

            case PlotType.Spectral:
                var plotSpectralResultsService = _serviceProvider.GetService <PlotSpectralResultsService>();
                return(plotSpectralResultsService.Plot((SpectralPlotParameters)plotParameters));

            default:
                return(null);
            }
        }
Example #28
0
        public SettingsDialog(PlotType plotType = PlotType.scatter)
        {
            InitializeComponent();

            type = plotType;

            Resources["colour"] = ConvertFromSystemDrawingColor(plotColour);
            colourTextBox.Text  = plotColour.ToArgb().ToString("X");
            Resources["scatterSettingsVisibility"]    = plotType == PlotType.scatter ? Visibility.Visible : Visibility.Collapsed;
            Resources["errorSettingsVisibility"]      = plotType == PlotType.scatter || plotType == PlotType.bar || plotType == PlotType.bar_grouped ? Visibility.Visible : Visibility.Collapsed;
            Resources["scatterBarSettingsVisibility"] = plotType == PlotType.scatter || plotType == PlotType.bar ? Visibility.Visible : Visibility.Collapsed;
            Resources["histogramSettingsVisibility"]  = plotType == PlotType.histogram ? Visibility.Visible : Visibility.Collapsed;
            Resources["labelSettingsVisibility"]      = plotType != PlotType.bar_grouped ? Visibility.Visible : Visibility.Collapsed;
            Resources["colourSettingsVisibility"]     = plotType != PlotType.bar_grouped ? Visibility.Visible : Visibility.Collapsed;
            Resources["multiselectVisibility"]        = plotType == PlotType.bar_grouped ? Visibility.Visible : Visibility.Collapsed;
        }
Example #29
0
        public void SetPlotType(PlotType type, SolidColorBrush solidColorBrush)
        {
            double size = 10;

            switch (type)
            {
            case PlotType.None:
                Plot.Fill   = Brushes.Transparent;
                Plot.Stroke = null;
                size        = 10;
                break;

            case PlotType.Type1:
            {
                if (solidColorBrush is null)
                {
                    Plot.Fill = new SolidColorBrush(Color.FromArgb(0xff, 0xb2, 0xb2, 0xb2));
                }
                else
                {
                    Plot.Fill = solidColorBrush;
                }
                Plot.Stroke = new SolidColorBrush(Color.FromArgb(0xff, 0x5f, 0x5f, 0x5f));
                size        = 10;
            }
            break;

            case PlotType.Type2:
            {
                if (solidColorBrush is null)
                {
                    Plot.Fill = new SolidColorBrush(Color.FromArgb(0xff, 0xb2, 0x62, 0x62));
                }
                else
                {
                    Plot.Fill = solidColorBrush;
                }
                Plot.Stroke = new SolidColorBrush(Color.FromArgb(0xff, 0x5f, 0x1f, 0x1f));
                size        = 4;
            }
            break;
            }
            Plot.Width  = size;
            Plot.Height = size;
            Plot.Margin = new Thickness(-(size / 2), -(size / 2), 0, 0);
        }
    protected void UpdatePlotTypes()
    {
        PlotType.Clear();

        var cell = new CellRendererText();

        PlotType.PackStart(cell, false);
        PlotType.AddAttribute(cell, "text", 0);
        var store = new ListStore(typeof(string));

        PlotType.Model = store;

        store.AppendValues("Data points");
        store.AppendValues("Class boundaries");

        PlotType.Active = 0;
    }
Example #31
0
        public void AddPlot(Vector.FxVectorF vecY, PlotType type, Color4 plotColor)
        {
            // add the vector to the list
            PlotGeometry plot = new PlotGeometry();

            // add the vectors
            plot.OrigVectorY = vecY;

            // set the color
            plot.Color = plotColor;

            // set the plot type
            plot.Type = type;

            // because he set vecY and vecX we set the vector define
            plot.StepType = XStepType.ZeroToMax;

            // add the plot to the list
            listPlotsGeometry.Add(plot);

            // fit the plots to the view
            FitPlots();

            // set the the geometry is dirty
            IsGeomrtryDirty = true;

            // check if the load have be called before of add
            if (Parent != null)
                // redraw to see the result
                Parent.ReDraw();
        }
Example #32
0
        private void InitPlotter(Vector.FxVectorF vec, PlotType plotType, Color color)
        {
            // init the lists
            listPlotsGeometry = new List<PlotGeometry>();

            // set the position and the size of the element
            this.Position = new Vector.FxVector2f(0);
            this.Size = new Vector.FxVector2f(750, 500);

            // add the vector to the list
            PlotGeometry plot = new PlotGeometry();
            plot.OrigVectorY = vec;
            plot.Color = color.ToColor4();
            plot.Type = plotType;
            plot.StepType = XStepType.ZeroToMax;

            // add the plot to the list
            listPlotsGeometry.Add(plot);

            // set the origin position
            {
                float max = vec.Max();
                float min = vec.Min();
                float orig_y = Size.Y / 2;
                if(max >0 && min<0)
                {
                    orig_y = Size.Y * (min / (max - min));
                }

                if(max >0 && min >= 0)
                {
                    orig_y = -min;
                }

                if(max <=0 && min <0)
                {
                    orig_y = Size.Y + max;
                }
                OriginPosition = new Vector.FxVector2f(5, orig_y);
            }

            // allocate scale
            _scale = new Vector.FxVector2f(1.0f);

            // fit the plots to the view
            FitPlots();

            // set the x_step base on the size of vec and the width
            X_Space = this.Size.x / vec.Size;

            // init format
            _TextFormat = new TextElementFormat();
            _TextFormat.familyName = "Calibri";
            _TextFormat.weight = SharpDX.DirectWrite.FontWeight.Black;
            _TextFormat.fontStyle = SharpDX.DirectWrite.FontStyle.Normal;
            _TextFormat.fontStretch = SharpDX.DirectWrite.FontStretch.Normal;
            _TextFormat.fontSize = 8.0f;

            // init toolstrip
            InitToolStrips();
        }
Example #33
0
 public PloterElement(Vector.FxVectorF vec, PlotType plotType)
 {
     InitPlotter(vec, plotType, Color.OrangeRed);
 }
Example #34
0
 public PloterElement(Vector.FxVectorF vec, PlotType plotType, Color color)
 {
     InitPlotter(vec, plotType, color);
 }
Example #35
0
 public PloterElement(Vector.FxVectorF vec, PlotType plotType, System.Drawing.Color color)
 {
     InitPlotter(vec, plotType, new Color(color.R, color.G, color.B, color.A));
 }
Example #36
0
 public void AddPlot( Vector.FxVectorF vecY, PlotType type, System.Drawing.Color plotColor )
 {
     AddPlot(vecY, type, new Color4(plotColor.R, plotColor.G, plotColor.B, plotColor.A));
 }
Example #37
0
 private short GetPlotStatus(UserPlotInfo userPlot, PlotType plotType)
 {
     if (userPlot != null)
     {
         if (plotType == PlotType.Normal)
         {
             var plotInfo = new ConfigCacheSet<PlotInfo>().FindKey(userPlot.PlotID);
             if (plotInfo.PrePlotID > 0)
             {
                 var preUserPlot = UserPlotHelper.GetUserPlotInfo(ContextUser.UserID, plotInfo.PrePlotID);
                 if (preUserPlot == null || preUserPlot.PlotStatus != PlotStatus.Completed)
                 {
                     return (short)PlotStatus.Locked;
                 }
             }
         }
         else
         {
             if (plotType == PlotType.Elite)
             {
                 var plotInfo = new ConfigCacheSet<PlotInfo>().FindKey(userPlot.PlotID);
                 if (plotInfo.PrePlotID > 0 && plotInfo.JYPrePlotID > 0)
                 {
                     var preUserPlot = UserPlotHelper.GetUserPlotInfo(ContextUser.UserID, plotInfo.JYPrePlotID);
                     if (preUserPlot == null || preUserPlot.PlotStatus != PlotStatus.Completed)
                     {
                         return (short)PlotStatus.Locked;
                     }
                 }
             }
         }
         return (short)userPlot.PlotStatus;
     }
     return (short)PlotStatus.Locked;
 }
Example #38
0
 protected override object this[string index]
 {
     get
     {
         #region
         switch (index)
         {
             case "PlotID": return PlotID;
             case "CityID": return CityID;
             case "PlotType": return PlotType;
             case "PlotSeqNo": return PlotSeqNo;
             case "PlotName": return PlotName;
             case "BossHeadID": return BossHeadID;
             case "BgScene": return BgScene;
             case "FgScene": return FgScene;
             case "PrePlotID": return PrePlotID;
             case "AftPlotID": return AftPlotID;
             case "DemandLv": return DemandLv;
             case "GameCoin": return GameCoin;
             case "Gold": return Gold;
             case "GoldProbability": return GoldProbability;
             case "ObtainNum": return ObtainNum;
             case "ExpNum": return ExpNum;
             case "Experience": return Experience;
             case "ScoreNum": return ScoreNum;
             case "ItemRank": return ItemRank;
             case "ItemProbability": return ItemProbability;
             case "SceneY1": return SceneY1;
             case "SceneY2": return SceneY2;
             case "Version": return Version;
             case "FestivalProbability": return FestivalProbability;
             case "FestivalReward": return FestivalReward;
             case "LayerNum": return LayerNum;
             case "EnableSparePart": return EnableSparePart;
             case "EnchantID": return EnchantID;
             case "EnchantProbability": return EnchantProbability;
             case "PlotDesc": return PlotDesc;
             case "ChallengeNum": return ChallengeNum;
             case "PlotLv": return PlotLv;
             case "HonourNum": return HonourNum;
             case "FragmentNum": return FragmentNum;
             case "JYPrePlotID": return JYPrePlotID;
             case "KgScene": return KgScene;
             default: throw new ArgumentException(string.Format("PlotInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
     set
     {
         #region
         switch (index)
         {
             case "PlotID":
                 _PlotID = value.ToInt();
                 break;
             case "CityID":
                 _CityID = value.ToInt();
                 break;
             case "PlotType":
                 _PlotType = value.ToEnum<PlotType>();
                 break;
             case "PlotSeqNo":
                 _PlotSeqNo = value.ToShort();
                 break;
             case "PlotName":
                 _PlotName = value.ToNotNullString();
                 break;
             case "BossHeadID":
                 _BossHeadID = value.ToNotNullString();
                 break;
             case "BgScene":
                 _BgScene = value.ToNotNullString();
                 break;
             case "FgScene":
                 _FgScene = value.ToNotNullString();
                 break;
             case "PrePlotID":
                 _PrePlotID = value.ToInt();
                 break;
             case "AftPlotID":
                 _AftPlotID = value.ToInt();
                 break;
             case "DemandLv":
                 _DemandLv = value.ToShort();
                 break;
             case "GameCoin":
                 _GameCoin = value.ToInt();
                 break;
             case "Gold":
                 _Gold = value.ToInt();
                 break;
             case "GoldProbability":
                 _GoldProbability = value.ToDecimal();
                 break;
             case "ObtainNum":
                 _ObtainNum = value.ToInt();
                 break;
             case "ExpNum":
                 _ExpNum = value.ToInt();
                 break;
             case "Experience":
                 _Experience = value.ToInt();
                 break;
             case "ScoreNum":
                 _ScoreNum = value.ToInt();
                 break;
             case "ItemRank":
                 _ItemRank = value.ToNotNullString();
                 break;
             case "ItemProbability":
                 _ItemProbability = value.ToDecimal();
                 break;
             case "SceneY1":
                 _SceneY1 = value.ToInt();
                 break;
             case "SceneY2":
                 _SceneY2 = value.ToInt();
                 break;
             case "Version":
                 _Version = value.ToInt();
                 break;
             case "FestivalProbability":
                 _FestivalProbability = value.ToDecimal();
                 break;
             case "FestivalReward":
                 _FestivalReward = ConvertCustomField<CacheList<FestivalReward>>(value, index);
                 break;
             case "LayerNum":
                 _LayerNum = value.ToInt();
                 break;
             case "EnableSparePart":
                 _EnableSparePart = value.ToInt();
                 break;
             case "EnchantID":
                 _EnchantID = value.ToNotNullString();
                 break;
             case "EnchantProbability":
                 _EnchantProbability = value.ToDecimal();
                 break;
             case "PlotDesc":
                 _PlotDesc = value.ToNotNullString();
                 break;
             case "ChallengeNum":
                 _ChallengeNum = value.ToInt();
                 break;
             case "PlotLv":
                 _PlotLv = value.ToInt();
                 break;
             case "HonourNum":
                 _HonourNum = value.ToInt();
                 break;
             case "FragmentNum":
                 _FragmentNum = value.ToInt();
                 break;
             case "JYPrePlotID":
                 _JYPrePlotID = value.ToInt();
                 break;
             case "KgScene":
                 _KgScene = value.ToNotNullString();
                 break;
             default: throw new ArgumentException(string.Format("PlotInfo index[{0}] isn't exist.", index));
         }
         #endregion
     }
 }