准备继承 hsl

dep_nodyang
nodyang 1 year ago
parent af59930b1b
commit 9c5ad7a7c5

@ -1,11 +1,5 @@
using Mesnac.Action.ChemicalWeighing.Entity;
using Mesnac.PlcUtils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Mesnac.Action.ChemicalWeighing.EngineeringDebuggingMode

@ -1,5 +1,5 @@
using Mesnac.Action.ChemicalWeighing.Entity;
using Mesnac.PlcUtils;
using System;
using System.Collections.Generic;
using System.ComponentModel;

@ -3,6 +3,7 @@ using Mesnac.Codd.Session;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -11,31 +12,27 @@ namespace Mesnac.Action.ChemicalWeighing.FreeDb
{
public class FreeSqlUnit
{
private static IFreeSql _instance = null;
private FreeSqlUnit() { }
public static IFreeSql Instance
{
get
{
if (_instance == null)
{
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
_instance = new FreeSql.FreeSqlBuilder()
.UseConnectionString(FreeSql.DataType.SqlServer, dbHelper.DbSession.ConnectionString)
.UseAutoSyncStructure(false) //自动同步实体结构到数据库
.Build(); //请务必定义成 Singleton 单例模式
}
return _instance;
}
}
public static IFreeSql Instance => freeSql.Value;
internal static T Select<T>()
static Lazy<IFreeSql> freeSql = new Lazy<IFreeSql>(() =>
{
throw new NotImplementedException();
}
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
return new FreeSql.FreeSqlBuilder()
.UseMonitorCommand(cmd => Trace.WriteLine($"Sql{cmd.CommandText}"))//监听SQL语句,Trace在输出选项卡中查看
.UseConnectionString(FreeSql.DataType.SqlServer, dbHelper.DbSession.ConnectionString)
.UseAutoSyncStructure(false) //自动同步实体结构到数据库FreeSql不会扫描程序集只有CRUD时才会生成表。
.Build();
});
}
}

@ -12,7 +12,7 @@ using Mesnac.Action.ChemicalWeighing.LjMixManager;
using Mesnac.Action.ChemicalWeighing.LjPlanning.Db;
using Mesnac.Action.ChemicalWeighing.LjPlanning.Entity;
using Mesnac.Action.ChemicalWeighing.LjProdcutLine;
using Mesnac.PlcUtils;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning

@ -3,7 +3,7 @@ using System.Linq;
using System.Windows.Forms;
using Mesnac.Action.Base;
using Mesnac.Action.ChemicalWeighing.LjPlanning.Db;
using Mesnac.PlcUtils;
namespace Mesnac.Action.ChemicalWeighing.LjPlanning
{

@ -125,8 +125,9 @@
<Reference Include="FreeSql.Repository, Version=3.2.800.0, Culture=neutral, PublicKeyToken=e2c05379863de526, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\FreeSql.Repository.3.2.800\lib\net45\FreeSql.Repository.dll</HintPath>
</Reference>
<Reference Include="HslCommunication">
<HintPath>..\..\..\PlugInPlatform\HslCommunication.dll</HintPath>
<Reference Include="HslCommunication, Version=11.0.6.0, Culture=neutral, PublicKeyToken=3d72ad3b6b5ec0e3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\HslCommunication.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.Core, Version=4.3.0.9338, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -969,10 +970,6 @@
<Project>{ad132cad-5288-44dc-a38f-4b0658fc228c}</Project>
<Name>Mesnac.DoUtils</Name>
</ProjectReference>
<ProjectReference Include="..\..\..\Mesnac.PlcUtils\Mesnac.PlcUtils.csproj">
<Project>{88eac8d1-8783-478c-ad9d-f916673b7004}</Project>
<Name>Mesnac.PlcUtils</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />

@ -42,6 +42,12 @@ namespace Mesnac.Action.ChemicalWeighing.Test
.ToDataTable("*");
this.startdate.MCValue = DateTime.Now.ToString() + dt2.Rows.Count;
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
var dt= dbHelper.GetDataTableBySql("select * from ActionCode");
}
List<DbMCControl> mcControllist;
IBaseControl startdate;

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -101,6 +101,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Libraries\Host.dll</HintPath>
</Reference>
<Reference Include="HslCommunication">
<HintPath>..\..\Actions\HslCommunication.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.Core, Version=4.3.0.9338, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\PlugInPlatform\ICSharpCode.Core.dll</HintPath>

