Skip to content

Commit 9a59c5e

Browse files
committed
Updating experiment configuration layout
1 parent 2a51a64 commit 9a59c5e

File tree

7 files changed

+220
-291
lines changed

7 files changed

+220
-291
lines changed

StroopTest/Views/ExperimentPages/ExperimentConfig.Designer.cs

+122-242
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StroopTest/Views/ExperimentPages/ExperimentConfig.cs

+21-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public partial class ExperimentConfig : UserControl
1212

1313
public ExperimentConfig()
1414
{
15-
Location = new Point(530, 48);
15+
Location = new Point(500, 38);
1616
InitializeComponent();
1717
}
1818

@@ -28,6 +28,7 @@ public string Path
2828
path = value;
2929
}
3030
}
31+
3132
private string[] defineTest()
3233
{
3334
FormDefineTest defineTest = new FormDefineTest(path, stroopProgramPath, reactionProgramPath);
@@ -48,22 +49,38 @@ private string[] defineTest()
4849
}
4950
return null;
5051
}
51-
private void program1button_Click(object sender, System.EventArgs e)
52+
53+
private void addProgramButton_Click(object sender, System.EventArgs e)
5254
{
5355
string[] result = defineTest();
5456
if(result != null)
5557
{
56-
program1Button.Text = result[0] + ": " + result[1];
58+
programDataGridView.Rows.Add(result[1], result[0]);
5759
}
5860
else
5961
{
60-
program1Button.Text = "abrir";
62+
/*do nothing*/
6163
}
6264
}
6365

6466
private void cancelButton_Click(object sender, EventArgs e)
6567
{
6668
this.Parent.Controls.Remove(this);
6769
}
70+
71+
private void deleteButton_Click(object sender, EventArgs e)
72+
{
73+
try
74+
{
75+
if (programDataGridView.RowCount > 0)
76+
{
77+
programDataGridView.Rows.RemoveAt(this.programDataGridView.SelectedRows[0].Index);
78+
}
79+
}
80+
catch (Exception ex)
81+
{
82+
MessageBox.Show(ex.Message);
83+
}
84+
}
6885
}
6986
}

StroopTest/Views/ExperimentPages/ExperimentConfig.resx

+6
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,10 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120+
<metadata name="programName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
121+
<value>True</value>
122+
</metadata>
123+
<metadata name="typePrograma.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
124+
<value>True</value>
125+
</metadata>
120126
</root>

StroopTest/Views/FormMain.Designer.cs

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StroopTest/Views/FormMain.cs

+12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public partial class FormMain : Form
2323
* */
2424
private static string stroopProgramPath = "StroopTestFiles/prg/";
2525
private static string reactionProgramPath = "ReactionTestFiles/prg/";
26+
private static string experimentProgramPath = "ExperimentTestFiles/prg/";
2627
private static string LSTFOLDERNAME = "/Lst/";
2728
private static string stroopResultsPath = "StroopTestFiles/data/";
2829
private static string reactionResultsPath = "ReactionTestFiles/data/";
@@ -50,9 +51,11 @@ public FormMain()
5051
testFilesPath = defaultPath + "/TestFiles/";
5152
string stroopTestFilesPath = testFilesPath + "/StroopTestFiles/";
5253
string reactionTestFilesPath = testFilesPath + "/ReactionTestFiles/";
54+
string experimentTestFilesPath = testFilesPath + "/ExperimentTestFiles/";
5355
string listsPath = testFilesPath + "/Lst/";
5456
string stroopData = stroopTestFilesPath + "/data/";
5557
string reactionData = reactionTestFilesPath + "/data/";
58+
string experimentData = experimentTestFilesPath + "/data/";
5659

5760
if (!Directory.Exists(testFilesPath))
5861
{
@@ -99,12 +102,18 @@ public FormMain()
99102
if (!Directory.Exists(reactionTestFilesPath))
100103
Directory.CreateDirectory(reactionTestFilesPath);
101104

105+
if (!Directory.Exists(experimentTestFilesPath))
106+
Directory.CreateDirectory(experimentTestFilesPath);
107+
102108
if (!Directory.Exists(testFilesPath + stroopProgramPath))
103109
Directory.CreateDirectory(testFilesPath + stroopProgramPath);
104110

105111
if (!Directory.Exists(testFilesPath + reactionProgramPath))
106112
Directory.CreateDirectory(testFilesPath + reactionProgramPath);
107113

114+
if (!Directory.Exists(testFilesPath + experimentProgramPath))
115+
Directory.CreateDirectory(testFilesPath + experimentProgramPath);
116+
108117
if (!Directory.Exists(listsPath))
109118
{
110119
Directory.CreateDirectory(listsPath);
@@ -116,6 +125,9 @@ public FormMain()
116125
if (!Directory.Exists(testFilesPath + reactionResultsPath))
117126
Directory.CreateDirectory(testFilesPath + reactionResultsPath);
118127

128+
if (!Directory.Exists(experimentData))
129+
Directory.CreateDirectory(experimentData);
130+
119131
if (!Directory.Exists(defaultPath + BACKUPFOLDERNAME))
120132
Directory.CreateDirectory(defaultPath + BACKUPFOLDERNAME);
121133
if (!File.Exists(testFilesPath + INSTRUCTIONSFILENAME))

StroopTest/Views/SidebarUserControls/ExperimentControl.Designer.cs

+32-32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

StroopTest/Views/SidebarUserControls/ExperimentControl.cs

+25-12
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-

2-
3-
using System;
4-
using System.Windows;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Drawing;
5+
using System.Data;
6+
using System.Linq;
7+
using System.Text;
8+
using System.Threading.Tasks;
9+
using System.Windows.Forms;
510
using TestPlatform.Views.ExperimentPages;
611

7-
namespace TestPlatform.Views
12+
namespace TestPlatform.Views.SidebarUserControls
813
{
914
public partial class ExperimentControl : DefaultUserControl
1015
{
1116
private string testFilesPath;
12-
1317
public ExperimentControl()
1418
{
1519
InitializeComponent();
@@ -28,16 +32,25 @@ public string TestFilesPath
2832
}
2933
}
3034

31-
private void newExperimentButton_Click(object sender, System.EventArgs e)
35+
private void newExperimentButton_Click(object sender, EventArgs e)
3236
{
3337
try
3438
{
35-
ExperimentConfig newExperiment = new ExperimentConfig();
36-
newExperiment.Path = TestFilesPath;
37-
Parent.Controls.Add(newExperiment);
38-
39+
if (newExperimentButton.Checked)
40+
{
41+
ExperimentConfig newExperiment = new ExperimentConfig();
42+
newExperiment.Path = TestFilesPath;
43+
Parent.Controls.Add(newExperiment);
44+
newExperimentButton.Checked = false;
45+
}
46+
else
47+
{
48+
/*do nothing*/
49+
}
50+
3951
}
40-
catch (Exception ex) {
52+
catch (Exception ex)
53+
{
4154
MessageBox.Show(ex.Message);
4255
}
4356
}

0 commit comments

Comments
 (0)