public void EnableGates(ref Gates gate, int threshold, int start, int end) { gate.Enable = true; gate.ThresholdPixel = threshold; gate.StartPixel = start; gate.EndPixel = end; }
private void InitialGates() { gate0 = new Gates(); gate0.color = Color.Red; gate0.Name = "gate0"; gate1 = new Gates(); gate1.color = Color.Blue; gate1.Name = "gate1"; gate2 = new Gates(); gate2.color = Color.Green; gate2.Name = "gate2"; gate3 = new Gates(); gate3.color = Color.Black; gate3.Name = "gate3"; }
private void StateGate(Gates g, Point p) { string tmp; tmp = g.MouseState(p); MouseState = g.Name + tmp; if (tmp == "mid") { Cursor = Cursors.NoMove2D; } if (tmp == "start" || tmp == "end") { Cursor = Cursors.NoMoveHoriz; } if (tmp == null) { MouseState = "+"; } }
private void RefreshGate(ref Gates gate, Point p) { if (MouseState.Contains("mid")) { int width = (gate.EndPixel - gate.StartPixel) / 2; gate.StartPixel = p.X - width; gate.EndPixel = p.X + width; gate.ThresholdPixel = p.Y; } if (MouseState.Contains("start")) { gate.StartPixel = p.X; } if (MouseState.Contains("end")) { gate.EndPixel = p.X; } float num = Convert.ToSingle(gate.Name.Substring(4)); GateChanged?.Invoke(new float[] { num, gate.Start, gate.End, gate.Threshold }); }