change - 计划下传完成判断

master
wenjy 2 years ago
parent 3580a27deb
commit 44e64eaf52

@ -30,6 +30,9 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="DevExpress.Charts.v19.1.Core, Version=19.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL"> <Reference Include="DevExpress.Charts.v19.1.Core, Version=19.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -119,10 +122,6 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Mesnac.ActionService.dll</HintPath> <HintPath>..\..\Mesnac.ActionService.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mesnac.Basic, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Main\Mesnac.Basic\bin\Debug\Mesnac.Basic.dll</HintPath>
</Reference>
<Reference Include="Mesnac.Codd, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Mesnac.Codd, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Libraries\Mesnac.Codd.dll</HintPath> <HintPath>..\..\..\Libraries\Mesnac.Codd.dll</HintPath>
@ -143,9 +142,6 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\PlugInPlatform\Mesnac.Gui.dll</HintPath> <HintPath>..\..\..\PlugInPlatform\Mesnac.Gui.dll</HintPath>
</Reference> </Reference>
<Reference Include="Mesnac.Gui.Common">
<HintPath>..\..\..\dll\Mesnac.Gui.Common.dll</HintPath>
</Reference>
<Reference Include="Mesnac.Gui.Run.Global, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Mesnac.Gui.Run.Global, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\Main\Mensac.Gui.Run.Global\bin\Debug\Mesnac.Gui.Run.Global.dll</HintPath> <HintPath>..\..\..\Main\Mensac.Gui.Run.Global\bin\Debug\Mesnac.Gui.Run.Global.dll</HintPath>
@ -464,6 +460,10 @@
<Project>{f022c0e6-2819-4fb1-bb86-0f389f061a44}</Project> <Project>{f022c0e6-2819-4fb1-bb86-0f389f061a44}</Project>
<Name>Mesnac.Controls.Default</Name> <Name>Mesnac.Controls.Default</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\..\Main\Mesnac.Basic\Mesnac.Basic.csproj">
<Project>{28acacf1-9936-4e97-a866-f84366ec5286}</Project>
<Name>Mesnac.Basic</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>

@ -65,16 +65,43 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
string reciprId = clientGridView.SelectedRows[0].Cells["recipe_id"].Value as string; string reciprId = clientGridView.SelectedRows[0].Cells["recipe_id"].Value as string;
writeToPlc(reciprId, this.selectedPlanId); writeToPlc(reciprId, this.selectedPlanId);
//判断下传是否成功 //判断下传是否成功
if (reciprId == readRecipeId())
{
ICSharpCode.Core.LoggingService<StopAction>.Info("{生产计划-计划下传} 计划下传成功...");
//下传成功后下传RpFinished信号 //下传成功后下传RpFinished信号
}
else
{
MessageBox.Show("计划下传失败!!!");
}
//开启线程读取计划执行状态 //开启线程读取计划执行状态
//执行完成后判断下一计划执行方式,自动方式则继续执行下发流程 //执行完成后判断下一计划执行方式,自动方式则继续执行下发流程
} }
public string readRecipeId()
{
bool readResult = BasePlcHelper.Instance.PlcRead(BasePlcHelper.Instance.ChemicalWeighing_PC_RecipeCode, out int[] res);
string readRecipeId = "";
if (res.Length > 0)
{
for (int i = 0; i < res.Length; i++)
{
if (res[i] > 0)
{
readRecipeId = readRecipeId + res[i];
}
}
}
return readRecipeId;
}
/// <summary> /// <summary>
/// 将配方数据写入PLC地址 /// 将配方数据写入PLC地址
/// </summary> /// </summary>

