Inheritance: MonoBehaviour
Example #1
0
 public override void Paint(Pad pad, double minX, double maxX, double minY, double maxY)
 {
     base.Paint(pad, minX, maxX, minY, maxY);
     if (string.IsNullOrWhiteSpace(Text))
         return;
     var size = pad.Graphics.MeasureString(Text, TextFont);
     var w = size.Width;
     var h = size.Height;
     var clientX = pad.ClientX(X);
     var clientY = pad.ClientY(Y);
     var point = PointF.Empty;
     switch (TextPosition)
     {
         case ETextPosition.RightTop:
             point = new PointF(clientX + TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.LeftTop:
             point = new PointF(clientX - w - TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.CentreTop:
             point = new PointF(clientX - w/2 - TextOffsetX, clientY - h - TextOffsetY);
             break;
         case ETextPosition.RightBottom:
             point = new PointF(clientX + TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
         case ETextPosition.LeftBottom:
             point = new PointF(clientX - w - TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
         case ETextPosition.CentreBottom:
             point = new PointF(clientX - w/2 - TextOffsetX, clientY + Size/2 + TextOffsetY);
             break;
     }
     pad.Graphics.DrawString(Text, TextFont, new SolidBrush(TextColor), point.X, point.Y);
 }
Example #2
0
 public PadProperyForm(object obj, Pad pad)
 {
     InitializeComponent();
     this.obj = obj;
     this.pad = pad;
     Text = string.Format("{0}  properties", obj.GetType().Name);
 }
Example #3
0
 private void BackgroundIntoBitmapIfNeeded(Pad pad, Bitmap bm)
 {
     if (this.Look != EChartLook.SurfaceOnly)
         return;
     var g = Graphics.FromImage(bm);
     TView.View(pad).PaintAxes(g, pad, 0, 0, this.H);
 }
Example #4
0
 public TLegend(Pad pad)
 {
     Pad = pad;
     BorderEnabled = true;
     BorderColor = Color.Black;
     BackColor = Color.LightYellow;
     Items = new ArrayList();
 }
Example #5
0
 public LineView(DrawingLine line, Pad pad)
 {
     this.line = line;
     this.pad = pad;
     this.toolTipEnabled = true;
     this.toolTipFormat = "{0} {1} {2} - {3:F6}";
     this.chartFirstDate = new DateTime(Math.Min(line.X1.Ticks, line.X2.Ticks));
     this.chartLastDate = new DateTime(Math.Max(line.X1.Ticks, line.X2.Ticks));
 }
Example #6
0
 //What is the value of the right analog stick
 public static Vector2 GetRightStick(Pad pad, int player)
 {
     switch(pad) {
         case Pad.XB:
             return new Vector2(Input.GetAxis(FormatAxis("XB","RS","X",player)), (Input.GetAxis(FormatAxis("XB","RS","Y",player)) * -1));
         case Pad.PS:
             return new Vector2(Input.GetAxis(FormatAxis("PS","RS","X",player)), (Input.GetAxis(FormatAxis("PS","RS","Y",player)) * -1));
     }
     return Vector2.zero;
 }
Example #7
0
  public void TestFuncAssigning() {
    Pad src = new Pad ("src", PadDirection.Src);
    src.GetCapsFunction = new PadGetCapsFunction (PadGetCapsStub);

    Caps caps = src.Caps;

    Assert.IsNotNull (caps, "Ooops, returned caps is null");
    Assert.IsFalse (caps.IsEmpty == true, "Ooops, returned caps are empty");
    Assert.AreEqual ("video/x-raw-yuv", caps.ToString ());
  }
Example #8
0
 //Return the input for the game's catch
 public static bool ReleaseButton(Pad pad, int player)
 {
     //Debug.Log("Catch Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKeyUp(FormatJoystick(player,17));//xbox B button
         case Pad.PS:
             return Input.GetKeyUp(FormatJoystick(player,8));//PS L2 button
     }
     return false;
 }
Example #9
0
 //Return the input for left on the dpad
 public static bool LeftButton(Pad pad, int player)
 {
     //Debug.Log("Left Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKey(FormatJoystick(player,7));//xbox D AXIS
         case Pad.PS:
             return Input.GetKey(FormatJoystick(player,7));//PS left button
     }
     return false;
 }
Example #10
0
    public PadAddElement () : base () {
      Pad pad = new Pad ("source", PadDirection.Src);
      CollectionAssert.IsEmpty (Pads);

      AddPad (pad);
      Assert.AreEqual (pad, GetStaticPad ("source"));
      CollectionAssert.Contains (Pads, pad);

      RemovePad (pad);
      Assert.IsNull (GetStaticPad ("source"));
      CollectionAssert.IsEmpty (Pads);
    }
Example #11
0
 //Return the input for the game's jump button
 public static bool JumpButton(Pad pad, int player)
 {
     //Debug.Log("Jump Button Called");
     switch(pad) {
         case Pad.XB:
             return Input.GetKey(FormatJoystick(player,16));//xbox A button
         case Pad.PS:
             //Debug.Log("Get Button X is " + Input.GetButton("A_1"));
             return Input.GetKey(FormatJoystick(player,14));
     }
     return false;
 }
 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var ts = obj as TimeSeries;
     if (ts == null || ts.Count == 0)
         return null;
     var dt1 = new DateTime((long)pad.XMin);
     var dt2 = new DateTime((long)pad.XMax);
     var min = ts.GetMin(dt1, dt2);
     min = double.IsNaN(min) ? 0 : min;
     var max = ts.GetMax(dt1, dt2);
     max = double.IsNaN(max) ? 0 : min;
     return new PadRange(min, max);
 }
Example #13
0
  public void TestPlainCreation() {
    Pad src = new Pad ("src", PadDirection.Src);
    Pad sink = new Pad ("sink", PadDirection.Sink);

    Assert.IsNotNull (src);
    Assert.IsNotNull (sink);

    Assert.IsFalse (src.Handle == IntPtr.Zero, "Ooops, src pad has null handle");
    Assert.IsFalse (sink.Handle == IntPtr.Zero, "Ooops, sink pad has null handle");

    Assert.AreEqual (PadDirection.Src, src.Direction);
    Assert.AreEqual (PadDirection.Sink, sink.Direction);
  }
 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var ts = obj as TickSeries;
     if (ts == null || ts.Count == 0)
         return null;
     var dt1 = new DateTime((long) pad.XMin);
     var dt2 = new DateTime((long) pad.XMax);
     var min = ts.GetMin(dt1, dt2);
     var minPx = min?.Price ?? 0;
     var max = ts.GetMax(dt1, dt2);
     var maxPx = max?.Price ?? 0;
     return new PadRange(minPx, maxPx);
 }
 public override PadRange GetPadRangeY(object obj, Pad pad)
 {
     var bs = obj as BarSeries;
     if (bs == null || bs.Count == 0)
         return null;
     var dt1 = new DateTime((long)pad.XMin);
     var dt2 = new DateTime((long)pad.XMax);
     var lowest = bs.LowestLowBar(dt1, dt2);
     var min = lowest?.Low ?? 0;
     var highest = bs.HighestHighBar(dt1, dt2);
     var max = highest?.High ?? 0;
     return new PadRange(min, max);
 }
