Commit 0d19fe78 authored by 潘栩锋's avatar 潘栩锋 🚴

优化 称重MainGraph 也变成 MainGraphV4模式

parent a0a202b4
......@@ -31,7 +31,6 @@ namespace FLY.Weight.UI.Client.UiModule
IUnityContainer container;
IWeightSystemService weightSystemService;
SetPLCUpdatePlan setPlan_accessory;
List<SetPLCUpdatePlan> setPlan_items = new List<SetPLCUpdatePlan>();
public MainGraph()
{
......@@ -45,42 +44,18 @@ namespace FLY.Weight.UI.Client.UiModule
IWeightSystemService weightSystemService)
{
this.container = container;
ucTotalFlow.Init(weightSystemService);
ucThickness.Init(weightSystemService);
this.weightSystemService = weightSystemService;
root_grid.DataContext = this.weightSystemService;
setPlan_accessory = new SetPLCUpdatePlan(
this.weightSystemService.PLCos,
this.weightSystemService.Accessory,
new string[] {
"TotalFlowSetting",
"TotalFlow",
"TotalProduction",
"ALast",
"ACurrent",
"ACurrentLen",
"AClear",
"BLast",
"BCurrent",
"BCurrentLen",
"BClear",
"TotalFilmWidth",
"IsRimNoRecycle",
"RimWidth",
"ActFilmWidth",
"SetThickness",
"TargetVelocity",
"CurrentVelocity"
});
for (int i = 0; i < this.weightSystemService.Items.Count(); i++)
{
SetPLCUpdatePlan plan = new SetPLCUpdatePlan(
this.weightSystemService.PLCos,
this.weightSystemService.Items[i],
item_update_propertynames);
UcWeighterItem.item_update_propertynames);
setPlan_items.Add(plan);
}
if (weightSystemService is WeightSystemServiceClient) {
......@@ -111,123 +86,12 @@ namespace FLY.Weight.UI.Client.UiModule
SetPLCUpdatePlan plan = new SetPLCUpdatePlan(
weightSystemService.PLCos,
weightSystemService.Items[start_idx+i],
item_update_propertynames);
UcWeighterItem.item_update_propertynames);
setPlan_items.Add(plan);
}
}
}
string[] item_update_propertynames = new string[] {
"CurrentFlow",
"CumulativeProduction",
"FlowSetting",
"CurrentFlow",
"ScrewPDisp",
"ScrewPSet",
"ScrewPDisp",
"MixBucketWeight",
"BinWeight",
"MixIsOn",
"BucketValveIsOpen",
"ScrewMotorFreq",
"ScrewMotorIsOn",
"ScrewIsAutoMode",
"ScrewManualFreq"
};
private async void button_frequency_Click(object sender, RoutedEventArgs e)
{
WdFrequency w = new WdFrequency();
var weight = ((Button)sender).Tag as FLY.Weight.Common.WeighterC;
w.FrequencySet = weight.ScrewManualFreq;
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
if (w.ShowDialog()==true)
{
//TODO
weight.ScrewManualFreq = (float)w.FrequencySet;
weight.ScrewManualFreqIsSet = true;
//不用写下降沿!!!!!
}
}
private void button_ratio_Click(object sender, RoutedEventArgs e)
{
WdRatioSet w = new WdRatioSet();
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.Init(weightSystemService);
w.ShowDialog();
}
private void button_info_Click(object sender, RoutedEventArgs e)
{
PgMenu p = new PgMenu();
container.BuildUp(p);
MultiLayout.FlyLayoutManager.NavigationService.Navigate(p);
}
private void button_clear_Click(object sender, RoutedEventArgs e)
{
foreach (FLY.Weight.Common.WeighterC weight in weightSystemService.Items)
{
weight.ClearProduction = true;
}
FLY.ControlLibrary.Window_Tip.Show("", "清空成功", TimeSpan.FromSeconds(2));
}
private void button_ingredient_Click(object sender, RoutedEventArgs e)
{
WdIngredient w = new WdIngredient();
var weight = ((Button)sender).Tag as WeighterC;
w.Init(container, weight, weightSystemService);
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
w.ShowDialog();
}
private void button_thickness_Click(object sender, RoutedEventArgs e)
{
WdThickness w = new WdThickness();
if (weightSystemService.Items.Count() < 1)
return;
w.SetThickness = (int)weightSystemService.Accessory.SetThickness;
w.FilmWidth = (int)weightSystemService.Accessory.TotalFilmWidth;
w.RimWidth = (int)weightSystemService.Accessory.RimWidth;
w.IsRimNoRecycle = weightSystemService.Accessory.IsRimNoRecycle;
w.Owner = FLY.ControlLibrary.COMMON.GetWindow(this);
if (w.ShowDialog() == true)
{
weightSystemService.Accessory.SetThickness = w.SetThickness;
weightSystemService.Accessory.TotalFilmWidth = w.FilmWidth;
weightSystemService.Accessory.RimWidth = w.RimWidth;
weightSystemService.Accessory.IsRimNoRecycle = w.IsRimNoRecycle;
FLY.ControlLibrary.Window_Tip.Show("","厚度参数设置成功", TimeSpan.FromSeconds(2));
}
}
private void button_aclear_Click(object sender, RoutedEventArgs e)
{
if (weightSystemService.ItemsCnt > 0)
{
weightSystemService.Accessory.AClear = true;
FLY.ControlLibrary.Window_Tip.Show("", "清空成功", TimeSpan.FromSeconds(2));
}
}
private void button_bclear_Click(object sender, RoutedEventArgs e)
{
if (weightSystemService.ItemsCnt > 0)
{
weightSystemService.Accessory.BClear = true;
FLY.ControlLibrary.Window_Tip.Show("", "清空成功", TimeSpan.FromSeconds(2));
}
}
}
......
......@@ -31,7 +31,6 @@ namespace FLY.Weight.UI.Client.UiModule
IUnityContainer container;
IWeightSystemService weightSystemService;
SetPLCUpdatePlan setPlan_accessory;
List<SetPLCUpdatePlan> setPlan_items = new List<SetPLCUpdatePlan>();
public MainGraphV4()
{
......
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