Ejemplo n.º 1
0
 public MahloIpcClient(
     ISewinQueue sewinQueue,
     ICutRollList cutRollList,
     IInspectionAreaList inspectionAreaList,
     IClientSettings appInfo,
     SynchronizationContext context)
 {
     this.appInfo            = appInfo;
     this.sewinQueue         = sewinQueue;
     this.cutRollList        = cutRollList;
     this.inspectionAreaList = inspectionAreaList;
     this.context            = context;
 }
Ejemplo n.º 2
0
        public MainForm(ICarpetProcessor carpetProcessor, ICutRollList cutRollList, IInspectionAreaList inspectionAreaList, IMahloIpcClient mahloClient, IServiceSettings serviceSettings)
        {
            this.InitializeComponent();
            this.carpetProcessor          = carpetProcessor;
            this.cutRollList              = cutRollList;
            this.inspectionAreaList       = inspectionAreaList;
            this.mahloClient              = mahloClient;
            this.serviceSettings          = serviceSettings;
            this.statusBar1.StatusBarInfo = (IStatusBarInfo)this.carpetProcessor.PatternRepeatLogic;
            this.defaultCellColor         = new CellColor
            {
                ForeColor = this.grdGreigeRoll.DefaultCellStyle.ForeColor,
                BackColor = this.grdGreigeRoll.DefaultCellStyle.BackColor
            };

            this.disposables.Add(
                Observable.FromEventPattern <PropertyChangedEventHandler, PropertyChangedEventArgs>(
                    h => ((INotifyPropertyChanged)this.carpetProcessor.MahloLogic).PropertyChanged += h,
                    h => ((INotifyPropertyChanged)this.carpetProcessor.MahloLogic).PropertyChanged -= h)
                .Where(args => args.EventArgs.PropertyName == nameof(this.carpetProcessor.MahloLogic.CurrentRoll))
                .Subscribe(args =>
            {
                this.mahloRollSrc.DataSource = this.carpetProcessor.MahloLogic.CurrentRoll;
                this.DoAutoScroll();
                this.grdGreigeRoll.Invalidate();
            }));

            this.disposables.Add(
                Observable.FromEventPattern <PropertyChangedEventHandler, PropertyChangedEventArgs>(
                    h => ((INotifyPropertyChanged)this.carpetProcessor.BowAndSkewLogic).PropertyChanged += h,
                    h => ((INotifyPropertyChanged)this.carpetProcessor.BowAndSkewLogic).PropertyChanged -= h)
                .Where(args => args.EventArgs.PropertyName == nameof(this.carpetProcessor.BowAndSkewLogic.CurrentRoll))
                .Subscribe(args =>
            {
                this.bowAndSkewRollSrc.DataSource = this.carpetProcessor.BowAndSkewLogic.CurrentRoll;
                this.DoAutoScroll();
                this.grdGreigeRoll.Invalidate();
            }));

            this.disposables.Add(
                Observable.FromEventPattern <PropertyChangedEventHandler, PropertyChangedEventArgs>(
                    h => ((INotifyPropertyChanged)this.carpetProcessor.PatternRepeatLogic).PropertyChanged += h,
                    h => ((INotifyPropertyChanged)this.carpetProcessor.PatternRepeatLogic).PropertyChanged -= h)
                .Where(args => args.EventArgs.PropertyName == nameof(this.carpetProcessor.PatternRepeatLogic.CurrentRoll))
                .Subscribe(args =>
            {
                this.patternRepeatRollSrc.DataSource = this.carpetProcessor.PatternRepeatLogic.CurrentRoll;
                this.DoAutoScroll();
                this.grdGreigeRoll.Invalidate();
            }));

            // Make column heading alignment match column data alignment
            foreach (DataGridViewColumn column in this.grdGreigeRoll.Columns)
            {
                column.HeaderCell.Style.Alignment = column.DefaultCellStyle.Alignment;
            }

            foreach (DataGridViewColumn column in this.grdCutRoll.Columns)
            {
                column.HeaderCell.Style.Alignment = column.DefaultCellStyle.Alignment;
            }

            foreach (DataGridViewColumn column in this.grdInspectionArea.Columns)
            {
                column.HeaderCell.Style.Alignment = column.DefaultCellStyle.Alignment;
            }

            this.colMalFeet.Tag         =
                this.colBasFeet.Tag     =
                    this.colPrsFeet.Tag = new CellFormattingAction(this.SetFeetColor);

            this.colBow.Tag        = new CellFormattingAction(this.SetBowColor);
            this.colSkew.Tag       = new CellFormattingAction(this.SetSkewColor);
            this.colElongation.Tag = new CellFormattingAction(this.SetElongationColor);

            this.colCutBow.Tag        = new CellFormattingAction(this.SetCutBowColor);
            this.colCutSkew.Tag       = new CellFormattingAction(this.SetCutSkewColor);
            this.colCutElongation.Tag = new CellFormattingAction(this.SetCutEPEColor);
        }