Example #16
0
 public TTitle(Pad pad, string text = "")
 {
     this.pad = pad;
     Text = Text;
     Items = new ArrayList();
     ItemsEnabled = false;
     Font = new Font("Arial", 8f);
     Color = Color.Black;
     Position = ETitlePosition.Left;
     Strategy = ETitleStrategy.Smart;
     X = 0;
     Y = 0;
 }
Example #17
0
 private Axis(Pad pad, double x1, double y1, double x2, double y2, EAxisPosition position)
 {
     this.pad = pad;
     Position = position;
     X1 = x1;
     X2 = x2;
     Y1 = y1;
     Y2 = y2;
     Enabled = true;
     Zoomed = false;
     Color = Color.Black;
     Title = "";
     TitleEnabled = true;
     TitlePosition = EAxisTitlePosition.Centre;
     TitleFont = new Font("Arial", 8f);
     TitleColor = Color.Black;
     TitleOffset = 2;
     LabelEnabled = true;
     LabelFont = new Font("Arial", 8f);
     LabelColor = Color.Black;
     LabelFormat = (string)null;
     LabelOffset = 2;
     LabelAlignment = EAxisLabelAlignment.Centre;
     GridEnabled = true;
     GridColor = Color.Gray;
     GridDashStyle = DashStyle.Solid;
     GridWidth = 0.5f;
     MinorGridEnabled = false;
     MinorGridColor = Color.Gray;
     MinorGridDashStyle = DashStyle.Solid;
     MinorGridWidth = 0.5f;
     MajorTicksEnabled = true;
     MajorTicksColor = Color.Black;
     MajorTicksWidth = 0.5f;
     MajorTicksLength = 4;
     MinorTicksEnabled = true;
     MinorTicksColor = Color.Black;
     MinorTicksWidth = 0.5f;
     MinorTicksLength = 1;
     Type = EAxisType.Numeric;
     VerticalGridStyle = EVerticalGridStyle.ByDateTime;
     this.fMouseDown = false;
     this.fMouseDownX = 0;
     this.fMouseDownY = 0;
     this.fOutlineEnabled = false;
     this.fOutline1 = 0;
     this.fOutline2 = 0;
     this.fWidth = -1;
     this.fHeight = -1;
 }
Example #18
0
 public void CalculateAxes(Pad pad, int left, int top, int h)
 {
     this.Left = left;
     this.Top = top;
     this.H = h;
     this.O = new TVec3((double)(left + h / 2), (double)(top + 3 * h / 4), 0.0);
     if (this.ScaleZ < 1.0)
         this.O.y -= (1.0 - this.ScaleZ) * 0.25 * (double)h;
     double num = 0.7 * (double)h;
     double Z = 0.5 * this.ScaleZ * (double)h;
     this.Lx = new TVec3(num, 0.0, 0.0);
     this.Ly = new TVec3(0.0, num, 0.0);
     this.Lz = new TVec3(0.0, 0.0, Z);
     this.Lx = this.ms * this.Lx;
     this.Ly = this.ms * this.Ly;
     this.Lz = this.ms * this.Lz;
 }
Example #19
0
        static Game()
        {
            //CustomGXTs = new Dictionary<string, string>();
            CustomGXTs = new TextDictionary();

            TextHook.RegisterCallback(key =>
            {
                if (CustomGXTs.ContainsKey(key))
                {
                    return CustomGXTs[key];
                }

                return null;
            });

            #if GTA_SA
            GamePad = new Pad(new IntPtr(0xB73458));
            GamePad2 = new Pad(new IntPtr(0xB7358C));
            #endif

            InstallFolder = System.Windows.Forms.Application.StartupPath;
        }
Example #20
0
 public unsafe void Paint(Pad Pad)
 {
     TView tview = TView.View(Pad);
     this.Left = tview.Left;
     this.Top = tview.Top;
     this.W = tview.H;
     this.H = tview.H;
     this.o = tview.O - new TVec3((double) this.Left, (double) this.Top, 0.0);
     this.Lx = tview.Lx;
     this.Ly = tview.Ly;
     this.Lz = tview.Lz;
     this.Light = tview.Light;
     if (this.Look == EChartLook.SurfaceOnly)
         this.BitmapWriteOnly = false;
     Bitmap bm = new Bitmap(this.W, this.H, PixelFormat.Format32bppRgb);
     this.BackgroundIntoBitmapIfNeeded(Pad, bm);
     Rectangle rect = new Rectangle(0, 0, this.W, this.H);
     BitmapData bitmapdata = bm.LockBits(rect, this.BitmapWriteOnly ? ImageLockMode.WriteOnly : ImageLockMode.ReadWrite, PixelFormat.Format32bppRgb);
     this.PaintBuffer((int*) bitmapdata.Scan0.ToPointer());
     bm.UnlockBits(bitmapdata);
     Color transparentColor = Color.FromArgb((int) byte.MaxValue, 0, 0, 0);
     bm.MakeTransparent(transparentColor);
     Pad.Graphics.DrawImage((Image) bm, this.Left, this.Top);
 }
