Skip to content

Commit

Permalink
累计同步更新
Browse files Browse the repository at this point in the history
  • Loading branch information
cdy816 committed Feb 21, 2022
1 parent c973457 commit 8d54972
Show file tree
Hide file tree
Showing 118 changed files with 18,413 additions and 1,149 deletions.
Binary file modified .vs/slnx.sqlite
Binary file not shown.
11 changes: 11 additions & 0 deletions Common/Cdy.Tag.Common/Common/DateTimeSpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace Cdy.Tag
{
Expand Down Expand Up @@ -80,6 +81,16 @@ public bool Contains(DateTime time)
return time >= Start & time < End;
}

/// <summary>
///
/// </summary>
/// <param name="times"></param>
/// <returns></returns>
public IEnumerable<DateTime> GetCrossTime(IEnumerable<DateTime> times)
{
return times.Where(e => Contains(e));
}

/// <summary>
///
/// </summary>
Expand Down
20 changes: 20 additions & 0 deletions Common/Cdy.Tag/ITagQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ public interface ITagManager
/// <returns></returns>
Tagbase GetTagByName(string name);

/// <summary>
///
/// </summary>
/// <param name="group"></param>
/// <returns></returns>
List<Tagbase> GetTagsByGroup(string group);

/// <summary>
///
/// </summary>
/// <param name="tagnames"></param>
/// <returns></returns>
IEnumerable<Tagbase> GetTagsByName(IEnumerable<string> tagnames);

/// <summary>
///
/// </summary>
Expand All @@ -63,6 +77,12 @@ public interface ITagManager
/// <returns></returns>
IEnumerable<Tagbase> ListAllTags();

/// <summary>
///
/// </summary>
/// <returns></returns>
IEnumerable<string> ListTagGroups();

/// <summary>
///
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Common/Cdy.Tag/Interface/QueryValueCalType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public enum QueryValueMatchType
}

/// <summary>
///
/// 数字型变量比较类型
/// </summary>
public enum NumberStatisticsType
{
Expand Down
32 changes: 30 additions & 2 deletions Common/Cdy.Tag/Real/RealDatabase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,16 @@ public List<Tagbase> GetTagsById(List<int> ids)
return re;
}

/// <summary>
///
/// </summary>
/// <param name="tagnames"></param>
/// <returns></returns>
public IEnumerable<Tagbase> GetTagsByName(IEnumerable<string> tagnames)
{
return Tags.Values.Where(e => tagnames.Contains(e.FullName));
}

/// <summary>
///
/// </summary>
Expand Down Expand Up @@ -452,33 +462,38 @@ public List<Tagbase> GetTagsByGroup(string group)
///
/// </summary>
/// <param name="group"></param>
public void RemoveByGroup(string group)
public List<int> RemoveByGroup(string group)
{
List<int> re = new List<int>();
if (this.Groups.ContainsKey(group))
{
var vv = this.Groups[group].Tags;
foreach (var vvv in vv)
{
Tags.Remove(vvv.Id);
re.Add(vvv.Id);
}
vv.Clear();
MinId = Tags.Keys.Count > 0 ? Tags.Keys.Min() : 0;
IsDirty = true;
}
return re;
}

/// <summary>
///
/// </summary>
/// <param name="group"></param>
public void RemoveGroup(string group)
public List<int> RemoveGroup(string group)
{
List<int> re = new List<int>();
if (this.Groups.ContainsKey(group))
{
var vv = this.Groups[group].Tags;
foreach (var vvv in vv)
{
Tags.Remove(vvv.Id);
re.Add(vvv.Id);
}

//获取改组的所有子组
Expand All @@ -489,6 +504,7 @@ public void RemoveGroup(string group)
foreach (var vvv in vvg.Tags)
{
Tags.Remove(vvv.Id);
re.Add(vvv.Id);
}
vvg.Tags.Clear();
}
Expand All @@ -503,6 +519,7 @@ public void RemoveGroup(string group)

IsDirty = true;
}
return re;
}

