Skip to content

Commit

Permalink
Запись рецепта в ПЛК включая поле String.
Browse files Browse the repository at this point in the history
String не вписывался в ограничегие new()
  • Loading branch information
AlexFrick92 committed Jun 26, 2024
1 parent 3f9b435 commit 7f024d9
Show file tree
Hide file tree
Showing 10 changed files with 516 additions and 221 deletions.
33 changes: 31 additions & 2 deletions PNTZ.Mufta.Domain/Data/ConnectionRecipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,43 @@
using System.Text;
using System.Threading.Tasks;
using System.Text.Json;
using System.Security.Principal;

namespace PNTZ.Mufta.Data
{
public class ConnectionRecipe : TorqueControl.Data.ConnectionRecipe<ConnectionRecipe>
{
public float HEAD_OPEN_PULSES { get; set; }

public float TURNS_BREAK { get; set; }
public ushort PLC_PROG_NR { get; set; }
public ushort LOG_NO { get; set; }
public ushort Tq_UNIT { get; set; }
public ushort Thread_type { get; set; }
public string PIPE_TYPE { get; set; }
public int Box_Moni_Time { get; set; }
public float Box_Len_Min { get; set; }
public float Box_Len_Max { get; set; }
public int Pre_Monit_Time { get; set; }
public float Pre_Len_Min { get; set; }
public float Pre_Len_Max { get; set; }
public int MU_Monit_Time { get; set; }
public float MU_Tq_Ref { get; set; }
public ushort MU_Makeup_Mode { get; set; }
public float MU_TqSpeedRed_1 { get; set; }
public float MU_TqSpeedRed_2 { get; set; }
public float MU_Tq_Dump { get; set; }
public float MU_Tq_Max { get; set; }
public float MU_Tq_Min { get; set; }
public float MU_Len_Speed_1 { get; set; }
public float MU_Len_Speed_2 { get; set; }
public float MU_Len_Dump { get; set; }
public float Mu_Len_Min { get; set; }
public float Mu_Len_Max { get; set; }
public float MU_Jval_Speed_1 { get; set; }
public float MU_Jval_Speed_2 { get; set; }
public float MU_Jval_Dump { get; set; }
public float MU_Jval_Min { get; set; }
public float MU_Jval_Max { get; set; }
public float MU_Tq_Save { get; set; }
}

}
9 changes: 0 additions & 9 deletions PNTZ.Mufta.Domain/RecipeHandling/ILoadRecipe.cs

This file was deleted.

16 changes: 10 additions & 6 deletions PNTZ.Mufta.Domain/RecipeHandling/RecipeLoader.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Promatis.DataPoint.Interface;
using System.Threading.Channels;
using TorqueControl.RecipeHandling;
using PNTZ.Mufta.Data;
using Promatis.Core.Logging;
using TorqueControl.Data;

namespace PNTZ.Mufta.RecipeHandling
{
Expand All @@ -14,15 +15,15 @@ public RecipeLoader(ILogger logger)
}
public string Name { get; set; } = "Cam1RecipeLoader";

public void LoadRecipe(ConnectionRecipe recipe)
public void DpInitialized()
{
DpConRecipe.Value = recipe;
_logger.Info($"Рецепт загружен");
DpConRecipe.ValueChanged += (s, v) => Console.WriteLine(v.TURNS_BREAK + " " + v.HEAD_OPEN_PULSES);
}

public void DpInitialized()
public void LoadRecipe<T>(ConnectionRecipe<T> recipe) where T : ConnectionRecipe<T>, new()
{
DpConRecipe.ValueChanged += (s, v) => Console.WriteLine(v.TURNS_BREAK + " " + v.HEAD_OPEN_PULSES);
DpConRecipe.Value = recipe as PNTZ.Mufta.Data.ConnectionRecipe;
_logger.Info($"Рецепт загружен");
}

#region DataPoints
Expand All @@ -32,6 +33,9 @@ public void DpInitialized()

public IDpValue<ushort> CommandFeedback { get; set; }


public IDpValue<string> Pipe_type { get; set; }

#endregion
}
}
32 changes: 31 additions & 1 deletion PNTZ.Mufta.Launcher/ConnectionRecipe1.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,34 @@
{
"HEAD_OPEN_PULSES": 101,
"TURNS_BREAK": 201
"TURNS_BREAK": 201,
"PLC_PROG_NR": 301,
"LOG_NO": 1,
"Tq_UNIT": 1,
"Thread_type": 1,
"PIPE_TYPE" : "PipeType",
"Box_Moni_Time": 10,
"Box_Len_Min" : 155.5,
"Box_Len_Max" : 165.5,
"Pre_Monit_Time": 10,
"Pre_Len_Min" : 155.5,
"Pre_Len_Max" : 155.6,
"MU_Monit_Time" : 10,
"MU_Tq_Ref" : 2000.5,
"MU_Makeup_Mode" : 2,
"MU_TqSpeedRed_1" : 1000.5,
"MU_TqSpeedRed_2": 1000.6,
"MU_Tq_Dump" : 3000.5,
"MU_Tq_Max" : 4000.5,
"MU_Tq_Min" : 1000.5,
"MU_Len_Speed_1" : 200.5,
"MU_Len_Speed_2" : 300.5,
"MU_Len_Dump" : 400.5,
"Mu_Len_Min" : 500.5,
"Mu_Len_Max" : 600.5,
"MU_Jval_Speed_1" : 700.5,
"MU_Jval_Speed_2" : 800.4,
"MU_Jval_Min" : 900.5,
"MU_Jval_Max" : 1000.5,
"MU_Jval_Dump" : 200.4,
"MU_Tq_Save" : 1200.4
}
197 changes: 196 additions & 1 deletion PNTZ.Mufta.Launcher/DpConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,21 @@
<RecipeLoader Name ="Cam1RecipeLoader"/>
</ProcessorDefinition>