Example #21
0
 public TLegend(Pad pad)
 {
     Pad = pad;
 }
Example #22
0
 public PadRange GetPadRangeY(Pad pad) => new PadRange(this.ray.Y * 0.999, this.ray.Y * 1.001);
Example #23
0
 public WindBlockBlock()
 {
     this._unnamed0 = new Pad(36);
 }
Example #24
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Slider other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                     ) &&
                 (
                     Active == other.Active ||
                     Active != null &&
                     Active.Equals(other.Active)
                 ) &&
                 (
                     Equals(Steps, other.Steps) ||
                     Steps != null && other.Steps != null &&
                     Steps.SequenceEqual(other.Steps)
                 ) &&
                 (
                     LenMode == other.LenMode ||
                     LenMode != null &&
                     LenMode.Equals(other.LenMode)
                 ) &&
                 (
                     Len == other.Len ||
                     Len != null &&
                     Len.Equals(other.Len)
                 ) &&
                 (
                     X == other.X ||
                     X != null &&
                     X.Equals(other.X)
                 ) &&
                 (
                     Pad == other.Pad ||
                     Pad != null &&
                     Pad.Equals(other.Pad)
                 ) &&
                 (
                     XAnchor == other.XAnchor ||
                     XAnchor != null &&
                     XAnchor.Equals(other.XAnchor)
                 ) &&
                 (
                     Y == other.Y ||
                     Y != null &&
                     Y.Equals(other.Y)
                 ) &&
                 (
                     YAnchor == other.YAnchor ||
                     YAnchor != null &&
                     YAnchor.Equals(other.YAnchor)
                 ) &&
                 (
                     Transition == other.Transition ||
                     Transition != null &&
                     Transition.Equals(other.Transition)
                 ) &&
                 (
                     CurrentValue == other.CurrentValue ||
                     CurrentValue != null &&
                     CurrentValue.Equals(other.CurrentValue)
                 ) &&
                 (
                     Font == other.Font ||
                     Font != null &&
                     Font.Equals(other.Font)
                 ) &&
                 (
                     ActiveBgColor == other.ActiveBgColor ||
                     ActiveBgColor != null &&
                     ActiveBgColor.Equals(other.ActiveBgColor)
                 ) &&
                 (
                     BgColor == other.BgColor ||
                     BgColor != null &&
                     BgColor.Equals(other.BgColor)
                 ) &&
                 (
                     BorderColor == other.BorderColor ||
                     BorderColor != null &&
                     BorderColor.Equals(other.BorderColor)
                 ) &&
                 (
                     BorderWidth == other.BorderWidth ||
                     BorderWidth != null &&
                     BorderWidth.Equals(other.BorderWidth)
                 ) &&
                 (
                     TickleN == other.TickleN ||
                     TickleN != null &&
                     TickleN.Equals(other.TickleN)
                 ) &&
                 (
                     TickColor == other.TickColor ||
                     TickColor != null &&
                     TickColor.Equals(other.TickColor)
                 ) &&
                 (
                     TickWidth == other.TickWidth ||
                     TickWidth != null &&
                     TickWidth.Equals(other.TickWidth)
                 ) &&
                 (
                     MinorTickLen == other.MinorTickLen ||
                     MinorTickLen != null &&
                     MinorTickLen.Equals(other.MinorTickLen)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     TemplateItemName == other.TemplateItemName ||
                     TemplateItemName != null &&
                     TemplateItemName.Equals(other.TemplateItemName)
                 ));
        }
 public PlatformSoundEffectTemplateBlockBlock()
 {
     this._unnamed0 = new Pad(12);
 }
 public ShaderLightResponseBlockBlock()
 {
     this._unnamed0 = new Pad(2);
     this._unnamed1 = new Pad(2);
 }
Example #27
0
 public ClothPropertiesBlockBlock()
 {
     this._flags           = new Flags(4);
     this._integrationType = new Enum(2);
     this._unnamed0        = new Pad(24);
 }