@ -1447,7 +1447,7 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
dbHelper.CommandType = CommandType.Text; dbHelper.CommandType = CommandType.Text;
string strSql = @"select row_number() over (order by create_Time) as index_Id ,uid, plan_Id, recipe_Id, recipe_Name, plan_Team, plan_Amount, real_Amount, string strSql = @"select row_number() over (order by create_Time) as index_Id ,uid, plan_Id, recipe_Id, recipe_Name, plan_Team, plan_Amount, real_Amount,
case run_Type when '0' then '' else '' end as 'run_Type', case run_Type when '0' then '' else '' end as 'run_Type',
case run_Type when '0' then '' else '' end as 'plan_State', case plan_State when '0' then '' else '' end as 'plan_State',
plan_beginTime, plan_endTime, create_By, create_Time, update_By, update_Time,plan_order from Base_PlanInfo plan_beginTime, plan_endTime, create_By, create_Time, update_By, update_Time,plan_order from Base_PlanInfo
order by plan_order asc"; order by plan_order asc";
dbHelper.CommandText = strSql; dbHelper.CommandText = strSql;
@ -2706,6 +2706,8 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
/// <param name="remark">备注</param> /// <param name="remark">备注</param>
/// <returns>返回新加计划的计划号</returns> /// <returns>返回新加计划的计划号</returns>
public static string SaveBasePlanInfo(Base_PlanInfo base_PlanInfo) public static string SaveBasePlanInfo(Base_PlanInfo base_PlanInfo)
{
try
{ {
DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local); DbHelper dbHelper = Mesnac.Basic.DataSourceFactory.Instance.GetDbHelper(Mesnac.Basic.DataSourceFactory.MCDbType.Local);
if (dbHelper == null) if (dbHelper == null)
@ -2718,7 +2720,7 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
//添加计划的SQL语句 //添加计划的SQL语句
string strSql3 = @"insert into Base_PlanInfo (uid, plan_Id, recipe_Id, recipe_Name, plan_Team, plan_Amount, run_Type, plan_State, plan_beginTime, string strSql3 = @"insert into Base_PlanInfo (uid, plan_Id, recipe_Id, recipe_Name, plan_Team, plan_Amount, run_Type, plan_State, plan_beginTime,
grid_Amount,line_Amount,car_Amount,create_By, create_Time,plan_order) VALUES (@uid, @plan_Id, @recipe_Id, @recipe_Name, @plan_Team, grid_Amount,line_Amount,car_Amount,create_By, create_Time,plan_order) VALUES (@uid, @plan_Id, @recipe_Id, @recipe_Name, @plan_Team,
@plan_Amount, @run_Type, @plan_State, @plan_beginTime,@grid_Amount,@line_Amount,@car_Amount @create_By, @create_Time,@plan_order)"; @plan_Amount, @run_Type, @plan_State, @plan_beginTime,@grid_Amount,@line_Amount,@car_Amount,@create_By, @create_Time,@plan_order)";
dbHelper.CommandText = strSql3; dbHelper.CommandText = strSql3;
dbHelper.AddParameter("@uid", base_PlanInfo.uid); dbHelper.AddParameter("@uid", base_PlanInfo.uid);
@ -2740,6 +2742,10 @@ namespace Mesnac.Action.ChemicalWeighing.Product.PptPlan
dbHelper.AddParameter("@plan_order", base_PlanInfo.plan_order); dbHelper.AddParameter("@plan_order", base_PlanInfo.plan_order);
dbHelper.ExecuteNonQuery(); dbHelper.ExecuteNonQuery();
}catch(Exception e)
{
ICSharpCode.Core.LoggingService<InsertAction>.Error("当班计划—添加计划失败"+e.Message);
}
return base_PlanInfo.plan_Id; return base_PlanInfo.plan_Id;
} }

