@@ -17,22 +17,23 @@ namespace BPASmartClient.Academy._50L | |||||
private PlcControl() { } | private PlcControl() { } | ||||
private ICommSiemens comm = CommHelper.Siemens; | private ICommSiemens comm = CommHelper.Siemens; | ||||
public void Init() | public void Init() | ||||
{ | { | ||||
CommHelper.CreateSiemens(CpuType.S71200, Json<DevicePar>.Data.IpAddress).OnSuccess(s => | |||||
{ | |||||
comm = s.Content; | |||||
Read(); | |||||
}); | |||||
//CommHelper.CreateSiemens(CpuType.S71200, Json<DevicePar>.Data.IpAddress).OnSuccess(s => | |||||
//{ | |||||
// comm = s.Content; | |||||
// Read(); | |||||
//}); | |||||
} | } | ||||
private void Read() | private void Read() | ||||
{ | { | ||||
TaskManage.GetInstance.StartLong(() => { | |||||
TaskManage.GetInstance.StartLong(() => | |||||
{ | |||||
comm.Read<bool[]>("DB1.DBX2000.0", 11).OnSuccess(s => | comm.Read<bool[]>("DB1.DBX2000.0", 11).OnSuccess(s => | ||||
{ | { | ||||
Data[FeedbackData.旋转电机启停反馈] = s.Content[0]; | Data[FeedbackData.旋转电机启停反馈] = s.Content[0]; | ||||
@@ -61,7 +62,7 @@ namespace BPASmartClient.Academy._50L | |||||
Data[FeedbackData.蒸汽比例阀实际开度] = s.Content[8]; | Data[FeedbackData.蒸汽比例阀实际开度] = s.Content[8]; | ||||
}); | }); | ||||
comm.Read<bool[]>("DB1.DBX1003.7", 1).OnSuccess(s =>{ Data[FeedbackData.心跳] = s.Content[0]; }); | |||||
comm.Read<bool[]>("DB1.DBX1003.7", 1).OnSuccess(s => { Data[FeedbackData.心跳] = s.Content[0]; }); | |||||
comm.Read<bool[]>("DB1.DBX2004.0", 3).OnSuccess(s => | comm.Read<bool[]>("DB1.DBX2004.0", 3).OnSuccess(s => | ||||
{ | { | ||||
@@ -70,7 +71,8 @@ namespace BPASmartClient.Academy._50L | |||||
AlarmHelper.GetInstance.Get<AlarmData>("50L反应釜").AbnormalNegativePressureFan = s.Content[2]; | AlarmHelper.GetInstance.Get<AlarmData>("50L反应釜").AbnormalNegativePressureFan = s.Content[2]; | ||||
}); | }); | ||||
if (Delay.GetInstance("心跳").Start(FeedbackData.心跳.GetValue<bool>(), 3)) { | |||||
if (Delay.GetInstance("心跳").Start(FeedbackData.心跳.GetValue<bool>(), 3)) | |||||
{ | |||||
Write(BoolAddEnum.心跳, true); | Write(BoolAddEnum.心跳, true); | ||||
} | } | ||||
Thread.Sleep(10); | Thread.Sleep(10); | ||||
@@ -0,0 +1,29 @@ | |||||
using SqlSugar; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Academy._50L | |||||
{ | |||||
[SplitTable(SplitType.Month)]//按月分表 | |||||
public class SamplingData | |||||
{ | |||||
[SplitField]//分表字段特性,标注之后在插入或者删除的时候都会根据这个创建时间来查找对应的表进行修改 | |||||
public DateTime Createtime { get; set; } | |||||
public float a { get; set; } | |||||
public SamplingData() | |||||
{ | |||||
Createtime = DateTime.Now; | |||||
} | |||||
public SamplingData(float _a) | |||||
{ | |||||
Createtime = DateTime.Now; | |||||
a = _a; | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,42 @@ | |||||
using SqlSugar; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.IO; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
namespace BPASmartClient.Academy._50L | |||||
{ | |||||
public class SqliteOperate | |||||
{ | |||||
private volatile static SqliteOperate _Instance; | |||||
public static SqliteOperate GetInstance => _Instance ?? (_Instance = new SqliteOperate()); | |||||
private SqliteOperate() { } | |||||
static string directoryPath = $"AccessFile\\DB\\{Json<DevicePar>.Data.ProjectTypeName}"; | |||||
static string path | |||||
{ | |||||
get | |||||
{ | |||||
Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory); | |||||
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{directoryPath}\\data.db"); | |||||
} | |||||
} | |||||
private SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig() | |||||
{ | |||||
ConnectionString = $"Data Source = {path}", | |||||
DbType = DbType.Sqlite, | |||||
IsAutoCloseConnection = true, | |||||
}); | |||||
public void Init() | |||||
{ | |||||
Db.CodeFirst.SplitTables().InitTables<SamplingData>(); | |||||
Db.Insertable<SamplingData>(new SamplingData(5.0f)).SplitTable().ExecuteCommand(); | |||||
} | |||||
} | |||||
} |
@@ -270,6 +270,7 @@ namespace BPASmartClient.Academy | |||||
Json<LocalRecipe>.Read(); | Json<LocalRecipe>.Read(); | ||||
Json<DevicePar>.Read(); | Json<DevicePar>.Read(); | ||||
Json<LocaMaterial>.Read(); | Json<LocaMaterial>.Read(); | ||||
SqliteOperate.GetInstance.Init(); | |||||
Sqlite.GetInstance.Init(); | Sqlite.GetInstance.Init(); | ||||
Simens_PLC.GetInstance.Connect(); | Simens_PLC.GetInstance.Connect(); | ||||
Simens_PLC.GetInstance.Init(); | Simens_PLC.GetInstance.Init(); | ||||
@@ -21,9 +21,10 @@ namespace BPASmartClient.Academy.Model | |||||
public HistorySqlite() { } | public HistorySqlite() { } | ||||
public SqlSugarScope Db { get; set; } | public SqlSugarScope Db { get; set; } | ||||
public ObservableCollection<RecipeChart> recipeCharts { get; set; } = new ObservableCollection<RecipeChart>(); | public ObservableCollection<RecipeChart> recipeCharts { get; set; } = new ObservableCollection<RecipeChart>(); | ||||
private string directoryPath = $"AccessFile\\DB\\{Json<DevicePar>.Data.ProjectTypeName}"; | |||||
public void FindAllList() | public void FindAllList() | ||||
{ | { | ||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "AccessFile\\DB\\Data"); | |||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, directoryPath); | |||||
try | try | ||||
{ | { | ||||
DirectoryInfo directoryInfo = new DirectoryInfo(path); | DirectoryInfo directoryInfo = new DirectoryInfo(path); | ||||
@@ -70,7 +71,7 @@ namespace BPASmartClient.Academy.Model | |||||
public void FindDateList() | public void FindDateList() | ||||
{ | { | ||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"AccessFile\\DB\\Data\\data{DateString}.db"); | |||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{directoryPath}\\data{DateString}.db"); | |||||
if (File.Exists(path)) | if (File.Exists(path)) | ||||
{ | { | ||||
recipeCharts.Clear(); | recipeCharts.Clear(); | ||||
@@ -102,7 +103,7 @@ namespace BPASmartClient.Academy.Model | |||||
public void FindProduct(string num) | public void FindProduct(string num) | ||||
{ | { | ||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"AccessFile\\DB\\Data\\data{DateString}.db"); | |||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{directoryPath}\\data{DateString}.db"); | |||||
if (File.Exists(path)) | if (File.Exists(path)) | ||||
{ | { | ||||
recipeCharts.Clear(); | recipeCharts.Clear(); | ||||
@@ -137,7 +138,7 @@ namespace BPASmartClient.Academy.Model | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"AccessFile\\DB\\Data\\data{DateString}.db"); | |||||
string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{directoryPath}\\data{DateString}.db"); | |||||
if (File.Exists(path)) | if (File.Exists(path)) | ||||
{ | { | ||||
Db = new SqlSugarScope(new ConnectionConfig() | Db = new SqlSugarScope(new ConnectionConfig() | ||||
@@ -14,12 +14,13 @@ namespace BPASmartClient.Academy.Model | |||||
public static Sqlite GetInstance { get; set; } = instance ??= new Sqlite(); | public static Sqlite GetInstance { get; set; } = instance ??= new Sqlite(); | ||||
private Sqlite() { } | private Sqlite() { } | ||||
public List<SaveData> saveDatas { get; set; } = new List<SaveData>(); | public List<SaveData> saveDatas { get; set; } = new List<SaveData>(); | ||||
static string directoryPath = $"AccessFile\\DB\\{Json<DevicePar>.Data.ProjectTypeName}"; | |||||
static string path | static string path | ||||
{ | { | ||||
get | get | ||||
{ | { | ||||
Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory); | Directory.CreateDirectory(AppDomain.CurrentDomain.BaseDirectory); | ||||
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"AccessFile\\DB\\Data\\data{DateTime.Now.ToString("yyyy-MM-dd")}.db"); | |||||
return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, $"{directoryPath}\\data{DateTime.Now.ToString("yyyy-MM-dd")}.db"); | |||||
} | } | ||||
} | } | ||||
public SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig() | public SqlSugarScope Db = new SqlSugarScope(new ConnectionConfig() | ||||
@@ -38,7 +39,7 @@ namespace BPASmartClient.Academy.Model | |||||
{ | { | ||||
Db.DbMaintenance.CreateDatabase(); | Db.DbMaintenance.CreateDatabase(); | ||||
Db.CodeFirst.SetStringDefaultLength(100).InitTables<SaveData>(); | Db.CodeFirst.SetStringDefaultLength(100).InitTables<SaveData>(); | ||||
Db.CodeFirst.SetStringDefaultLength(100).InitTables<SaveNameData>(); | |||||
//Db.CodeFirst.SetStringDefaultLength(100).InitTables<SaveNameData>(); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -0,0 +1,182 @@ | |||||
<UserControl x:Class="BPASmartClient.CustomResource.UserControls.Control.HeatExchanger" | |||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |||||
xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls.Control" | |||||
mc:Ignorable="d" | |||||
d:DesignHeight="64" d:DesignWidth="64"> | |||||
<Viewbox Stretch="Uniform" Width="64" Height="64" ToolTip="Heat exchanger" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:s="clr-namespace:System;assembly=mscorlib"> | |||||
<Viewbox.Tag> | |||||
<s:Int64>696502080</s:Int64> | |||||
</Viewbox.Tag> | |||||
<Canvas UseLayoutRounding="False" Name="Group_Heat_exchanger" Tag="#00000000,#FFC0C0C0,Shaded,0,None" LayoutTransform="Identity" Width="112.5" Height="41.623" HorizontalAlignment="Left" VerticalAlignment="Top"> | |||||
<Canvas Name="Group_HeatExchanger" Tag="#00000000,#FFC0C0C0,Shaded,0,None" Width="92.913" Height="37.573" Canvas.Left="9.903" Canvas.Top="3.427"> | |||||
<Path Data="M10.12,8.095L102.816,8.095 102.816,36.219 10.12,36.219z" Stretch="Fill" Width="92.696" Height="28.124" Canvas.Left="0.217" Canvas.Top="4.668"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="M99.674,41L102.815,41 102.815,3.427 99.674,3.427z" Stretch="Fill" Width="3.141" Height="37.573" Canvas.Left="89.771" Canvas.Top="0"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="M9.903,41L12.718,41 12.718,3.427 9.903,3.427z" Stretch="Fill" Width="2.815" Height="37.573" Canvas.Left="0" Canvas.Top="0"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
</Canvas> | |||||
<Canvas Name="Group_R" Tag="#00000000,#FFC0C0C0,Shaded,0,None" Width="10.121" Height="37.573" Canvas.Left="102.379" Canvas.Top="3.427"> | |||||
<Path Data="M112.498,13.326L105.072,13.326 105.072,8.151 112.498,8.151z" Stretch="Fill" Width="7.426" Height="5.175" Canvas.Left="2.693" Canvas.Top="4.724"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="F1M102.815,8.095L102.815,36.219 105.072,36.219 105.072,36.183C109.207,35.82,112.5,29.691,112.5,22.158L112.5,22.158C112.5,14.625,109.207,8.494,105.072,8.131L105.072,8.131 105.072,8.095z" Stretch="Fill" Width="9.685" Height="28.124" Canvas.Left="0.436" Canvas.Top="4.668"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="M102.49,41L105.305,41 105.305,3.427 102.49,3.427z" Stretch="Fill" Width="2.815" Height="37.573" Canvas.Left="0.111" Canvas.Top="0"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="F1M102.815,41L102.379,41 102.379,3.427 102.815,3.427z" Stretch="Fill" Fill="#FF717171" Width="0.436" Height="37.573" Canvas.Left="0" Canvas.Top="0" /> | |||||
</Canvas> | |||||
<Canvas Name="Group_L" Tag="#00000000,#FFC0C0C0,Shaded,0,None" Width="10.228" Height="37.573" Canvas.Left="0" Canvas.Top="3.427"> | |||||
<Path Data="M7.427,36.05L0.00199999999999978,36.05 0.00199999999999978,30.876 7.427,30.876z" Stretch="Fill" Width="7.425" Height="5.174" Canvas.Left="0.002" Canvas.Top="27.449"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="F1M7.427,8.095L7.427,8.125C3.595,8.407,0.473,13.643,0,20.377L0,20.377 0,23.938C0.473,30.671,3.595,35.907,7.427,36.189L7.427,36.189 7.427,36.219 10.12,36.219 10.12,8.095z" Stretch="Fill" Width="10.12" Height="28.124" Canvas.Left="0" Canvas.Top="4.668"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.497,1" EndPoint="0.497,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="M7.086,41L10.228,41 10.228,3.427 7.086,3.427z" Stretch="Fill" Width="3.142" Height="37.573" Canvas.Left="7.086" Canvas.Top="0"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0.5,1" EndPoint="0.5,0"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="F1M10.228,41L9.792,41 9.792,3.427 10.228,3.427z" Stretch="Fill" Fill="#FF717171" Width="0.436" Height="37.573" Canvas.Left="9.792" Canvas.Top="0" /> | |||||
</Canvas> | |||||
<Canvas Name="Group_Valves" Tag="#00000000,#FFC0C0C0,Shaded,0,None" Width="50.398" Height="8.775" Canvas.Left="48.15" Canvas.Top="-0.623"> | |||||
<Path Data="M49.95,2.135L54,2.135 54,8.152 49.95,8.152z" Stretch="Fill" Width="4.05" Height="6.017" Canvas.Left="1.8" Canvas.Top="2.758"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="M48.15,-0.622999999999998L55.575,-0.622999999999998 55.575,3.427 48.15,3.427z" Stretch="Fill" Width="7.425" Height="4.05" Canvas.Left="0" Canvas.Top="0"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="M92.698,2.135L96.748,2.135 96.748,8.152 92.698,8.152z" Stretch="Fill" Width="4.05" Height="6.017" Canvas.Left="44.548" Canvas.Top="2.758"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
<Path Data="M90.898,-0.622999999999998L98.548,-0.622999999999998 98.548,3.427 90.898,3.427z" Stretch="Fill" Width="7.65" Height="4.05" Canvas.Left="42.748" Canvas.Top="0"> | |||||
<Path.Fill> | |||||
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> | |||||
<LinearGradientBrush.GradientStops> | |||||
<GradientStop Color="#FF565656" Offset="0" /> | |||||
<GradientStop Color="#FFDCDCDC" Offset="0.45" /> | |||||
<GradientStop Color="#FFA3A3A3" Offset="0.77" /> | |||||
<GradientStop Color="#FF565656" Offset="1" /> | |||||
</LinearGradientBrush.GradientStops> | |||||
</LinearGradientBrush> | |||||
</Path.Fill> | |||||
</Path> | |||||
</Canvas> | |||||
</Canvas> | |||||
</Viewbox> | |||||
</UserControl> |
@@ -0,0 +1,28 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using System.Threading.Tasks; | |||||
using System.Windows; | |||||
using System.Windows.Controls; | |||||
using System.Windows.Data; | |||||
using System.Windows.Documents; | |||||
using System.Windows.Input; | |||||
using System.Windows.Media; | |||||
using System.Windows.Media.Imaging; | |||||
using System.Windows.Navigation; | |||||
using System.Windows.Shapes; | |||||
namespace BPASmartClient.CustomResource.UserControls.Control | |||||
{ | |||||
/// <summary> | |||||
/// HeatExchanger.xaml 的交互逻辑 | |||||
/// </summary> | |||||
public partial class HeatExchanger : UserControl | |||||
{ | |||||
public HeatExchanger() | |||||
{ | |||||
InitializeComponent(); | |||||
} | |||||
} | |||||
} |
@@ -1,12 +1,11 @@ | |||||
using System.Windows; | using System.Windows; | ||||
using System.Windows.Controls; | |||||
using System.Windows.Documents; | using System.Windows.Documents; | ||||
using System.Windows.Input; | using System.Windows.Input; | ||||
using System.Windows.Media; | using System.Windows.Media; | ||||
namespace BPASmartClient.CustomResource.UserControls.DeCanvas | namespace BPASmartClient.CustomResource.UserControls.DeCanvas | ||||
{ | { | ||||
public class RubberbandAdorner :Adorner | |||||
public class RubberbandAdorner : Adorner | |||||
{ | { | ||||
private Point? startPoint; | private Point? startPoint; | ||||
private Point? endPoint; | private Point? endPoint; | ||||
@@ -14,13 +13,13 @@ namespace BPASmartClient.CustomResource.UserControls.DeCanvas | |||||
private DesignerCanvas designerCanvas; | private DesignerCanvas designerCanvas; | ||||
public RubberbandAdorner(DesignerCanvas designerCanvas,Point? dragStartPoint) | |||||
public RubberbandAdorner(DesignerCanvas designerCanvas, Point? dragStartPoint) | |||||
: base(designerCanvas) | : base(designerCanvas) | ||||
{ | { | ||||
this.designerCanvas = designerCanvas; | this.designerCanvas = designerCanvas; | ||||
this.startPoint = dragStartPoint; | this.startPoint = dragStartPoint; | ||||
rubberbandPen = new Pen(Brushes.LightSlateGray,1); | |||||
rubberbandPen.DashStyle = new DashStyle(new double[] { 2 },1); | |||||
rubberbandPen = new Pen(Brushes.LightSlateGray, 1); | |||||
rubberbandPen.DashStyle = new DashStyle(new double[] { 2 }, 1); | |||||
} | } | ||||
protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e) | protected override void OnMouseMove(System.Windows.Input.MouseEventArgs e) | ||||
@@ -62,10 +61,10 @@ namespace BPASmartClient.CustomResource.UserControls.DeCanvas | |||||
// without a background the OnMouseMove event would not be fired ! | // without a background the OnMouseMove event would not be fired ! | ||||
// Alternative: implement a Canvas as a child of this adorner, like | // Alternative: implement a Canvas as a child of this adorner, like | ||||
// the ConnectionAdorner does. | // the ConnectionAdorner does. | ||||
dc.DrawRectangle(Brushes.Transparent,null,new Rect(RenderSize)); | |||||
dc.DrawRectangle(Brushes.Transparent, null, new Rect(RenderSize)); | |||||
if (this.startPoint.HasValue && this.endPoint.HasValue) | if (this.startPoint.HasValue && this.endPoint.HasValue) | ||||
dc.DrawRectangle(Brushes.Transparent,rubberbandPen,new Rect(this.startPoint.Value,this.endPoint.Value)); | |||||
dc.DrawRectangle(Brushes.Transparent, rubberbandPen, new Rect(this.startPoint.Value, this.endPoint.Value)); | |||||
} | } | ||||
private void UpdateSelection() | private void UpdateSelection() | ||||
@@ -74,7 +73,7 @@ namespace BPASmartClient.CustomResource.UserControls.DeCanvas | |||||
item.IsSelected = false; | item.IsSelected = false; | ||||
designerCanvas.SelectedItems.Clear(); | designerCanvas.SelectedItems.Clear(); | ||||
Rect rubberBand = new Rect(startPoint.Value,endPoint.Value); | |||||
Rect rubberBand = new Rect(startPoint.Value, endPoint.Value); | |||||
foreach (Control item in designerCanvas.Children) | foreach (Control item in designerCanvas.Children) | ||||
{ | { | ||||
Rect itemRect = VisualTreeHelper.GetDescendantBounds(item); | Rect itemRect = VisualTreeHelper.GetDescendantBounds(item); | ||||