Example #28
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Pad != null)
         {
             hashCode = hashCode * 59 + Pad.GetHashCode();
         }
         if (Colors != null)
         {
             hashCode = hashCode * 59 + Colors.GetHashCode();
         }
         if (DepthFade != null)
         {
             hashCode = hashCode * 59 + DepthFade.GetHashCode();
         }
         if (Line != null)
         {
             hashCode = hashCode * 59 + Line.GetHashCode();
         }
         if (CAuto != null)
         {
             hashCode = hashCode * 59 + CAuto.GetHashCode();
         }
         if (CMin != null)
         {
             hashCode = hashCode * 59 + CMin.GetHashCode();
         }
         if (CMax != null)
         {
             hashCode = hashCode * 59 + CMax.GetHashCode();
         }
         if (CMid != null)
         {
             hashCode = hashCode * 59 + CMid.GetHashCode();
         }
         if (ColorScale != null)
         {
             hashCode = hashCode * 59 + ColorScale.GetHashCode();
         }
         if (AutoColorScale != null)
         {
             hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         }
         if (ReverseScale != null)
         {
             hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         }
         if (ShowScale != null)
         {
             hashCode = hashCode * 59 + ShowScale.GetHashCode();
         }
         if (ColorBar != null)
         {
             hashCode = hashCode * 59 + ColorBar.GetHashCode();
         }
         if (ColorAxis != null)
         {
             hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         }
         if (ColorsSrc != null)
         {
             hashCode = hashCode * 59 + ColorsSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #29
0
 public virtual void Paint(Pad Pad, double XMin, double XMax, double YMin, double YMax)
 {
     if (Pad.For3D)
     {
         int millisecond = DateTime.Now.Millisecond;
         int num1 = Pad.ClientX(XMin);
         int num2 = (Pad.ClientY(YMax) + Pad.Y1) / 2;
         int num3 = Math.Abs(Pad.ClientX(XMax) - Pad.ClientX(XMin));
         int num4 = Math.Abs(Pad.ClientY(YMax) - Pad.ClientY(YMin));
         int H = num3 < num4 ? num3 : num4;
         int Left = num1 + num3 / 2 - H / 2;
         int Top = num2;
         if (this.fShowMaxZ == 0.0)
             this.ShowUnnormalizedZ();
         Pad.AxisZ3D.Min = 0.0;
         Pad.AxisZ3D.Max = this.fShowMaxZ;
         TView.View(Pad).PaintAxes(Pad, Left, Top, H);
         if (!this.Multicolor3D)
         {
             switch (this.Smoothing)
             {
                 case ESmoothing.Disabled:
                     this.Draw3DChart.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                     this.Draw3DChart.Paint(Pad);
                     break;
                 case ESmoothing.Linear:
                     this.Draw3DChartSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                     this.Draw3DChartSmoothedLinear.Paint(Pad);
                     break;
             }
         }
         else
         {
             switch (this.Smoothing)
             {
                 case ESmoothing.Disabled:
                     this.Draw3DChartMulticolor.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                     this.Draw3DChartMulticolor.Paint(Pad);
                     break;
                 case ESmoothing.Linear:
                     this.Draw3DChartMulticolorSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                     this.Draw3DChartMulticolorSmoothedLinear.Paint(Pad);
                     break;
             }
         }
         int num5 = DateTime.Now.Millisecond - millisecond;
     }
     else
     {
         int millisecond1 = DateTime.Now.Millisecond;
         int millisecond2 = DateTime.Now.Millisecond;
         int x = Pad.ClientX(this.fXMin);
         int y = Pad.ClientY(this.fYMax);
         int W = Pad.ClientX(this.fXMax) - x;
         int H = Pad.ClientY(this.fYMin) - y;
         int length = this.fPalette.Length;
         int[] numArray = new int[length];
         for (int index = 0; index < length; ++index)
             numArray[index] = this.fPalette[index].ToArgb();
         TPaintingBitmap tpaintingBitmap = new TPaintingBitmap(W, H);
         tpaintingBitmap.Fill(Pad.ForeColor);
         double num1 = (double)W / (double)this.fNBinsX;
         double num2 = (double)H / (double)this.fNBinsY;
         int w = (int)(num1 + 1.0);
         int h = (int)(num2 + 1.0);
         double num3 = (double)(this.fNColors - 1) / (this.fBinMax - this.fBinMin);
         int index1 = 0;
         double num4 = 0.0;
         while (index1 < this.fNBinsX)
         {
             int index2 = 0;
             double num5 = 0.0;
             while (index2 < this.fNBinsY)
             {
                 if (this.fBins[index1, index2] != 0.0)
                 {
                     int index3 = (int)(num3 * (this.fBins[index1, index2] - this.fBinMin));
                     tpaintingBitmap.FillRectangle(numArray[index3], (int)num4, H - (int)num5 - h, w, h);
                 }
                 ++index2;
                 num5 += num2;
             }
             ++index1;
             num4 += num1;
         }
         Bitmap bitmap = tpaintingBitmap.Get();
         Pad.Graphics.DrawImage((Image)bitmap, x, y);
         int millisecond3 = DateTime.Now.Millisecond;
         int num6 = millisecond2 - millisecond1;
         int num7 = millisecond3 - millisecond1;
     }
 }
Example #30
0
        /// <inheritdoc />
        public bool Equals([AllowNull] Marker other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Pad == other.Pad ||
                     Pad != null &&
                     Pad.Equals(other.Pad)
                     ) &&
                 (
                     Equals(Colors, other.Colors) ||
                     Colors != null && other.Colors != null &&
                     Colors.SequenceEqual(other.Colors)
                 ) &&
                 (
                     DepthFade == other.DepthFade ||
                     DepthFade != null &&
                     DepthFade.Equals(other.DepthFade)
                 ) &&
                 (
                     Line == other.Line ||
                     Line != null &&
                     Line.Equals(other.Line)
                 ) &&
                 (
                     CAuto == other.CAuto ||
                     CAuto != null &&
                     CAuto.Equals(other.CAuto)
                 ) &&
                 (
                     CMin == other.CMin ||
                     CMin != null &&
                     CMin.Equals(other.CMin)
                 ) &&
                 (
                     CMax == other.CMax ||
                     CMax != null &&
                     CMax.Equals(other.CMax)
                 ) &&
                 (
                     CMid == other.CMid ||
                     CMid != null &&
                     CMid.Equals(other.CMid)
                 ) &&
                 (
                     ColorScale == other.ColorScale ||
                     ColorScale != null &&
                     ColorScale.Equals(other.ColorScale)
                 ) &&
                 (
                     AutoColorScale == other.AutoColorScale ||
                     AutoColorScale != null &&
                     AutoColorScale.Equals(other.AutoColorScale)
                 ) &&
                 (
                     ReverseScale == other.ReverseScale ||
                     ReverseScale != null &&
                     ReverseScale.Equals(other.ReverseScale)
                 ) &&
                 (
                     ShowScale == other.ShowScale ||
                     ShowScale != null &&
                     ShowScale.Equals(other.ShowScale)
                 ) &&
                 (
                     ColorBar == other.ColorBar ||
                     ColorBar != null &&
                     ColorBar.Equals(other.ColorBar)
                 ) &&
                 (
                     ColorAxis == other.ColorAxis ||
                     ColorAxis != null &&
                     ColorAxis.Equals(other.ColorAxis)
                 ) &&
                 (
                     ColorsSrc == other.ColorsSrc ||
                     ColorsSrc != null &&
                     ColorsSrc.Equals(other.ColorsSrc)
                 ));
        }
