Skip to content

Commit

Permalink
Merge pull request #182 from lab-neuro-comp/Fix_Bugs
Browse files Browse the repository at this point in the history
181/Fixing severall bugs
  • Loading branch information
gabrielalbino authored Apr 23, 2018
2 parents 45dae57 + 55c9efa commit 5f5bc9c
Show file tree
Hide file tree
Showing 12 changed files with 135 additions and 78 deletions.
36 changes: 36 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,39 @@ You can run tests using visual studio default configurations.

Please send a [GitHub Pull Request to TestPlatform](https://github.com/lab-neuro-comp/Test-Platform/pull/new/master) stating what you've done.
The Pull Request will only be accepted if the contribution works in all cultures (en-US and pt-BR).


# Deployment



For this project deployment, follow the steps below (You need WinRAR to be installed in your computer)



1. Change localization to specific culture that will be released. Don't forget to also change version in AssemblyInfo.cs (Inside Properties)


![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/main_culture.png?raw=true)



2. Go to project properties and click on the left menu on publish, changing application files accordingly to culture being published. Then, click on the Publish Wizard



![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/publish_projects.png?raw=true)



3. Right click on the folder created after published, and click to add to file (using WinRAR).


4. Use WinRAR advanced SFX options to create an executable of the compressed files


![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/sfx_shortcut.png?raw=true)



![enter image description here](https://github.com/lab-neuro-comp/Test-Platform/blob/master/images/sfx_text.png?raw=true)
22 changes: 22 additions & 0 deletions StroopTest/Controllers/ExpositionController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,27 @@ public static void BeginExperimentTest(string programName, string participantNam
}

}

public static void formSecondScreen(Form form)
{
Screen[] sc;
sc = Screen.AllScreens;
if (sc.Count<Screen>() > 1)
{
foreach (Screen s in sc)
{
if (!s.Primary)
{
form.WindowState = FormWindowState.Maximized;
form.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
form.Bounds = s.Bounds;
form.MaximizeBox = true;
}
}
}

}


}
}
4 changes: 3 additions & 1 deletion StroopTest/Models/General/StrList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ public bool saveContent(bool shouldSave)
{
string listDestination = Global.testFilesPath + Global.listFolderName + ListName + Type + "/";
Directory.CreateDirectory(listDestination);
int i = 0;
foreach (string content in listContent)
{
try
{
File.Copy(content, listDestination + Path.GetFileName(content), true);
File.Copy(content, listDestination + i + Path.GetFileName(content), true);

}
catch
Expand All @@ -165,6 +166,7 @@ public bool saveContent(bool shouldSave)
CultureInfo currentCulture = System.Threading.Thread.CurrentThread.CurrentUICulture;
MessageBox.Show(LocRM.GetString("fileNotFound", currentCulture) + "\n" + content);
}
i++;
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion StroopTest/Models/Tests/Reaction/ReactionProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public string StimuluShape

set
{
if (!value || value && numberPositions == 0)
if (!value || value && numberPositions == 1)
{
expandImage = value;
}
Expand Down
4 changes: 2 additions & 2 deletions StroopTest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0")]
[assembly: AssemblyFileVersion("3.0")]
[assembly: AssemblyVersion("3.1")]
[assembly: AssemblyFileVersion("3.1")]

11 changes: 4 additions & 7 deletions StroopTest/TestPlatform.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<HockeyAppResourceId>4e4db72659e84ec1ab96ac2196fa1559</HockeyAppResourceId>
<PublishUrl>C:\Users\fabio\Desktop\UnB\Iniciação Científica\en-US\</PublishUrl>
<PublishUrl>C:\Users\fabio\Desktop\UnB\Iniciação Científica\pt-BR\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
Expand All @@ -36,7 +36,7 @@
<WebPage>publish.htm</WebPage>
<OpenBrowserOnPublish>false</OpenBrowserOnPublish>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>3.0.0.0</ApplicationVersion>
<ApplicationVersion>3.1.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>
Expand Down Expand Up @@ -532,7 +532,6 @@
</EmbeddedResource>
<EmbeddedResource Include="Views\MatchingPages\FormMatchConfig.resx">
<DependentUpon>FormMatchConfig.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Views\MatchingPages\MatchingExposition.resx">
<DependentUpon>MatchingExposition.cs</DependentUpon>
Expand Down Expand Up @@ -736,8 +735,6 @@
<None Include="Resources\bell.wav" />
<None Include="Resources\error.wav" />
<None Include="Resources\hit.wav" />
<None Include="Resources\helpToolTipMatrixImage.bmp" />
<None Include="Resources\helpPagesImages\positionMap.png" />
<Content Include="Resources\icons\circle.png" />
<Content Include="Resources\icons\cross.png" />
<Content Include="Resources\icons\helpButton.png" />
Expand Down Expand Up @@ -803,7 +800,7 @@
<Group>en-US</Group>
<TargetPath>
</TargetPath>
<PublishState>Include</PublishState>
<PublishState>Exclude</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Satellite</FileType>
</PublishFile>
Expand All @@ -812,7 +809,7 @@
<Group>pt-BR</Group>
<TargetPath>
</TargetPath>
<PublishState>Exclude</PublishState>
<PublishState>Include</PublishState>
<IncludeHash>True</IncludeHash>
<FileType>Satellite</FileType>
</PublishFile>
Expand Down
10 changes: 2 additions & 8 deletions StroopTest/Views/ListsPages/FormImgConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ public FormImgConfig(string imgListEdit)

private void openImgList()
{
try
{
FormDefine defineFilePath = defineFilePath = new FormDefine(LocRM.GetString("imageList", currentCulture), Global.testFilesPath + Global.listFolderName, "dir","_image",true, false);
var result = defineFilePath.ShowDialog();

Expand All @@ -55,17 +53,13 @@ private void openImgList()
isListNameValid = false;
return;
}
imgListNameTextBox.Text = listName.Remove(listName.Length - 6); // removes the _img identification from file while editing (when its saved it is always added again)
imgListNameTextBox.Text = listName; // removes the _img identification from file while editing (when its saved it is always added again)
imageList = new StrList(listName, IMAGE);
string[] filePaths = imageList.ListContent.ToArray();
readImagesIntoDGV(filePaths, imgPathDataGridView);

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

}

private void btnOpen_Click(object sender, EventArgs e)
Expand Down
41 changes: 16 additions & 25 deletions StroopTest/Views/ListsPages/FormImgConfig.resx
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,27 @@
<metadata name="fileNameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="fileNameColumn.HeaderText" xml:space="preserve">
<value>Nome do Arquivo</value>
</data>
<data name="fileNameColumn.Width" type="System.Int32, mscorlib">
<value>120</value>
</data>
<metadata name="thumbnailColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="thumbnailColumn.HeaderText" xml:space="preserve">
<value>Imagem</value>
</data>
<data name="thumbnailColumn.Width" type="System.Int32, mscorlib">
<value>120</value>
</data>
<metadata name="filePathColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="filePathColumn.HeaderText" xml:space="preserve">
<value>Localização</value>
</data>
<data name="imgPathDataGridView.Location" type="System.Drawing.Point, System.Drawing">
<value>25, 357</value>
</data>
Expand All @@ -327,30 +342,6 @@
<data name="&gt;&gt;imgPathDataGridView.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<metadata name="fileNameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="fileNameColumn.HeaderText" xml:space="preserve">
<value>Nome do Arquivo</value>
</data>
<data name="fileNameColumn.Width" type="System.Int32, mscorlib">
<value>120</value>
</data>
<metadata name="thumbnailColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="thumbnailColumn.HeaderText" xml:space="preserve">
<value>Imagem</value>
</data>
<data name="thumbnailColumn.Width" type="System.Int32, mscorlib">
<value>120</value>
</data>
<metadata name="filePathColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="filePathColumn.HeaderText" xml:space="preserve">
<value>Localização</value>
</data>
<data name="moveUpButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
<value>Top, Bottom, Left</value>
</data>
Expand Down Expand Up @@ -625,7 +616,7 @@
<value>True</value>
</data>
<data name="numberFiles.Location" type="System.Drawing.Point, System.Drawing">
<value>133, 351</value>
<value>133, 337</value>
</data>
<data name="numberFiles.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
<value>4, 0, 4, 0</value>
Expand Down
3 changes: 3 additions & 0 deletions StroopTest/Views/MatchingPages/MatchingExposition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ public MatchingExposition(string prgName, string participantName, char mark)
this.FormBorderStyle = FormBorderStyle.None;
this.MaximizeBox = true;
this.StartPosition = FormStartPosition.Manual;
ExpositionController.formSecondScreen(this);

InitializeComponent();
startTime = hour + "_" + minutes + "_" + seconds;
executingTest.ParticipantName = participantName;
executingTest.setProgramInUse(path + "/prg/", prgName);
executingTest.Mark = mark;

stimuluControls = new List<Control>();
outputFile = outputDataPath + executingTest.ParticipantName + "_" + executingTest.ProgramInUse.ProgramName + ".txt";
startExposition();
Expand Down
12 changes: 7 additions & 5 deletions StroopTest/Views/ReactionPages/FormReactExposition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public FormReactExposition(string prgName, string participantName, char mark)
this.FormBorderStyle = FormBorderStyle.None;
this.MaximizeBox = true;
this.StartPosition = FormStartPosition.Manual;
ExpositionController.formSecondScreen(this);
InitializeComponent();
startTime = hour + "_" + minutes + "_" + seconds;
executingTest.ParticipantName = participantName;
Expand Down Expand Up @@ -715,14 +716,15 @@ private void expositionBW_RunWorkerCompleted(object sender, RunWorkerCompletedEv

private void intervalBW_DoWork(object sender, DoWorkEventArgs e)
{
ExpositionController.makingFixPoint(executingTest.ProgramInUse.FixPoint, executingTest.ProgramInUse.FixPointColor,
this);


executingTest.InitialTime = DateTime.Now;
accumulativeStopWatch.Start();

for (int counter = 0; counter < executingTest.ProgramInUse.NumExpositions && !cancelExposition; counter++)
{
ExpositionController.makingFixPoint(executingTest.ProgramInUse.FixPoint, executingTest.ProgramInUse.FixPointColor,
this);
currentExposition = counter;
//preparing execution
expositionBackground();
Expand Down Expand Up @@ -832,7 +834,7 @@ private Point randomScreenThreePositions(Size size)
/* creates a x and y vector on center of the screen */
private Point centerShapePosition(Size size)
{
currentPosition = 0;
currentPosition = 2;
StimulusPosition stimulusPosition = new StimulusPosition(ClientSize, size);
Point newPoint = stimulusPosition.threePointsPosition(currentPosition);
currentPositionOutput = stimulusPosition.CurrentPosition;
Expand Down Expand Up @@ -1023,11 +1025,11 @@ private Point[] createTrianglePoints()
private void intervalBW_ProgressChanged(object sender, ProgressChangedEventArgs e)
{

if (exposing)
if (exposing && !cancelExposition)
{
this.Controls.Add((Control)e.UserState);
}
else
else if (!cancelExposition)
{
this.Controls.Remove((Control)e.UserState);
}
Expand Down
Loading

0 comments on commit 5f5bc9c

Please sign in to comment.