Commit 4a26be49 authored by 潘栩锋's avatar 潘栩锋 🚴

复制 v8 的 GraphStyle.xaml, PropertyBinding.cs

parent 5aed4f07
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:FLY.ControlLibrary.Converter"
>
<conv:PercentConverter x:Key="percentconv" />
<conv:VisibilityConverter x:Key="visbilityconv" />
<conv:TimeSpan2MinConverter x:Key="timespanconv"/>
<conv:TimeSpan2MinConverter x:Key="ts2minconv"/>
<conv:TimeSpan2msConverter x:Key="ts2msconv"/>
<conv:TimeSpan2SecConverter x:Key="ts2secconv"/>
<conv:TimeSpan2MinSecConverter x:Key="ts2minsecconv" />
<conv:Equals2VisibleConverter_Collapsed x:Key="e2visconv_collapsed" />
<conv:Equals2VisibleConverter x:Key="e2visconv" />
<conv:Equals2HiddenConverter x:Key="e2hiddenconv" />
<conv:Equals2CollapsedConverter x:Key="e2collapsedconv" />
<conv:Equals2BoolConverter x:Key="e2bconv"/>
<conv:BoolReverseConverter x:Key="brconv"/>
<conv:RatioConverter x:Key="ratioconv" />
<conv:RatioConverter_TimeSpan x:Key="ratioconv_ts" />
<conv:Item2IndexConverter x:Key="i2iConv"/>
<conv:Item2NoConverter x:Key="i2noConv"/>
</ResourceDictionary>
\ No newline at end of file
...@@ -145,6 +145,10 @@ ...@@ -145,6 +145,10 @@
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Converter\Converters.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Converter\Dictionary_MyConv.xaml"> <Page Include="Converter\Dictionary_MyConv.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
......
...@@ -163,29 +163,26 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -163,29 +163,26 @@ namespace FLYAD7_OBJ_INTERFACE
} }
public class Pack_DriveState : IPack public class Pack_DriveState : IPack
{ {
//当前运行指令(1B)+当前运行状态(1B)+运行模式(1B)+ systick(4B) + 命令序列码(4B) //当前运行指令(1B)+当前运行状态(1B)+运行模式(1B)
public DRIVE_MAN_ORDER order; public DRIVE_MAN_ORDER order;
public DRIVE_MAN_STATUS status; public DRIVE_MAN_STATUS status;
public byte mode; public byte mode;
public int systick;
public Int32 marker;
#region IPack 成员 #region IPack 成员
public byte[] ToBytes() public virtual byte[] ToBytes()
{ {
List<byte> buf = new List<byte>(); List<byte> buf = new List<byte>();
buf.Add((byte)order); buf.Add((byte)order);
buf.Add((byte)status); buf.Add((byte)status);
buf.Add((byte)mode); buf.Add((byte)mode);
buf.AddRange(BitConverter.GetBytes(systick));
buf.AddRange(BitConverter.GetBytes(marker));
return buf.ToArray(); return buf.ToArray();
} }
public bool TryParse(byte[] value) public virtual bool TryParse(byte[] value)
{ {
if (value.Count() < (1 + 1 + 1 + 4 + 4)) if (value.Count() < (1 + 1 + 1))
return false; return false;
int idx = 0; int idx = 0;
order = (DRIVE_MAN_ORDER)value[idx]; order = (DRIVE_MAN_ORDER)value[idx];
...@@ -194,6 +191,36 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -194,6 +191,36 @@ namespace FLYAD7_OBJ_INTERFACE
idx++; idx++;
mode = value[idx]; mode = value[idx];
idx++; idx++;
return true;
}
#endregion
}
public class Pack_DriveState_2 : Pack_DriveState
{
//当前运行指令(1B)+当前运行状态(1B)+运行模式(1B)+ systick(4B) + 命令序列码(4B)
public int systick;
public Int32 marker;
#region IPack 成员
public override byte[] ToBytes()
{
List<byte> buf = new List<byte>();
buf.AddRange(base.ToBytes());
buf.AddRange(BitConverter.GetBytes(systick));
buf.AddRange(BitConverter.GetBytes(marker));
return buf.ToArray();
}
public override bool TryParse(byte[] value)
{
if (!base.TryParse(value))
return false;
int idx = 3;
if (value.Count() < (1 + 1 + 1 + 4 + 4))
return false;
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
idx += 4; idx += 4;
marker = BitConverter.ToInt32(value, idx); marker = BitConverter.ToInt32(value, idx);
...@@ -201,6 +228,21 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -201,6 +228,21 @@ namespace FLYAD7_OBJ_INTERFACE
return true; return true;
} }
public virtual bool TryParse_version(byte[] value, out int version)
{
version = 1;
if (!base.TryParse(value))
return false;
int idx = 3;
if (value.Count() < (1 + 1 + 1 + 4 + 4))
return true;
version = 2;
systick = BitConverter.ToInt32(value, idx);
idx += 4;
marker = BitConverter.ToInt32(value, idx);
idx += 4;
return true;
}
#endregion #endregion
} }
public class Pack_SyncStatus : IPack public class Pack_SyncStatus : IPack
...@@ -221,7 +263,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -221,7 +263,7 @@ namespace FLYAD7_OBJ_INTERFACE
if (value.Count() < (1)) if (value.Count() < (1))
return false; return false;
int idx = 0; int idx = 0;
status = (SYNC_STATUS)value[idx]; status = (SYNC_STATUS)value[idx];
idx++; idx++;
return true; return true;
...@@ -592,7 +634,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -592,7 +634,7 @@ namespace FLYAD7_OBJ_INTERFACE
{ {
buf.Add((byte)'I'); buf.Add((byte)'I');
} }
else else
{ {
buf.Add((byte)'N'); buf.Add((byte)'N');
} }
...@@ -601,7 +643,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -601,7 +643,7 @@ namespace FLYAD7_OBJ_INTERFACE
} }
public override bool TryParse(byte[] value) public override bool TryParse(byte[] value)
{ {
if (value.Count() < (2+4+1)) if (value.Count() < (2 + 4 + 1))
return false; return false;
int idx = 0; int idx = 0;
idx += 2; idx += 2;
...@@ -1278,7 +1320,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1278,7 +1320,7 @@ namespace FLYAD7_OBJ_INTERFACE
#endregion #endregion
#region Pack #region Pack
public class Pack_PushPos1 public class Pack_PushPos1
{ {
public int pos1; public int pos1;
public int speed1; public int speed1;
...@@ -1470,7 +1512,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1470,7 +1512,7 @@ namespace FLYAD7_OBJ_INTERFACE
/// </summary> /// </summary>
/// <param name="value"></param> /// <param name="value"></param>
/// <returns></returns> /// <returns></returns>
public virtual bool TryParse(byte[] value,out int cnt) public virtual bool TryParse(byte[] value, out int cnt)
{ {
cnt = 2; cnt = 2;
int idx = 0; int idx = 0;
...@@ -1492,7 +1534,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1492,7 +1534,7 @@ namespace FLYAD7_OBJ_INTERFACE
} }
return true; return true;
} }
} }
public class Pack_PushStatus public class Pack_PushStatus
...@@ -1510,7 +1552,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1510,7 +1552,7 @@ namespace FLYAD7_OBJ_INTERFACE
List<byte> buf = new List<byte>(); List<byte> buf = new List<byte>();
buf.Add((byte)order); buf.Add((byte)order);
buf.Add((byte)status); buf.Add((byte)status);
return buf.ToArray(); return buf.ToArray();
} }
/// <summary> /// <summary>
...@@ -1530,7 +1572,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1530,7 +1572,7 @@ namespace FLYAD7_OBJ_INTERFACE
#endregion #endregion
} }
public class Pack_PushGrid public class Pack_PushGrid
{ {
public Misc.DIRECTION direction; public Misc.DIRECTION direction;
...@@ -1568,7 +1610,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1568,7 +1610,7 @@ namespace FLYAD7_OBJ_INTERFACE
public virtual bool TryParse(byte[] value, out int cnt) public virtual bool TryParse(byte[] value, out int cnt)
{ {
cnt = 5; cnt = 5;
if (value.Length < cnt) if (value.Length < cnt)
return false; return false;
int idx = 0; int idx = 0;
...@@ -1636,7 +1678,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1636,7 +1678,7 @@ namespace FLYAD7_OBJ_INTERFACE
public bool TryParse_version(byte[] value, out int version) public bool TryParse_version(byte[] value, out int version)
{ {
version = 1; version = 1;
if (!base.TryParse(value)) if (!base.TryParse(value))
return false; return false;
int idx = 8; int idx = 8;
int cnt = 8 + 4; int cnt = 8 + 4;
...@@ -1645,7 +1687,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1645,7 +1687,7 @@ namespace FLYAD7_OBJ_INTERFACE
version = 2; version = 2;
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
idx += 4; idx += 4;
return true; return true;
} }
#endregion #endregion
} }
...@@ -1690,7 +1732,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1690,7 +1732,7 @@ namespace FLYAD7_OBJ_INTERFACE
idx += 4; idx += 4;
return true; return true;
} }
public bool TryParse_version(byte[] value, out int version) public bool TryParse_version(byte[] value, out int version)
{ {
version = 1; version = 1;
if (!base.TryParse(value)) if (!base.TryParse(value))
...@@ -1710,7 +1752,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1710,7 +1752,7 @@ namespace FLYAD7_OBJ_INTERFACE
idx += 4; idx += 4;
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
idx += 4; idx += 4;
return true; return true;
} }
#endregion #endregion
} }
...@@ -1798,7 +1840,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1798,7 +1840,7 @@ namespace FLYAD7_OBJ_INTERFACE
/// <returns></returns> /// <returns></returns>
public override bool TryParse(byte[] value, out int cnt) public override bool TryParse(byte[] value, out int cnt)
{ {
if (!base.TryParse(value,out cnt)) if (!base.TryParse(value, out cnt))
return false; return false;
int idx = cnt; int idx = cnt;
...@@ -1864,7 +1906,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1864,7 +1906,7 @@ namespace FLYAD7_OBJ_INTERFACE
int cnt = 2 + 1 + 4 + 4; int cnt = 2 + 1 + 4 + 4;
if (value.Length < cnt) if (value.Length < cnt)
return false; return false;
mode = value[idx]; mode = value[idx];
idx++; idx++;
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
...@@ -1906,7 +1948,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1906,7 +1948,7 @@ namespace FLYAD7_OBJ_INTERFACE
public byte[] ToBytes() public byte[] ToBytes()
{ {
List<byte> buf = new List<byte>(); List<byte> buf = new List<byte>();
buf.AddRange(base.ToBytes()); buf.AddRange(base.ToBytes());
...@@ -1917,7 +1959,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1917,7 +1959,7 @@ namespace FLYAD7_OBJ_INTERFACE
return buf.ToArray(); return buf.ToArray();
} }
public override bool TryParse(byte[] value) public override bool TryParse(byte[] value)
{ {
int cnt; int cnt;
return TryParse(value, out cnt); return TryParse(value, out cnt);
...@@ -1925,23 +1967,23 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1925,23 +1967,23 @@ namespace FLYAD7_OBJ_INTERFACE
} }
public override bool TryParse(byte[] value, out int cnt) public override bool TryParse(byte[] value, out int cnt)
{ {
if (!base.TryParse(value,out cnt)) if (!base.TryParse(value, out cnt))
return false; return false;
int idx = cnt; int idx = cnt;
cnt += (4+4); cnt += (4 + 4);
if (value.Length < cnt) if (value.Length < cnt)
return false; return false;
marker = BitConverter.ToInt32(value, idx); marker = BitConverter.ToInt32(value, idx);
idx+=4; idx += 4;
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
idx += 4; idx += 4;
return true; return true;
} }
public virtual bool TryParse_version(byte[] value, out int version) public virtual bool TryParse_version(byte[] value, out int version)
{ {
version = 1; version = 1;
...@@ -1954,7 +1996,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1954,7 +1996,7 @@ namespace FLYAD7_OBJ_INTERFACE
if (value.Length < cnt) if (value.Length < cnt)
return true; return true;
version = 2; version = 2;
marker = BitConverter.ToInt32(value, idx); marker = BitConverter.ToInt32(value, idx);
...@@ -1962,7 +2004,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1962,7 +2004,7 @@ namespace FLYAD7_OBJ_INTERFACE
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
idx += 4; idx += 4;
return true; return true;
} }
#endregion #endregion
......
...@@ -348,14 +348,17 @@ namespace FlyADBase ...@@ -348,14 +348,17 @@ namespace FlyADBase
/// 用于检测当 为IsRunning时,脉冲是否停了很久。 /// 用于检测当 为IsRunning时,脉冲是否停了很久。
/// </summary> /// </summary>
int last_position = int.MinValue; int last_position = int.MinValue;
/// <summary>
/// 脉冲不变化次数
/// </summary>
int position_no_changed_cnt = 0;
TimeSpan NoTGridTimeOut = TimeSpan.FromSeconds(60); TimeSpan NoTGridTimeOut = TimeSpan.FromSeconds(60);
Stopwatch stopwatch_noTGrid = new Stopwatch(); Stopwatch stopwatch_noTGrid = new Stopwatch();
IsReadyContext isReadyContext = new IsReadyContext(); IsReadyContext isReadyContext = new IsReadyContext();
SysTickContext sysTickContext = new SysTickContext(); SysTickContext sysTickContext = new SysTickContext();
...@@ -366,7 +369,8 @@ namespace FlyADBase ...@@ -366,7 +369,8 @@ namespace FlyADBase
string jsonDbPath; string jsonDbPath;
DateTime lastTimeGridTime; DateTime lastTimeGridTime;
static FlyAD7() { static FlyAD7()
{
propertyName_save = FlyAD7JsonDb.GetMemberNames(); propertyName_save = FlyAD7JsonDb.GetMemberNames();
} }
/// <summary> /// <summary>
...@@ -380,7 +384,7 @@ namespace FlyADBase ...@@ -380,7 +384,7 @@ namespace FlyADBase
void constructor() void constructor()
{ {
Now = DateTime.Now; Now = DateTime.Now;
sysTickContext.BeReseted += () => BeResetTime = DateTime.Now; //sysTickContext.BeReseted += () => BeResetTime = DateTime.Now;
this.PropertyChanged += new PropertyChangedEventHandler(FlyAD7_PropertyChanged); this.PropertyChanged += new PropertyChangedEventHandler(FlyAD7_PropertyChanged);
...@@ -456,17 +460,33 @@ namespace FlyADBase ...@@ -456,17 +460,33 @@ namespace FlyADBase
() => () =>
{ {
if (!IsConnected) if (!IsConnected)
{
position_no_changed_cnt = 0;
return; return;
}
if (DriveStatus != DRIVE_MAN_STATUS.RUNNING) if (DriveStatus != DRIVE_MAN_STATUS.RUNNING)
{
position_no_changed_cnt = 0;
return; return;
}
if (Position != last_position) if (Position != last_position)
{ {
last_position = Position; last_position = Position;
position_no_changed_cnt = 0;
return; return;
} }
position_no_changed_cnt++;
if (driveman_wait.CheckMark(TimeSpan.FromSeconds(3)))//每3秒检查一次 if (position_no_changed_cnt >= 10)
{
//连续10秒,脉冲一样
//异常
DriveStatus = DRIVE_MAN_STATUS.STOP_MANUAL;
position_no_changed_cnt = 0;
return;
}
if (driveman_wait.CheckMark(TimeSpan.FromSeconds(2)))//每2秒检查一次
{ {
driveman_wait.Mark(); driveman_wait.Mark();
CurrObjSys.GetValueEx( CurrObjSys.GetValueEx(
...@@ -593,7 +613,8 @@ namespace FlyADBase ...@@ -593,7 +613,8 @@ namespace FlyADBase
ID, ID,
FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_ZERO_POS); FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_ZERO_POS);
} }
else { else
{
//参数不保存在设备中, 保存在电脑。 //参数不保存在设备中, 保存在电脑。
//参数写入到设备。 //参数写入到设备。
NotifyPropertyChanged(nameof(MotorType)); NotifyPropertyChanged(nameof(MotorType));
...@@ -658,7 +679,7 @@ namespace FlyADBase ...@@ -658,7 +679,7 @@ namespace FlyADBase
ID, ID,
FLYAD7_OBJ_INTERFACE.FLYIO_OBJ_INTERFACE.GET_IO); FLYAD7_OBJ_INTERFACE.FLYIO_OBJ_INTERFACE.GET_IO);
NotifyPropertyChanged(nameof(Pos1LCShift));//写入到AD盒 NotifyPropertyChanged(nameof(Pos1LCShift));//写入到AD盒
NotifyPropertyChanged(nameof(Pos2LCShift));//写入到AD盒 NotifyPropertyChanged(nameof(Pos2LCShift));//写入到AD盒
...@@ -682,11 +703,12 @@ namespace FlyADBase ...@@ -682,11 +703,12 @@ namespace FlyADBase
if (IsConnected) if (IsConnected)
{ {
ConnectCnt++; ConnectCnt++;
BeResetTime = DateTime.Now;
AfterConnected(); AfterConnected();
} }
else else
{ {
isReadyContext.Reset();
DriveOrder = DRIVE_MAN_ORDER.IDLE; DriveOrder = DRIVE_MAN_ORDER.IDLE;
DriveStatus = DRIVE_MAN_STATUS.STOP; DriveStatus = DRIVE_MAN_STATUS.STOP;
} }
...@@ -777,14 +799,24 @@ namespace FlyADBase ...@@ -777,14 +799,24 @@ namespace FlyADBase
break; break;
case FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.GET_STATE: case FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.GET_STATE:
{ {
FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState p = new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState(); int version;
if (!p.TryParse(infodata)) FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState_2 pack = new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState_2();
if (!pack.TryParse_version(infodata, out version))
break; break;
DriveOrder = p.order;
DriveStatus = p.status;
Marker = p.marker;
advGetState(); if (version == 1)
{
DriveOrder = pack.order;
DriveStatus = pack.status;
}
else if (version == 2)
{
DriveOrder = pack.order;
DriveStatus = pack.status;
Marker = pack.marker;
advGetState();
}
isReadyContext.isReadyGetState = true; isReadyContext.isReadyGetState = true;
} }
...@@ -898,7 +930,7 @@ namespace FlyADBase ...@@ -898,7 +930,7 @@ namespace FlyADBase
Position = pack.pos1; Position = pack.pos1;
DateTime dt = sysTickContext.ToDateTime(pack.systick); DateTime dt = sysTickContext.ToDateTime(pack.systick);
Now = dt; Now = dt;
PositionChangedEvent?.Invoke(this, new PositionChangedEventArgs() { Time = dt, Position = Position }); PositionChangedEvent?.Invoke(this, new PositionChangedEventArgs() { Time = dt, Position = Position });
} }
calSpeed.SetPos1(Now, Position); calSpeed.SetPos1(Now, Position);
...@@ -923,7 +955,7 @@ namespace FlyADBase ...@@ -923,7 +955,7 @@ namespace FlyADBase
Position2 = pack.pos2; Position2 = pack.pos2;
DateTime dt = sysTickContext.ToDateTime(pack.systick); DateTime dt = sysTickContext.ToDateTime(pack.systick);
Now = dt; Now = dt;
Position2ChangedEvent?.Invoke(this, new PositionChangedEventArgs() { Time = dt, Position = Position }); Position2ChangedEvent?.Invoke(this, new PositionChangedEventArgs() { Time = dt, Position = Position });
} }
calSpeed.SetPos2(Now, Position2); calSpeed.SetPos2(Now, Position2);
...@@ -1148,7 +1180,7 @@ namespace FlyADBase ...@@ -1148,7 +1180,7 @@ namespace FlyADBase
} }
break; break;
} }
_end_push_info: _end_push_info:
bShieldSetValueEx = false; bShieldSetValueEx = false;
} }
...@@ -1173,7 +1205,7 @@ namespace FlyADBase ...@@ -1173,7 +1205,7 @@ namespace FlyADBase
ID, ID,
FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.CALL_PXX, FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.CALL_PXX,
new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_CallRunto() { to = TargetPos }.ToBytes()); new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_CallRunto() { to = TargetPos }.ToBytes());
} }
break; break;
case DRIVE_MAN_ORDER.ORIGIN: case DRIVE_MAN_ORDER.ORIGIN:
...@@ -1246,9 +1278,9 @@ namespace FlyADBase ...@@ -1246,9 +1278,9 @@ namespace FlyADBase
bool ret = FlyAD7JsonDb.Load(jsonDbPath, this); bool ret = FlyAD7JsonDb.Load(jsonDbPath, this);
bShieldSetValueEx = false; bShieldSetValueEx = false;
this.PropertyChanged += FlyAD7_PropertyChanged2; this.PropertyChanged += FlyAD7_PropertyChanged2;
return ret; return ret;
} }
...@@ -1444,7 +1476,7 @@ namespace FlyADBase ...@@ -1444,7 +1476,7 @@ namespace FlyADBase
/// <param name="velocity"></param> /// <param name="velocity"></param>
public void SetVelocity(UInt32 velocity) public void SetVelocity(UInt32 velocity)
{ {
SetPosParam(velocity,UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue); SetPosParam(velocity, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue);
} }
/// <summary> /// <summary>
...@@ -1467,7 +1499,7 @@ namespace FlyADBase ...@@ -1467,7 +1499,7 @@ namespace FlyADBase
FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_SYSINFO); FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_SYSINFO);
} }
/// <summary> /// <summary>
/// 初始化系统信息区 /// 初始化系统信息区
/// </summary> /// </summary>
...@@ -1779,12 +1811,12 @@ namespace FlyADBase ...@@ -1779,12 +1811,12 @@ namespace FlyADBase
//备份参数 //备份参数
public bool IsDevParamValid = false; public bool IsDevParamValid = false;
public MOTORTYPE MotorType = MOTORTYPE.SERVO; public MOTORTYPE MotorType = MOTORTYPE.SERVO;
public UInt16 PosOfGrid = 10; public UInt16 PosOfGrid = 10;
public UInt16 Ratio01 = 4; public UInt16 Ratio01 = 4;
public UInt16 Ratio02 = 1; public UInt16 Ratio02 = 1;
public Int16 PosOffset = 0; public Int16 PosOffset = 0;
public UInt32 JogVelocity = 1000; public UInt32 JogVelocity = 1000;
/// <summary> /// <summary>
/// 硬件版本 /// 硬件版本
...@@ -1795,8 +1827,9 @@ namespace FlyADBase ...@@ -1795,8 +1827,9 @@ namespace FlyADBase
public int HardwareVersion = 2; public int HardwareVersion = 2;
public static string[] GetMemberNames() { public static string[] GetMemberNames()
var type = typeof(FlyAD7JsonDb); {
var type = typeof(FlyAD7JsonDb);
return type.GetMembers().Select(mi => mi.Name).ToArray(); return type.GetMembers().Select(mi => mi.Name).ToArray();
} }
...@@ -1830,6 +1863,10 @@ namespace FlyADBase ...@@ -1830,6 +1863,10 @@ namespace FlyADBase
if (dt_1st == DateTime.MinValue) if (dt_1st == DateTime.MinValue)
{ {
dt_1st = DateTime.Now; dt_1st = DateTime.Now;
//毫秒级别取整
long tick = dt_1st.Ticks % TimeSpan.TicksPerMillisecond;
dt_1st -= TimeSpan.FromTicks(tick);
systick_1st = systick; systick_1st = systick;
return dt_1st; return dt_1st;
} }
...@@ -1841,6 +1878,10 @@ namespace FlyADBase ...@@ -1841,6 +1878,10 @@ namespace FlyADBase
//被复位了 //被复位了
BeReseted?.Invoke(); BeReseted?.Invoke();
dt_1st = DateTime.Now; dt_1st = DateTime.Now;
//毫秒级别取整
long tick = dt_1st.Ticks % TimeSpan.TicksPerMillisecond;
dt_1st -= TimeSpan.FromTicks(tick);
systick_1st = systick; systick_1st = systick;
return dt_1st; return dt_1st;
} }
......
This diff is collapsed.
...@@ -5,11 +5,16 @@ ...@@ -5,11 +5,16 @@
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<!--MahApps Style-->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
<!--项目Style-->
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style TargetType="GroupBox" /> <Style TargetType="GroupBox"/>
<Style TargetType="Expander"/>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
<Page.Resources> <Page.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/> <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<local:PgErrorAllTableVmUt x:Key="viewModel"/> <local:PgErrorAllTableVmUt x:Key="viewModel" />
</ResourceDictionary> </ResourceDictionary>
</Page.Resources> </Page.Resources>
<Grid d:DataContext="{StaticResource viewModel}"> <Grid d:DataContext="{StaticResource viewModel}">
...@@ -93,7 +92,6 @@ ...@@ -93,7 +92,6 @@
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}"> <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding IsNewest}" Value="True"> <DataTrigger Binding="{Binding IsNewest}" Value="True">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="IsEnabled" Value="False"/> <Setter Property="IsEnabled" Value="False"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
...@@ -108,7 +106,6 @@ ...@@ -108,7 +106,6 @@
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}"> <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding IsNewest}" Value="True"> <DataTrigger Binding="{Binding IsNewest}" Value="True">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="IsEnabled" Value="False"/> <Setter Property="IsEnabled" Value="False"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
......
...@@ -2,25 +2,32 @@ ...@@ -2,25 +2,32 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"> xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf">
<!--颜色--> <!--颜色-->
<SolidColorBrush x:Key="TextBrush" Color="#4C4949" /> <SolidColorBrush x:Key="TextBrush" Color="#4C4949" />
<SolidColorBrush x:Key="GrayBrush1" Color="#FF727272"/> <SolidColorBrush x:Key="GrayBrush1" Color="#FF727272"/>
<SolidColorBrush x:Key="GrayBrush2" Color="#FF858484" /> <SolidColorBrush x:Key="GrayBrush2" Color="#FF858484" />
<!--在图表中描述字符串的透明背景-->
<SolidColorBrush x:Key="TextTransparentBackgroundBrush" Color="#99FFFFFF"/>
<SolidColorBrush x:Key="SemiTransparentGreyBrush2" Color="#99FFFFFF"/> <SolidColorBrush x:Key="SemiTransparentGreyBrush2" Color="#99FFFFFF"/>
<SolidColorBrush x:Key="SemiTransparentGreyBrush" Color="#99F0F0F0"/> <SolidColorBrush x:Key="SemiTransparentGreyBrush" Color="#99F0F0F0"/>
<SolidColorBrush x:Key="SemiTransparentActiveBrush" Color="#50008BE5"/> <SolidColorBrush x:Key="SemiTransparentActiveBrush" Color="#50008BE5"/>
<SolidColorBrush x:Key="WhiteBrush" Color="White"/> <SolidColorBrush x:Key="WhiteBrush" Color="White"/>
<!--尺寸--> <!--尺寸-->
<sys:Double x:Key="FontSize.Title">16</sys:Double> <sys:Double x:Key="FontSize.Title">15</sys:Double>
<sys:Double x:Key="FontSize.Value">20</sys:Double> <sys:Double x:Key="FontSize.Value">15</sys:Double>
<sys:Double x:Key="FontSize.Unit">15</sys:Double> <sys:Double x:Key="FontSize.Unit">15</sys:Double>
<Thickness x:Key="TextMargin">5,0</Thickness> <Thickness x:Key="TextMargin">2.5 0</Thickness>
<sys:Double x:Key="GraphInfoRowMaxHeight">19</sys:Double>
<sys:Double x:Key="GraphInfo2RowMaxHeight">38</sys:Double>
<!--字体--> <!--字体-->
<Style x:Key="TitleStyle" TargetType="TextBlock"> <Style x:Key="TitleStyle" TargetType="TextBlock">
<Setter Property="Padding" Value="5,2"/>
<Setter Property="Width" Value="50"/> <Setter Property="Width" Value="50"/>
<Setter Property="Foreground" Value="{StaticResource GrayBrush1}"/> <Setter Property="Foreground" Value="{StaticResource GrayBrush1}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Title}"/> <Setter Property="FontSize" Value="{StaticResource FontSize.Title}"/>
...@@ -29,7 +36,7 @@ ...@@ -29,7 +36,7 @@
<Style x:Key="ValueStyle" TargetType="TextBlock"> <Style x:Key="ValueStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/> <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Value}"/> <Setter Property="FontSize" Value="{StaticResource FontSize.Value}"/>
<Setter Property="Padding" Value="{StaticResource TextMargin}"/> <Setter Property="Padding" Value="5,2"/>
</Style> </Style>
<Style x:Key="UnitStyle" TargetType="TextBlock"> <Style x:Key="UnitStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource GrayBrush2}"/> <Setter Property="Foreground" Value="{StaticResource GrayBrush2}"/>
...@@ -38,6 +45,7 @@ ...@@ -38,6 +45,7 @@
</Style> </Style>
<!--Axis.Section--> <!--Axis.Section-->
<!--图表中选择器-->
<Style x:Key="Styles.Axis.Section.Selected" TargetType="lvc:AxisSection" > <Style x:Key="Styles.Axis.Section.Selected" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/> <Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="False"/> <Setter Property="DataLabel" Value="False"/>
...@@ -47,8 +55,16 @@ ...@@ -47,8 +55,16 @@
<Setter Property="Stroke" Value="#FFCA000C"/> <Setter Property="Stroke" Value="#FFCA000C"/>
<Setter Property="Fill" Value="#59CA000C"/> <Setter Property="Fill" Value="#59CA000C"/>
<!--<Setter Property="Stroke" Value="#FFFDC8C8"/>--> </Style>
<!--<Setter Property="Fill" Value="#59F7D8D8"/>-->
<!--图表中放大用选择器-->
<Style x:Key="Styles.Axis.Section.Selected.ZoomIn" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="True"/>
<Setter Property="DisableAnimations" Value="True"/>
<Setter Property="DataLabelForeground" Value="White"/>
<Setter Property="Opacity" Value="0.5"/>
<Setter Property="Stroke" Value="{StaticResource MahApps.Brushes.Accent}"/>
</Style> </Style>
<!--扫描图,纵向趋势图Y轴 标签--> <!--扫描图,纵向趋势图Y轴 标签-->
......
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