Example #31
0
 protected override ProgressMonitor OnGetStatusProgressMonitor(string title, IconId icon, bool showErrorDialogs, bool showTaskTitle, bool lockGui, Pad statusSourcePad, bool showCancelButton)
 {
     return(StatusProgressMonitor);
 }
Example #32
0
        public IAsyncOperation RunTest(UnitTest test, IExecutionHandler context, bool buildOwnerObject)
        {
            string testName = test.FullName;

            if (buildOwnerObject)
            {
                IBuildTarget bt = test.OwnerObject as IBuildTarget;
                if (bt != null && bt.NeedsBuilding(IdeApp.Workspace.ActiveConfiguration))
                {
                    if (!IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted)
                    {
                        MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations();
                        IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted();
                    }

                    AsyncOperation retOper = new AsyncOperation();

                    IAsyncOperation op = IdeApp.ProjectOperations.Build(bt);
                    retOper.TrackOperation(op, false);

                    op.Completed += delegate {
                        // The completed event of the build operation is run in the gui thread,
                        // so we need a new thread, because refreshing must be async
                        System.Threading.ThreadPool.QueueUserWorkItem(delegate {
                            if (op.Success)
                            {
                                RefreshTests();
                                test = SearchTest(testName);
                                if (test != null)
                                {
                                    Gtk.Application.Invoke(delegate {
                                        // RunTest must run in the gui thread
                                        retOper.TrackOperation(RunTest(test, context, false), true);
                                    });
                                }
                                else
                                {
                                    retOper.SetCompleted(false);
                                }
                            }
                        });
                    };

                    return(retOper);
                }
            }

            if (!IdeApp.ProjectOperations.ConfirmExecutionOperation())
            {
                return(NullProcessAsyncOperation.Failure);
            }

            Pad resultsPad = IdeApp.Workbench.GetPad <TestResultsPad>();

            if (resultsPad == null)
            {
                resultsPad = IdeApp.Workbench.ShowPad(new TestResultsPad(), "MonoDevelop.NUnit.TestResultsPad", GettextCatalog.GetString("Test results"), "Bottom", "md-solution");
            }

            // Make the pad sticky while the tests are runnig, so the results pad is always visible (even if minimized)
            // That's required since when running in debug mode, the layout is automatically switched to debug.

            resultsPad.Sticky = true;
            resultsPad.BringToFront();

            TestSession session = new TestSession(test, context, (TestResultsPad)resultsPad.Content);

            session.Completed += delegate {
                Gtk.Application.Invoke(delegate {
                    resultsPad.Sticky = false;
                });
            };

            session.Start();

            IdeApp.ProjectOperations.CurrentRunOperation = session;

            return(session);
        }
Example #33
0
 void MoveToPad(Pad pad)
 {
     curPad = pad;
 }
Example #34
0
 public override int GetHashCode()
 {
     return(this.GetType().FullName.GetHashCode() ^ Collect.GetHashCode() ^ Pad.GetHashCode() ^ Buffer.GetHashCode() ^ Pos.GetHashCode() ^ Segment.GetHashCode() ^ state.GetHashCode() ^ _priv.GetHashCode());
 }
Example #35
0
 public PadRange GetPadRangeY(Pad pad)
 {
     return(new PadRange(0, 0));
 }
Example #36
0
 public Pad cd(int padIndex)
 {
     padIndex = Math.Max(1, padIndex);
     padIndex = Math.Min(this.fPads.Count, padIndex);
     return Chart.fPad = this.fPads[padIndex - 1];
 }
Example #37
0
 public void SetMessageSourcePad(Pad pad)
 {
     sourcePad = pad;
 }
Example #38
0
 private static bool PointInPad(Pad pad, Point p)
 {
     return pad.X1 <= p.X && pad.X2 >= p.X && pad.Y1 <= p.Y && p.Y <= pad.Y2;
 }
Example #39
0
 public HudNumberBlockBlock()
 {
     this._unnamed0 = new Pad(2);
     this._unnamed1 = new Pad(76);
 }
Example #40
0
 public bool Equals(CollectData other)
 {
     return(true && Collect.Equals(other.Collect) && Pad.Equals(other.Pad) && Buffer.Equals(other.Buffer) && Pos.Equals(other.Pos) && Segment.Equals(other.Segment) && state.Equals(other.state) && _priv.Equals(other._priv));
 }
