Commit 8424f769 authored by 潘栩锋's avatar 潘栩锋 🚴

修复 收卷,下吹测量旋转架位置,反向开关失效

parent 10bcf722
...@@ -71,6 +71,9 @@ ...@@ -71,6 +71,9 @@
<Compile Include="WdDRList.xaml.cs"> <Compile Include="WdDRList.xaml.cs">
<DependentUpon>WdDRList.xaml</DependentUpon> <DependentUpon>WdDRList.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="WdRotary.xaml.cs">
<DependentUpon>WdRotary.xaml</DependentUpon>
</Compile>
<Compile Include="WdSetup.xaml.cs"> <Compile Include="WdSetup.xaml.cs">
<DependentUpon>WdSetup.xaml</DependentUpon> <DependentUpon>WdSetup.xaml</DependentUpon>
</Compile> </Compile>
...@@ -98,6 +101,10 @@ ...@@ -98,6 +101,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="WdRotary.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="WdSetup.xaml"> <Page Include="WdSetup.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
......
...@@ -13,8 +13,10 @@ ...@@ -13,8 +13,10 @@
<local:PgMainVmUt x:Key="viewModel"/> <local:PgMainVmUt x:Key="viewModel"/>
</Page.Resources> </Page.Resources>
<Grid d:DataContext="{StaticResource viewModel}"> <Grid d:DataContext="{StaticResource viewModel}">
<StackPanel Margin="5">
<GroupBox Header="PLC" Margin="5">
<StackPanel> <StackPanel>
<ItemsControl x:Name="itemcontrol" ItemsSource="{Binding PLCs}" Margin="5"> <ItemsControl x:Name="itemcontrol" ItemsSource="{Binding PLCs}">
<ItemsControl.ItemTemplate> <ItemsControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<StackPanel> <StackPanel>
...@@ -22,7 +24,7 @@ ...@@ -22,7 +24,7 @@
<StackPanel Margin="4" > <StackPanel Margin="4" >
<TextBlock Text="更新速度" /> <TextBlock Text="更新速度" />
<TextBlock FontSize="20"> <TextBlock FontSize="20">
<Run Text="{Binding ActUpdateInterval,Converter={StaticResource timespan2msConv}, Mode=OneWay}" /> <Run Text="{Binding ActUpdateInterval,StringFormat=\{0:sfff\}, Mode=OneWay}" />
<Run Text="ms" FontSize="15"/> <Run Text="ms" FontSize="15"/>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
...@@ -44,7 +46,7 @@ ...@@ -44,7 +46,7 @@
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<Button Margin="4" Content="..." Height="40" Width="40" Tag="{Binding .}" Click="btnMoreClick"/> <Button Margin="4" Padding="5,2" Content="..." Tag="{Binding .}" Click="btnMoreClick"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</DataTemplate> </DataTemplate>
...@@ -52,6 +54,78 @@ ...@@ -52,6 +54,78 @@
</ItemsControl> </ItemsControl>
<Button Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnSetupClick"></Button> <Button Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnSetupClick"></Button>
</StackPanel> </StackPanel>
</GroupBox>
<GroupBox x:Name="gbRotary" Header="旋转架" Margin="5">
<StackPanel>
<StackPanel Orientation="Horizontal" >
<StackPanel Margin="4" >
<TextBlock Text="旋转启动" />
<TextBlock FontSize="20" Text="{Binding IsRotaryOn}"/>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="顺时针旋转(反)" />
<TextBlock FontSize="20" Text="{Binding IsBackw}"/>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="逆时针旋转(正)" />
<TextBlock FontSize="20" Text="{Binding IsForw}"/>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="电机频率" />
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="20" Text="{Binding RotaryFreqSet,StringFormat={}{0:F0}}"/>
<TextBlock Text="Hz" VerticalAlignment="Bottom"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="速度" />
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="20" Text="{Binding RSpeed,StringFormat={}{0:F0}}"/>
<TextBlock Text="pps" VerticalAlignment="Bottom"/>
</StackPanel>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="全局脉冲" />
<StackPanel Orientation="Horizontal">
<TextBlock FontSize="20" Text="{Binding RPosGlobal,StringFormat={}{0:F0}}"/>
<TextBlock Text="p" VerticalAlignment="Bottom"/>
</StackPanel>
</StackPanel>
</StackPanel>
<StackPanel Orientation="Horizontal" >
<StackPanel Margin="4" >
<TextBlock Text="换向信号0" />
<TextBlock>
<Run Text="{Binding IsTurnSign0}"/>[<Run FontSize="20" Text="{Binding RPosAtTurnSign0,StringFormat={}{0:F0}}"/>p]
(<Run FontSize="20" Text="{Binding TurnSign0Cnt}"/>)
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="复位原点信号" />
<TextBlock>
<Run Text="{Binding IsOrgSign}"/>[<Run FontSize="20" Text="{Binding RPosAtOrgSign,StringFormat={}{0:F0}}"/>p]
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="换向信号1" />
<TextBlock>
<Run Text="{Binding IsTurnSign1}"/>[<Run FontSize="20" Text="{Binding RPosAtTurnSign1,StringFormat={}{0:F0}}"/>p]
</TextBlock>
</StackPanel>
<StackPanel Margin="4" >
<TextBlock Text="牵引速度" />
<TextBlock>
<Run FontSize="20" Text="{Binding TractionVelocity,StringFormat={}{0:F1}}"/>m/min
</TextBlock>
</StackPanel>
<Button Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnRotaryClick"></Button>
</StackPanel>
</StackPanel>
</GroupBox>
</StackPanel>
</Grid> </Grid>
</Page> </Page>
...@@ -21,16 +21,19 @@ namespace FLY.DownBlowing.UI.Server ...@@ -21,16 +21,19 @@ namespace FLY.DownBlowing.UI.Server
/// </summary> /// </summary>
public partial class PgMain : Page public partial class PgMain : Page
{ {
FLY.DownBlowing.Server.TDGage gage;
public PgMain() public PgMain()
{ {
InitializeComponent(); InitializeComponent();
} }
public void Init(FLY.DownBlowing.Server.TDGage gage) public void Init(FLY.DownBlowing.Server.TDGage gage)
{ {
this.gage = gage;
FLY.OBJComponents.Server.PLCProxySystem plsos = FLY.OBJComponents.Server.PLCProxySystem plsos =
gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem; gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem;
this.itemcontrol.ItemsSource = plsos.PLCs; this.itemcontrol.ItemsSource = plsos.PLCs;
this.gbRotary.DataContext = gage.rotarySystem;
} }
private void btnSetupClick(object sender, RoutedEventArgs e) private void btnSetupClick(object sender, RoutedEventArgs e)
...@@ -49,6 +52,13 @@ namespace FLY.DownBlowing.UI.Server ...@@ -49,6 +52,13 @@ namespace FLY.DownBlowing.UI.Server
w.Init(plc); w.Init(plc);
w.ShowDialog(); w.ShowDialog();
} }
private void btnRotaryClick(object sender, RoutedEventArgs e)
{
WdRotary w = new WdRotary();
w.Init(gage.rotarySystem);
w.ShowDialog();
}
} }
public class PgMainVmUt : INotifyPropertyChanged public class PgMainVmUt : INotifyPropertyChanged
......
...@@ -51,7 +51,7 @@ using System.Windows; ...@@ -51,7 +51,7 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0")] [assembly: AssemblyVersion("7.0.2")]
[assembly: AssemblyFileVersion("7.0.0")] [assembly: AssemblyFileVersion("7.0.2")]
[assembly: Guid("A4B71A37-7B77-47AA-9F59-ACC3EF84C4E0")] [assembly: Guid("A4B71A37-7B77-47AA-9F59-ACC3EF84C4E0")]
<Window x:Class="FLY.DownBlowing.UI.Server.WdRotary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.DownBlowing.UI.Server"
mc:Ignorable="d"
Title="WdRotary" Height="101.4" Width="518.1">
<Grid>
<StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="5" x:Name="spRotary">
<CheckBox Content="反向" IsChecked="{Binding IsReversed}"/>
</StackPanel>
<Button Content="确定" Padding="20,5" Margin="5" Click="btnOkClick"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>