@ -39,7 +39,7 @@
<BootstrapperEnabled>true</BootstrapperEnabled> <BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
@ -67,6 +67,9 @@
<PropertyGroup> <PropertyGroup>
<StartupObject /> <StartupObject />
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="FastReport, Version=1.5.14.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL"> <Reference Include="FastReport, Version=1.5.14.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
@ -662,7 +665,9 @@
<EmbeddedResource Include="Properties\MesnacResource.zh-CN.resx"> <EmbeddedResource Include="Properties\MesnacResource.zh-CN.resx">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Properties\MesnacResource.en-US.resx" /> <EmbeddedResource Include="Properties\MesnacResource.en-US.resx">
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Data\EventConfig\空项目\设备管理.停机故障原因-.xml"> <Content Include="Data\EventConfig\空项目\设备管理.停机故障原因-.xml">
@ -1035,8 +1040,6 @@
<PropertyGroup> <PropertyGroup>
<PreBuildEvent>XCOPY "$(SolutionDir)bin\*.*" /S/Y "$(TargetDir)" <PreBuildEvent>XCOPY "$(SolutionDir)bin\*.*" /S/Y "$(TargetDir)"
XCOPY "$(SolutionDir)packages\*.*" /S/Y "$(TargetDir)" XCOPY "$(SolutionDir)packages\*.*" /S/Y "$(TargetDir)"
XCOPY "$(SolutionDir)Main\MCEdit\Data\EventConfig\*.*" /S/Y "$(TargetDir)Data\EventConfig\"
XCOPY "$(SolutionDir)Main\MCEdit\Data\MCProject\*.*" /S/Y "$(TargetDir)Data\MCProject\"
XCOPY "$(SolutionDir)Main\MCEdit\Data\ComponentProperty.xml" /S/Y "$(TargetDir)Data\" XCOPY "$(SolutionDir)Main\MCEdit\Data\ComponentProperty.xml" /S/Y "$(TargetDir)Data\"
XCOPY "$(SolutionDir)Main\MCEdit\Data\ComponentProperty.en-US.xml" /S/Y "$(TargetDir)Data\" XCOPY "$(SolutionDir)Main\MCEdit\Data\ComponentProperty.en-US.xml" /S/Y "$(TargetDir)Data\"
XCOPY "$(SolutionDir)Main\MCEdit\Data\ComponentAction.xml" /S/Y "$(TargetDir)Data\" XCOPY "$(SolutionDir)Main\MCEdit\Data\ComponentAction.xml" /S/Y "$(TargetDir)Data\"

@ -241,7 +241,7 @@
<Name>Mesnac.Controls.ChemicalWeighing</Name> <Name>Mesnac.Controls.ChemicalWeighing</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\Controls\Mesnac.Controls.Default\Mesnac.Controls.Default.csproj"> <ProjectReference Include="..\..\Controls\Mesnac.Controls.Default\Mesnac.Controls.Default.csproj">
<Project>{F022C0E6-2819-4FB1-BB86-0F389F061A44}</Project> <Project>{f022c0e6-2819-4fb1-bb86-0f389f061a44}</Project>
<Name>Mesnac.Controls.Default</Name> <Name>Mesnac.Controls.Default</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\Mensac.Gui.Run.Global\Mesnac.Gui.Run.Global.csproj"> <ProjectReference Include="..\Mensac.Gui.Run.Global\Mesnac.Gui.Run.Global.csproj">

@ -119,6 +119,9 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MCEdit", "Main\MCEdit\MCEdit.csproj", "{0C653BC3-0016-4CC8-BD75-3F961FED1FBC}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MCEdit", "Main\MCEdit\MCEdit.csproj", "{0C653BC3-0016-4CC8-BD75-3F961FED1FBC}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{B9B99759-8B95-4078-A5E9-A63E0E48384C} = {B9B99759-8B95-4078-A5E9-A63E0E48384C} {B9B99759-8B95-4078-A5E9-A63E0E48384C} = {B9B99759-8B95-4078-A5E9-A63E0E48384C}
{90CC2D8A-DEC5-4D2A-82C9-F7A033060DC1} = {90CC2D8A-DEC5-4D2A-82C9-F7A033060DC1}
{6A2190C6-B530-4D5B-BD34-29EFB0431F67} = {6A2190C6-B530-4D5B-BD34-29EFB0431F67}
{E7FE3BD9-0D1D-497B-AA59-CE46159CEFBC} = {E7FE3BD9-0D1D-497B-AA59-CE46159CEFBC}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mesnac.Gui.Run.Global", "Main\Mensac.Gui.Run.Global\Mesnac.Gui.Run.Global.csproj", "{CC98CB3B-F532-4510-AC08-7DDBD520CB06}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mesnac.Gui.Run.Global", "Main\Mensac.Gui.Run.Global\Mesnac.Gui.Run.Global.csproj", "{CC98CB3B-F532-4510-AC08-7DDBD520CB06}"

Loading…
Cancel
Save