Fix PureResolve
This commit is contained in:
@@ -35,7 +35,7 @@ public partial class Flask : TextureRect, IChemicalContainer
|
||||
if (fc.Mixture.HeterogeneousMixture == HeterogeneousMixture.Null)
|
||||
{
|
||||
Map.Remove(fc);
|
||||
RemoveChild(fc);
|
||||
InnerLayer.RemoveChild(fc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ using VirtualChemistry.Chemistry.Mixtures.Implements;
|
||||
public partial class MainControlPanel : HBoxContainer
|
||||
{
|
||||
private HSlider EnvTemperature { get; set; }
|
||||
|
||||
private HSlider ContainerVolume { get; set; }
|
||||
private HomogeneousMixture SelectedMixture { get; set; }
|
||||
private Label Density { get; set; }
|
||||
@@ -14,6 +13,8 @@ public partial class MainControlPanel : HBoxContainer
|
||||
private Label HeatConductivity { get; set; }
|
||||
private Label Amount { get; set; }
|
||||
private Label Temperature { get; set; }
|
||||
private Label FreeVolume { get; set; }
|
||||
private Label Stiffness { get; set; }
|
||||
private Tree Compounds { get; set; }
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
@@ -25,16 +26,13 @@ public partial class MainControlPanel : HBoxContainer
|
||||
HeatConductivity = GetNode<Label>("V2/HHeatConductivity/HeatConductivity");
|
||||
Amount = GetNode<Label>("V2/HAmount/Amount");
|
||||
Temperature = GetNode<Label>("V2/HTemperature/Temperature");
|
||||
FreeVolume = GetNode<Label>("V2/HFreeVolume/FreeVolume");
|
||||
Stiffness = GetNode<Label>("V2/HStiffnesss/Stiffness");
|
||||
Compounds = GetNode<Tree>("V3/Compounds");
|
||||
|
||||
GlobalScene.MainControlPanel = this;
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
}
|
||||
|
||||
public void Update(HomogeneousMixture mixture)
|
||||
{
|
||||
SelectedMixture = mixture;
|
||||
@@ -50,7 +48,9 @@ public partial class MainControlPanel : HBoxContainer
|
||||
HeatConductivity.Text = $"{SelectedMixture.HeatConductivity.Get}";
|
||||
Amount.Text = $"{SelectedMixture.Amount}";
|
||||
Temperature.Text = $"{SelectedMixture.Temperature}";
|
||||
|
||||
FreeVolume.Text = $"{SelectedMixture.FreeVolume}";
|
||||
Stiffness.Text = $"{SelectedMixture.CompressionStiffness}";
|
||||
BuildTree();
|
||||
}
|
||||
|
||||
private void BuildTree()
|
||||
@@ -79,4 +79,33 @@ public partial class MainControlPanel : HBoxContainer
|
||||
.GetMeta("isoExp")
|
||||
.AsString();
|
||||
}
|
||||
|
||||
private void OneStep()
|
||||
{
|
||||
GlobalScene.Flask.Content.OneStep();
|
||||
GlobalScene.Flask.Update();
|
||||
}
|
||||
|
||||
private void RemoveTop()
|
||||
{
|
||||
GlobalScene.Flask.Content.RemoveTop();
|
||||
GlobalScene.Flask.Update();
|
||||
}
|
||||
|
||||
private void RemoveBottom()
|
||||
{
|
||||
GlobalScene.Flask.Content.RemoveBottom();
|
||||
GlobalScene.Flask.Update();
|
||||
}
|
||||
|
||||
private void SetTemperature(float temp)
|
||||
{
|
||||
GlobalScene.Flask.EnvironmentTemperature = temp;
|
||||
}
|
||||
|
||||
private void SetVolume(float vol)
|
||||
{
|
||||
GlobalScene.Flask.ContainerVolume = vol;
|
||||
GlobalScene.Flask.Update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,9 @@ text = "Env Temperature"
|
||||
|
||||
[node name="EnvTemperature" type="HSlider" parent="V1"]
|
||||
layout_mode = 2
|
||||
max_value = 9.0
|
||||
step = 0.1
|
||||
value = 1.0
|
||||
|
||||
[node name="Label2" type="Label" parent="V1"]
|
||||
layout_mode = 2
|
||||
@@ -37,6 +40,10 @@ text = "Container Volume"
|
||||
|
||||
[node name="ContainerVolume" type="HSlider" parent="V1"]
|
||||
layout_mode = 2
|
||||
min_value = 0.2
|
||||
max_value = 20.0
|
||||
step = 0.2
|
||||
value = 1.0
|
||||
|
||||
[node name="VSeparator" type="VSeparator" parent="."]
|
||||
layout_mode = 2
|
||||
@@ -103,6 +110,28 @@ text = "Temperature: "
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
[node name="HFreeVolume" type="HBoxContainer" parent="V2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="V2/HFreeVolume"]
|
||||
layout_mode = 2
|
||||
text = "Free Volums: "
|
||||
|
||||
[node name="FreeVolume" type="Label" parent="V2/HFreeVolume"]
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
[node name="HStiffnesss" type="HBoxContainer" parent="V2"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="V2/HStiffnesss"]
|
||||
layout_mode = 2
|
||||
text = "Stiffness: "
|
||||
|
||||
[node name="Stiffness" type="Label" parent="V2/HStiffnesss"]
|
||||
layout_mode = 2
|
||||
text = "0"
|
||||
|
||||
[node name="VSeparator2" type="VSeparator" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -120,4 +149,9 @@ layout_mode = 2
|
||||
[node name="VSeparator4" type="VSeparator" parent="."]
|
||||
layout_mode = 2
|
||||
|
||||
[connection signal="pressed" from="V1/OneStep" to="." method="OneStep"]
|
||||
[connection signal="pressed" from="V1/RemoveTop" to="." method="RemoveTop"]
|
||||
[connection signal="pressed" from="V1/RemoveBottom" to="." method="RemoveBottom"]
|
||||
[connection signal="value_changed" from="V1/EnvTemperature" to="." method="SetTemperature"]
|
||||
[connection signal="value_changed" from="V1/ContainerVolume" to="." method="SetVolume"]
|
||||
[connection signal="item_selected" from="V3/Compounds" to="." method="IsomerSelectedHandler"]
|
||||
|
||||
@@ -12,12 +12,6 @@ public partial class VirtualChemDemo : Node2D
|
||||
ExpressionLoader.Visible = true;
|
||||
}
|
||||
|
||||
public void OneStep()
|
||||
{
|
||||
Flask.Content.OneStep();
|
||||
Flask.Update();
|
||||
}
|
||||
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
@@ -26,7 +20,6 @@ public partial class VirtualChemDemo : Node2D
|
||||
FullRepr = GetNode<RichTextLabel>("HRepr/FullRepr");
|
||||
Flask = GetNode<Flask>("Flask");
|
||||
GlobalScene.Demo = this;
|
||||
|
||||
}
|
||||
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
|
||||
Reference in New Issue
Block a user