/// <summary>
Expand Down Expand Up @@ -764,6 +781,17 @@ public IEnumerable<Tagbase> ListAllTags()
return Tags.Values;
}

/// <summary>
///
/// </summary>
/// <returns></returns>
public IEnumerable<string> ListTagGroups()
{
var re = Groups.Keys.ToList();
re.Add("");
return re;
}

/// <summary>
///
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Common/Cdy.Tag/Real/Tagbase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public abstract class FloatingTagBase : NumberTagBase
/// <summary>
/// 小数位数
/// </summary>
public byte Precision { get; set; } = 6;
public byte Precision { get; set; } = 2;
#endregion ...Properties...

#region ... Methods ...
Expand Down
6 changes: 4 additions & 2 deletions Common/Cdy.Tag/TagValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public struct RealTagValue
public object Value { get; set; }

/// <summary>
///
/// 值类型
/// <see cref="Cdy.Tag.TagType"/>
/// </summary>
public byte ValueType { get; set; }

Expand Down Expand Up @@ -139,7 +140,8 @@ public struct RealTagValue2
public object Value { get; set; }

/// <summary>
///
/// 值类型
/// <see cref="Cdy.Tag.TagType"/>
/// </summary>
public byte ValueType { get; set; }

Expand Down
9 changes: 8 additions & 1 deletion Develop/DBDevelopService/Services/DevelopServerService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,14 @@ public override Task<BoolResultReplay> RemoveTagGroup(RemoveGroupRequest request
lock (db)
{
DbManager.Instance.CheckAndContinueLoadDatabase(db);
db.RealDatabase.RemoveGroup(request.Name);
var reids = db.RealDatabase.RemoveGroup(request.Name);
if (reids != null && reids.Count > 0)
{
foreach (var vv in reids)
{
db.HisDatabase.RemoveHisTag(vv);
}
}
}
return Task.FromResult(new BoolResultReplay() { Result = true });
}
Expand Down
10 changes: 10 additions & 0 deletions Develop/DbManager.Desktop/DBInStudio.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
<WarningLevel>3</WarningLevel>
</PropertyGroup>

<ItemGroup>
<Compile Remove="DataMonitor\**" />
<EmbeddedResource Remove="DataMonitor\**" />
<None Remove="DataMonitor\**" />
<Page Remove="DataMonitor\**" />
</ItemGroup>

<ItemGroup>
<None Remove="Image\add.png" />
<None Remove="Image\alarm.png" />
Expand All @@ -36,6 +43,7 @@
<None Remove="Image\log-out.png" />
<None Remove="Image\max.png" />
<None Remove="Image\minus.png" />
<None Remove="Image\monitor.png" />
<None Remove="Image\mrdbd.ico" />
<None Remove="Image\ok.png" />
<None Remove="Image\permissions.png" />
Expand All @@ -62,6 +70,7 @@

<ItemGroup>
<ProjectReference Include="..\..\Common\Cdy.Tag\Cdy.Tag.csproj" />
<ProjectReference Include="..\..\Proxy\DBGrpcApi.Client\DBGrpcApi.Client.csproj" />
<ProjectReference Include="..\DBDevelopClientApi\DBDevelopClientApi.csproj" />
</ItemGroup>

Expand All @@ -85,6 +94,7 @@
<Resource Include="Image\log-out.png" />
<Resource Include="Image\max.png" />
<Resource Include="Image\minus.png" />
<Resource Include="Image\monitor.png" />
<Resource Include="Image\mrdbd.ico" />
<Resource Include="Image\ok.png" />
<Resource Include="Image\permissions.png" />
Expand Down
Binary file added Develop/DbManager.Desktop/Image/monitor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Develop/DbManager.Desktop/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,20 @@
</Button.ContentTemplate>
</Button>

<Border BorderBrush="LightGray" BorderThickness="1,0,0,0" Width="2" VerticalAlignment="Stretch" Margin="2,4" />

