diff --git a/VsProject/PropagationRemasteredBeta/MainVue.Designer.cs b/VsProject/PropagationRemasteredBeta/MainVue.Designer.cs index d775974..8695b49 100644 --- a/VsProject/PropagationRemasteredBeta/MainVue.Designer.cs +++ b/VsProject/PropagationRemasteredBeta/MainVue.Designer.cs @@ -39,6 +39,7 @@ namespace PropagationRemasteredBeta this.chkbxSaveFiles = new System.Windows.Forms.CheckBox(); this.tbxSaveFilePath = new System.Windows.Forms.TextBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.nupPopulationHeight = new System.Windows.Forms.NumericUpDown(); this.label12 = new System.Windows.Forms.Label(); this.btnRandomizeStats = new System.Windows.Forms.Button(); this.nupCureTime = new System.Windows.Forms.NumericUpDown(); @@ -55,18 +56,19 @@ namespace PropagationRemasteredBeta this.label3 = new System.Windows.Forms.Label(); this.lblPopulationSizePrediction = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); - this.nupPopulationSize = new System.Windows.Forms.NumericUpDown(); + this.nupPopulationWidth = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.btnRunSimulation = new System.Windows.Forms.Button(); this.btnOpenSimViewer = new System.Windows.Forms.Button(); this.groupBox1.SuspendLayout(); this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nupPopulationHeight)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nupCureTime)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nupImmunes)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nupInfecteds)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nupMortality)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nupInfectiosity)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nupPopulationSize)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nupPopulationWidth)).BeginInit(); this.SuspendLayout(); // // lblTitle @@ -166,6 +168,7 @@ namespace PropagationRemasteredBeta // // groupBox2 // + this.groupBox2.Controls.Add(this.nupPopulationHeight); this.groupBox2.Controls.Add(this.label12); this.groupBox2.Controls.Add(this.btnRandomizeStats); this.groupBox2.Controls.Add(this.nupCureTime); @@ -182,7 +185,7 @@ namespace PropagationRemasteredBeta this.groupBox2.Controls.Add(this.label3); this.groupBox2.Controls.Add(this.lblPopulationSizePrediction); this.groupBox2.Controls.Add(this.label2); - this.groupBox2.Controls.Add(this.nupPopulationSize); + this.groupBox2.Controls.Add(this.nupPopulationWidth); this.groupBox2.Controls.Add(this.label1); this.groupBox2.Font = new System.Drawing.Font("Verdana", 12F); this.groupBox2.Location = new System.Drawing.Point(12, 268); @@ -192,6 +195,24 @@ namespace PropagationRemasteredBeta this.groupBox2.TabStop = false; this.groupBox2.Text = "Simulation Settings"; // + // nupPopulationHeight + // + this.nupPopulationHeight.Location = new System.Drawing.Point(292, 69); + this.nupPopulationHeight.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.nupPopulationHeight.Name = "nupPopulationHeight"; + this.nupPopulationHeight.Size = new System.Drawing.Size(236, 32); + this.nupPopulationHeight.TabIndex = 22; + this.nupPopulationHeight.Value = new decimal(new int[] { + 400, + 0, + 0, + 0}); + this.nupPopulationHeight.ValueChanged += new System.EventHandler(this.nupPopulationHeight_ValueChanged); + // // label12 // this.label12.AutoSize = true; @@ -355,32 +376,32 @@ namespace PropagationRemasteredBeta this.label2.TabIndex = 2; this.label2.Text = "Simulated individuals :"; // - // nupPopulationSize + // nupPopulationWidth // - this.nupPopulationSize.Location = new System.Drawing.Point(14, 69); - this.nupPopulationSize.Maximum = new decimal(new int[] { + this.nupPopulationWidth.Location = new System.Drawing.Point(14, 69); + this.nupPopulationWidth.Maximum = new decimal(new int[] { 10000, 0, 0, 0}); - this.nupPopulationSize.Name = "nupPopulationSize"; - this.nupPopulationSize.Size = new System.Drawing.Size(514, 32); - this.nupPopulationSize.TabIndex = 1; - this.nupPopulationSize.Value = new decimal(new int[] { + this.nupPopulationWidth.Name = "nupPopulationWidth"; + this.nupPopulationWidth.Size = new System.Drawing.Size(236, 32); + this.nupPopulationWidth.TabIndex = 1; + this.nupPopulationWidth.Value = new decimal(new int[] { 400, 0, 0, 0}); - this.nupPopulationSize.ValueChanged += new System.EventHandler(this.nupPopulationSize_ValueChanged); + this.nupPopulationWidth.ValueChanged += new System.EventHandler(this.nupPopulationSize_ValueChanged); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(9, 41); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(71, 25); + this.label1.Size = new System.Drawing.Size(217, 25); this.label1.TabIndex = 0; - this.label1.Text = "Size :"; + this.label1.Text = "Size (width;height):"; // // btnRunSimulation // @@ -423,12 +444,13 @@ namespace PropagationRemasteredBeta this.groupBox1.PerformLayout(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nupPopulationHeight)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nupCureTime)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nupImmunes)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nupInfecteds)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nupMortality)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nupInfectiosity)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nupPopulationSize)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nupPopulationWidth)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -444,7 +466,7 @@ namespace PropagationRemasteredBeta private System.Windows.Forms.Label label1; private System.Windows.Forms.Label lblPopulationSizePrediction; private System.Windows.Forms.Label label2; - private System.Windows.Forms.NumericUpDown nupPopulationSize; + private System.Windows.Forms.NumericUpDown nupPopulationWidth; private System.Windows.Forms.NumericUpDown nupImmunes; private System.Windows.Forms.Label label5; private System.Windows.Forms.NumericUpDown nupInfecteds; @@ -466,5 +488,6 @@ namespace PropagationRemasteredBeta private System.Windows.Forms.Button btnRandomName; private System.Windows.Forms.Label label12; private System.Windows.Forms.Button btnRandomizeStats; + private System.Windows.Forms.NumericUpDown nupPopulationHeight; } } \ No newline at end of file diff --git a/VsProject/PropagationRemasteredBeta/MainVue.cs b/VsProject/PropagationRemasteredBeta/MainVue.cs index 6354fc3..32c2269 100644 --- a/VsProject/PropagationRemasteredBeta/MainVue.cs +++ b/VsProject/PropagationRemasteredBeta/MainVue.cs @@ -33,7 +33,7 @@ namespace PropagationRemasteredBeta private void btnRunSimulation_Click(object sender, EventArgs e) { - terrainSize = new Size(Convert.ToInt32(nupPopulationSize.Value), Convert.ToInt32(nupPopulationSize.Value)); + terrainSize = new Size(Convert.ToInt32(nupPopulationWidth.Value), Convert.ToInt32(nupPopulationHeight.Value)); infectedProportion = Convert.ToInt32(nupInfecteds.Value); resistantProportion = Convert.ToInt32(nupImmunes.Value); deathRate = Convert.ToInt32(nupMortality.Value); @@ -50,8 +50,11 @@ namespace PropagationRemasteredBeta } private void nupPopulationSize_ValueChanged(object sender, EventArgs e) { - decimal value = nupPopulationSize.Value; - lblPopulationSizePrediction.Text = (value * value).ToString(); + lblPopulationSizePrediction.Text = (nupPopulationWidth.Value * nupPopulationHeight.Value).ToString(); + } + private void nupPopulationHeight_ValueChanged(object sender, EventArgs e) + { + lblPopulationSizePrediction.Text = (nupPopulationWidth.Value * nupPopulationHeight.Value).ToString(); } private void Refresh() { @@ -76,5 +79,7 @@ namespace PropagationRemasteredBeta { } + + } } diff --git a/VsProject/PropagationRemasteredBeta/PropagationRemasteredBeta.csproj b/VsProject/PropagationRemasteredBeta/PropagationRemasteredBeta.csproj index 7d73559..5644347 100644 --- a/VsProject/PropagationRemasteredBeta/PropagationRemasteredBeta.csproj +++ b/VsProject/PropagationRemasteredBeta/PropagationRemasteredBeta.csproj @@ -79,6 +79,7 @@ True Resources.resx + True SettingsSingleFileGenerator @@ -93,5 +94,8 @@ + + + \ No newline at end of file diff --git a/VsProject/PropagationRemasteredBeta/Properties/Resources.Designer.cs b/VsProject/PropagationRemasteredBeta/Properties/Resources.Designer.cs index 33596cf..ac16388 100644 --- a/VsProject/PropagationRemasteredBeta/Properties/Resources.Designer.cs +++ b/VsProject/PropagationRemasteredBeta/Properties/Resources.Designer.cs @@ -1,71 +1,73 @@ //------------------------------------------------------------------------------ // -// Ce code a été généré par un outil. -// Version du runtime :4.0.30319.42000 +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 // -// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si -// le code est régénéré. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. // //------------------------------------------------------------------------------ -namespace PropagationRemasteredBeta.Properties -{ - - +namespace PropagationRemasteredBeta.Properties { + using System; + + /// - /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder - // à l'aide d'un outil, tel que ResGen ou Visual Studio. - // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen - // avec l'option /str ou régénérez votre projet VS. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// - /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe. + /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PropagationRemasteredBeta.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// - /// Remplace la propriété CurrentUICulture du thread actuel pour toutes - /// les recherches de ressources à l'aide de cette classe de ressource fortement typée. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap loading { + get { + object obj = ResourceManager.GetObject("loading", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/VsProject/PropagationRemasteredBeta/Properties/Resources.resx b/VsProject/PropagationRemasteredBeta/Properties/Resources.resx index af7dbeb..9a598d4 100644 --- a/VsProject/PropagationRemasteredBeta/Properties/Resources.resx +++ b/VsProject/PropagationRemasteredBeta/Properties/Resources.resx @@ -46,7 +46,7 @@ mimetype: application/x-microsoft.net.object.binary.base64 value : The object must be serialized with - : System.Serialization.Formatters.Binary.BinaryFormatter + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter : and then encoded with base64 encoding. mimetype: application/x-microsoft.net.object.soap.base64 @@ -60,6 +60,7 @@ : and then encoded with base64 encoding. --> + @@ -68,9 +69,10 @@ - + + @@ -85,9 +87,10 @@ - + + @@ -109,9 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ..\Resources\loading.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/VsProject/PropagationRemasteredBeta/Resources/loading.png b/VsProject/PropagationRemasteredBeta/Resources/loading.png new file mode 100644 index 0000000..0c9fd66 Binary files /dev/null and b/VsProject/PropagationRemasteredBeta/Resources/loading.png differ diff --git a/VsProject/PropagationRemasteredBeta/SimulationVue.cs b/VsProject/PropagationRemasteredBeta/SimulationVue.cs index 2175384..e9fea80 100644 --- a/VsProject/PropagationRemasteredBeta/SimulationVue.cs +++ b/VsProject/PropagationRemasteredBeta/SimulationVue.cs @@ -69,6 +69,10 @@ namespace PropagationRemasteredBeta } else { + //I dont know why but this does not display immediatly after pressing the button + pbxTerrain.Image = Properties.Resources.loading; + //this.Invalidate(); + started = true; btnStartNormal.Text = "Stop"; btnStartOneForAll.Text = "Stop"; @@ -76,6 +80,8 @@ namespace PropagationRemasteredBeta t = new Terrain(terrainSize, infectedProportion, resistantProportion, deathRate, infectionRate, cureTime); frameCount = 0; + pbxTerrain.Image = Properties.Resources.loading; + switch (mode) { case 1: @@ -124,8 +130,6 @@ namespace PropagationRemasteredBeta BufferImage = t.Display(); - - if (needToSave) { Save(BufferImage, frameCount); @@ -137,7 +141,6 @@ namespace PropagationRemasteredBeta lblFrameCount.Text = frameCount.ToString(); lblTotalTime.Text = totalTime.ToString(); - //refresh all the stats lblMemory.Text = GetMemoryUsage().ToString() + " Mb"; lblelementsCounter.Text = t.DRAWED_ELEMENTS.ToString(); @@ -196,6 +199,7 @@ namespace PropagationRemasteredBeta private void SimulationVue_Load(object sender, EventArgs e) { lblSimulationName.Text = simulationName; + //pbxTerrain.Image = Properties.Resources.loading; } } }