@ -26,7 +26,7 @@
<!--机台号-->
<add key="EquipCode" value="01" />
<!--设备时钟类型值包括Thread或Timer-->
<add key="BASE_EQUIP_CLOCKTYPE" value="Timer" />
<add key="BASE_EQUIP_CLOCKTYPE" value="Thread" />
<!-- 是否加载数据源树 -->
<add key="IsLoadDataSourceTree" value="false" />
<!--是否开启保存回放数据-->

@ -96,6 +96,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Libraries\Host.dll</HintPath>
</Reference>
<Reference Include="HslCommunication">
<HintPath>..\..\Actions\HslCommunication.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.Core, Version=4.3.0.9338, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\PlugInPlatform\ICSharpCode.Core.dll</HintPath>
@ -282,10 +285,6 @@
<Project>{ad132cad-5288-44dc-a38f-4b0658fc228c}</Project>
<Name>Mesnac.DoUtils</Name>
</ProjectReference>
<ProjectReference Include="..\..\Mesnac.PlcUtils\Mesnac.PlcUtils.csproj">
<Project>{88eac8d1-8783-478c-ad9d-f916673b7004}</Project>
<Name>Mesnac.PlcUtils</Name>
</ProjectReference>
<ProjectReference Include="..\Mensac.Gui.Run.Global\Mesnac.Gui.Run.Global.csproj">
<Project>{CC98CB3B-F532-4510-AC08-7DDBD520CB06}</Project>
<Name>Mesnac.Gui.Run.Global</Name>

@ -15,12 +15,7 @@ namespace MCRun
using Mesnac.Core.Service;
using Mesnac.DoUtils;
using Mesnac.Gui.Workbench;
using Mesnac.PlcUtils;
using Mesnac.PlcUtils.common;
using Mesnac.PlcUtils.enumInfo;
using Mesnac.PlcUtils.Impl;
using System.Drawing.Drawing2D;
using System.Threading.Tasks;
class Program
{

@ -31,9 +31,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="HslCommunication">
<HintPath>..\PlugInPlatform\HslCommunication.dll</HintPath>
</Reference>
<Reference Include="ICSharpCode.Core">
<HintPath>..\PlugInPlatform\ICSharpCode.Core.dll</HintPath>
</Reference>

@ -161,8 +161,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mesnac.Action.Default", "Ac
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PlcUtils", "PlcUtils", "{DE8C4FC3-17D6-4217-8AB1-72ADE8D85810}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mesnac.PlcUtils", "Mesnac.PlcUtils\Mesnac.PlcUtils.csproj", "{88EAC8D1-8783-478C-AD9D-F916673B7004}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DoUtils", "DoUtils", "{9F21B6A6-9B19-4AAC-88EF-A430D8808540}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mesnac.DoUtils", "Mesnac.DoUtils\Mesnac.DoUtils.csproj", "{AD132CAD-5288-44DC-A38F-4B0658FC228C}"
@ -321,18 +319,6 @@ Global
{6A2190C6-B530-4D5B-BD34-29EFB0431F67}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6A2190C6-B530-4D5B-BD34-29EFB0431F67}.Release|x86.ActiveCfg = Release|Any CPU
{6A2190C6-B530-4D5B-BD34-29EFB0431F67}.Release|x86.Build.0 = Release|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Debug|x86.ActiveCfg = Debug|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Debug|x86.Build.0 = Debug|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Release|Any CPU.Build.0 = Release|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Release|x86.ActiveCfg = Release|Any CPU
{88EAC8D1-8783-478C-AD9D-F916673B7004}.Release|x86.Build.0 = Release|Any CPU
{AD132CAD-5288-44DC-A38F-4B0658FC228C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AD132CAD-5288-44DC-A38F-4B0658FC228C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD132CAD-5288-44DC-A38F-4B0658FC228C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -373,7 +359,6 @@ Global
{91C803A6-90D1-4361-8B92-9AFD9E766411} = {8314C6B1-6D76-4441-85DB-562354BA4578}
{D0C0324F-434E-47EB-8F7C-BA6CD7F233B4} = {DE938080-4A00-4686-9CE4-1C33FCA86346}
{6A2190C6-B530-4D5B-BD34-29EFB0431F67} = {66F3B234-E56C-4EF4-AB6D-BB6D91467855}
{88EAC8D1-8783-478C-AD9D-F916673B7004} = {DE8C4FC3-17D6-4217-8AB1-72ADE8D85810}
{AD132CAD-5288-44DC-A38F-4B0658FC228C} = {9F21B6A6-9B19-4AAC-88EF-A430D8808540}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution

Loading…
Cancel
Save