<Button BorderThickness="0" ToolTip="{local:ResMarker Monitor}" Command="{Binding StartMonitorCommand}" HorizontalAlignment="Left" Margin="10,0,0,0" Height="32" VerticalContentAlignment="Center" VerticalAlignment="Center" Width="80" >
<Button.ContentTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="/Image/monitor.png" Height="18" RenderOptions.BitmapScalingMode="HighQuality" />
<TextBlock Text="{local:ResMarker Monitor}" FontWeight="Bold" VerticalAlignment="Center" Margin="5,0"/>
</StackPanel>
</DataTemplate>
</Button.ContentTemplate>
</Button>


<Border BorderBrush="LightGray" BorderThickness="1,0,0,0" Width="2" VerticalAlignment="Stretch" Margin="2,4" Visibility="{Binding HasAlarmStudioConfig,Converter={StaticResource btv}}" />
<Button BorderThickness="0" ToolTip="{local:ResMarker Alarm}" Visibility="{Binding HasAlarmStudioConfig,Converter={StaticResource btv}}" Command="{Binding AlarmConfigCommand}" HorizontalAlignment="Left" Margin="10,0,0,0" Height="32" VerticalAlignment="Center" Width="80" >
<Button.ContentTemplate>
Expand Down
27 changes: 27 additions & 0 deletions Develop/DbManager.Desktop/Properties/Resources.Designer.cs

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

9 changes: 9 additions & 0 deletions Develop/DbManager.Desktop/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@
<data name="Modify" xml:space="preserve">
<value>Modify</value>
</data>
<data name="Monitor" xml:space="preserve">
<value>Monitor</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
Expand Down Expand Up @@ -343,6 +346,9 @@
<data name="PropertyPaste" xml:space="preserve">
<value>PropertyPaste</value>
</data>
<data name="Quality" xml:space="preserve">
<value>Quality</value>
</data>
<data name="Read" xml:space="preserve">
<value>Read</value>
</data>
Expand Down Expand Up @@ -494,6 +500,9 @@
<data name="UseTls" xml:space="preserve">
<value>UseTls</value>
</data>
<data name="Value" xml:space="preserve">
<value>Value</value>
</data>
<data name="ValueChanged" xml:space="preserve">
<value>ValueChanged</value>
</data>
Expand Down
9 changes: 9 additions & 0 deletions Develop/DbManager.Desktop/Properties/Resources.zh-CN.resx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@
<data name="Modify" xml:space="preserve">
<value>修改</value>
</data>
<data name="Monitor" xml:space="preserve">
<value>监视</value>
</data>
<data name="Name" xml:space="preserve">
<value>名称</value>
</data>
Expand Down Expand Up @@ -341,6 +344,9 @@
<data name="PropertyPaste" xml:space="preserve">
<value>粘贴属性</value>
</data>
<data name="Quality" xml:space="preserve">
<value>质量</value>
</data>
<data name="Read" xml:space="preserve">
<value>读</value>
</data>
Expand Down Expand Up @@ -492,6 +498,9 @@
<data name="UseTls" xml:space="preserve">
<value>加密传输</value>
</data>
<data name="Value" xml:space="preserve">
<value>值</value>
</data>
<data name="ValueChanged" xml:space="preserve">
<value>值改变</value>
</data>
Expand Down
17 changes: 17 additions & 0 deletions Develop/DbManager.Desktop/View/TagGroupDetailView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,23 @@
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>

<DataGridTemplateColumn Header="{local:ResMarker Value}" Width="Auto" MinWidth="60">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Foreground="{DynamicResource Window.Forground}" Margin="5,0" Text="{Binding Value}" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

<DataGridTemplateColumn Header="{local:ResMarker Quality}" Width="Auto" MinWidth="60">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Foreground="{DynamicResource Window.Forground}" Margin="5,0" Text="{Binding Quality}" VerticalAlignment="Center" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

</DataGrid.Columns>
<DataGrid.RowDetailsTemplate>
<DataTemplate>
Expand Down
Loading

0 comments on commit 8d54972

Please sign in to comment.