Skip to content

Commit

Permalink
Updated setup and help files
Browse files Browse the repository at this point in the history
  • Loading branch information
Proektsoftbg committed Dec 16, 2024
1 parent 67d0378 commit a82b32f
Show file tree
Hide file tree
Showing 30 changed files with 2,944 additions and 145 deletions.
2 changes: 1 addition & 1 deletion Calcpad.Api/PyCalcpad/PyCalcpad.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AnalysisLevel>latest</AnalysisLevel>
<RootNamespace>PyCalcpad</RootNamespace>
<OutputType>Library</OutputType>
<Version>7.1.4</Version>
<Version>7.1.5</Version>
<Authors>Nedelcho Ganchovski</Authors>
<Company>Proektsoft EOOD</Company>
<GenerateRuntimeConfigFiles>true</GenerateRuntimeConfigFiles>
Expand Down
2 changes: 1 addition & 1 deletion Calcpad.Cli/Calcpad.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<LangVersion>latest</LangVersion>
<AnalysisLevel>latest</AnalysisLevel>
<RootNamespace>Calcpad.Cli</RootNamespace>
<Version>7.1.4</Version>
<Version>7.1.5</Version>
<Authors>Nedelcho Ganchovski</Authors>
<Company>Proektsoft EOOD</Company>
<PackageId>Cli</PackageId>
Expand Down
28 changes: 19 additions & 9 deletions Calcpad.Core/Plotter/Plotter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ protected void DrawGridPng(SKCanvas canvas, double x0, double y0, double xs, dou
using var gridPen = CreateGridPen();
using var axisPen = CreateAxisPen();
using var textPen = CreateTextPen();
using var framePen = CreateFramePen();
var sz = new SKRect();
textPen.MeasureText(" -0.12 ", ref sz);
var tw = sz.Width / 5f;
Expand Down Expand Up @@ -148,7 +149,7 @@ protected void DrawGridPng(SKCanvas canvas, double x0, double y0, double xs, dou
xg += stepX;
}
textPen.TextAlign = SKTextAlign.Left;
canvas.DrawRect(Left, Margin, xn - Left, yn - Margin, axisPen);
canvas.DrawRect(Left, Margin, xn - Left, yn - Margin, framePen);
if (y0 >= Margin - 0.1 && y0 <= yn + 0.1)
{
canvas.DrawLine(Left, (float)y0, xn, (float)y0, axisPen);
Expand All @@ -172,35 +173,44 @@ protected void DrawGridPng(SKCanvas canvas, double x0, double y0, double xs, dou
protected SKPaint CreateGridPen() => new()
{
Style = SKPaintStyle.Stroke,
Color = SKColors.Black.WithAlpha(15),
Color = SKColors.Black.WithAlpha(20),
StrokeWidth = ScreenScaleFactor,
IsAntialias = true
};

protected SKPaint CreateFramePen() => new()
{
Style = SKPaintStyle.Stroke,
Color = SKColors.Black.WithAlpha(62),
StrokeWidth = ScreenScaleFactor,
IsAntialias = true
};

protected SKPaint CreateAxisPen() => new()
{
Style = SKPaintStyle.Stroke,
Color = SKColors.Black.WithAlpha(60),
Color = SKColors.Black,
StrokeWidth = ScreenScaleFactor,
IsAntialias = true
};


protected SKPaint CreateTextPen() => new()
{
Style = SKPaintStyle.StrokeAndFill,
Color = SKColors.Black,
StrokeWidth = 0.5f,
Typeface = SKTypeface.FromFamilyName("Segoe UI"),
TextSize = 10f * ScreenScaleFactor,
TextSize = 12f * ScreenScaleFactor,
TextAlign = SKTextAlign.Left,
IsAntialias = true,
IsAutohinted = true
};

protected void DrawGridSvg(SvgDrawing canvas, double x0, double y0, double xs, double ys, Box bounds)
{
double tw = 5 * ScreenScaleFactor;
double th = 4 * ScreenScaleFactor;
double tw = 5.5 * ScreenScaleFactor;
double th = 4.5 * ScreenScaleFactor;
double th05 = th / 2.0;
double xn = Width - Right;
double yn = Height - Margin;
Expand All @@ -218,6 +228,7 @@ protected void DrawGridSvg(SvgDrawing canvas, double x0, double y0, double xs, d
var a = 4f * ScreenScaleFactor;
var xt = Left - tw / 2f - a / 2f;
string s;
canvas.DrawRectangle(Left, Margin, xn - Left, yn - Margin, "PlotFrame");
while ((yg < max) == (stepY > 0))
{
var y = y0 - yg * ys;
Expand Down Expand Up @@ -253,7 +264,7 @@ protected void DrawGridSvg(SvgDrawing canvas, double x0, double y0, double xs, d
xg += stepX;

max = bounds.Right + tol;
var yt = yn + 2f * th + 1.5 * a;
var yt = yn + 2f * th + a;
isScientific = Math.Abs(bounds.Right) + Math.Abs(bounds.Left) >= 20000;
if (midLine)
{
Expand Down Expand Up @@ -287,7 +298,6 @@ protected void DrawGridSvg(SvgDrawing canvas, double x0, double y0, double xs, d

xg += stepX;
}
canvas.DrawRectangle(Left, Margin, xn - Left, yn - Margin, "PlotAxis");
if (y0 >= Margin - 0.1 && y0 <= yn + 0.1)
{
canvas.DrawLine(Left, y0, xn, y0, "PlotAxis");
Expand All @@ -296,7 +306,7 @@ protected void DrawGridSvg(SvgDrawing canvas, double x0, double y0, double xs, d
if (x0 >= Left - 0.1 && x0 <= xn + 0.1)
{
canvas.DrawLine(x0, Margin, x0, yn, "PlotAxis");
canvas.DrawText("y", x0 + tw/2d, Margin - th - a/2d);
canvas.DrawText("y", x0, Margin - 2*th, "middle");
}
var sy0 = OutputWriter.FormatNumberHelper(bounds.Bottom, 2);
var sy1 = OutputWriter.FormatNumberHelper(bounds.Top, 2);
Expand Down
15 changes: 8 additions & 7 deletions Calcpad.Core/Plotter/SvgDrawing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal SvgDrawing(double width, double height, double scaleFactor)
Height = Math.Round(height);
ScaleFactor = scaleFactor;
var k = 1.35 * scaleFactor;
_svgTag = $"<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewbox=\" 0 0 {Width} {Height}\" style=\"font-size: {3*scaleFactor}pt; width: {width/k}pt; height: {height/k}pt;\">";
_svgTag = $"<svg class=\"Plot\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewbox=\" 0 0 {Width} {Height}\" style=\"font-size: {3*scaleFactor}pt; width: {width/k}pt; height: {height/k}pt;\">";
_sb = new StringBuilder(_svgTag);
_sb.AppendLine();
AddStyle();
Expand Down Expand Up @@ -141,8 +141,9 @@ private void AddStyle()
{
var sf2 = 1.5 * ScaleFactor;
_sb.AppendLine("<style type=\"text/css\">");
_sb.AppendLine($".PlotGrid {{fill:none; stroke-width:{ScaleFactor}; stroke:Black; stroke-opacity:0.06;}}");
_sb.AppendLine($".PlotAxis {{fill:none; stroke-width:{ScaleFactor}; stroke:Black; stroke-opacity:0.24;}}");
_sb.AppendLine($".PlotGrid {{fill:none; stroke-width:{ScaleFactor}; stroke:Black; stroke-opacity:0.08;}}");
_sb.AppendLine($".PlotFrame {{fill:none; stroke-width:{ScaleFactor}; stroke:Black; stroke-opacity:0.24;}}");
_sb.AppendLine($".PlotAxis {{fill:none; stroke-width:{ScaleFactor}; stroke:Black;}}");
_sb.AppendLine($".PlotSeries1 {{fill:none; stroke-width:{sf2}; stroke:Red;}}");
_sb.AppendLine($".PlotSeries2 {{fill:none; stroke-width:{sf2}; stroke:Green;}}");
_sb.AppendLine($".PlotSeries3 {{fill:none; stroke-width:{sf2}; stroke:Blue;}}");
Expand Down Expand Up @@ -173,10 +174,10 @@ private void AddStyle()
_sb.AppendLine(".PlotFill8 {stroke:none; fill:DarkOrange; fill-opacity:0.020;}");
_sb.AppendLine(".PlotFill9 {stroke:none; fill:Maroon; fill-opacity:0.020;}");
_sb.AppendLine(".PlotFill10 {stroke:none; fill:YellowGreen; fill-opacity:0.020;}");
_sb.AppendLine($"text {{fill:Black; font-family:'Segoe UI', Sans; font-size:{10*ScaleFactor}px}}");
_sb.AppendLine("text.left {text-anchor: start;}");
_sb.AppendLine("text.middle {text-anchor: middle;}");
_sb.AppendLine("text.end {text-anchor: end;}");
_sb.AppendLine($".Plot text {{fill:Black; font-family:'Segoe UI', Sans; font-size:{12*ScaleFactor}px}}");
_sb.AppendLine(".Plot text.left {text-anchor: start;}");
_sb.AppendLine(".Plot text.middle {text-anchor: middle;}");
_sb.AppendLine(".Plot text.end {text-anchor: end;}");
_sb.AppendLine("</style>");
}

Expand Down
59 changes: 0 additions & 59 deletions Calcpad.Wpf/AppMessages.bg.resx
Original file line number Diff line number Diff line change
@@ -1,64 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
Expand Down
59 changes: 0 additions & 59 deletions Calcpad.Wpf/AppMessages.zh.resx
Original file line number Diff line number Diff line change
@@ -1,64 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
Expand Down
2 changes: 1 addition & 1 deletion Calcpad.Wpf/Calcpad.wpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.71" />
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.11" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion Calcpad.Wpf/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2387,7 +2387,7 @@ void FillDefined(Dictionary<string, int> defs, Brush foreground, string suffix =
var keys = defs.Keys;
foreach (var s in keys)
{
if (defs[s] < _currentLineNumber)
if (defs[s] < _currentLineNumber && !IsPlot(s))
{
var item = new ListBoxItem()
{
Expand All @@ -2402,6 +2402,13 @@ void FillDefined(Dictionary<string, int> defs, Brush foreground, string suffix =
}
}
}

bool IsPlot(string s) => s[0] == 'P' &&
(s.Equals("PlotWidth", StringComparison.Ordinal) ||
s.Equals("PlotHeight", StringComparison.Ordinal) ||
s.Equals("PlotStep", StringComparison.Ordinal) ||
s.Equals("PlotSVG", StringComparison.Ordinal)
);
}


Expand Down
2 changes: 1 addition & 1 deletion Calcpad.Wpf/MainWindowResources.zh.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="calcpad_download_help_html" xml:space="preserve">
<value>https://calcpad.eu/download/help.html</value>
<value>https://calcpad.eu/download/help.zh.html</value>
</data>
<data name="TryRestoreState_Recovered_SavePrompt" xml:space="preserve">
<value>Calcpad从意外关闭中恢复.
Expand Down
Binary file removed Setup/Linux/Calcpad.7.1.3.rpm
Binary file not shown.
Binary file removed Setup/Linux/Calcpad.7.1.3.tar.gz
Binary file not shown.
Binary file removed Setup/Linux/Calcpad.7.1.3.zip
Binary file not shown.
Binary file removed Setup/Linux/Calcpad.7.1.4.deb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions Setup/Linux/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ sudo apt remove dotnet*
sudo snap install chromium
```
3. Download the Calcpad setup package from the following link:
https://github.com/Proektsoftbg/Calcpad/blob/main/Setup/Linux/Calcpad.7.1.4.deb
https://github.com/Proektsoftbg/Calcpad/blob/main/Setup/Linux/Calcpad.7.1.5.deb

Then, install Calcpad, using the following command:
```
sudo apt-get install -y <path-to-your-downloads-folder>/Calcpad.7.1.4.deb
sudo apt-get install -y <path-to-your-downloads-folder>/Calcpad.7.1.5.deb
```
Instead of `<path-to-your-downloads-folder>` you must put the actual path, something like this:
```
sudo apt-get install -y /home/ned/snap/chromium/2795/Downloads/Calcpad.7.1.4.deb
sudo apt-get install -y /home/ned/snap/chromium/2795/Downloads/Calcpad.7.1.5.deb
```
If you get a message like the one bellow, please ignore it:
N: Download is performed unsandboxed as root as file '.../Calcpad.7.1.4.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
N: Download is performed unsandboxed as root as file '.../Calcpad.7.1.5.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

And that's it. You can start the Calcpad command line interpreter (CLI) by simply typing:
```
Expand Down
1 change: 1 addition & 0 deletions Setup/Linux/Sublime/calcpad.sublime-completions
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"PeV",
"PlotHeight",
"PlotStep",
"PlotSVG",
"PlotWidth",
"Precision",
"Rd",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@
<KeyWord name="pL" />
<KeyWord name="PlotHeight" />
<KeyWord name="PlotStep" />
<KeyWord name="PlotSVG" />
<KeyWord name="PlotWidth" />
<KeyWord name="pm" />
<KeyWord name="pole" />
Expand Down
Loading

0 comments on commit a82b32f

Please sign in to comment.