Commit 809883b9 authored by 潘栩锋's avatar 潘栩锋 🚴

Squashed commit of the following:

commit 3efa3a6e
Author: simon <panruising@163.com>
Date:   Fri Feb 26 23:56:10 2021 +0800

    只是把 PUSH_DATA 的字符串改为 nameof() 而已

commit d6493b28
Merge: 7ea0eeb2 e0cc5eb7
Author: simon <panruising@163.com>
Date:   Fri Feb 26 20:36:05 2021 +0800

    Merge remote-tracking branch 'remotes/gitlab/feature-feng-updateMahApp-20201203'

commit 7ea0eeb2
Author: simon <panruising@163.com>
Date:   Thu Jan 28 23:25:22 2021 +0800

    模拟AD盒支持360旋转

commit f0287233
Author: simon <panruising@163.com>
Date:   Sun Jan 24 23:08:03 2021 +0800

    flyad7 吹膜模拟添加360旋转, 旋转架复位,旋转架停止, 牵引停止
parent e0cc5eb7
......@@ -69,7 +69,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
......
......@@ -137,11 +137,17 @@ namespace FLY.Simulation.Blowing
if (mBlowing.CheckLimit0())
Misc.MyBase.CLEARBIT(ref istatus, IODefinition.IN_RENZIJIA_0 - 1);
}
if (mBlowing.CheckLimit1())
Misc.MyBase.CLEARBIT(ref istatus, IODefinition.IN_RENZIJIA_1-1);
Misc.MyBase.CLEARBIT(ref istatus, IODefinition.IN_RENZIJIA_1 - 1);
if (mBlowing.CheckOrg())
Misc.MyBase.CLEARBIT(ref istatus, IODefinition.IN_RENZIJIA_ORG - 1);
if (mBlowing.CheckRoll())
Misc.MyBase.CLEARBIT(ref istatus, IODefinition.IN_RSENSOR-1);
Misc.MyBase.CLEARBIT(ref istatus, IODefinition.IN_RSENSOR - 1);
return istatus;
}
......@@ -149,11 +155,12 @@ namespace FLY.Simulation.Blowing
public int GetPosition2()
{
return 0;
double p = mBlowing.GlobalAngle / 360;
return (int)(mBlowing.PosOfR * p);
}
public int GetSpeed2()
{
return 0;
return (int)(mBlowing.PosOfR * mBlowing.CurrAngleVelocity / 360);
}
}
}
......
......@@ -61,7 +61,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
......
......@@ -68,7 +68,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
......
......@@ -96,7 +96,7 @@
<Version>10.1.1</Version>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -410,8 +410,9 @@ namespace FLY.Simulation.Flyad7
Position2Org = mSimGageAD.GetPosition2();
int pos2;
if(mSyncPos2List.Position2Changed(Position2, out pos2))
//同步模式
if (mSyncPos2List.Position2Changed(Position2, out int pos2))
{
Position2 = pos2;
}
......@@ -439,12 +440,12 @@ namespace FLY.Simulation.Flyad7
else
Misc.MyBase.SIGNBIT(ref istatus, IODefinition.IN_ORG - 1);
//同步模式下才有这个
UInt16 inchange = (UInt16)(istatus ^ IStatus);
if (Misc.MyBase.CHECKBIT(inchange, IODefinition.IN_VSENSOR - 1))
{
//处理position2
int pos2;
if(mSyncPos2List.VSensorChanged(Misc.MyBase.CHECKBIT(istatus, IODefinition.IN_VSENSOR - 1), Position2, out pos2))
if (mSyncPos2List.VSensorChanged(Misc.MyBase.CHECKBIT(istatus, IODefinition.IN_VSENSOR - 1), Position2, out int pos2))
{
Position2 = pos2;
}
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
......
......@@ -69,7 +69,7 @@ namespace FLY.Simulation.Flyad7.OBJProxy
void Data_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == "IStatus")
if (e.PropertyName == nameof(Data.IStatus))
{
ostatus = Data.OStatus;
UInt16 inchange = (UInt16)(istatus ^ Data.IStatus);
......@@ -86,7 +86,7 @@ namespace FLY.Simulation.Flyad7.OBJProxy
pos2 = Data.Position2
}.ToBytes());
}
else if ((e.PropertyName == "DriveStatus")||(e.PropertyName == "Marker"))
else if ((e.PropertyName == nameof(Data.DriveStatus))||(e.PropertyName == nameof(Data.Marker)))
{
CurrObjSys.PushObjInfoEx(this, FLYAD7_OBJ_INTERFACE.PUSH_DATA_INTERFACE.PUSH_STATUS,
new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState
......
......@@ -61,7 +61,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
......
......@@ -57,7 +57,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
......
......@@ -7,14 +7,45 @@ namespace FLY.Simulation
{
public class IODefinition
{
/// <summary>
/// 归0
/// </summary>
public const int IN_ORG = 2;
/// <summary>
/// 反向限位
/// </summary>
public const int IN_MINLIMIT = 3;
/// <summary>
/// 正向限位
/// </summary>
public const int IN_MAXLIMIT = 4;
/// <summary>
/// 手动正转
/// </summary>
public const int IN_FORW = 7;
/// <summary>
/// 手动反转
/// </summary>
public const int IN_BACKW = 8;
/// <summary>
/// 旋转架 信号0
/// </summary>
public const int IN_RENZIJIA_0 = 9;
/// <summary>
/// 旋转架 信号1
/// </summary>
public const int IN_RENZIJIA_1 = 10;
/// <summary>
/// 线速度
/// </summary>
public const int IN_RSENSOR = 11;
/// <summary>
/// 纵向边界信息
/// </summary>
public const int IN_VSENSOR = 12;
/// <summary>
/// 旋转架 复位信号
/// </summary>
public const int IN_RENZIJIA_ORG = 12;
}
}
......@@ -192,7 +192,7 @@
<Version>12.0.3</Version>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
......
......@@ -164,7 +164,21 @@
<TextBlock Style="{StaticResource FieldNameStyle}" Text="第1根加热棒对应角度"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding Channel1stAngle}"/>
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="2">
<TextBlock Style="{StaticResource FieldNameStyle}" Text="1圈脉冲数"/>
<TextBox Style="{StaticResource InputStyle}" Text="{Binding PosOfR}"/>
</StackPanel>
<Button Style="{StaticResource ButtonStyle}" Content="保存" Click="btnSaveClick"/>
<GroupBox Header="运动控制">
<StackPanel>
<CheckBox Content="连续旋转" Height="16" Margin="5" IsChecked="{Binding Is360}" />
<CheckBox Content="正向旋转" Height="16" Margin="5" IsChecked="{Binding IsForw}" />
<CheckBox Content="复位" Height="16" Margin="5" IsChecked="{Binding IsOrg}" />
<CheckBox Content="旋转启动" Height="16" Margin="5" IsChecked="{Binding IsRotationOn}" />
<CheckBox Content="牵引启动" Height="16" Margin="5" IsChecked="{Binding IsTractionOn}" />
</StackPanel>
</GroupBox>
</StackPanel>
</GroupBox>
......
......@@ -27,17 +27,13 @@ namespace FlyADBase
const int MARKNO_SET_SYSPARAM = 3;
const int MARKNO_SET_SAVE = 4;
#endregion
#region 成员变量
TCPCConn conn = null;
/// <summary>
/// 不设置服务器
/// </summary>
private bool bShieldSetValueEx = false;
/// <summary>
/// AD盒使用时间刷新
/// </summary>
private DateTime dt_surplus = DateTime.MinValue;
class DtAndBool
{
......@@ -72,8 +68,11 @@ namespace FlyADBase
int last_position = int.MinValue;
bool isReadyGetState = false;
bool isReadyGetPos1AD1 = false;
bool isReadyGetPos2 = false;
bool isReadyGetIO = false;
#endregion
/// <summary>
///
......@@ -81,12 +80,27 @@ namespace FlyADBase
public FlyAD7()
{
Now = DateTime.Now;
mSysTick.Reset();
mSysTick.BeReseted += MSysTick_BeReseted;
this.PropertyChanged += new PropertyChangedEventHandler(FlyAD7_PropertyChanged);
PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, new PollModule.PollHandler(OnPoll));
//每隔一个小时
PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, () =>
{
if (!IsConnected)
return;
if (Surplus < 60000)
{
if (Surplus > 0)
{
Surplus--;
CurrObjSys.CallFunctionEx(conn, FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.ID, ID,
FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.CALL_SURPLUS_SUB,
null);
}
}
}, TimeSpan.FromMinutes(60));
//60秒内收不到1个timegrid ,就会重连
PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD,
......@@ -108,12 +122,16 @@ namespace FlyADBase
}
}
}
}, TimeSpan.FromSeconds(1));
constructor2();
}
private void MSysTick_BeReseted()
{
BeResetTime = DateTime.Now;
}
#region IFlyADClient
/// <summary>
/// 连接成功
......@@ -172,7 +190,16 @@ namespace FlyADBase
conn = CurrObjSys.Connect_to_Another_OBJSys(LocalEP, ID);
conn.HasCRC = HasCRC;
}
/// <summary>
/// 已经从AD盒获取全部当前数据
/// </summary>
public bool IsReady { get; protected set; }
/// <summary>
/// 通过判断systick,判断AD盒是否发生重启;
/// BeReseted为上一次被复位时间
/// </summary>
public DateTime BeResetTime { get; private set; }
/// <summary>
/// 用于同步, 最后一次 纵向信号 0->1 时,主轴脉冲
/// </summary>
......@@ -188,6 +215,30 @@ namespace FlyADBase
#endregion
void updateIsReady() {
if (isReadyGetState == false)
{
IsReady = false;
return;
}
if (isReadyGetPos1AD1 == false)
{
IsReady = false;
return;
}
if (isReadyGetPos2 == false)
{
IsReady = false;
return;
}
if (isReadyGetIO == false)
{
IsReady = false;
return;
}
IsReady = true;
return;
}
void FlyAD7_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(HasCRC))
......@@ -306,6 +357,11 @@ namespace FlyADBase
SENSE_CONFIG.ADD);
UpdateParam();
isReadyGetState = false;
isReadyGetPos1AD1 = false;
isReadyGetPos2 = false;
isReadyGetIO = false;
updateIsReady();
//DRIVE_MAN
CurrObjSys.GetValueEx(
......@@ -354,10 +410,6 @@ namespace FlyADBase
SyncEnd();
mSysTick.Reset();
Init2();
}
......@@ -400,6 +452,10 @@ namespace FlyADBase
Position = pack.pos;
//AD = pack.ad;
advGetPos1AD1(pack.ad);
isReadyGetPos1AD1 = true;
updateIsReady();
} break;
case FLYAD7_OBJ_INTERFACE.FLYADC_OBJ_INTERFACE.GET_POS2:
{
......@@ -411,6 +467,9 @@ namespace FlyADBase
if (!IsCalSpeed)
Speed2 = pack.speed2;
isReadyGetPos2 = true;
updateIsReady();
}
break;
}
......@@ -428,6 +487,9 @@ namespace FlyADBase
IStatus = pack.istatus;
OStatus = pack.ostatus;
advGetIo();
isReadyGetIO = true;
updateIsReady();
} break;
}
} break;
......@@ -451,13 +513,15 @@ namespace FlyADBase
} break;
case FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.GET_STATE:
{
//TODO ?????
FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState p = new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState();
if (!p.TryParse(infodata))
break;
DriveOrder = p.order;//TODO
DriveOrder = p.order;
DriveStatus = p.status;
Marker = p.marker;
isReadyGetState = true;
updateIsReady();
} break;
case FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.GET_SYNC_STATUS:
{
......@@ -473,7 +537,6 @@ namespace FlyADBase
if (!p.TryParse(infodata))
break;
//TODO
}
break;
}
......@@ -549,8 +612,7 @@ namespace FlyADBase
{
Int32 systick_1st = 0;
DateTime dt_1st = DateTime.MinValue;
Int32 systick_last = 0;
public event Action BeReseted;
public void Reset()
{
dt_1st = DateTime.MinValue;
......@@ -566,37 +628,32 @@ namespace FlyADBase
{
dt_1st = DateTime.Now;
systick_1st = systick;
systick_last = systick;
return dt_1st;
}
//记录与新的timemark 相差10秒,太大了,重新生成 timemark 与 dt 的关系
else if (Math.Abs(systick - systick_last) > 10000)
int ms = systick - systick_1st;
if ((ms < -1000) ||//时间被提前
(ms> 1000 * 60 * 3))//记录与新的timemark 相差3分钟,太大了,重新生成 timemark 与 dt 的关系
{
//被复位了
BeReseted?.Invoke();
dt_1st = DateTime.Now;
systick_1st = systick;
systick_last = systick;
return dt_1st;
}
else
{
int ms = systick - systick_1st;
systick_last = systick;
DateTime dt = dt_1st.AddMilliseconds(ms);
systick_1st = systick;
dt_1st = dt;
if (Math.Abs((DateTime.Now-dt).TotalSeconds) > 5000)//滞后5s,异常
{
//修正
dt = DateTime.Now;
dt_1st = dt;
}
//if (Math.Abs((DateTime.Now-dt).TotalSeconds) > 5000)//滞后5s,异常
//{
// //修正
// dt = DateTime.Now;
// dt_1st = dt;
//}
return dt;
}
}
}
TSysTick mSysTick = new TSysTick();
......@@ -836,25 +893,7 @@ namespace FlyADBase
DateTime now = DateTime.Now;
if (Surplus != 65535)
{
if (dt_surplus == DateTime.MinValue)
{
dt_surplus = now - TimeSpan.FromMinutes(40);//再过20分钟,就会 执行 使用时间+1
}
else if ((now - dt_surplus).TotalHours >= 1) //每隔一个小时 执行 使用时间+1
{
dt_surplus = now;
if (Surplus > 0)
{
Surplus--;
CurrObjSys.CallFunctionEx(conn, FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.ID, ID,
FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.CALL_SURPLUS_SUB,
null);
}
}
}
if (sysinfo_wait.NeedGet(now, TimeSpan.FromSeconds(1)))
{
......
......@@ -45,12 +45,23 @@ namespace FlyADBase
/// </summary>
void ReConnect();
/// <summary>
/// 已经从AD盒获取全部当前数据
/// </summary>
bool IsReady { get; }
/// <summary>
/// 通过判断systick,判断AD盒是否发生重启;
/// BeResetTime为上一次被复位时间
/// </summary>
DateTime BeResetTime { get; }
/// <summary>
/// 用于同步, 最后一次 纵向信号 0->1 时,主轴脉冲
/// </summary>
int LastPos2At01 { get; }
/// <summary>
/// 当前在同步状态
/// </summary>
......@@ -60,6 +71,8 @@ namespace FlyADBase
/// 同步列表,完成后,会删除
/// </summary>
ObservableCollection<SyncOrder> SyncOrders { get; }
}
/// <summary>
......@@ -67,6 +80,7 @@ namespace FlyADBase
/// </summary>
public interface IFlyADClientAdv : IFlyADClient
{
/// <summary>
/// 通过脉冲计算速度,不使用AD盒的输出
/// </summary>
......
......@@ -213,7 +213,7 @@
<Version>12.0.3</Version>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody">
<Version>3.2.5</Version>
<Version>3.3.1</Version>
</PackageReference>
<PackageReference Include="Unity">
<Version>5.11.7</Version>
......
......@@ -11,6 +11,16 @@
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
......@@ -31,6 +41,16 @@
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Costura" minOccurs="0" maxOccurs="1">
......
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