public void UpdateProgressBar() { Components.Logics.PulseFormerLogics l = (Components.Logics.PulseFormerLogics)parent.Logics; if (l.pulsesOld == l.pulses) { return; } if (l.pulses.Length == 0) { for (int i = 0; i < fbobuffer.Length; i++) { fbobuffer[i] = Shortcuts.BG_COLOR; } } else { float v = 0; for (int x = 0; x < progressbar.Width; x++) { v = l.pulses[x * l.pulses.Length / progressbar.Width]; fbobuffer[x] = Color.White * v; } } progressbar.SetData <Color>(fbobuffer); l.pulsesOld = l.pulses; }
public void UpdateProgressBar() { Components.Logics.PulseFormerLogics l = (Components.Logics.PulseFormerLogics)selectedPF.Logics; //if (l.pulsesOld == l.pulses) // return; if (l.pulses.Length == 0) { for (int i = 0; i < fbobuffer.Length; i++) { fbobuffer[i] = Shortcuts.BG_COLOR; } } else { float v = 0; Color c = Color.White; for (int x = 0; x < progressbar.Width; x++) { v = l.pulses[x * l.pulses.Length / progressbar.Width]; c = Color.White * v; for (int y = 0; y < progressbar.Height; y++) { fbobuffer[y * progressbar.Width + x] = c; } } } progressbar.SetData <Color>(fbobuffer); l.pulsesOld = l.pulses; }
public override void Draw(MicroWorld.Graphics.Renderer renderer) { if (texture0cw == null) { return; } if (!CanDraw()) { return; } Components.Logics.PulseFormerLogics l = (Components.Logics.PulseFormerLogics)parent.Logics; switch (parent.ComponentRotation) { case Component.Rotation.cw0: renderer.Draw(texture0cw, new Rectangle((int)Position.X, (int)Position.Y, (int)GetSizeRotated(parent.ComponentRotation).X, (int)GetSizeRotated(parent.ComponentRotation).Y), null, Color.White); break; case Component.Rotation.cw90: renderer.Draw(texture90cw, new Rectangle((int)Position.X, (int)Position.Y, (int)GetSizeRotated(parent.ComponentRotation).X, (int)GetSizeRotated(parent.ComponentRotation).Y), null, Color.White); break; /* * case Component.Rotation.cw180: * renderer.Draw(texture180cw, * new Rectangle((int)Position.X, (int)Position.Y, * (int)GetSizeRotated(parent.ComponentRotation).X, (int)GetSizeRotated(parent.ComponentRotation).Y), null, * Color.White); * break; * case Component.Rotation.cw270: * renderer.Draw(texture270cw, * new Rectangle((int)Position.X, (int)Position.Y, * (int)GetSizeRotated(parent.ComponentRotation).X, (int)GetSizeRotated(parent.ComponentRotation).Y), null, * Color.White); * break;//*/ default: break; } }
public override void Draw(MicroWorld.Graphics.Renderer renderer) { if (texture0cw == null) { return; } if (!CanDraw()) { return; } Components.Logics.PulseFormerLogics l = (Components.Logics.PulseFormerLogics)parent.Logics; UpdateProgressBar(); switch (parent.ComponentRotation) { case Component.Rotation.cw0: renderer.Draw(texture0cw, new Rectangle((int)Position.X, (int)Position.Y, (int)Size.X, (int)Size.Y), null, Color.White); renderer.Draw(progressbar, new Rectangle((int)Position.X + 11, (int)Position.Y + 8, 34, 8), null, Color.White); break; default: break; } }