<DataPointDefinition>
<DataPointDefinition>
<DpValue>
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_ALLG"."PIPE_TYPE"</NodeId>
</Provider>

<Processor Name ="Cam1RecipeLoader" TargetProperty="Pipe_type"/>

</DpValue>

<!--Heartbeat-->



<!--Connection recipe -->
<DpValue>
<DpProperty Name="HEAD_OPEN_PULSES">
<Provider Name ="Stend AKF">
Expand All @@ -25,6 +38,188 @@
</Provider>
</DpProperty>

<DpProperty Name="PLC_PROG_NR">
<Provider Name ="Stend AKF">
<NodeId>
ns=3;s="REZ_TPC_DOWN"."REZ_ALLG"."PLC_PROG_NR"
</NodeId>
</Provider>
</DpProperty>

<DpProperty Name="LOG_NO">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_ALLG"."LOG_NO"</NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Tq_UNIT">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_ALLG"."Tq_UNIT"</NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Thread_type">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_ALLG"."Thread_type" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="PIPE_TYPE">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_ALLG"."PIPE_TYPE"</NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Box_Moni_Time">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_Muffe"."Box_Moni_Time" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Box_Len_Min">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_Muffe"."Box_Len_Min" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Box_Len_Max">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_Muffe"."Box_Len_Max" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Pre_Monit_Time">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_MVS"."Pre_Moni_Time" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Pre_Len_Min">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_MVS"."Pre_Len_Min" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Pre_Len_Max">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_MVS"."Pre_Len_Max" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Monit_Time">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Moni_Time" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Tq_Ref">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Tq_Ref" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Makeup_Mode">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Makeup_Mode" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_TqSpeedRed_1">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_TqSpeed_Red_1" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_TqSpeedRed_2">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_TqSpeed_Red_2" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Tq_Dump">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Tq_Dump" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Tq_Max">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Tq_Max" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Tq_Min">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Tq_Min" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Len_Speed_1">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Len_Speed_1" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Len_Speed_2">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Len_Speed_2" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Len_Dump">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Len_Dump" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Mu_Len_Min">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."Mu_Len_Min" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="Mu_Len_Max">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."Mu_Len_Max" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Jval_Speed_1">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_JVal_Speed_1" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Jval_Speed_2">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_JVAL_Speed_2" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Jval_Dump">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_JVAL_Dump" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Jval_Min">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_JVal_Min" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Jval_Max">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_JVal_Max" </NodeId>
</Provider>
</DpProperty>

<DpProperty Name="MU_Tq_Save">
<Provider Name ="Stend AKF">
<NodeId> ns=3;s="REZ_TPC_DOWN"."REZ_CAM"."MU_Tq_Save" </NodeId>
</Provider>
</DpProperty>

<Processor Name ="Cam1RecipeLoader" TargetProperty="DpConRecipe"/>
</DpValue>

Expand Down
Binary file modified PNTZ.Mufta.Launcher/Images/promatislogo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion PNTZ.Mufta.Launcher/PNTZ.Mufta.Launcher.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0-windows10.0.22621.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -15,6 +15,7 @@
<ItemGroup>
<ProjectReference Include="..\..\GUI\Promatis.Desktop\Promatis.Desktop.csproj" />
<ProjectReference Include="..\..\MES.CLG\Binding\Promatis.DataPoint\Promatis.DataPoint.Configuration.csproj" />
<ProjectReference Include="..\..\MES.CLG\DpProcessor\Promatis.DpProcessor.PlcSystem\Promatis.DpProcessor.PlcSystem.csproj" />
<ProjectReference Include="..\..\MES.CLG\DpProvider\Promatis.DpProvider.OpcUa\Promatis.DpProvider.OpcUa.csproj" />
<ProjectReference Include="..\..\Tools\Promatis.DebuggingToolkit\Promatis.DebuggingToolkit.csproj" />
<ProjectReference Include="..\PNTZ.Mufta.Domain\PNTZ.Mufta.Domain.csproj" />
Expand Down
Loading

0 comments on commit 7f024d9

Please sign in to comment.