Skip to content

Commit

Permalink
Updating experiment configuration layout
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiola-m committed Jul 5, 2017
1 parent 2a51a64 commit 9a59c5e
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 291 deletions.
364 changes: 122 additions & 242 deletions StroopTest/Views/ExperimentPages/ExperimentConfig.Designer.cs

Large diffs are not rendered by default.

25 changes: 21 additions & 4 deletions StroopTest/Views/ExperimentPages/ExperimentConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial class ExperimentConfig : UserControl

public ExperimentConfig()
{
Location = new Point(530, 48);
Location = new Point(500, 38);
InitializeComponent();
}

Expand All @@ -28,6 +28,7 @@ public string Path
path = value;
}
}

private string[] defineTest()
{
FormDefineTest defineTest = new FormDefineTest(path, stroopProgramPath, reactionProgramPath);
Expand All @@ -48,22 +49,38 @@ private string[] defineTest()
}
return null;
}
private void program1button_Click(object sender, System.EventArgs e)

private void addProgramButton_Click(object sender, System.EventArgs e)
{
string[] result = defineTest();
if(result != null)
{
program1Button.Text = result[0] + ": " + result[1];
programDataGridView.Rows.Add(result[1], result[0]);
}
else
{
program1Button.Text = "abrir";
/*do nothing*/
}
}

private void cancelButton_Click(object sender, EventArgs e)
{
this.Parent.Controls.Remove(this);
}

private void deleteButton_Click(object sender, EventArgs e)
{
try
{
if (programDataGridView.RowCount > 0)
{
programDataGridView.Rows.RemoveAt(this.programDataGridView.SelectedRows[0].Index);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
6 changes: 6 additions & 0 deletions StroopTest/Views/ExperimentPages/ExperimentConfig.resx
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="programName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="typePrograma.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
3 changes: 2 additions & 1 deletion StroopTest/Views/FormMain.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions StroopTest/Views/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public partial class FormMain : Form
* */
private static string stroopProgramPath = "StroopTestFiles/prg/";
private static string reactionProgramPath = "ReactionTestFiles/prg/";
private static string experimentProgramPath = "ExperimentTestFiles/prg/";
private static string LSTFOLDERNAME = "/Lst/";
private static string stroopResultsPath = "StroopTestFiles/data/";
private static string reactionResultsPath = "ReactionTestFiles/data/";
Expand Down Expand Up @@ -50,9 +51,11 @@ public FormMain()
testFilesPath = defaultPath + "/TestFiles/";
string stroopTestFilesPath = testFilesPath + "/StroopTestFiles/";
string reactionTestFilesPath = testFilesPath + "/ReactionTestFiles/";
string experimentTestFilesPath = testFilesPath + "/ExperimentTestFiles/";
string listsPath = testFilesPath + "/Lst/";
string stroopData = stroopTestFilesPath + "/data/";
string reactionData = reactionTestFilesPath + "/data/";
string experimentData = experimentTestFilesPath + "/data/";

if (!Directory.Exists(testFilesPath))
{
Expand Down Expand Up @@ -99,12 +102,18 @@ public FormMain()
if (!Directory.Exists(reactionTestFilesPath))
Directory.CreateDirectory(reactionTestFilesPath);

if (!Directory.Exists(experimentTestFilesPath))
Directory.CreateDirectory(experimentTestFilesPath);

if (!Directory.Exists(testFilesPath + stroopProgramPath))
Directory.CreateDirectory(testFilesPath + stroopProgramPath);

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

if (!Directory.Exists(testFilesPath + experimentProgramPath))
Directory.CreateDirectory(testFilesPath + experimentProgramPath);

if (!Directory.Exists(listsPath))
{
Directory.CreateDirectory(listsPath);
Expand All @@ -116,6 +125,9 @@ public FormMain()
if (!Directory.Exists(testFilesPath + reactionResultsPath))
Directory.CreateDirectory(testFilesPath + reactionResultsPath);

if (!Directory.Exists(experimentData))
Directory.CreateDirectory(experimentData);

if (!Directory.Exists(defaultPath + BACKUPFOLDERNAME))
Directory.CreateDirectory(defaultPath + BACKUPFOLDERNAME);
if (!File.Exists(testFilesPath + INSTRUCTIONSFILENAME))
Expand Down
64 changes: 32 additions & 32 deletions StroopTest/Views/SidebarUserControls/ExperimentControl.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 25 additions & 12 deletions StroopTest/Views/SidebarUserControls/ExperimentControl.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@


using System;
using System.Windows;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TestPlatform.Views.ExperimentPages;

namespace TestPlatform.Views
namespace TestPlatform.Views.SidebarUserControls
{
public partial class ExperimentControl : DefaultUserControl
{
private string testFilesPath;

public ExperimentControl()
{
InitializeComponent();
Expand All @@ -28,16 +32,25 @@ public string TestFilesPath
}
}

private void newExperimentButton_Click(object sender, System.EventArgs e)
private void newExperimentButton_Click(object sender, EventArgs e)
{
try
{
ExperimentConfig newExperiment = new ExperimentConfig();
newExperiment.Path = TestFilesPath;
Parent.Controls.Add(newExperiment);

if (newExperimentButton.Checked)
{
ExperimentConfig newExperiment = new ExperimentConfig();
newExperiment.Path = TestFilesPath;
Parent.Controls.Add(newExperiment);
newExperimentButton.Checked = false;
}
else
{
/*do nothing*/
}

}
catch (Exception ex) {
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Expand Down

0 comments on commit 9a59c5e

Please sign in to comment.