tbf/TestBenchFramework/UiControls/CameraPictureFullCtrl.cs

73 lines
1.6 KiB
C#

///
/// Copyright (c) 2017 Sensus Metering Systems
///
using System;
using System.Drawing;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF.UiControls
{
public partial class CameraPictureFullCtrl : UserControl, ICameraPicture
{
private DateTime imageTimeStamp;
public Image NewImage
{
set
{
pictureBox.Image = value;
imageTimeStamp = DateTime.Now;
ledPictureBox.BackColor = Color.Red;
}
}
public Image Image
{
set { pictureBox.Image = value; }
get { return pictureBox.Image; }
}
public DateTime TimeStamp
{
set { imageTimeStamp = value; }
get { return imageTimeStamp; }
}
public string Caption
{
set { captionLabel.Text = value; }
get { return captionLabel.Text; }
}
public CameraPictureFullCtrl()
{
InitializeComponent();
captionLabel.Text = "No info available";
}
public void UpdateLed(DateTime now)
{
ledPictureBox.BackColor = (now - imageTimeStamp > TimeSpan.FromMilliseconds(500))
? SystemColors.Control
: Color.Red;
}
private void stopButton_Click(object sender, EventArgs e)
{
}
private void saveButton_Click(object sender, EventArgs e)
{
}
private void maxButton_Click(object sender, EventArgs e)
{
}
}
}