using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Aitex.Core.Backend
{
public partial class AICtrl : UserControl
{
public AICtrl()
{
InitializeComponent();
}
public void SetName(string name)
{
labelName.Text = name;
}
///
/// is forced to some value
///
public void SetForced(bool force)
{
if (force)
{
btnForce.BackColor = Color.Red;
btnAuto.BackColor = Color.LightGray;
}
else
{
btnForce.BackColor = Color.LightGray;
btnAuto.BackColor = Color.LightGray;
}
}
///
/// set value
///
///
public void SetValue(float value)
{
string disp = String.Format("{0:f2}", value);
if (textBoxCurr.Text != disp)
textBoxCurr.Text = disp;
}
///
/// get value
///
///
public Int16 GetValue()
{
string hexString = textBoxSetPt.Text;
Int16 resu = 0;
if (!Int16.TryParse(hexString, System.Globalization.NumberStyles.HexNumber, null, out resu))
resu = 0;
return resu;
}
private void btnAuto_Click(object sender, EventArgs e)
{
//var sim = Aitex.FlyWheel.Simulation.Sim_TcAdsClient.Instance;
//if (sim != null)
// sim.AI_Forced[(int)Tag] = false;
}
private void btnForce_Click(object sender, EventArgs e)
{
//var sim = Aitex.FlyWheel.Simulation.Sim_TcAdsClient.Instance;
//if (sim != null)
//{
// sim.AI_Forced[(int)Tag] = true;
// sim.INPUT.AI[(int)Tag] = GetValue();
//}
}
}
}