Example #41
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (Active != null)
         {
             hashCode = hashCode * 59 + Active.GetHashCode();
         }
         if (Steps != null)
         {
             hashCode = hashCode * 59 + Steps.GetHashCode();
         }
         if (LenMode != null)
         {
             hashCode = hashCode * 59 + LenMode.GetHashCode();
         }
         if (Len != null)
         {
             hashCode = hashCode * 59 + Len.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (Pad != null)
         {
             hashCode = hashCode * 59 + Pad.GetHashCode();
         }
         if (XAnchor != null)
         {
             hashCode = hashCode * 59 + XAnchor.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (YAnchor != null)
         {
             hashCode = hashCode * 59 + YAnchor.GetHashCode();
         }
         if (Transition != null)
         {
             hashCode = hashCode * 59 + Transition.GetHashCode();
         }
         if (CurrentValue != null)
         {
             hashCode = hashCode * 59 + CurrentValue.GetHashCode();
         }
         if (Font != null)
         {
             hashCode = hashCode * 59 + Font.GetHashCode();
         }
         if (ActiveBgColor != null)
         {
             hashCode = hashCode * 59 + ActiveBgColor.GetHashCode();
         }
         if (BgColor != null)
         {
             hashCode = hashCode * 59 + BgColor.GetHashCode();
         }
         if (BorderColor != null)
         {
             hashCode = hashCode * 59 + BorderColor.GetHashCode();
         }
         if (BorderWidth != null)
         {
             hashCode = hashCode * 59 + BorderWidth.GetHashCode();
         }
         if (TickleN != null)
         {
             hashCode = hashCode * 59 + TickleN.GetHashCode();
         }
         if (TickColor != null)
         {
             hashCode = hashCode * 59 + TickColor.GetHashCode();
         }
         if (TickWidth != null)
         {
             hashCode = hashCode * 59 + TickWidth.GetHashCode();
         }
         if (MinorTickLen != null)
         {
             hashCode = hashCode * 59 + MinorTickLen.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (TemplateItemName != null)
         {
             hashCode = hashCode * 59 + TemplateItemName.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #42
0
 public SoundPitchRangeBlock()
 {
     this._unnamed  = new Pad(2);
     this._unnamed2 = new Pad(12);
 }
Example #43
0
 /// <summary>
 /// Sets the threshold (or value) that's considered a touch.
 /// </summary>
 /// <param name="pad">The <see cref="Pad" /> to check.</param>
 /// <param name="threshold">The value that's considered a touch.</param>
 public static void SetThreshold(Pad pad, long threshold)
 {
     _thresholds[(int)pad] = threshold;
 }
Example #44
0
        public async Task <PadSeries?> FindByName(string name)
        {
            using (var conn = OpenConnection()) {
                using (var reader = await conn.QueryMultipleAsync(
                           @"  select * from pad_series where name = @Name;
                            select pad_sizes.* from pad_sizes 
                                join pad_series ps on ps.id = pad_sizes.pad_series_id
                                where ps.name = @Name;
                            select pi.*, i.* from images i 
                                join pad_images pi on i.id = pi.image_id 
                                join pads p on pi.pad_id = p.id 
                                join pad_series ps on ps.id = p.pad_series_id
                                where ps.name = @Name;
                            select pads.* from pads
                                join pad_series ps on pads.pad_series_id = ps.id
                                where ps.name = @Name;
                            select po.* from pad_options po 
                                left join pads pc on po.pad_id = pc.id 
                                join pad_series ps on pc.pad_series_id = ps.id
                                where ps.name = @Name;
                            select po.id as pad_option_id, pn.* from part_numbers pn 
                                join pad_option_part_numbers popn on pn.id = popn.part_number_id 
                                join pad_options po on po.id = popn.pad_option_id 
                                join pads p on po.pad_id = p.id 
                                join pad_series ps on p.pad_series_id = ps.id
                                where ps.name = @Name; 
                        ",
                           new { Name = name }
                           )) {
                    // See if we even found a pad series first
                    var seriesRow = reader.ReadFirstOrDefault <PadSeriesRow>();
                    if (seriesRow == null)
                    {
                        return(null);
                    }

                    var sizes = reader.Read <PadSizeRow>().Select(ps => new PadSize(
                                                                      ps.Id,
                                                                      new Measurement(ps.DiameterAmount, MeasurementUnitUtils.Parse(ps.DiameterUnit)),
                                                                      ps.ThicknessAmount != null ? new Measurement(ps.ThicknessAmount ?? 0, MeasurementUnitUtils.Parse(ps.ThicknessUnit !)) : null
                                                                      )).ToList();

                    var images = reader.Read <PadImageRow, ImageRow, Tuple <PadImageRow, ImageRow> >((pi, i) => new Tuple <PadImageRow, ImageRow>(pi, i));

                    var padKVpairs = reader.Read <PadRow>().Select(p => {
                        var i = images.Where(i => i.Item1.PadId == p.Id).FirstOrDefault();
                        ProcessedImage?processedImage = null;

                        if (i != null)
                        {
                            processedImage = new ProcessedImage(
                                i.Item2.Id,
                                i.Item2.FileName,
                                i.Item2.MimeType,
                                ImageUtils.LoadFromBinary(i.Item2.ImageData),
                                ImageUtils.LoadFromBinary(i.Item2.ThumbnailData)
                                );
                        }

                        var pad = new Pad(
                            p.Id,
                            p.Name,
                            p.Category.ToList(),
                            p.Material != null ? PadMaterialUtils.Parse(p.Material) : null,
                            p.Texture != null ? PadTextureUtils.Parse(p.Texture) : null,
                            p.Color != null ? PadColorUtils.Parse(p.Color) : null,
                            p.HasCenterHole,
                            processedImage
                            );

                        return(pad);
                    }).Select(p => new KeyValuePair <Guid, Pad>(p.Id, p));

                    var pads = new Dictionary <Guid, Pad>(padKVpairs);

                    var options    = reader.Read <PadOptionRow>();
                    var optionDict = new Dictionary <Guid, PadOption>();
                    foreach (var opt in options)
                    {
                        Pad?pad;

                        if (pads.TryGetValue(opt.PadId, out pad))
                        {
                            var po = new PadOption(opt.PadSizeId);
                            pad.Options.Add(po);
                            optionDict.Add(opt.Id, po);
                        }
                    }

                    var partNumbers = reader.Read <Guid, PartNumberRow, (Guid PadOptionId, PartNumberRow PartNumber)>((id, pn) => (id, pn));
                    foreach (var partNumber in partNumbers)
                    {
                        PadOption?option;

                        if (optionDict.TryGetValue(partNumber.PadOptionId, out option))
                        {
                            option.PartNumbers.Add(new PartNumber(partNumber.PartNumber.Id, partNumber.PartNumber.Value, partNumber.PartNumber.Notes));
                        }
                    }

                    return(new PadSeries(
                               seriesRow.Id,
                               seriesRow.Name,
                               seriesRow.BrandId,
                               seriesRow.PolisherTypes.ToList(),
                               sizes,
                               pads.Values.ToList()
                               ));
                }
            }
        }
Example #45
0
 public void Create(Pad pad)
 {
     this.pads.Add(pad);
     this.pads.Save();
 }
Example #46
0
 public TLegend(Pad pad) : base()
 {
     this.Pad = pad;
     this.Init();
 }
Example #47
0
 public void Set(Pad Pad, double[,] h, int nx, int ny, double MinX, double MaxX, double MinY, double MaxY, double MinZ, double MaxZ, Color[] palette)
 {
     base.Set(Pad, h, nx, ny, MinX, MaxX, MinY, MaxY, MaxZ);
     this.c0 = new TColor[palette.Length];
     for (int index = 0; index < this.c0.Length; ++index)
         this.c0[index] = (TColor)palette[index];
     this.K = (double)(this.c0.Length - 1) / (MaxZ - MinZ) / this.Kz;
     this.MinZ = MinZ * this.Kz;
 }
Example #48
0
 public WindBlock()
 {
     __unnamed = new Pad(36);
 }
Example #49
0
 public PlanarFogPatchyFogBlockBlock()
 {
     this._unnamed0 = new Pad(12);
 }
Example #50
0
        /// <summary>
        /// Reads the value of the pad.
        /// </summary>
        /// <param name="pad">The <see cref="Pad" /> to check.</param>
        /// <returns>The value of the pad.</returns>
        public static long RawRead(Pad pad)
        {
            if (_pins[0] == null)
            {
                _pins[0] = new PulseFeedback(PulseFeedback.Mode.DrainDuration, true, 10, (Cpu.Pin)32);
                _pins[1] = new PulseFeedback(PulseFeedback.Mode.DrainDuration, true, 10, (Cpu.Pin)33);
                _pins[2] = new PulseFeedback(PulseFeedback.Mode.DrainDuration, true, 10, (Cpu.Pin)34);
            }

            switch (pad)
            {
                case Pad.Left: return _pins[0].Read();
                case Pad.Middle: return _pins[1].Read();
                case Pad.Right: return _pins[2].Read();
                default: return 0;
            }
        }
Example #51
0
 public virtual void Set(Pad Pad, double[,] h, int nx, int ny, double MinX, double MaxX, double MinY, double MaxY, double MaxZ)
 {
     this.h = h;
     this.nx = nx;
     this.ny = ny;
     this.MinX = MinX;
     this.MaxX = MaxX;
     this.MinY = MinY;
     this.MaxY = MaxY;
     this.M = MaxZ;
     this.Kx = (double)nx / (MaxX - MinX);
     this.Ky = (double)ny / (MaxY - MinY);
     this.Kz = TView.View(Pad).Lz.NormInf / this.M;
 }
Example #52
0
 public PlanarFogBlockBlock()
 {
     this._flags    = new Flags(2);
     this._unnamed0 = new Pad(2);
     this._unnamed1 = new Pad(2);
 }
Example #53
0
 /// <summary>
 /// Determine if the pad has been touched.
 /// </summary>
 /// <param name="pad">The <see cref="Pad" /> to check.</param>
 /// <returns>If the pad has been touched (true) or not (false).</returns>
 public static bool IsTouched(Pad pad)
 {
     if ((RawRead(pad) > _thresholds[(int)pad]))
         return true;
     return false;
 }
        internal static async Task RunTests(IEnumerable <UnitTest> tests, MonoDevelop.Projects.ExecutionContext context, bool buildOwnerObject, bool checkCurrentRunOperation, CancellationTokenSource cs)
        {
            if (buildOwnerObject)
            {
                var build_targets = new HashSet <IBuildTarget> ();
                foreach (var t in tests)
                {
                    if (t.OwnerObject is IBuildTarget bt)
                    {
                        build_targets.Add(bt);
                    }
                }
                if (IdeApp.Preferences.BuildBeforeRunningTests)
                {
                    var res = await IdeApp.ProjectOperations.CheckAndBuildForExecute(
                        build_targets, IdeApp.Workspace.ActiveConfiguration, true,
                        false, null, cs.Token);

                    if (!res)
                    {
                        return;
                    }
                }

                var test_names = new HashSet <string> (tests.Select((v) => v.FullName));

                await RefreshTests(cs.Token);

                tests = test_names.Select((fullName) => SearchTest(fullName)).Where((t) => t != null).ToList();

                if (tests.Any())
                {
                    await RunTests(tests, context, false, checkCurrentRunOperation, cs);
                }
                return;
            }

            if (checkCurrentRunOperation && !IdeApp.ProjectOperations.ConfirmExecutionOperation())
            {
                return;
            }

            Pad resultsPad = GetTestResultsPad();

            var         test    = tests.Count() == 1 ? tests.First() : new UnitTestSelection(tests, tests.First().OwnerObject);
            TestSession session = new TestSession(test, context, (TestResultsPad)resultsPad.Content, cs);

            OnTestSessionStarting(new TestSessionEventArgs {
                Session = session, Test = test
            });

            if (checkCurrentRunOperation)
            {
                IdeApp.ProjectOperations.AddRunOperation(session);
            }

            try {
                await session.Start();
            } finally {
                resultsPad.Sticky = false;
            }
        }
Example #55
0
 /// <summary>
 /// Sets the threshold (or value) that's considered a touch.
 /// </summary>
 /// <param name="pad">The <see cref="Pad" /> to check.</param>
 /// <param name="threshold">The value that's considered a touch.</param>
 public static void SetThreshold(Pad pad, long threshold)
 {
     _thresholds[(int)pad] = threshold;
 }
Example #56
0
        public virtual void Paint(Pad Pad, double XMin, double XMax, double YMin, double YMax)
        {
            if (Pad.For3D)
            {
                int millisecond = DateTime.Now.Millisecond;
                int num1        = Pad.ClientX(XMin);
                int num2        = (Pad.ClientY(YMax) + Pad.Y1) / 2;
                int num3        = Math.Abs(Pad.ClientX(XMax) - Pad.ClientX(XMin));
                int num4        = Math.Abs(Pad.ClientY(YMax) - Pad.ClientY(YMin));
                int H           = num3 < num4 ? num3 : num4;
                int Left        = num1 + num3 / 2 - H / 2;
                int Top         = num2;
                if (this.fShowMaxZ == 0.0)
                {
                    this.ShowUnnormalizedZ();
                }
                Pad.AxisZ3D.Min = 0.0;
                Pad.AxisZ3D.Max = this.fShowMaxZ;
                TView.View(Pad).PaintAxes(Pad, Left, Top, H);
                if (!this.Multicolor3D)
                {
                    switch (this.Smoothing)
                    {
                    case ESmoothing.Disabled:
                        this.Draw3DChart.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                        this.Draw3DChart.Paint(Pad);
                        break;

                    case ESmoothing.Linear:
                        this.Draw3DChartSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMax);
                        this.Draw3DChartSmoothedLinear.Paint(Pad);
                        break;
                    }
                }
                else
                {
                    switch (this.Smoothing)
                    {
                    case ESmoothing.Disabled:
                        this.Draw3DChartMulticolor.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                        this.Draw3DChartMulticolor.Paint(Pad);
                        break;

                    case ESmoothing.Linear:
                        this.Draw3DChartMulticolorSmoothedLinear.Set(Pad, this.fBins, this.fNBinsX, this.fNBinsY, this.fXMin, this.fXMax, this.fYMin, this.fYMax, this.fBinMin, this.fBinMax, this.fPalette);
                        this.Draw3DChartMulticolorSmoothedLinear.Paint(Pad);
                        break;
                    }
                }
                int num5 = DateTime.Now.Millisecond - millisecond;
            }
            else
            {
                int   millisecond1 = DateTime.Now.Millisecond;
                int   millisecond2 = DateTime.Now.Millisecond;
                int   x            = Pad.ClientX(this.fXMin);
                int   y            = Pad.ClientY(this.fYMax);
                int   W            = Pad.ClientX(this.fXMax) - x;
                int   H            = Pad.ClientY(this.fYMin) - y;
                int   length       = this.fPalette.Length;
                int[] numArray     = new int[length];
                for (int index = 0; index < length; ++index)
                {
                    numArray[index] = this.fPalette[index].ToArgb();
                }
                TPaintingBitmap tpaintingBitmap = new TPaintingBitmap(W, H);
                tpaintingBitmap.Fill(Pad.ForeColor);
                double num1   = (double)W / (double)this.fNBinsX;
                double num2   = (double)H / (double)this.fNBinsY;
                int    w      = (int)(num1 + 1.0);
                int    h      = (int)(num2 + 1.0);
                double num3   = (double)(this.fNColors - 1) / (this.fBinMax - this.fBinMin);
                int    index1 = 0;
                double num4   = 0.0;
                while (index1 < this.fNBinsX)
                {
                    int    index2 = 0;
                    double num5   = 0.0;
                    while (index2 < this.fNBinsY)
                    {
                        if (this.fBins[index1, index2] != 0.0)
                        {
                            int index3 = (int)(num3 * (this.fBins[index1, index2] - this.fBinMin));
                            tpaintingBitmap.FillRectangle(numArray[index3], (int)num4, H - (int)num5 - h, w, h);
                        }
                        ++index2;
                        num5 += num2;
                    }
                    ++index1;
                    num4 += num1;
                }
                Bitmap bitmap = tpaintingBitmap.Get();
                Pad.Graphics.DrawImage((Image)bitmap, x, y);
                int millisecond3 = DateTime.Now.Millisecond;
                int num6         = millisecond2 - millisecond1;
                int num7         = millisecond3 - millisecond1;
            }
        }
Example #57
0
 public virtual Pad AddPad(double x1, double y1, double x2, double y2)
 {
     var pad = new Pad(this, x1, y1, x2, y2);
     pad.Name = $"Pad {this.fPads.Count + 1}";
     pad.ForeColor = this.fPadsForeColor;
     pad.Zoom += ZoomChanged;
     this.fPads.Add(pad);
     return Chart.fPad = pad;
 }
Example #58
0
 public ContrailPointStatesBlock()
 {
     this._unnamed    = new Pad(32);
     this._scaleFlags = new Flags(4);
 }
    public void CopyFrom(tk2dSpriteCollectionDefinition src)
    {
        additive = src.additive;
        scale = src.scale;
        texture = src.texture;
        anchor = src.anchor;
        anchorX = src.anchorX;
        anchorY = src.anchorY;
        overrideMesh = src.overrideMesh;
        dice = src.dice;
        diceUnitX = src.diceUnitX;
        diceUnitY = src.diceUnitY;
        pad = src.pad;

        fromSpriteSheet = src.fromSpriteSheet;
        extractRegion = src.extractRegion;
        regionX = src.regionX;
        regionY = src.regionY;
        regionW = src.regionW;
        regionH = src.regionH;
        regionId = src.regionId;
    }
        // Called after pipeline state is set to playing
        private void RTSPPadAdded(object o, PadAddedArgs args)
        {
            Pad Sink = runningPipeline.Depay.GetStaticPad("sink");

            args.NewPad.Link(Sink);
        }