diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/Blowing.cs b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/Blowing.cs index 153433a11a932d2b9e31886e44bb1d8cfd37a00e..e3aa11b10013cd2080030830d96dc12c817527e5 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/Blowing.cs +++ b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/Blowing.cs @@ -15,14 +15,49 @@ namespace FLY.Simulation.Blowing { #region 傿•° #region 旋转架 - + /// <summary> + /// 360° è¿žç»æ—‹è½¬ + /// </summary> + [JsonProperty] + public bool Is360 { get; set; } + /// <summary> + /// æ£å‘旋转 + /// </summary> + public bool IsForw { get; set; } + + /// <summary> + /// 旋转架å¤ä½ä¸ + /// </summary> + public bool IsOrg { get; set; } + + /// <summary> + /// 旋转架å¯åŠ¨ä¸ + /// </summary> + public bool IsRotationOn { get; set; } + + /// <summary> + /// 牵引å¯åŠ¨ä¸ + /// </summary> + public bool IsTractionOn { get; set; } + + /// <summary> + /// 1圈总脉冲 + /// </summary> + [JsonProperty] + public double PosOfR { get; set; } + + /// <summary> /// 两个é™ä½é—´çš„角度范围 != 旋转的总角度,é™ä½å€¼ ° /// </summary> [JsonProperty] public double AngleRange { get; set; } - + /// <summary> + /// å¤ä½ä¿¡å·è§’度范围° + /// </summary> + [JsonProperty] + public double OrgAngleRange { get; set; } /// <summary> /// 旋转的速度, min/R 1R = 360° /// </summary> @@ -108,11 +143,18 @@ namespace FLY.Simulation.Blowing #endregion #region åŠ¨æ€æ•°æ® + + + /// <summary> /// 当å‰äººå—架角度 ° /// </summary> public double CurrAngle { get; private set; } /// <summary> + /// 全局角度 ° + /// </summary> + public double GlobalAngle { get; private set; } + /// <summary> /// 当å‰é€Ÿåº¦ï¼Œå•ä½ Â°/s /// </summary> public double CurrAngleVelocity { get; private set; } @@ -129,7 +171,6 @@ namespace FLY.Simulation.Blowing #endregion public HMI mHMI; - private int avg; public int Avg { get; set; } /// <summary> /// åŽŸå§‹æ•°æ® @@ -167,7 +208,8 @@ namespace FLY.Simulation.Blowing { //撞了é™ä½åŽï¼Œé™ä½ä¿¡å·ä¸€ç›´åœ¨ã€‚。。。 - + PosOfR = 50000; + OrgAngleRange = 5;//å¤ä½ä¿¡å·è§’度° AngleRange = 350;//两个é™ä½é—´çš„角度范围350° AngleVelocity = 6;//出é™ä½ 到 æ’žå¦ä¸€ä¸ªé™ä½çš„æ—¶é—´ 8min/ 360° AngleAccTime = 1;//åŠ é€Ÿæ—¶é—´1s @@ -217,6 +259,15 @@ namespace FLY.Simulation.Blowing mHMI = new HMI(); mHMI.mAirRing = mAirRing2; + + + + Is360 = false; + + IsForw = true; + IsOrg = false; + IsRotationOn = true; + IsTractionOn = true; } void mAirRing2_AfterDatasUpdateEvent(ObservableCollection<int> obj) @@ -427,7 +478,7 @@ namespace FLY.Simulation.Blowing if (percent < 0) { angle = 0; - return false; + return true; } //找到了 angle = (mPositionAngleList[idx1].angle - mPositionAngleList[idx2].angle) * percent + mPositionAngleList[idx2].angle; @@ -435,7 +486,7 @@ namespace FLY.Simulation.Blowing } } angle = 0; - return false; + return true; } public FilmData GetData(double position) @@ -449,7 +500,13 @@ namespace FLY.Simulation.Blowing return GetData(position, angle); } - + double GetValidAngle(double a) { + while (a >= 360) + a -= 360; + while (a < 0) + a += 360; + return a; + } /// <summary> /// 获å–è†œæ³¡æ•°æ® /// </summary> @@ -467,17 +524,8 @@ namespace FLY.Simulation.Blowing //压æ‰å¯¹é¢çš„角度 double a_other = 360 - a; - a += angle; - if (a >= 360) - a -= 360; - else if (a < 0) - a += 360; - - a_other += angle; - if (a_other >= 360) - a_other -= 360; - else if (a_other < 0) - a_other += 360; + a = GetValidAngle( a + angle ); + a_other = GetValidAngle(a_other + angle); int dat_idx1 = (int)(a / 360 * AfterDatas.Count()); int dat_idx2 = (int)(a_other / 360 * AfterDatas.Count()); @@ -497,6 +545,7 @@ namespace FLY.Simulation.Blowing /// </summary> public void OnPoll(DateTime now) { + UpdatePositionAndAngle(now); } @@ -527,10 +576,43 @@ namespace FLY.Simulation.Blowing /// </summary> DateTime mDTWrap = DateTime.MinValue; - void UpdateAngleV(DateTime now, TimeSpan ts) + + /// <summary> + /// 更新旋转 + /// </summary> + /// <param name="now"></param> + /// <param name="ts"></param> + void UpdateAngleV(DateTime now, TimeSpan ts) + { + if (IsOrg) { + IsRotationOn = false; + + UpdateAngleV_Org(now, ts); + return; + } + + if (IsRotationOn) { + if (Is360) + { + UpdateAngleV_360(now, ts); + } + else { + UpdateAngleV_ForwBackw(now, ts); + } + } + } + + + + /// <summary> + /// æ£å呿—‹è½¬ + /// </summary> + /// <param name="now"></param> + /// <param name="ts"></param> + void UpdateAngleV_ForwBackw(DateTime now, TimeSpan ts) { double angle = CurrAngle + CurrAngleVelocity * ts.TotalSeconds; - //旋转 + switch (mState) { case STATE.Constant: @@ -566,9 +648,12 @@ namespace FLY.Simulation.Blowing { //å转 anglev = -anglev; + IsForw = false; + } + else { + IsForw = true; } - double dv = anglev - CurrAngleVelocity; - CurrAngleAccV = dv / AngleAccTime; + CurrAngleAccV = anglev / AngleAccTime; } } break; case STATE.Acc: @@ -594,28 +679,111 @@ namespace FLY.Simulation.Blowing } } break; } + double delta = angle - CurrAngle; + GlobalAngle += delta; + CurrAngle = angle; + } + + + /// <summary> + /// è¿žç»æ—‹è½¬ + /// </summary> + /// <param name="now"></param> + /// <param name="ts"></param> + void UpdateAngleV_360(DateTime now, TimeSpan ts) + { + double anglev = 360.0 / (AngleVelocity * 60); + if (IsForw) + CurrAngleVelocity = anglev; + else + CurrAngleVelocity = -anglev; + + double angle = CurrAngle + CurrAngleVelocity * ts.TotalSeconds; + double delta = angle - CurrAngle; + GlobalAngle += delta; + + while (angle >= 360) + angle -= 360; + while (angle < 0) + angle +=360; + + CurrAngle = angle; + + } + + /// <summary> + /// å¤ä½ + /// </summary> + /// <param name="now"></param> + /// <param name="ts"></param> + void UpdateAngleV_Org(DateTime now, TimeSpan ts) + { + double anglev = 360.0 / (AngleVelocity * 60); + + if (CurrAngle > 0){ + CurrAngleVelocity = -anglev; + } + else if (CurrAngle < 0) + { + CurrAngleVelocity = anglev; + } + else { + CurrAngleVelocity = 0; + IsOrg = false; + return; + } + double angle = CurrAngle + CurrAngleVelocity * ts.TotalSeconds; + double delta = angle - CurrAngle; + + if (((CurrAngle > 0) && (angle <= 0))|| + ((CurrAngle < 0) && (angle >= 0))) + { + delta = 0 - CurrAngle; + CurrAngle = 0; + CurrAngleVelocity = 0; + IsOrg = false; + return; + } + GlobalAngle += delta; CurrAngle = angle; } + + + + /// <summary> + /// é©±åŠ¨å™¨ï¼Œæ ¹æ®æ—¶é—´ï¼Œæ›´æ–°angle, + /// </summary> + /// <param name="now"></param> void UpdatePositionAndAngle(DateTime now) { if (mDTLast == DateTime.MinValue) { + double position = FilmDistance; + DateTime time = now; + while (position > 0) + { + mPositionAngleList.Insert(0, + new PositionAngleInfo() + { + dt = time, + position = position, + angle = 0 + }); + TimeSpan ts1 = TimeSpan.FromMilliseconds(10); + time -= ts1; + position -= FilmVelocity * ts1.TotalMinutes; + } + mDTLast = now; - CurrFilmLength = 0; + CurrFilmLength = FilmDistance; CurrAngle = 0;//在ä¸é—´ mState = STATE.Constant; double anglev = 360.0 / (AngleVelocity * 60); CurrAngleVelocity = anglev; - mPositionAngleList.Add( - new PositionAngleInfo() - { - dt = mDTLast, - position = CurrFilmLength, - angle = CurrAngle - }); + return; } @@ -627,7 +795,12 @@ namespace FLY.Simulation.Blowing mDTLast = dt; //线速度。。。。 - CurrFilmLength += FilmVelocity * ts.TotalMinutes; + + + + if(IsTractionOn)//å¯åŠ¨ç‰µå¼• + CurrFilmLength += FilmVelocity * ts.TotalMinutes; + UpdateAngleV(dt, ts); @@ -642,20 +815,46 @@ namespace FLY.Simulation.Blowing if (mPositionAngleList.Count > ListCap) mPositionAngleList.RemoveAt(0); } - - public bool CheckLimit1() + public bool CheckOrg() { - if (CurrAngle >= AngleRange / 2) + if (CurrAngle <= OrgAngleRange / 2 && CurrAngle >= -OrgAngleRange / 2) return true; else return false; } + public bool CheckLimit1() + { + if (Is360) + { + if (CurrAngleVelocity < 0) + return true; + else + return false; + } + else + { + if (CurrAngle >= AngleRange / 2) + return true; + else + return false; + } + } public bool CheckLimit0() { - if (CurrAngle <= (-AngleRange / 2)) - return true; + if (Is360) + { + if (CurrAngleVelocity > 0) + return true; + else + return false; + } else - return false; + { + if (CurrAngle <= (-AngleRange / 2)) + return true; + else + return false; + } } public bool CheckRoll() { diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FLY.Simulation.Blowing.csproj b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FLY.Simulation.Blowing.csproj index 922272a4d0094e0c2165e41b0be3c051eeeb4e97..cc193b014ee4ccd662b497c635890ca18574d593 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FLY.Simulation.Blowing.csproj +++ b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FLY.Simulation.Blowing.csproj @@ -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" /> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FodyWeavers.xsd b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FodyWeavers.xsd index 2f1b8aae7ac25cfe2d38c6569ec17c5095b4c29a..69dbe488cee79454bf999f336aa11c7dd4321892 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/FodyWeavers.xsd @@ -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> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/GageAD.cs b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/GageAD.cs index 3065f5c3c13173821abae866ffc4431b63174036..7245720a6be9cb880b19f1299d72147a681ad932 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Blowing/GageAD.cs +++ b/Project.FLY.FlyADBase/FLY.Simulation.Blowing/GageAD.cs @@ -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); } } } diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Casting/FLY.Simulation.Casting.csproj b/Project.FLY.FlyADBase/FLY.Simulation.Casting/FLY.Simulation.Casting.csproj index c27f6f8ef0a0b607ce3712d7e8a94e7fe54fe86c..45806e3a8a83ac06babcfbc134acf5e16e6bab3d 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Casting/FLY.Simulation.Casting.csproj +++ b/Project.FLY.FlyADBase/FLY.Simulation.Casting/FLY.Simulation.Casting.csproj @@ -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" /> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Casting/FodyWeavers.xsd b/Project.FLY.FlyADBase/FLY.Simulation.Casting/FodyWeavers.xsd index 2f1b8aae7ac25cfe2d38c6569ec17c5095b4c29a..69dbe488cee79454bf999f336aa11c7dd4321892 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Casting/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/FLY.Simulation.Casting/FodyWeavers.xsd @@ -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> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Coating/FLY.Simulation.Coating.csproj b/Project.FLY.FlyADBase/FLY.Simulation.Coating/FLY.Simulation.Coating.csproj index b624bcaa71b50e5473ddf49d78665c6793084352..a9f367b0e988c813aa1db104d0fd646e42f61113 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Coating/FLY.Simulation.Coating.csproj +++ b/Project.FLY.FlyADBase/FLY.Simulation.Coating/FLY.Simulation.Coating.csproj @@ -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" /> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Coating/FodyWeavers.xsd b/Project.FLY.FlyADBase/FLY.Simulation.Coating/FodyWeavers.xsd index 2f1b8aae7ac25cfe2d38c6569ec17c5095b4c29a..69dbe488cee79454bf999f336aa11c7dd4321892 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Coating/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/FLY.Simulation.Coating/FodyWeavers.xsd @@ -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> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLY.Simulation.Flyad7.csproj b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLY.Simulation.Flyad7.csproj index e10d915f0425bdea4df607cccd28b74f68b7c4e0..718becb12a4415a09034c99eda37fe2d9a0d28d8 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLY.Simulation.Flyad7.csproj +++ b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLY.Simulation.Flyad7.csproj @@ -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" /> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLYAD7.cs b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLYAD7.cs index 144ee2d118904acb44b891624cf48db59f2844f7..f9a1eadcd5cc2fd3b73f4d4901a69cc94092286a 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLYAD7.cs +++ b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FLYAD7.cs @@ -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)) + 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; } diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FodyWeavers.xsd b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FodyWeavers.xsd index 2f1b8aae7ac25cfe2d38c6569ec17c5095b4c29a..69dbe488cee79454bf999f336aa11c7dd4321892 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/FodyWeavers.xsd @@ -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> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/OBJProxy/PUSH_DATA.cs b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/OBJProxy/PUSH_DATA.cs index 650eed632fa7041bde60ca11a73214a7751c9107..67798b75f7bb38e1c1145be00de7a29bf1300942 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/OBJProxy/PUSH_DATA.cs +++ b/Project.FLY.FlyADBase/FLY.Simulation.Flyad7/OBJProxy/PUSH_DATA.cs @@ -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 diff --git a/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FLY.Simulation.HeaderAndTailer.csproj b/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FLY.Simulation.HeaderAndTailer.csproj index 6219dd534fe64427b7ebb4c762ae2477bba3415f..3543a4e7202b26d35bf4f089102141ee92a2cf48 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FLY.Simulation.HeaderAndTailer.csproj +++ b/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FLY.Simulation.HeaderAndTailer.csproj @@ -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" /> diff --git a/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FodyWeavers.xsd b/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FodyWeavers.xsd index 2f1b8aae7ac25cfe2d38c6569ec17c5095b4c29a..69dbe488cee79454bf999f336aa11c7dd4321892 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/FLY.Simulation.HeaderAndTailer/FodyWeavers.xsd @@ -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> diff --git a/Project.FLY.FlyADBase/FLY.Simulation/FLY.Simulation.csproj b/Project.FLY.FlyADBase/FLY.Simulation/FLY.Simulation.csproj index fc2f6b35406f41ffd386e6d8a41dca57fb42e64c..9c0522c98356734f4ff2af72b3de2f94b1f2e5dc 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation/FLY.Simulation.csproj +++ b/Project.FLY.FlyADBase/FLY.Simulation/FLY.Simulation.csproj @@ -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" /> diff --git a/Project.FLY.FlyADBase/FLY.Simulation/FodyWeavers.xsd b/Project.FLY.FlyADBase/FLY.Simulation/FodyWeavers.xsd index 2f1b8aae7ac25cfe2d38c6569ec17c5095b4c29a..69dbe488cee79454bf999f336aa11c7dd4321892 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/FLY.Simulation/FodyWeavers.xsd @@ -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> diff --git a/Project.FLY.FlyADBase/FLY.Simulation/IODefinition.cs b/Project.FLY.FlyADBase/FLY.Simulation/IODefinition.cs index 39190970c5bd063bb86dfee9febad8020f4e6059..3266cb3cb1605b7641b56c18103458ba44caf7b7 100644 --- a/Project.FLY.FlyADBase/FLY.Simulation/IODefinition.cs +++ b/Project.FLY.FlyADBase/FLY.Simulation/IODefinition.cs @@ -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; } } diff --git a/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FLYAD7_Simulation_Wpf.csproj b/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FLYAD7_Simulation_Wpf.csproj index 066597885c2683b0630a553c611eac2e309a2b0e..83faa0a4cd3f51a58b6c8c3964a9737a841128bd 100644 --- a/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FLYAD7_Simulation_Wpf.csproj +++ b/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FLYAD7_Simulation_Wpf.csproj @@ -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" /> diff --git a/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FodyWeavers.xsd b/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FodyWeavers.xsd index 112d36316ee64a6a36766b96b3b32de9cf5d66a4..70aa3c921631d4bdcc473030b87107ec2d4cb842 100644 --- a/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/FodyWeavers.xsd @@ -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"> diff --git a/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml b/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml index 275296ec7ddff8be223e8619542dbb85ebd7a253..daad4fe89e3362ba41c7e2835a43bcc590f4f6c2 100644 --- a/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml +++ b/Project.FLY.FlyADBase/FLYAD7_Simulation_Wpf/WindowBlowing.xaml @@ -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> diff --git a/Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs b/Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs index e7d2fecb47cab430a887cfddbeafcea67d1058b1..1706156d4400a725437a85def376cbafe06bef01 100644 --- a/Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs +++ b/Project.FLY.FlyADBase/FlyADBase/FlyAD7.cs @@ -27,18 +27,14 @@ 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 { bool bNeedGet; @@ -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( @@ -353,11 +409,7 @@ namespace FlyADBase SyncClear(); 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,36 +628,31 @@ 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; - } - return dt; - } + 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; + //} + 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))) { diff --git a/Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs b/Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs index 87f67e4758e64f3ba304bf6da2be4824e332abf9..8e2a9e26da7decf178a3cd3754baaf051e8fd410 100644 --- a/Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs +++ b/Project.FLY.FlyADBase/FlyADBase/IFlyADClientAdv.cs @@ -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> diff --git a/Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj b/Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj index 1d77c868745f25d59a2e61f12593704c846f50d0..fdaec7ade4e0119ae0350a02f41b9d1eeea85430 100644 --- a/Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj +++ b/Project.FLY.FlyADBase/Flyad7_WPF/Flyad7_WPF.csproj @@ -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> diff --git a/Project.FLY.FlyADBase/Flyad7_WPF/FodyWeavers.xsd b/Project.FLY.FlyADBase/Flyad7_WPF/FodyWeavers.xsd index 112d36316ee64a6a36766b96b3b32de9cf5d66a4..70aa3c921631d4bdcc473030b87107ec2d4cb842 100644 --- a/Project.FLY.FlyADBase/Flyad7_WPF/FodyWeavers.xsd +++ b/Project.FLY.FlyADBase/Flyad7_WPF/FodyWeavers.xsd @@ -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">