123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- 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;
- }
- /// <summary>
- /// is forced to some value
- /// </summary>
- public void SetForced(bool force)
- {
- if (force)
- {
- btnForce.BackColor = Color.Red;
- btnAuto.BackColor = Color.LightGray;
- }
- else
- {
- btnForce.BackColor = Color.LightGray;
- btnAuto.BackColor = Color.LightGray;
- }
- }
- /// <summary>
- /// set value
- /// </summary>
- /// <param name="value"></param>
- public void SetValue(float value)
- {
- string disp = String.Format("{0:f2}", value);
- if (textBoxCurr.Text != disp)
- textBoxCurr.Text = disp;
- }
-
- /// <summary>
- /// get value
- /// </summary>
- /// <returns></returns>
- 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();
- //}
- }
- }
- }
|