using FLY.DownBlowing.Server;
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.Shapes;
namespace FLY.DownBlowing.UI.Server
{
/// <summary>
/// WdRotary.xaml 的交互逻辑
/// </summary>
public partial class WdRotary : Window
{
RotarySystem rotarySystem;
public WdRotary()
{
InitializeComponent();
}
public void Init(RotarySystem rotarySystem)
{
this.rotarySystem = rotarySystem;
spRotary.DataContext = rotarySystem;
}
private void btnOkClick(object sender, RoutedEventArgs e)
{
rotarySystem.Save();
}
}
}
...@@ -62,10 +62,15 @@ ...@@ -62,10 +62,15 @@
<Compile Include="Server\Model\DbModel.cs" /> <Compile Include="Server\Model\DbModel.cs" />
<Compile Include="Server\Model\DbTable.cs" /> <Compile Include="Server\Model\DbTable.cs" />
<Compile Include="Server\Model\HistoryDb.cs" /> <Compile Include="Server\Model\HistoryDb.cs" />
<Compile Include="Server\RotarySystem.cs" />
<Compile Include="Server\SysParam.cs" /> <Compile Include="Server\SysParam.cs" />
<Compile Include="Server\TDGage.cs" /> <Compile Include="Server\TDGage.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\Project.FLY.Thick.Blowing\FLY.Thick.Blowing.RotaryMachine\FLY.Thick.Blowing.RotaryMachine.csproj">
<Project>{a1e64379-0509-4b01-8cea-5bc3cb323403}</Project>
<Name>FLY.Thick.Blowing.RotaryMachine</Name>
</ProjectReference>
<ProjectReference Include="..\..\thick_public\Project.FLY.FObjSys\FObjBaseReflect\FObjBase.Reflect.csproj"> <ProjectReference Include="..\..\thick_public\Project.FLY.FObjSys\FObjBaseReflect\FObjBase.Reflect.csproj">
<Project>{15f40c32-d546-4b2a-8d80-b3ddbcdaa690}</Project> <Project>{15f40c32-d546-4b2a-8d80-b3ddbcdaa690}</Project>
<Name>FObjBase.Reflect</Name> <Name>FObjBase.Reflect</Name>
......
...@@ -17,6 +17,6 @@ namespace FLY.DownBlowing.OBJ_INTERFACE ...@@ -17,6 +17,6 @@ namespace FLY.DownBlowing.OBJ_INTERFACE
public const UInt32 WARNING_OBJ_ID = 20000; public const UInt32 WARNING_OBJ_ID = 20000;
public const UInt32 RotarySerivce_OBJ_ID = FLY.Thick.Blowing.RotaryMachine.OBJ_INTERFACE.OBJ_INTERFACE_ID.RotarySerivce_OBJ_ID;
} }
} }
using FLY.DownBlowing.IService; using FLY.DownBlowing.IService;
using FLY.DownBlowing.OBJ_INTERFACE; using FLY.DownBlowing.OBJ_INTERFACE;
using FLY.OBJComponents.Server.OBJProxy; using FLY.OBJComponents.Server.OBJProxy;
using FLY.Thick.Blowing.RotaryMachine.IService;
using System.Net; using System.Net;
namespace FLY.DownBlowing.Server.OBJProxy namespace FLY.DownBlowing.Server.OBJProxy
...@@ -16,6 +17,11 @@ namespace FLY.DownBlowing.Server.OBJProxy ...@@ -16,6 +17,11 @@ namespace FLY.DownBlowing.Server.OBJProxy
var warnSystemOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.WARNING_OBJ_ID, var warnSystemOBJProxy = new FObjBase.Reflect.Reflect_Proxy(objsys_idx, OBJ_INTERFACE_ID.WARNING_OBJ_ID,
typeof(OBJComponents.IService.IWarningSystem2Service), mGage.mWarning); typeof(OBJComponents.IService.IWarningSystem2Service), mGage.mWarning);
var mRotarySystemOBJProxy = new FObjBase.Reflect.Reflect_Proxy(
objsys_idx,
OBJ_INTERFACE_ID.RotarySerivce_OBJ_ID,
typeof(IRotarySerivce),
gage.rotarySystem);
downBlowingSystemOBJProxy.CurrObjSys.Start_Conn_Server( downBlowingSystemOBJProxy.CurrObjSys.Start_Conn_Server(
new IPEndPoint(IPAddress.Any, gage.mSysParam.OBJ_Port)); new IPEndPoint(IPAddress.Any, gage.mSysParam.OBJ_Port));
......
This diff is collapsed.
using FLY.OBJComponents.Server; using FLY.OBJComponents.IService;
using FLY.OBJComponents.Server;
using FLY.OBJComponents.Server.OBJProxy; using FLY.OBJComponents.Server.OBJProxy;
using FObjBase; using FObjBase;
using System; using System;
...@@ -21,7 +22,7 @@ namespace FLY.DownBlowing.Server ...@@ -21,7 +22,7 @@ namespace FLY.DownBlowing.Server
Model.DbModel mDbModel; Model.DbModel mDbModel;
public Model.HistoryDb mHistoryDb; public Model.HistoryDb mHistoryDb;
public WarningSystem2 mWarning; public WarningSystem2 mWarning;
public RotarySystem rotarySystem;
public TDGage(string nam) public TDGage(string nam)
{ {
mName = nam; mName = nam;
...@@ -39,6 +40,7 @@ namespace FLY.DownBlowing.Server ...@@ -39,6 +40,7 @@ namespace FLY.DownBlowing.Server
mDbModel = new Model.DbModel(); mDbModel = new Model.DbModel();
mHistoryDb = new Model.HistoryDb(); mHistoryDb = new Model.HistoryDb();
mWarning = new WarningSystem2(); mWarning = new WarningSystem2();
rotarySystem = new RotarySystem();
} }
#region Init登陆服务器初始化---------------------------------------------------- #region Init登陆服务器初始化----------------------------------------------------
/// <summary> /// <summary>
...@@ -69,7 +71,14 @@ namespace FLY.DownBlowing.Server ...@@ -69,7 +71,14 @@ namespace FLY.DownBlowing.Server
mWarning.Init(mHistoryDb.ErrorBuffer); mWarning.Init(mHistoryDb.ErrorBuffer);
mData.Init(mHistoryDb, mWarning); mData.Init(mHistoryDb, mWarning);
rotarySystem.Init(mData.WinderData);
Misc.BindingOperations.SetBinding(mData.PLCos, nameof(IPLCProxySystemService.IsConnectedWithPLC), () => {
if (mData.PLCos.IsConnectedWithPLC)
rotarySystem.StartMeasureRPos();
else
rotarySystem.StopMeasureRPos();
});
} }
......
...@@ -70,6 +70,9 @@ ...@@ -70,6 +70,9 @@
<Compile Include="WdDRList.xaml.cs"> <Compile Include="WdDRList.xaml.cs">
<DependentUpon>WdDRList.xaml</DependentUpon> <DependentUpon>WdDRList.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="WdRotary.xaml.cs">
<DependentUpon>WdRotary.xaml</DependentUpon>
</Compile>
<Compile Include="WdSetup.xaml.cs"> <Compile Include="WdSetup.xaml.cs">
<DependentUpon>WdSetup.xaml</DependentUpon> <DependentUpon>WdSetup.xaml</DependentUpon>
</Compile> </Compile>
...@@ -97,6 +100,10 @@ ...@@ -97,6 +100,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="WdRotary.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="WdSetup.xaml"> <Page Include="WdSetup.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
......
...@@ -89,7 +89,6 @@ ...@@ -89,7 +89,6 @@
<TextBlock Text="p" VerticalAlignment="Bottom"/> <TextBlock Text="p" VerticalAlignment="Bottom"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<Button Margin="4" Padding="5,2" Content="..." Tag="{Binding .}" />
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal" > <StackPanel Orientation="Horizontal" >
<StackPanel Margin="4" > <StackPanel Margin="4" >
...@@ -117,6 +116,7 @@ ...@@ -117,6 +116,7 @@
<Run FontSize="20" Text="{Binding TractionVelocity,StringFormat={}{0:F1}}"/>m/min <Run FontSize="20" Text="{Binding TractionVelocity,StringFormat={}{0:F1}}"/>m/min
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
<Button Content="配置" Padding="20,5" Margin="5" HorizontalAlignment="Left" Click="btnRotaryClick"></Button>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
......
...@@ -23,12 +23,14 @@ namespace FLY.Winder.UI.Server ...@@ -23,12 +23,14 @@ namespace FLY.Winder.UI.Server
/// </summary> /// </summary>
public partial class PgMain : Page public partial class PgMain : Page
{ {
TDGage gage;
public PgMain() public PgMain()
{ {
InitializeComponent(); InitializeComponent();
} }
public void Init(TDGage gage) public void Init(TDGage gage)
{ {
this.gage = gage;
var plsos = gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem; var plsos = gage.mData.PLCos as FLY.OBJComponents.Server.PLCProxySystem;
this.itemcontrol.ItemsSource = plsos.PLCs; this.itemcontrol.ItemsSource = plsos.PLCs;
...@@ -51,6 +53,13 @@ namespace FLY.Winder.UI.Server ...@@ -51,6 +53,13 @@ namespace FLY.Winder.UI.Server
w.Init(plc); w.Init(plc);
w.ShowDialog(); w.ShowDialog();
} }
private void btnRotaryClick(object sender, RoutedEventArgs e)
{
WdRotary w = new WdRotary();
w.Init(gage.rotarySystem);
w.ShowDialog();
}
} }
public class PgMainVmUt : INotifyPropertyChanged public class PgMainVmUt : INotifyPropertyChanged
{ {
......
...@@ -51,6 +51,6 @@ using System.Windows; ...@@ -51,6 +51,6 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("7.0.0.0")] [assembly: AssemblyVersion("7.0.2.0")]
[assembly: AssemblyFileVersion("7.0.0.0")] [assembly: AssemblyFileVersion("7.0.2.0")]
[assembly: Guid("0CE35EA7-927A-41C0-9DC6-80511329760B")] [assembly: Guid("0CE35EA7-927A-41C0-9DC6-80511329760B")]
<Window x:Class="FLY.Winder.UI.Server.WdRotary"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FLY.Winder.UI.Server"
mc:Ignorable="d"
Title="WdRotary" Height="101.4" Width="518.1">
<Grid>
<StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel Margin="5" x:Name="spRotary">
<CheckBox Content="反向" IsChecked="{Binding IsReversed}"/>
</StackPanel>
<Button Content="确定" Padding="20,5" Margin="5" Click="btnOkClick"/>
</StackPanel>
</StackPanel>
</Grid>
</Window>
using FLY.Winder.Server;
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.Shapes;
namespace FLY.Winder.UI.Server
{
/// <summary>
/// WdRotary.xaml 的交互逻辑
/// </summary>
public partial class WdRotary : Window
{
RotarySystem rotarySystem;
public WdRotary()
{
InitializeComponent();
}
public void Init(RotarySystem rotarySystem)
{
this.rotarySystem = rotarySystem;
spRotary.DataContext = rotarySystem;
}
private void btnOkClick(object sender, RoutedEventArgs e)
{
rotarySystem.Save();
}
}
}
...@@ -21,6 +21,6 @@ namespace FLY.Winder.OBJ_INTERFACE ...@@ -21,6 +21,6 @@ namespace FLY.Winder.OBJ_INTERFACE
public const UInt32 WINDER_OBJ_INFOLIST_ID = 33004; public const UInt32 WINDER_OBJ_INFOLIST_ID = 33004;
public const UInt32 RotarySerivce_OBJ_ID = 33010; public const UInt32 RotarySerivce_OBJ_ID = FLY.Thick.Blowing.RotaryMachine.OBJ_INTERFACE.OBJ_INTERFACE_ID.RotarySerivce_OBJ_ID;
} }
} }
...@@ -18,7 +18,7 @@ namespace FLY.Winder.Server ...@@ -18,7 +18,7 @@ namespace FLY.Winder.Server
/// <summary> /// <summary>
/// 方向相反 /// 方向相反
/// </summary> /// </summary>
public bool IsReversed { get; set; } = false; public bool IsReversed { get; set; } = true;
#region 状态 #region 状态
/// <summary> /// <summary>
/// 正方向运行 (逆时针旋转 counter-clockwise) /// 正方向运行 (逆时针旋转 counter-clockwise)
...@@ -138,6 +138,18 @@ namespace FLY.Winder.Server ...@@ -138,6 +138,18 @@ namespace FLY.Winder.Server
}); });
Misc.BindingOperations.SetBinding(winderAccessory, nameof(winderAccessory.RotaryFreq), () => Misc.BindingOperations.SetBinding(winderAccessory, nameof(winderAccessory.RotaryFreq), () =>
{
updateRSpeed();
});
this.PropertyChanged += RotarySystem_PropertyChanged;
dispatcherTimer = new DispatcherTimer();
dispatcherTimer.Interval = TimeSpan.FromSeconds(0.1);
dispatcherTimer.Tick += DispatcherTimer_Tick;
stopwatch_rpos = new Stopwatch();
}
void updateRSpeed()
{ {
if (IsForw) if (IsForw)
{ {
...@@ -151,16 +163,7 @@ namespace FLY.Winder.Server ...@@ -151,16 +163,7 @@ namespace FLY.Winder.Server
{ {
RSpeed = 0; RSpeed = 0;
} }
});
this.PropertyChanged += RotarySystem_PropertyChanged;
dispatcherTimer = new DispatcherTimer();
dispatcherTimer.Interval = TimeSpan.FromSeconds(0.1);
dispatcherTimer.Tick += DispatcherTimer_Tick;
stopwatch_rpos = new Stopwatch();
} }
private void DispatcherTimer_Tick(object sender, EventArgs e) private void DispatcherTimer_Tick(object sender, EventArgs e)
{ {
double totalSeconds = stopwatch_rpos.Elapsed.TotalSeconds; double totalSeconds = stopwatch_rpos.Elapsed.TotalSeconds;
...@@ -199,7 +202,8 @@ namespace FLY.Winder.Server ...@@ -199,7 +202,8 @@ namespace FLY.Winder.Server
IsTurnSign0 = (!IsReversed) ? winderAccessory.IsRotaryBackwTurn : winderAccessory.IsRotaryForwTurn; IsTurnSign0 = (!IsReversed) ? winderAccessory.IsRotaryBackwTurn : winderAccessory.IsRotaryForwTurn;
IsTurnSign1 = (!IsReversed) ? winderAccessory.IsRotaryForwTurn : winderAccessory.IsRotaryBackwTurn; IsTurnSign1 = (!IsReversed) ? winderAccessory.IsRotaryForwTurn : winderAccessory.IsRotaryBackwTurn;
} }
else if (e.PropertyName == nameof(IsTurnSign0)) { else if (e.PropertyName == nameof(IsTurnSign0))
{
if (IsTurnSign0) if (IsTurnSign0)
{ {
RPosAtTurnSign0 = RPosGlobal; RPosAtTurnSign0 = RPosGlobal;
...@@ -220,13 +224,21 @@ namespace FLY.Winder.Server ...@@ -220,13 +224,21 @@ namespace FLY.Winder.Server
RPosAtOrgSign = RPosGlobal; RPosAtOrgSign = RPosGlobal;
} }
} }
else { else
{
if (IsBackw) if (IsBackw)
{ {
RPosAtOrgSign = RPosGlobal; RPosAtOrgSign = RPosGlobal;
} }
} }
} }
else if (e.PropertyName == nameof(IsForw))
{
updateRSpeed();
}
else if (e.PropertyName == nameof(IsBackw)) {
updateRSpeed();
}
} }
string filePath = "rotary.json"; string filePath = "rotary.json";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment