Skip to content

Commit

Permalink
Merge branch 'release/2.2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
zigaroula committed Sep 25, 2020
2 parents 5958119 + 20acec1 commit 47514ce
Show file tree
Hide file tree
Showing 105 changed files with 2,595 additions and 387 deletions.
Binary file modified Assets/Prefabs/Elements/Content/Main Buttons/Main Button.prefab
Binary file not shown.
Binary file not shown.
Binary file modified Assets/Prefabs/General/Main menu.prefab
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Prefabs/Quick Start.meta

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

Binary file not shown.

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

Binary file modified Assets/Prefabs/Visualization/3D/UI/3D Menu.prefab
Binary file not shown.
Binary file not shown.
Binary file modified Assets/Prefabs/Visualization/UI/Informations/Graph/Graph.prefab
Binary file not shown.
Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Assets/Resources/Prefabs/UI/Windows/Bug Reporter window.prefab
Binary file not shown.
Binary file modified Assets/Resources/Prefabs/UI/Windows/Icon modifier window.prefab
Binary file not shown.
Binary file modified Assets/Resources/Prefabs/UI/Windows/Open project window.prefab
Binary file not shown.
Binary file not shown.
Binary file modified Assets/Resources/Prefabs/UI/Windows/Protocol modifier window.prefab
Binary file not shown.
Binary file not shown.
Binary file not shown.

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

Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Scripts/HBP/3D/HBP3DModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public IEnumerator c_Load(IEnumerable<Data.Visualization.Visualization> visualiz
if (!visualization.IsVisualizable) throw new CanNotLoadVisualization(visualization.Name);

yield return Ninja.JumpToUnity;
yield return this.StartCoroutineAsync(visualization.c_Load((localProgress, duration, text) => { onChangeProgress(progress + localProgress * visualizationWeight * LOADING_VISUALIZATION_PROGRESS, duration, text); Debug.Log(localProgress); }), out Task visualizationLoadingTask);
yield return this.StartCoroutineAsync(visualization.c_Load((localProgress, duration, text) => onChangeProgress(progress + localProgress * visualizationWeight * LOADING_VISUALIZATION_PROGRESS, duration, text)), out Task visualizationLoadingTask);

if (visualizationLoadingTask.State == TaskState.Done)
{
Expand Down
9 changes: 7 additions & 2 deletions Assets/Scripts/HBP/3D/Scene/Base3DScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Data.Enums.SceneType Type
{
get
{
return Visualization.Patients.Count > 1 ? Data.Enums.SceneType.MultiPatients : Data.Enums.SceneType.SinglePatient;
return Visualization.Patients.Count == 1 ? Data.Enums.SceneType.SinglePatient : Data.Enums.SceneType.MultiPatients;
}
}

Expand Down Expand Up @@ -699,6 +699,10 @@ public bool IsGeneratorUpToDate
/// Event called when displaying the correlations
/// </summary>
[HideInInspector] public UnityEvent OnChangeDisplayCorrelations = new UnityEvent();
/// <summary>
/// Event called when finished loading the scene completely
/// </summary>
[HideInInspector] public UnityEvent OnSceneCompletelyLoaded = new UnityEvent();
#endregion

#region Private Methods
Expand Down Expand Up @@ -736,6 +740,7 @@ private void Update()
{
UpdateVisibleState(true);
IsSceneCompletelyLoaded = true;
OnSceneCompletelyLoaded.Invoke();
if (Visualization.Configuration.FirstColumnToSelect < Columns.Count)
{
Columns[Visualization.Configuration.FirstColumnToSelect].SelectFirstOrDefaultSiteByName(Visualization.Configuration.FirstSiteToSelect);
Expand Down Expand Up @@ -1636,7 +1641,7 @@ public void ResetIEEG(bool hardReset = true)
IsGeneratorUpToDate = false;
CutTexturesNeedUpdate = true;
}
OnIEEGOutdated.Invoke(true);
OnIEEGOutdated.Invoke(Columns.Any(c => c is Column3DIEEG || c is Column3DCCEP));
}
/// <summary>
/// Passive raycast on the scene (to hover sites for instance)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class BrainVision : DataContainer
/// <summary>
/// Path to the BrainVision header file with Alias.
/// </summary>
[DataMember(Name = "Header")] public string SavedHeader { get; protected set; }
[DataMember(Name = "Header")] public string SavedHeader { get; protected set; } = "";
/// <summary>
/// Path to the BrainVision format header file without Alias.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class EDF : DataContainer
/// <summary>
/// Path to the EDF file with Alias.
/// </summary>
[DataMember(Name = "EDF")] public string SavedFile { get; protected set; }
[DataMember(Name = "EDF")] public string SavedFile { get; protected set; } = "";
/// <summary>
/// Path to the EDF file without Alias.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Elan : DataContainer
/// <summary>
/// Path to the EEG file with Alias.
/// </summary>
[DataMember(Name = "EEG")] public string SavedEEG { get; protected set; }
[DataMember(Name = "EEG")] public string SavedEEG { get; protected set; } = "";
/// <summary>
/// Path to the EEG file without Alias.
/// </summary>
Expand All @@ -77,7 +77,7 @@ public string EEGHeader
/// <summary>
/// Path to the POS file with Alias.
/// </summary>
[DataMember(Name = "POS")] public string SavedPOS { get; protected set; }
[DataMember(Name = "POS")] public string SavedPOS { get; protected set; } = "";
/// <summary>
/// Path of the POS file without Alias.
/// </summary>
Expand All @@ -90,7 +90,7 @@ public string POS
/// <summary>
/// Path to the notes file with Alias.
/// </summary>
[DataMember(Name = "Notes")] public string SavedNotes { get; protected set; }
[DataMember(Name = "Notes")] public string SavedNotes { get; protected set; } = "";
/// <summary>
/// Path of the notes file without Alias.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class Micromed : DataContainer
/// <summary>
/// Path to the EEG file with Alias.
/// </summary>
[DataMember(Name = "TRC")] public string SavedPath { get; protected set; }
[DataMember(Name = "TRC")] public string SavedPath { get; protected set; } = "";
/// <summary>
/// Path of the EEG file without Alias.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion Assets/Scripts/HBP/Data/Dataset/Data/BlocData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ public BlocData(DynamicData data, Bloc bloc)
Trials = SortTrials(bloc, trials).ToArray();

Frequency = data.Frequency;
// TODO : Treatments
}
#endregion

Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/HBP/Data/TrialMatrix/Grid/ChannelStruct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -420,4 +420,6 @@ public SceneData(List<Column> columns)
Columns = columns;
}
}

[Serializable] public class ChannelsEvent : UnityEngine.Events.UnityEvent<ChannelStruct[]> { }
}
11 changes: 6 additions & 5 deletions Assets/Scripts/HBP/Data/Visualization/Data/IEEGData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class IEEGData : DynamicData
public Dictionary<string, string> UnitByChannelID { get; set; } = new Dictionary<string, string>();

private Dictionary<string, Tools.CSharp.EEG.Frequency> m_FrequencyByChannelID = new Dictionary<string, Tools.CSharp.EEG.Frequency>();
public List<Tools.CSharp.EEG.Frequency> Frequencies = new List<Tools.CSharp.EEG.Frequency>();
private List<Tools.CSharp.EEG.Frequency> m_Frequencies = new List<Tools.CSharp.EEG.Frequency>();
public float MaxFrequency { get { return m_Frequencies.Count > 0 ? m_Frequencies.Max(f => f.RawValue) : 0; } }
#endregion

#region Public Methods
Expand All @@ -34,7 +35,7 @@ public void Load(IEnumerable<IEEGDataInfo> columnData, Experience.Protocol.Bloc
if (!m_FrequencyByChannelID.ContainsKey(channelID)) m_FrequencyByChannelID.Add(channelID, data.Frequency);
if (!UnitByChannelID.ContainsKey(channelID)) UnitByChannelID.Add(channelID, data.UnitByChannel[channel]);
}
if (!Frequencies.Contains(data.Frequency)) Frequencies.Add(data.Frequency);
if (!m_Frequencies.Contains(data.Frequency)) m_Frequencies.Add(data.Frequency);
// Events
EventStatistics.Add(DataManager.GetEventsStatistics(dataInfo, bloc));
}
Expand All @@ -47,14 +48,14 @@ public override void Unload()
StatisticsByChannelID.Clear();
UnitByChannelID.Clear();
m_FrequencyByChannelID.Clear();
Frequencies.Clear();
m_Frequencies.Clear();
ProcessedValuesByChannel.Clear();
}
public void SetTimeline(Tools.CSharp.EEG.Frequency maxFrequency, Experience.Protocol.Bloc columnBloc, IEnumerable<Experience.Protocol.Bloc> blocs)
{
// Process frequencies
Frequencies.Add(maxFrequency);
Frequencies = Frequencies.GroupBy(f => f.Value).Select(g => g.First()).ToList();
m_Frequencies.Add(maxFrequency);
m_Frequencies = m_Frequencies.GroupBy(f => f.Value).Select(g => g.First()).ToList();

// Get index of each subBloc
Dictionary<Experience.Protocol.SubBloc, int> indexBySubBloc = new Dictionary<Experience.Protocol.SubBloc, int>();
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scripts/HBP/Data/Visualization/Visualization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public ReadOnlyCollection<CCEPColumn> CCEPColumns
/// </summary>
public virtual bool IsVisualizable
{
get { return Columns.Count > 0 && Patients.Count > 0 && Columns.All((column) => column.IsCompatible(Patients)); }
get { return Columns.Count > 0 && Columns.All((column) => column.IsCompatible(Patients)); }
}
/// <summary>
/// Is the visualization opened in a scene ?
Expand Down Expand Up @@ -468,7 +468,7 @@ IEnumerator c_LoadColumns(Dictionary<Column, IEnumerable<DataInfo>> dataInfoByCo
yield break;
}
}
Tools.CSharp.EEG.Frequency maxiEEGFrequency = new Tools.CSharp.EEG.Frequency(iEEGColumns.Max(column => column.Data.Frequencies.Max(f => f.RawValue)));
Tools.CSharp.EEG.Frequency maxiEEGFrequency = new Tools.CSharp.EEG.Frequency(iEEGColumns.Max(column => column.Data.MaxFrequency));
for (int i = 0; i < nbIEEGColumns; ++i)
{
IEEGColumn column = iEEGColumns[i];
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scripts/HBP/Lite.meta

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

34 changes: 34 additions & 0 deletions Assets/Scripts/HBP/Lite/LiteManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using HBP.Data;
using HBP.Data.Experience.Dataset;
using HBP.Data.Experience.Protocol;
using HBP.Data.Visualization;
using System.Collections.Generic;
using UnityEngine;

namespace HBP.Lite
{
public class LiteManager : MonoBehaviour
{
#region Properties
private Project m_Project;
private List<Patient> m_Patients;
private Protocol m_Protocol;
private Dataset m_Dataset;
private Visualization m_Visualization;
#endregion

#region Private Methods
private void Awake()
{
ApplicationState.ProjectLoaded = new Project();
m_Patients = new List<Patient>();
m_Protocol = new Protocol("Protocol", new Bloc[0]);
m_Dataset = new Dataset("Dataset", m_Protocol, new DataInfo[0]);
m_Visualization = new Visualization("Visualization", m_Patients, new Column[] { new IEEGColumn("Column", new BaseConfiguration(), m_Dataset, "Data", new Bloc(), new DynamicConfiguration()) });
m_Project = new Project(new ProjectPreferences("Project"), m_Patients, new Group[0], new Protocol[] { m_Protocol }, new Dataset[] { m_Dataset }, new Visualization[] { m_Visualization });
ApplicationState.ProjectLoaded = m_Project;
ApplicationState.Module3D.LoadScenes(new Visualization[] { m_Visualization });
}
#endregion
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/HBP/Lite/LiteManager.cs.meta

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

2 changes: 1 addition & 1 deletion Assets/Scripts/HBP/ShortCut/ShortcutManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private bool OpenProtocolsActionPerformed
{
get
{
return IsControlPressed && Input.GetKeyDown(KeyCode.B);
return IsControlPressed && Input.GetKeyDown(KeyCode.E);
}
}
private bool OpenDatasetsActionPerformed
Expand Down
6 changes: 6 additions & 0 deletions Assets/Scripts/HBP/UI/Menu/FileMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class FileMenu : Menu
public InteractableConditions SaveProjectInteractableConditions { get { return m_SaveProjectInteractableConditions; } }
[SerializeField] InteractableConditions m_SaveProjectAsInteractableConditions;
public InteractableConditions SaveProjectAsInteractableConditions { get { return m_SaveProjectAsInteractableConditions; } }
[SerializeField] InteractableConditions m_QuickStartInteractableConditions;
public InteractableConditions QuickStartInteractableConditions { get { return m_QuickStartInteractableConditions; } }
[SerializeField] InteractableConditions m_QuitInteractableConditions;
public InteractableConditions QuitInteractableConditions { get { return m_QuitInteractableConditions; } }
#endregion
Expand All @@ -35,6 +37,10 @@ public void OpenSaveProjectAs()
{
ApplicationState.WindowsManager.Open("Save project as window");
}
public void QuickStart()
{
ApplicationState.WindowsManager.Open("Quick start window");
}
public void Quit()
{
ApplicationState.DialogBoxManager.Open(Tools.Unity.DialogBoxManager.AlertType.WarningMultiOptions, "Quit HiBoP?", "Are you sure you want to quit HiBoP? Make sure all your data is saved.", () => { Application.Quit(); }, "Quit", () => { }, "Cancel");
Expand Down
5 changes: 4 additions & 1 deletion Assets/Scripts/HBP/UI/Module3D/overlay/SiteInfoDisplayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,21 @@ public void Initialize()
SetPosition(siteInfo);
SetSite(siteInfo.Site);
SetPatient(siteInfo.Site.Information.Patient);
SetTags(siteInfo);
switch (siteInfo.Mode)
{
case Data.Enums.SiteInformationDisplayMode.Anatomy:
SetStates(siteInfo.Site);
SetTags(siteInfo);
break;
case Data.Enums.SiteInformationDisplayMode.IEEG:
SetIEEG(siteInfo);
SetStates(siteInfo.Site);
SetTags(siteInfo);
break;
case Data.Enums.SiteInformationDisplayMode.CCEP:
SetCCEP(siteInfo);
SetStates(siteInfo.Site);
SetTags(siteInfo);
break;
case Data.Enums.SiteInformationDisplayMode.Light:
break;
Expand Down Expand Up @@ -230,6 +232,7 @@ void SetTags(HBP.Module3D.SiteInfo siteInfo)
stringBuilder.Append(string.Format("\t• <b>{0}</b>: {1}\n", tag.Tag.Name, tag.DisplayableValue));
}
m_TagsText.text = stringBuilder.Remove(stringBuilder.Length - 1, 1).ToString();
m_Tags.SetActive(true);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/HBP/UI/Others/Informations/Informations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class Informations : MonoBehaviour
{
#region Properties
public ChannelInformations ChannelInformations;
public ROIInformations ROIInformations;
public GridInformations ROIInformations;
#endregion

#region Public Methods
Expand Down
Loading

0 comments on commit 47514ce

Please sign in to comment.