3using System.Collections.Generic;
11using System.Threading.Tasks;
24 bool m_bStartRecording =
false;
34 InitializeComponent();
37 m_bStartRecording = bStartRecording;
42 ctrl.Dock = DockStyle.Fill;
43 toolStripContainer1.ContentPanel.Controls.Add(ctrl);
46 m_dlgActionImage.FormClosing += dlgActionImage_FormClosing;
54 get {
return m_strName; }
62 public void Render(Image bmp, Image bmpAction)
64 m_ctrl.
Render(m_strName, bmp);
66 if (bmpAction ==
null)
68 btnShowActionImage.Enabled =
false;
72 btnShowActionImage.Enabled =
true;
73 m_dlgActionImage.
SetImage(bmpAction);
83 public void Render(
double[] rgData, Image bmp, Image bmpAction)
85 m_ctrl.
Render(
true, m_strName, rgData, bmp);
87 if (bmpAction ==
null)
89 btnShowActionImage.Enabled =
false;
93 btnShowActionImage.Enabled =
true;
94 m_dlgActionImage.
SetImage(bmpAction);
98 private void dlgActionImage_FormClosing(
object sender, FormClosingEventArgs e)
100 if (e.CloseReason == CloseReason.WindowsShutDown)
103 m_dlgActionImage.Hide();
107 private void FormGym_Load(
object sender, EventArgs e)
109 Text =
"MyCaffe Test Gym - " + m_strName;
111 if (m_bStartRecording)
113 btnRecord.Checked =
true;
114 btnRecord_Click(btnRecord, EventArgs.Empty);
118 private void FormGym_FormClosing(
object sender, FormClosingEventArgs e)
120 if (e.CloseReason == CloseReason.WindowsShutDown || e.CloseReason == CloseReason.ApplicationExitCall)
127 private void btnShowActionImage_Click(
object sender, EventArgs e)
129 if (btnShowActionImage.Checked)
131 if (m_dlgActionImage.Visible)
132 m_dlgActionImage.BringToFront();
134 m_dlgActionImage.Show(
this);
138 if (m_dlgActionImage.Visible)
139 m_dlgActionImage.Hide();
143 private void btnRecord_Click(
object sender, EventArgs e)
145 if (btnRecord.Checked)
147 btnRecord.Image = Properties.Resources.record_on;
152 btnRecord.Image = Properties.Resources.record_off;
157 private void btnDeleteRecordingData_Click(
object sender, EventArgs e)
162 private void timerUI_Tick(
object sender, EventArgs e)
The MyCaffeGymControl displays the actual Gym visualizations.
bool HasRecordingData
Returns whether or not the Gym has any recording data.
bool EnableRecording
Enable or disable recording. When recording is enabled, each image is saved to the recording folder.
void DeleteRecordingData()
Delete any recording data that exists.
void Render(string strName, Image bmp)
Renders the Gym visualization.
The MyCaffe.basecode contains all generic types used throughout MyCaffe.
The MyCaffe.gym namespace contains all classes related to the Gym's supported by MyCaffe.
The MyCaffe namespace contains the main body of MyCaffe code that closesly tracks the C++ Caffe open-...