Commit fdd69281 authored by 潘栩锋's avatar 潘栩锋 🚴

和美安装包_v6.22.3 -20210510

1. 修复 扫描测厚仪 FilmVelocity 同时由两个源生成。
2. 修复 追边,扫描测厚仪 FilmVelocity 使用了 电脑时间生成后,不准的问题。
3. 修复 系统有多个PLC,但只显示第1个PLC的连接状态,现在任何一个断开都会触发报警
4. 优化 服务器 设置完参数,能自动重启了。
parent e65227a2
...@@ -89,7 +89,10 @@ namespace FLY.FeedbackRenZiJia.UI.Server ...@@ -89,7 +89,10 @@ namespace FLY.FeedbackRenZiJia.UI.Server
} }
break; break;
} }
Application.Current.Shutdown(); //切换为exe的目录,这样程序再次进入时,才能 进入Gage1 文件夹
System.Environment.CurrentDirectory = "../";
//重启软件
AppHelper.AppJustOne.Restart();
} }
} }
} }
......
...@@ -298,7 +298,7 @@ namespace FLY.FeedbackRenZiJia.Server ...@@ -298,7 +298,7 @@ namespace FLY.FeedbackRenZiJia.Server
FObjBase.PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD, FObjBase.PollModule.Current.Poll_Config(PollModule.POLL_CONFIG.ADD,
() => () =>
{ {
Misc.BindingOperations.SetBinding(this, "IsConnectedWithPLC", () => Misc.BindingOperations.SetBinding(this, nameof(IsConnectedWithPLC), () =>
{ {
bool b = !IsConnectedWithPLC; bool b = !IsConnectedWithPLC;
......
...@@ -98,8 +98,10 @@ namespace FLY.IBC.UI.Server ...@@ -98,8 +98,10 @@ namespace FLY.IBC.UI.Server
} }
if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) {
File.Copy(item.Path, "plcgroup.json", true); File.Copy(item.Path, "plcgroup.json", true);
//System.Windows.Forms.Application.Restart(); //切换为exe的目录,这样程序再次进入时,才能 进入Gage1 文件夹
Application.Current.Shutdown(); System.Environment.CurrentDirectory = "../";
//重启软件
AppHelper.AppJustOne.Restart();
} }
} }
} }
......
...@@ -77,7 +77,7 @@ namespace FLY.IBC.Server ...@@ -77,7 +77,7 @@ namespace FLY.IBC.Server
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//step 2 报警配置 //step 2 报警配置
errorConf = new ErrorConf(PLCos, this.warning, "IBC"); errorConf = new ErrorConf(plcos, this.warning, "IBC");
errorConf.AddErrorAction(Item); errorConf.AddErrorAction(Item);
for (int i = 0; i < TAreas.Count(); i++) for (int i = 0; i < TAreas.Count(); i++)
{ {
......
...@@ -101,14 +101,14 @@ namespace FLY.Integrated.Server ...@@ -101,14 +101,14 @@ namespace FLY.Integrated.Server
"plcgroup.json", "plcgroup.json",
(plcgroup) => new Dictionary<string, INotifyPropertyChanged> (plcgroup) => new Dictionary<string, INotifyPropertyChanged>
{ {
{ "Ibc", Ibc }, { nameof(Ibc), Ibc },
{ "Accessory", Accessory } { nameof(Accessory), Accessory }
} }
); );
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//step 2 报警配置 //step 2 报警配置
errorConf = new ErrorConf(PLCos, this.warning, "综合IBC"); errorConf = new ErrorConf(plcos, this.warning, "综合IBC");
errorConf.AddErrorAction(Accessory); errorConf.AddErrorAction(Accessory);
errorConf.AddErrorAction(Ibc); errorConf.AddErrorAction(Ibc);
errorConf.InitError(); errorConf.InitError();
...@@ -118,8 +118,11 @@ namespace FLY.Integrated.Server ...@@ -118,8 +118,11 @@ namespace FLY.Integrated.Server
//step 3 历史数据记录 //step 3 历史数据记录
//添加任务 //添加任务
PLCos.SetPlan("Ibc", new string[] { PLCos.SetPlan(nameof(Ibc), new string[] {
"FilmWidth","InletAirFreq","OutletAirFreq","ExCoolFreq" nameof(Ibc.FilmWidth),
nameof(Ibc.InletAirFreq),
nameof(Ibc.OutletAirFreq),
nameof(Ibc.ExCoolFreq)
}, 0); }, 0);
psdWidth = new PeriodicallySaveData<Db_Width>(); psdWidth = new PeriodicallySaveData<Db_Width>();
...@@ -144,8 +147,11 @@ namespace FLY.Integrated.Server ...@@ -144,8 +147,11 @@ namespace FLY.Integrated.Server
}; };
}); });
PLCos.SetPlan("Accessory", new string[] { PLCos.SetPlan(nameof(Accessory), new string[] {
"TractionVelocity","RotaryFreq","IsRotaryForw","IsRotaryBackw" nameof(Accessory.TractionVelocity),
nameof(Accessory.RotaryFreq),
nameof(Accessory.IsRotaryForw),
nameof(Accessory.IsRotaryBackw)
}, 0); }, 0);
psdWinderInfo = new PeriodicallySaveData<Db_WinderInfo>(); psdWinderInfo = new PeriodicallySaveData<Db_WinderInfo>();
......
...@@ -233,9 +233,11 @@ namespace FLY.Thick.Blowing.IService ...@@ -233,9 +233,11 @@ namespace FLY.Thick.Blowing.IService
{ {
RollCell r = new RollCell(); RollCell r = new RollCell();
r.dt = dt; r.dt = dt;
r.sysTime = sysTime;
return r; return r;
} }
public DateTime dt; public DateTime dt;
public DateTime sysTime;
public override string ToString() public override string ToString()
{ {
return dt.ToString(); return dt.ToString();
......
...@@ -915,7 +915,7 @@ namespace FLY.Thick.Blowing.Server ...@@ -915,7 +915,7 @@ namespace FLY.Thick.Blowing.Server
bool status = !Misc.MyBase.CHECKBIT(e.IStatus, Roll_bit - 1); bool status = !Misc.MyBase.CHECKBIT(e.IStatus, Roll_bit - 1);
//TODO,不使用AD盒的时间 //TODO,不使用AD盒的时间
//DateTime dt = e.Time;//信号更新发生的时间 DateTime sysTime = e.Time;//信号更新发生的时间
DateTime dt = DateTime.Now; DateTime dt = DateTime.Now;
...@@ -924,7 +924,8 @@ namespace FLY.Thick.Blowing.Server ...@@ -924,7 +924,8 @@ namespace FLY.Thick.Blowing.Server
mRollList.RAdd( mRollList.RAdd(
new RollCell() new RollCell()
{ {
dt = dt dt = dt,
sysTime = sysTime
}); });
...@@ -1075,20 +1076,17 @@ namespace FLY.Thick.Blowing.Server ...@@ -1075,20 +1076,17 @@ namespace FLY.Thick.Blowing.Server
{ {
if (mRollList.Count > 1) if (mRollList.Count > 1)
{ {
DateTime dt1 = mRollList[mRollList.Count - 1].dt; DateTime sysTime1 = mRollList[mRollList.Count - 1].sysTime;
int cnt = 5; int cnt = 5;
if (cnt > mRollList.Count) if (cnt > mRollList.Count)
cnt = mRollList.Count; cnt = mRollList.Count;
DateTime sysTime2 = mRollList[mRollList.Count - cnt].sysTime;
DateTime dt2 = mRollList[mRollList.Count - cnt].dt; TimeSpan ts_last = TimeSpan.FromTicks((sysTime1 - sysTime2).Ticks / (cnt - 1));//5次的平均滤波, 使用AD盒的时间算出来的时间差,最准
DateTime dt11 = mRollList[mRollList.Count - (cnt - 1)].dt; DateTime dt11 = mRollList[mRollList.Count - (cnt - 1)].dt;
TimeSpan ts_last = TimeSpan.FromTicks((dt1 - dt2).Ticks / (cnt - 1));//5次的平均滤波
//因为没有使用AD盒的时间,所以可以用DateTime.Now 比较 //因为没有使用AD盒的时间,所以可以用DateTime.Now 比较
TimeSpan ts_now = TimeSpan.FromTicks((DateTime.Now - dt11).Ticks / (cnt - 1)); TimeSpan ts_now = TimeSpan.FromTicks((DateTime.Now - dt11).Ticks / (cnt - 1));//使用 电脑的时间,算出来的时间差,大概而已
TimeSpan ts_max; TimeSpan ts_max;
if (ts_now > (ts_last + ts_last)) if (ts_now > (ts_last + ts_last))
{ {
......
...@@ -332,25 +332,6 @@ namespace FLY.Thick.BlowingScan.Server ...@@ -332,25 +332,6 @@ namespace FLY.Thick.BlowingScan.Server
} }
}; };
//------------------------------------------------------------------------------------------------------------------------------------
//线速度------------------------------------------------------------------------------------------------------------------------------
flyAd.PropertyChanged += (s, e) =>
{
if (e.PropertyName == nameof(flyAd.Speed2))
{
if (initParam.FilmVSrc != FilmVSRC.EN2)
return;
double speed = flyAd.Speed2 * initParam.Encoder2_mmpp;//mm/s
speed = speed * 60 / 1000;//m/min
dynArea.FilmVelocity = speed;
}
};
//------------------------------------------------------------------------------------------------------------------------------------
//辊信号生成线速度-----------------------------------------------------------------------------------------------------------------------------
InitRoundFilmVelocity();
//------------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------------------
//数据有效----------------------------------------------------------------------------------------------------------------------------- //数据有效-----------------------------------------------------------------------------------------------------------------------------
...@@ -689,92 +670,6 @@ namespace FLY.Thick.BlowingScan.Server ...@@ -689,92 +670,6 @@ namespace FLY.Thick.BlowingScan.Server
} }
} }
#region 辊信号生成 线速度
DispatcherTimer round_t;
DateTime dtRound = DateTime.MinValue;
void InitRoundFilmVelocity()
{
round_t = new DispatcherTimer();
round_t.Interval = TimeSpan.FromSeconds(1);
round_t.Tick += new EventHandler(round_t_Tick);
flyAd.IStatusChangedEvent += new IStatusChangedEventHandler(mFlyAD_IStatusChangedEvent_round);
}
void mFlyAD_IStatusChangedEvent_round(object sender, IStatusChangedEventArgs e)
{
if (initParam.FilmVSrc != FilmVSRC.ROUND)
return;
if (!Misc.MyBase.CHECKBIT(e.IChanged, 11 - 1))
return;
if (Misc.MyBase.CHECKBIT(e.IStatus, 11 - 1))
return;
//1->0
DateTime dt = e.Time;
if (dt <= dtRound)
return;
if (dtRound != DateTime.MinValue)
{
double v = initParam.MmOfR / 1000.0 / (dt - dtRound).TotalMinutes;
if (v < 1)
{
dt = DateTime.MinValue;
v = 0;
}
dynArea.FilmVelocity = v;
}
dtRound = dt;
if (dtRound != DateTime.MinValue)
{
if (!round_t.IsEnabled)
round_t.Start();
}
}
void round_t_Tick(object sender, EventArgs e)
{
if (initParam.FilmVSrc != FilmVSRC.ROUND)
{
round_t.Stop();
return;
}
if (dtRound == DateTime.MinValue)
{
round_t.Stop();
return;
}
//1->0
DateTime dt = DateTime.Now;
if (dt <= dtRound)
return;
double v = initParam.MmOfR / 1000.0 / (dt - dtRound).TotalMinutes;
if (v < (dynArea.FilmVelocity - 1))
{
if (v < 2)
{
dtRound = DateTime.MinValue;
v = 0;
}
dynArea.FilmVelocity = v;
}
if (dtRound == DateTime.MinValue)
{
round_t.Stop();
return;
}
}
#endregion
void mDynArea_PropertyChanged(object sender, PropertyChangedEventArgs e) void mDynArea_PropertyChanged(object sender, PropertyChangedEventArgs e)
{ {
if (e.PropertyName == nameof(dynArea.FilmVelocity)) if (e.PropertyName == nameof(dynArea.FilmVelocity))
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<Grid x:Name="grid_plcos"/> <Grid x:Name="grid_plcos"/>
<Grid x:Name="grid_WeightSystem"/> <Grid x:Name="grid_WeightSystem"/>
<StackPanel Margin="5"> <StackPanel Margin="5">
<StackPanel Orientation="Vertical" Margin="4" DataContext="{Binding ElementName=grid_WeightSystem,Path=DataContext}"> <StackPanel Margin="5" DataContext="{Binding ElementName=grid_WeightSystem,Path=DataContext}">
<TextBlock Text="当前线速度设置m/min*10" /> <TextBlock Text="当前线速度设置m/min" />
<TextBlock FontSize="20"> <TextBlock FontSize="20">
<Run Text="{Binding Accessory.CurrentVelocitySet,StringFormat=\{0:F0\}, Mode=OneWay}" /> <Run Text="{Binding Accessory.CurrentVelocitySet,StringFormat={}{0:F1}, Mode=OneWay}" />
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
<ItemsControl x:Name="itemcontrol"> <ItemsControl x:Name="itemcontrol">
......
...@@ -133,8 +133,11 @@ namespace FLY.Weight.UI.Server ...@@ -133,8 +133,11 @@ namespace FLY.Weight.UI.Server
if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
{ {
File.Copy(item.Path, "plcgroup.json", true); File.Copy(item.Path, "plcgroup.json", true);
//System.Windows.Forms.Application.Restart();
Application.Current.Shutdown(); //切换为exe的目录,这样程序再次进入时,才能 进入Gage1 文件夹
System.Environment.CurrentDirectory = "../";
//重启软件
AppHelper.AppJustOne.Restart();
} }
} }
......
...@@ -86,9 +86,9 @@ namespace FLY.Weight.Server ...@@ -86,9 +86,9 @@ namespace FLY.Weight.Server
private void MBDetect_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e) private void MBDetect_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{ {
if (e.PropertyName == "FilmVelocity") if (e.PropertyName == nameof(mBDetect.FilmVelocity))
{ {
mData.Accessory.CurrentVelocitySet = (((int)(mBDetect.FilmVelocity * 10)) / 10.0f); mData.Accessory.CurrentVelocitySet = (float)mBDetect.FilmVelocity;
} }
} }
......
...@@ -68,8 +68,6 @@ namespace FLY.Weight.Server ...@@ -68,8 +68,6 @@ namespace FLY.Weight.Server
/// 周期保存Ibc数据 /// 周期保存Ibc数据
/// </summary> /// </summary>
PeriodicallySaveData<Lc_Flow> psdFlow; PeriodicallySaveData<Lc_Flow> psdFlow;
public WeightSystem() public WeightSystem()
{ {
if (!LoadNumberNames()) if (!LoadNumberNames())
...@@ -90,7 +88,7 @@ namespace FLY.Weight.Server ...@@ -90,7 +88,7 @@ namespace FLY.Weight.Server
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//step 2 报警配置 //step 2 报警配置
errorConf = new ErrorConf(PLCos, this.warning, "称重"); errorConf = new ErrorConf(plcos, this.warning, "称重");
errorConf.AddErrorAction(Accessory); errorConf.AddErrorAction(Accessory);
for (int i = 0; i < Items.Count(); i++) for (int i = 0; i < Items.Count(); i++)
{ {
......
...@@ -98,8 +98,11 @@ namespace FLY.Weight2.UI.Server ...@@ -98,8 +98,11 @@ namespace FLY.Weight2.UI.Server
} }
if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) {
File.Copy(item.Path, "plcgroup.json", true); File.Copy(item.Path, "plcgroup.json", true);
//System.Windows.Forms.Application.Restart();
Application.Current.Shutdown(); //切换为exe的目录,这样程序再次进入时,才能 进入Gage1 文件夹
System.Environment.CurrentDirectory = "../";
//重启软件
AppHelper.AppJustOne.Restart();
} }
} }
} }
......
...@@ -80,7 +80,7 @@ namespace FLY.Weight2.Server ...@@ -80,7 +80,7 @@ namespace FLY.Weight2.Server
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//step 2 报警配置 //step 2 报警配置
errorConf = new ErrorConf(PLCos, this.warning, "称重"); errorConf = new ErrorConf(plcos, this.warning, "称重");
errorConf.AddErrorAction(Accessory); errorConf.AddErrorAction(Accessory);
for (int i = 0; i < Items.Count(); i++) for (int i = 0; i < Items.Count(); i++)
{ {
......
...@@ -95,8 +95,11 @@ namespace FLY.Winder.UI.Server ...@@ -95,8 +95,11 @@ namespace FLY.Winder.UI.Server
} }
if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) { if (MessageBox.Show("需要重启,才能生效", "提示", MessageBoxButton.OKCancel) == MessageBoxResult.OK) {
File.Copy(item.Path, "plcgroup.json", true); File.Copy(item.Path, "plcgroup.json", true);
//System.Windows.Forms.Application.Restart();
Application.Current.Shutdown(); //切换为exe的目录,这样程序再次进入时,才能 进入Gage1 文件夹
System.Environment.CurrentDirectory = "../";
//重启软件
AppHelper.AppJustOne.Restart();
} }
} }
} }
......
...@@ -72,9 +72,9 @@ namespace FLY.Winder.Server ...@@ -72,9 +72,9 @@ namespace FLY.Winder.Server
{ {
//PLCos.ObjNames[n].Key 必须与 plcgroup.json 中的 OwnerName 一致!!!! //PLCos.ObjNames[n].Key 必须与 plcgroup.json 中的 OwnerName 一致!!!!
var objNames = new Dictionary<string, INotifyPropertyChanged>(); var objNames = new Dictionary<string, INotifyPropertyChanged>();
objNames.Add("Accessory", Accessory); objNames.Add(nameof(Accessory), Accessory);
for (int i = 0; i < Items.Count(); i++) for (int i = 0; i < Items.Count(); i++)
objNames.Add($"Items[{i}]", Items[i]); objNames.Add($"{nameof(Items)}[{i}]", Items[i]);
return objNames; return objNames;
} }
...@@ -83,7 +83,7 @@ namespace FLY.Winder.Server ...@@ -83,7 +83,7 @@ namespace FLY.Winder.Server
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//step 2 报警配置 //step 2 报警配置
errorConf = new ErrorConf(PLCos, this.warning, "收卷"); errorConf = new ErrorConf(plcos, this.warning, "收卷");
//反射找出全部是报警的property //反射找出全部是报警的property
...@@ -107,20 +107,20 @@ namespace FLY.Winder.Server ...@@ -107,20 +107,20 @@ namespace FLY.Winder.Server
//step 3 历史数据记录 //step 3 历史数据记录
//添加任务 //添加任务
PLCos.SetPlan("Accessory", new string[] { PLCos.SetPlan(nameof(Accessory), new string[] {
"Velocity", nameof(Accessory.Velocity),
"Traction1Current", nameof(Accessory.Traction1Current),
"Traction2Current", nameof(Accessory.Traction2Current),
"Traction2TensionKg", nameof(Accessory.Traction2TensionKg),
"RotaryCurrent", nameof(Accessory.RotaryCurrent),
"RotaryFreq", nameof(Accessory.RotaryFreq),
"IsRotaryForw", nameof(Accessory.IsRotaryForw),
"IsRotaryBackw" nameof(Accessory.IsRotaryBackw)
}, 0); }, 0);
for (int i = 0; i < Items.Count(); i++) for (int i = 0; i < Items.Count(); i++)
PLCos.SetPlan($"Items[{i}]", new string[] { PLCos.SetPlan($"{nameof(Items)}[{i}]", new string[] {
"TensionKg", nameof(WinderInsideOutside.TensionKg),
"Current" nameof(WinderInsideOutside.Current)
}, 0); }, 0);
psdWinderInfo = new PeriodicallySaveData<Db_WinderInfo>(); psdWinderInfo = new PeriodicallySaveData<Db_WinderInfo>();
......
Subproject commit 8957f54bb1bf04be95af6d047cc4d08ed142639c Subproject commit 2d5a6d3985d9e31ec384e92f00b97075f1fb762a
和美安装包_v6.22.3 -20210510
1. 修复 扫描测厚仪 FilmVelocity 同时由两个源生成。
2. 修复 追边,扫描测厚仪 FilmVelocity 使用了 电脑时间生成后,不准的问题。
3. 修复 系统有多个PLC,但只显示第1个PLC的连接状态,现在任何一个断开都会触发报警
4. 优化 服务器 设置完参数,能自动重启了。
和美安装包_v6.22.2 -20210425 和美安装包_v6.22.2 -20210425
1. 修复 追边,扫描测厚仪服务器主界面都改回用window控件. 解决 WindowBigClose 找不到MahApps.Brush.Accent 出错。 1. 修复 追边,扫描测厚仪服务器主界面都改回用window控件. 解决 WindowBigClose 找不到MahApps.Brush.Accent 出错。
......
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