Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diff between RC branch and 3.1 Switch on Main branch #14725

Merged
merged 6 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Windows;
using System.Windows.Controls;
using Dynamo.Logging;
using Dynamo.Models;
using Dynamo.Utilities;
using DynamoUtilities;
using Microsoft.Web.WebView2.Core;
Expand Down Expand Up @@ -216,7 +217,14 @@ public void Dispose()
#region ILogSource Implementation
private void Log(string message)
{
viewModel.MessageLogged?.Invoke(LogMessage.Info(message));
if (DynamoModel.IsTestMode)
{
System.Console.WriteLine(message);
}
else
{
viewModel?.MessageLogged?.Invoke(LogMessage.Info(message));
}
}
#endregion
}
Expand Down
63 changes: 63 additions & 0 deletions src/DynamoCoreWpf/Properties/Resources.Designer.cs

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

23 changes: 22 additions & 1 deletion src/DynamoCoreWpf/Properties/Resources.en-US.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3861,4 +3861,25 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="NotificationToAgreeMLNodeautocompleteTOU" xml:space="preserve">
<value>To access the Recommended Nodes feature, please read and accept Dynamo &gt; Agreement and Terms of Use.</value>
</data>
</root>
<data name="GESUnitCentimeters" xml:space="preserve">
<value>Centimeters</value>
</data>
<data name="GESUnitFeet" xml:space="preserve">
<value>Feet</value>
</data>
<data name="GESUnitInches" xml:space="preserve">
<value>Inches</value>
</data>
<data name="GESUnitKilometers" xml:space="preserve">
<value>Kilometers</value>
</data>
<data name="GESUnitMeters" xml:space="preserve">
<value>Meters</value>
</data>
<data name="GESUnitMiles" xml:space="preserve">
<value>Miles</value>
</data>
<data name="GESUnitMillimeters" xml:space="preserve">
<value>Millimeters</value>
</data>
</root>
25 changes: 23 additions & 2 deletions src/DynamoCoreWpf/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3602,7 +3602,7 @@ You can manage this in Preferences -&gt; Security.</value>
<data name="PackageDeprecatedTooltip" xml:space="preserve">
<value>This package is outdated and cannot be installed.</value>
</data>
<data name="PackageManagerMyPackagesPublishVersion" xml:space="preserve">
<data name="PackageManagerMyPackagesPublishVersion" xml:space="preserve">
<value>Publish Version</value>
</data>
<data name="SplashScreenViewExtensions" xml:space="preserve">
Expand Down Expand Up @@ -3848,4 +3848,25 @@ In certain complex graphs or host program scenarios, Automatic mode may cause in
<data name="NotificationToAgreeMLNodeautocompleteTOU" xml:space="preserve">
<value>To access the Recommended Nodes feature, please read and accept Dynamo &gt; Agreement and Terms of Use.</value>
</data>
</root>
<data name="GESUnitCentimeters" xml:space="preserve">
<value>Centimeters</value>
</data>
<data name="GESUnitFeet" xml:space="preserve">
<value>Feet</value>
</data>
<data name="GESUnitInches" xml:space="preserve">
<value>Inches</value>
</data>
<data name="GESUnitKilometers" xml:space="preserve">
<value>Kilometers</value>
</data>
<data name="GESUnitMeters" xml:space="preserve">
<value>Meters</value>
</data>
<data name="GESUnitMiles" xml:space="preserve">
<value>Miles</value>
</data>
<data name="GESUnitMillimeters" xml:space="preserve">
<value>Millimeters</value>
</data>
</root>
6 changes: 1 addition & 5 deletions src/DynamoCoreWpf/UI/Converters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
using Dynamo.Search.SearchElements;
using Dynamo.UI;
using Dynamo.UI.Controls;
using Dynamo.Updates;
using Dynamo.Utilities;
using Dynamo.ViewModels;
using Dynamo.Wpf.Properties;
Expand Down Expand Up @@ -3898,10 +3897,7 @@ public object Convert(object value, Type targetType, object parameter,
CultureInfo culture)
{
if (value is string nullOrEmptyString && String.IsNullOrEmpty(nullOrEmptyString)) return Visibility.Visible;
if (value is string zeroString && zeroString.Equals("0"))
{
return Visibility.Visible;
}

return Visibility.Collapsed;
}

