Commit 282fc80a authored by 潘栩锋's avatar 潘栩锋 🚴

合并

parents 370f1e72 4398e7f6
...@@ -241,6 +241,7 @@ namespace FlyADBase ...@@ -241,6 +241,7 @@ namespace FlyADBase
IsReady = true; IsReady = true;
return; return;
} }
void FlyAD7_PropertyChanged(object sender, PropertyChangedEventArgs e) void FlyAD7_PropertyChanged(object sender, PropertyChangedEventArgs e)
{ {
if (e.PropertyName == nameof(HasCRC)) if (e.PropertyName == nameof(HasCRC))
...@@ -419,7 +420,6 @@ namespace FlyADBase ...@@ -419,7 +420,6 @@ namespace FlyADBase
isReadyGetPos1AD1 = true; isReadyGetPos1AD1 = true;
updateIsReady(); updateIsReady();
} }
break; break;
case FLYAD7_OBJ_INTERFACE.FLYADC_OBJ_INTERFACE.GET_POS2: case FLYAD7_OBJ_INTERFACE.FLYADC_OBJ_INTERFACE.GET_POS2:
...@@ -758,8 +758,8 @@ namespace FlyADBase ...@@ -758,8 +758,8 @@ namespace FlyADBase
dt, dt,
pack.istatus, pack.istatus,
pack.inChange, pack.inChange,
pack.pos1, Position,
pack.pos2)); Position2));
calSpeed.SetPos1(Now, Position); calSpeed.SetPos1(Now, Position);
calSpeed.SetPos2(Now, Position2); calSpeed.SetPos2(Now, Position2);
...@@ -791,6 +791,7 @@ namespace FlyADBase ...@@ -791,6 +791,7 @@ namespace FlyADBase
{ {
//怕数据发送出错 //怕数据发送出错
dt = DateTime.Now; dt = DateTime.Now;
Now = dt;
} }
else// if (version == 2) else// if (version == 2)
{ {
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
<Compile Include="IFlyADClientAdv.cs" /> <Compile Include="IFlyADClientAdv.cs" />
<Compile Include="EventArgs\IStatusChangedEventArgs.cs" /> <Compile Include="EventArgs\IStatusChangedEventArgs.cs" />
<Compile Include="EventArgs\MiniGridEventArgs.cs" /> <Compile Include="EventArgs\MiniGridEventArgs.cs" />
<Compile Include="EventArgs\PositionChangedEventArgs.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SyncOrder.cs" /> <Compile Include="SyncOrder.cs" />
<Compile Include="EventArgs\TimeGridAdvEventArgs.cs" /> <Compile Include="EventArgs\TimeGridAdvEventArgs.cs" />
......
...@@ -420,6 +420,9 @@ namespace FlyADBase ...@@ -420,6 +420,9 @@ namespace FlyADBase
void advGetState() void advGetState()
{ {
mTimeGridAdvHelper.AddDriveStatus_Default(Now, DriveOrder, DriveStatus, Marker); mTimeGridAdvHelper.AddDriveStatus_Default(Now, DriveOrder, DriveStatus, Marker);
}
void advGetState() {
} }
void advPushPos1() void advPushPos1()
{ {
......
...@@ -39,7 +39,7 @@ namespace FLY.Thick.Base.Client ...@@ -39,7 +39,7 @@ namespace FLY.Thick.Base.Client
/// 扫描架长 /// 扫描架长
/// </summary> /// </summary>
public int PosLength { get; set; } = 8900; public int PosLength { get; set; } = 8900;
/// <summary> /// <summary>
/// 自动归原点间距 /// 自动归原点间距
/// </summary> /// </summary>
...@@ -65,7 +65,7 @@ namespace FLY.Thick.Base.Client ...@@ -65,7 +65,7 @@ namespace FLY.Thick.Base.Client
/// <summary> /// <summary>
/// 设置的速度,与 实际速度比例 /// 设置的速度,与 实际速度比例
/// </summary> /// </summary>
public double Speed1Scale { get; set; } =1; public double Speed1Scale { get; set; } = 1;
/// <summary> /// <summary>
/// 线速度来源 /// 线速度来源
...@@ -91,7 +91,7 @@ namespace FLY.Thick.Base.Client ...@@ -91,7 +91,7 @@ namespace FLY.Thick.Base.Client
public double MmOfR { get; set; } = 314; public double MmOfR { get; set; } = 314;
/// <summary> /// <summary>
/// 数据有效源 /// 数据有效源
/// </summary> /// </summary>
...@@ -144,7 +144,7 @@ namespace FLY.Thick.Base.Client ...@@ -144,7 +144,7 @@ namespace FLY.Thick.Base.Client
/// 减速时间 /// 减速时间
/// </summary> /// </summary>
public UInt32 DTime { get; set; } = 200; public UInt32 DTime { get; set; } = 200;
/// <summary> /// <summary>
/// 归0速度1 /// 归0速度1
/// </summary> /// </summary>
...@@ -209,7 +209,7 @@ namespace FLY.Thick.Base.Client ...@@ -209,7 +209,7 @@ namespace FLY.Thick.Base.Client
public string DbDirPath { get; set; } public string DbDirPath { get; set; }
#endregion #endregion
public void Apply() public void Apply()
{ {
Call(nameof(Apply)); Call(nameof(Apply));
} }
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
namespace FLY.Thick.Base.Common
{
public class CoatingSegmentPart : INotifyPropertyChanged
{
private double total;
//涂长+留白单位mm
public double Total
{
get { return total; }
set
{
if (total != value)
{
total = value;
NotifyPropertyChanged("Total");
}
}
}
private double distance;
public double Distance//留白单位mm
{
get { return distance; }
set
{
if (distance != value)
{
distance = value;
NotifyPropertyChanged("Distance");
}
}
}
public CoatingSegmentPart Clone()
{
CoatingSegmentPart p = new CoatingSegmentPart();
p.Total = Total;
p.Distance = Distance;
return p;
}
public byte[] ToByte()
{
List<byte> buf = new List<byte>();
buf.AddRange(BitConverter.GetBytes(Total));
buf.AddRange(BitConverter.GetBytes(Distance));
return buf.ToArray();
}
/// <summary>
/// 16个字节转换
/// </summary>
/// <param name="value"></param>
/// <param name="offset"></param>
/// <returns></returns>
public bool TryParse(byte[] value, int offset)
{
if (value.Length - offset < 16)
return false;
Total = BitConverter.ToDouble(value, offset + 0);
Distance = BitConverter.ToDouble(value, offset + 8);
return true;
}
protected void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
public class CoatingSegmentProfile : INotifyPropertyChanged
{
string productname;
/// <summary>
/// 产品名称
/// </summary>
public string ProductName
{
get { return productname; }
set
{
if (productname != value)
{
productname = value;
NotifyPropertyChanged("ProductName");
}
}
}
ObservableCollection<CoatingSegmentPart> coatingpartlist = new ObservableCollection<CoatingSegmentPart>();
/// <summary>
/// 涂布段长 &amp; 留白
/// </summary>
public ObservableCollection<CoatingSegmentPart> CoatingPartList
{
get { return coatingpartlist; }
}
public byte[] ToBytes()
{
List<byte> buf = new List<byte>();
byte[] name_bytes = Misc.Converter.StringToBytes(ProductName);
if (name_bytes == null)
{
buf.AddRange(BitConverter.GetBytes(0));
}
else{
buf.AddRange(BitConverter.GetBytes((int)name_bytes.Length));
buf.AddRange(name_bytes);
}
buf.AddRange(BitConverter.GetBytes(CoatingPartList.Count()));
for (int i = 0; i < CoatingPartList.Count(); i++)
buf.AddRange(CoatingPartList[i].ToByte());
return buf.ToArray();
}
/// <summary>
///
/// </summary>
/// <param name="value"></param>
/// <param name="offset"></param>
/// <param name="cnt"></param>
/// <returns></returns>
public bool TryParse(byte[] value, int offset, out int cnt)
{
cnt = (4 + 4);
if (value.Length - offset < cnt)
return false;
int idx = offset;
int len = BitConverter.ToInt32(value, idx);
idx += 4;
cnt += len;
if (value.Length < cnt)
return false;
byte[] bytes = new byte[len];
Array.Copy(value, idx, bytes, 0, len);
idx += len;
string name = Misc.Converter.BytesToString(bytes);
int len2 = BitConverter.ToInt32(value, idx);
idx += 4;
cnt += len2 * 16;
if (value.Length < cnt)
return false;
CoatingPartList.Clear();
ProductName = name;
for (int i = 0; i < len2; i++)
{
CoatingSegmentPart coatingPart = new CoatingSegmentPart();
coatingPart.TryParse(value, idx);
idx += 16;
CoatingPartList.Add(coatingPart);
}
return true;
}
protected void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Misc;
namespace FLY.Thick.Base.Common
{
public class ProfileParam
{
public string pname;
public int target;
public int alarm;
public double comp;
public int shift;
public int beginNo;
public int endNo;
public int dataBeginNo;
public int dataEndNo;
#region IPack 成员
public byte[] ToBytes()
{
List<byte> buf = new List<byte>();
byte[] bs = Misc.Converter.StringToBytes(pname);
buf.AddRange(BitConverter.GetBytes(bs.Length));
buf.AddRange(bs);
buf.AddRange(BitConverter.GetBytes(target));
buf.AddRange(BitConverter.GetBytes(alarm));
buf.AddRange(BitConverter.GetBytes(comp));
buf.AddRange(BitConverter.GetBytes(shift));
buf.AddRange(BitConverter.GetBytes(beginNo));
buf.AddRange(BitConverter.GetBytes(endNo));
buf.AddRange(BitConverter.GetBytes(dataBeginNo));
buf.AddRange(BitConverter.GetBytes(dataEndNo));
return buf.ToArray();
}
public bool TryParse(byte[] value)
{
int cnt = 4 + 4 * 2 + 8 + 4 * 5;
if (value.Length < cnt)
return false;
int idx = 0;
int len = BitConverter.ToInt32(value, idx);
idx += 4;
cnt += len;
if (value.Length < cnt)
return false;
pname = Misc.Converter.BytesToString(value, idx, len);
idx += len;
target = BitConverter.ToInt32(value, idx);
idx += 4;
alarm = BitConverter.ToInt32(value, idx);
idx += 4;
comp = BitConverter.ToDouble(value, idx);
idx += 8;
shift = BitConverter.ToInt32(value, idx);
idx += 4;
beginNo = BitConverter.ToInt32(value, idx);
idx += 4;
endNo = BitConverter.ToInt32(value, idx);
idx += 4;
dataBeginNo = BitConverter.ToInt32(value, idx);
idx += 4;
dataEndNo = BitConverter.ToInt32(value, idx);
idx += 4;
return true;
}
#endregion
}
}
...@@ -63,7 +63,6 @@ ...@@ -63,7 +63,6 @@
<Compile Include="Client\ScanCorrServiceClient.cs" /> <Compile Include="Client\ScanCorrServiceClient.cs" />
<Compile Include="Client\TDGageServiceClient.cs" /> <Compile Include="Client\TDGageServiceClient.cs" />
<Compile Include="Common\BorderType.cs" /> <Compile Include="Common\BorderType.cs" />
<Compile Include="Common\CoatingSegmentPart.cs" />
<Compile Include="Common\Common.cs" /> <Compile Include="Common\Common.cs" />
<Compile Include="Common\CurveCell.cs" /> <Compile Include="Common\CurveCell.cs" />
<Compile Include="Common\CurveCore.cs" /> <Compile Include="Common\CurveCore.cs" />
...@@ -74,7 +73,6 @@ ...@@ -74,7 +73,6 @@
<Compile Include="Common\FlyAD_Common.cs" /> <Compile Include="Common\FlyAD_Common.cs" />
<Compile Include="Common\FlyData_WarningHistory.cs" /> <Compile Include="Common\FlyData_WarningHistory.cs" />
<Compile Include="Common\PasswordCommon.cs" /> <Compile Include="Common\PasswordCommon.cs" />
<Compile Include="Common\ProfileParam.cs" />
<Compile Include="Common\TimeGridEventArgs.cs" /> <Compile Include="Common\TimeGridEventArgs.cs" />
<Compile Include="IService\IBoltMapService.cs" /> <Compile Include="IService\IBoltMapService.cs" />
<Compile Include="IService\IBorderSearchService.cs" /> <Compile Include="IService\IBorderSearchService.cs" />
......
...@@ -11,7 +11,7 @@ using FObjBase.Reflect; ...@@ -11,7 +11,7 @@ using FObjBase.Reflect;
namespace FLY.Thick.Base.IService namespace FLY.Thick.Base.IService
{ {
public interface IFlyADService:INotifyPropertyChanged public interface IFlyADService : INotifyPropertyChanged
{ {
#region 参数 #region 参数
bool HasCRC { get; set; } bool HasCRC { get; set; }
......
...@@ -10,7 +10,7 @@ namespace FLY.Thick.Base.IService ...@@ -10,7 +10,7 @@ namespace FLY.Thick.Base.IService
/// <summary> /// <summary>
/// 硬件配置参数 /// 硬件配置参数
/// </summary> /// </summary>
public interface IInitParamService:INotifyPropertyChanged public interface IInitParamService : INotifyPropertyChanged
{ {
/// <summary> /// <summary>
/// 扫描架长 /// 扫描架长
...@@ -96,6 +96,11 @@ namespace FLY.Thick.Base.IService ...@@ -96,6 +96,11 @@ namespace FLY.Thick.Base.IService
/// </summary> /// </summary>
bool HasPunch { get; set; } bool HasPunch { get; set; }
/// <summary>
/// 有纵向光纤传感器
/// </summary>
bool HasVSign { get; set; }
/// <summary> /// <summary>
/// 打孔设备与探头中心偏移,单位mm /// 打孔设备与探头中心偏移,单位mm
/// </summary> /// </summary>
......
...@@ -214,7 +214,6 @@ namespace FLY.Thick.Base.Server ...@@ -214,7 +214,6 @@ namespace FLY.Thick.Base.Server
if (!Misc.MyBase.CHECKBIT(e.IChanged, FlyADIODefine.Instance.InNo_Roll)) if (!Misc.MyBase.CHECKBIT(e.IChanged, FlyADIODefine.Instance.InNo_Roll))
return; return;
if (Misc.MyBase.CHECKBIT(e.IStatus, FlyADIODefine.Instance.InNo_Roll)) if (Misc.MyBase.CHECKBIT(e.IStatus, FlyADIODefine.Instance.InNo_Roll))
return; return;
......
...@@ -14,7 +14,7 @@ namespace FLY.Thick.Base.Server ...@@ -14,7 +14,7 @@ namespace FLY.Thick.Base.Server
/// <summary> /// <summary>
/// 硬件配置参数 /// 硬件配置参数
/// </summary> /// </summary>
public class InitParam: IInitParamService, INotifyPropertyChanged public class InitParam : IInitParamService, INotifyPropertyChanged
{ {
#region 属性,成员变量的代理 #region 属性,成员变量的代理
/// <summary> /// <summary>
...@@ -37,14 +37,14 @@ namespace FLY.Thick.Base.Server ...@@ -37,14 +37,14 @@ namespace FLY.Thick.Base.Server
/// 自动归原点间距 /// 自动归原点间距
/// </summary> /// </summary>
public int AutoOrgInterval { get; set; } = 10; public int AutoOrgInterval { get; set; } = 10;
/// <summary> /// <summary>
/// 线速度来源 /// 线速度来源
/// </summary> /// </summary>
public FilmVSRC FilmVSrc { get; set; } = FilmVSRC.ROUND; public FilmVSRC FilmVSrc { get; set; } = FilmVSRC.ROUND;
/// <summary> /// <summary>
/// 最小线速度 m/min /// 最小线速度 m/min
/// </summary> /// </summary>
...@@ -58,7 +58,7 @@ namespace FLY.Thick.Base.Server ...@@ -58,7 +58,7 @@ namespace FLY.Thick.Base.Server
/// </summary> /// </summary>
public double Encoder2_mmpp { get; set; } = 0.1; public double Encoder2_mmpp { get; set; } = 0.1;
/// <summary> /// <summary>
/// //1圈多少mm /// //1圈多少mm
/// </summary> /// </summary>
...@@ -95,27 +95,27 @@ namespace FLY.Thick.Base.Server ...@@ -95,27 +95,27 @@ namespace FLY.Thick.Base.Server
/// </summary> /// </summary>
public UInt32 VAccuracy { get; set; } = 3000; public UInt32 VAccuracy { get; set; } = 3000;
/// <summary> /// <summary>
/// 开始速度 Start Velocity /// 开始速度 Start Velocity
/// </summary> /// </summary>
public UInt32 SVelocity { get; set; } = 500; public UInt32 SVelocity { get; set; } = 500;
/// <summary> /// <summary>
/// 加速时间 /// 加速时间
/// </summary> /// </summary>
public UInt32 ATime { get; set; } = 200; public UInt32 ATime { get; set; } = 200;
/// <summary> /// <summary>
/// 减速时间 /// 减速时间
/// </summary> /// </summary>
public UInt32 DTime { get; set; } = 200; public UInt32 DTime { get; set; } = 200;
/// <summary> /// <summary>
/// 归0速度1 /// 归0速度1
/// </summary> /// </summary>
public UInt32 HVelocity1 { get; set; } = 5000; public UInt32 HVelocity1 { get; set; } = 5000;
/// <summary> /// <summary>
/// 归0速度2 /// 归0速度2
/// </summary> /// </summary>
...@@ -220,10 +220,10 @@ namespace FLY.Thick.Base.Server ...@@ -220,10 +220,10 @@ namespace FLY.Thick.Base.Server
/// 加载 /// 加载
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public bool Load() public bool Load()
{ {
//return Misc.SaveToXmlHepler.Load(param_path, this); //return Misc.SaveToXmlHepler.Load(param_path, this);
if (!File.Exists(param_path)) if (!File.Exists(param_path))
{ {
return false; return false;
} }
...@@ -232,7 +232,8 @@ namespace FLY.Thick.Base.Server ...@@ -232,7 +232,8 @@ namespace FLY.Thick.Base.Server
string json = File.ReadAllText(param_path); string json = File.ReadAllText(param_path);
Newtonsoft.Json.JsonConvert.PopulateObject(json, this); Newtonsoft.Json.JsonConvert.PopulateObject(json, this);
} }
catch { catch
{
return false; return false;
} }
return true; return true;
...@@ -240,7 +241,7 @@ namespace FLY.Thick.Base.Server ...@@ -240,7 +241,7 @@ namespace FLY.Thick.Base.Server
/// <summary> /// <summary>
/// 保存 /// 保存
/// </summary> /// </summary>
void Save() void Save()
{ {
string json = Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); string json = Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
File.WriteAllText(param_path, json); File.WriteAllText(param_path, json);
...@@ -261,6 +262,6 @@ namespace FLY.Thick.Base.Server ...@@ -261,6 +262,6 @@ namespace FLY.Thick.Base.Server
Save(); Save();
} }
} }
} }
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