Commit 7c595ed8 authored by 潘栩锋's avatar 潘栩锋 🚴

容器只注册 IBlowingService, 程序强制转换为 IBlowingFixService

parent 07a9416d
...@@ -23,12 +23,13 @@ namespace FLY.Thick.Blowing.UI.Fix.Client ...@@ -23,12 +23,13 @@ namespace FLY.Thick.Blowing.UI.Fix.Client
} }
[InjectionMethod] [InjectionMethod]
public void Init( public void Init(
IBlowingFixService blowingFixService, IBlowingService blowingFixService,
IBlowingDetectService blowingDetectService) IBlowingDetectService blowingDetectService)
{ {
viewModel = new PgBlowingVm(); viewModel = new PgBlowingVm();
viewModel.Init(blowingFixService, blowingDetectService);
viewModel.Init((IBlowingFixService)blowingFixService, blowingDetectService);
this.DataContext = viewModel; this.DataContext = viewModel;
//this.grid_blowing.DataContext = viewModel.renZiJiaService; //this.grid_blowing.DataContext = viewModel.renZiJiaService;
//this.grid_bDetect.DataContext = viewModel.bDetect; //this.grid_bDetect.DataContext = viewModel.bDetect;
......
...@@ -25,11 +25,12 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule ...@@ -25,11 +25,12 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule
[InjectionMethod] [InjectionMethod]
public void Init( public void Init(
IUnityContainer container, IUnityContainer container,
IBlowingFixService blowingFixService, IBlowingService blowingFixService,
IBlowingDetectService blowingDetectService) IBlowingDetectService blowingDetectService)
{ {
this.container = container; this.container = container;
this.blowingFixService = blowingFixService;
this.blowingFixService = (IBlowingFixService)blowingFixService;
this.blowingDetectService = blowingDetectService; this.blowingDetectService = blowingDetectService;
Border_Blowing.DataContext = blowingFixService; Border_Blowing.DataContext = blowingFixService;
......
...@@ -23,7 +23,7 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule ...@@ -23,7 +23,7 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule
ScanGraphCircularParam graphparam; ScanGraphCircularParam graphparam;
BulkDataServiceClientAdv bulkDataServiceClientAdv; BulkDataServiceClientAdv bulkDataServiceClientAdv;
IDynAreaService dynAreaService; IDynAreaService dynAreaService;
IBlowingFixService blowingFixService; IBlowingService blowingService;
public ScanGraphCircular() public ScanGraphCircular()
{ {
InitializeComponent(); InitializeComponent();
...@@ -33,11 +33,11 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule ...@@ -33,11 +33,11 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule
public void Init(int id, public void Init(int id,
IDynAreaService dynAreaService, IDynAreaService dynAreaService,
BulkDataServiceClientAdv bulkDataServiceClientAdv, BulkDataServiceClientAdv bulkDataServiceClientAdv,
IBlowingFixService blowingFixService) IBlowingService blowingService)
{ {
this.dynAreaService = dynAreaService; this.dynAreaService = dynAreaService;
this.bulkDataServiceClientAdv = bulkDataServiceClientAdv; this.bulkDataServiceClientAdv = bulkDataServiceClientAdv;
this.blowingFixService = blowingFixService; this.blowingService = blowingService;
//查找参数 //查找参数
graphparam = ScanGraphCircularParams.Current.Items.Find(p => p.ID == id); graphparam = ScanGraphCircularParams.Current.Items.Find(p => p.ID == id);
...@@ -62,8 +62,8 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule ...@@ -62,8 +62,8 @@ namespace FLY.Thick.Blowing.UI.Fix.Client.UiModule
graph.SetBinding(GraphScanCircular.MPIsRightProperty, new Binding("MPIsRight")); graph.SetBinding(GraphScanCircular.MPIsRightProperty, new Binding("MPIsRight"));
//TODO //TODO
graph.SetBinding(GraphScanCircular.BoltCntProperty, new Binding("NBolts") { Source = blowingFixService }); graph.SetBinding(GraphScanCircular.BoltCntProperty, new Binding("NBolts") { Source = blowingService });
graph.SetBinding(GraphScanCircular.OrgBoltNoProperty, new Binding("OrgBoltNo") { Source = blowingFixService }); graph.SetBinding(GraphScanCircular.OrgBoltNoProperty, new Binding("OrgBoltNo") { Source = blowingService });
graph.SetBinding(GraphScanCircular.TargetProperty, new Binding("Target") { Source = dynAreaService.DynArea }); graph.SetBinding(GraphScanCircular.TargetProperty, new Binding("Target") { Source = dynAreaService.DynArea });
graph.SetBinding(GraphScanCircular.AlarmProperty, new Binding("Alarm") { Source = dynAreaService.DynArea }); graph.SetBinding(GraphScanCircular.AlarmProperty, new Binding("Alarm") { Source = dynAreaService.DynArea });
......
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