Expand Down
31 changes: 30 additions & 1 deletion src/DynamoCoreWpf/ViewModels/Menu/PreferencesViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,35 @@ public bool importSettingsContent(string content)
return setSettings(newPreferences);
}

/// <summary>
/// Returns localized resource strings for Units
/// </summary>
private string GetLocalizedUnits(Enum value)
{
if (value != null)
{
switch (value)
{
case Configurations.Units.Millimeters:
return Res.GESUnitMillimeters;
case Configurations.Units.Centimeters:
return Res.GESUnitCentimeters;
case Configurations.Units.Kilometers:
return Res.GESUnitKilometers;
case Configurations.Units.Meters:
return Res.GESUnitMeters;
case Configurations.Units.Inches:
return Res.GESUnitInches;
case Configurations.Units.Feet:
return Res.GESUnitFeet;
case Configurations.Units.Miles:
return Res.GESUnitMiles;
}
}
return null;
}


private bool setSettings(PreferenceSettings newPreferences)
{
// Explicit copy
Expand Down Expand Up @@ -1381,7 +1410,7 @@ public PreferencesViewModel(DynamoViewModel dynamoViewModel)
SelectedLanguage = Configurations.SupportedLocaleDic.FirstOrDefault(x => x.Value == preferenceSettings.Locale).Key;

// Chose the scaling unit, if option is allowed by user
UnitList = Configurations.SupportedUnits.Keys.Select(x => x.ToString()).ToObservableCollection();
UnitList = Configurations.SupportedUnits.Keys.Select(x => GetLocalizedUnits(x)).ToObservableCollection();
SelectedUnits = Configurations.SupportedUnits.FirstOrDefault(x => x.Key.ToString() == preferenceSettings.GraphicScaleUnit).Key.ToString();

GroupStyleFontSizeList = preferenceSettings.PredefinedGroupStyleFontSizes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2411,22 +2411,6 @@ private void PreviewPackageBuild()
.ToList();
try
{
var unqualifiedFiles = GetAllUnqualifiedFiles();

if (files == null || files.Count() < 1 || unqualifiedFiles.Count() > 0)
{
string filesCannotBePublished = null;
foreach (var file in unqualifiedFiles)
{
filesCannotBePublished = filesCannotBePublished + file + "\n";
}
string FileNotPublishMessage = string.Format(Resources.FileNotPublishMessage, filesCannotBePublished);
UploadState = PackageUploadHandle.State.Error;
MessageBoxResult response = DynamoModel.IsTestMode ? MessageBoxResult.OK : MessageBoxService.Show(Owner, FileNotPublishMessage, Resources.FileNotPublishCaption, MessageBoxButton.OK, MessageBoxImage.Error);

return;
}

// Generate the Package Name, either based on the user 'Description', or the root path name, if no 'Description' yet
var packageName = !string.IsNullOrEmpty(Name) ? Name : Path.GetFileName(publishPath);
var rootItemPreview = RetainFolderStructureOverride ?
Expand Down
4 changes: 1 addition & 3 deletions src/DynamoSandbox/DynamoSandbox.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<PropertyGroup>
<ApplicationIcon>logo_square_32x32.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\DynamoApplications\DynamoApplications.csproj">
<Project>{aa782772-fe61-4226-baa4-eb529fa1646b}</Project>
Expand Down Expand Up @@ -54,9 +55,6 @@
<Name>DynamoShapeManager</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\logo_square_32x32.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="logo_square_32x32.ico" />
</ItemGroup>
Expand Down
31 changes: 0 additions & 31 deletions src/DynamoSandbox/app.config

This file was deleted.

58 changes: 8 additions & 50 deletions src/Engine/ProtoAssociative/CodeGen_SSA.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ProtoCore.AST.AssociativeAST;
using ProtoCore.AST.AssociativeAST;
using ProtoCore.DSASM;
using ProtoCore.Utils;
using System.Collections.Generic;
Expand Down Expand Up @@ -275,7 +275,11 @@ private List<AssociativeNode> BuildSSA(List<AssociativeNode> astList, ProtoCore.
BinaryExpressionNode bnode = (node as BinaryExpressionNode);
int generatedUID = ProtoCore.DSASM.Constants.kInvalidIndex;

if (context.applySSATransform && core.Options.GenerateSSA)
// Skip SSA for input ASTs that are first assigned null such as this:
// a = null; (update "a") => a = <some primitive>;
// SSA would break up the null AST into two assignments, which then breaks update:
// a = null; (SSA) => temp = null; a = temp;
if (context.applySSATransform && core.Options.GenerateSSA && !bnode.IsInputExpression)
{
int ssaID = ProtoCore.DSASM.Constants.kInvalidIndex;
string name = ProtoCore.Utils.CoreUtils.GenerateIdentListNameString(bnode.LeftNode);
Expand Down Expand Up @@ -382,53 +386,6 @@ private List<AssociativeNode> BuildSSA(List<AssociativeNode> astList, ProtoCore.
return astList;
}

private void DfsSSAIeentList(AssociativeNode node, ref Stack<AssociativeNode> ssaStack, ref List<AssociativeNode> astlist)
{
if (node is IdentifierListNode)
{
IdentifierListNode listNode = node as IdentifierListNode;

bool isSingleDot = !(listNode.LeftNode is IdentifierListNode) && !(listNode.RightNode is IdentifierListNode);
if (isSingleDot)
{
BinaryExpressionNode bnode = BuildSSAIdentListAssignmentNode(listNode);
astlist.Add(bnode);
ssaStack.Push(bnode);
}
else
{
DfsSSAIeentList(listNode.LeftNode, ref ssaStack, ref astlist);

IdentifierListNode newListNode = node as IdentifierListNode;
newListNode.Optr = Operator.dot;

AssociativeNode leftnode = ssaStack.Pop();
Validity.Assert(leftnode is BinaryExpressionNode);

newListNode.LeftNode = (leftnode as BinaryExpressionNode).LeftNode;
newListNode.RightNode = listNode.RightNode;

BinaryExpressionNode bnode = BuildSSAIdentListAssignmentNode(newListNode);
astlist.Add(bnode);
ssaStack.Push(bnode);

}
}
else if (node is FunctionCallNode)
{
FunctionCallNode fcNode = node as FunctionCallNode;
for (int idx = 0; idx < fcNode.FormalArguments.Count; idx++)
{
AssociativeNode arg = fcNode.FormalArguments[idx];

Stack<AssociativeNode> ssaStack1 = new Stack<AssociativeNode>();
DFSEmitSSA_AST(arg, ssaStack1, ref astlist);
AssociativeNode argNode = ssaStack.Pop();
fcNode.FormalArguments[idx] = argNode is BinaryExpressionNode ? (argNode as BinaryExpressionNode).LeftNode : argNode;
}
}
}

private void DFSEmitSSA_AST(AssociativeNode node, Stack<AssociativeNode> ssaStack, ref List<AssociativeNode> astlist)
{
Validity.Assert(null != astlist && null != ssaStack);
Expand Down Expand Up @@ -488,7 +445,8 @@ private void DFSEmitSSA_AST(AssociativeNode node, Stack<AssociativeNode> ssaStac

var bnode = AstFactory.BuildAssignment(leftNode, rightNode);
bnode.isSSAAssignment = isSSAAssignment;
bnode.IsInputExpression = astBNode.IsInputExpression;
// TODO: SSA is not called for ASTs that are input expressions. Revisit this if there are any issues.
// bnode.IsInputExpression = astBNode.IsInputExpression;

astlist.Add(bnode);
ssaStack.Push(bnode);
Expand Down
3 changes: 2 additions & 1 deletion src/Engine/ProtoCore/DSASM/InstructionSet.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using ProtoCore.Exceptions;
Expand All @@ -10,6 +10,7 @@ namespace ProtoCore.DSASM
public enum Registers
{
RX,
// Register used to temporarily store primitive values for graph update cycles.
LX,
}

Expand Down
2 changes: 1 addition & 1 deletion src/Libraries/CoreNodeModels/Enum.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
Expand Down
Loading
Loading