Example #1
0
        public UCSwitch()
        {
            InitializeComponent();
            mBeckHoff = Utils.GetBeckHoffInstance();

            InitStatusMap();
        }
Example #2
0
 public PageDebugBucket()
 {
     InitializeComponent();
     Utils.NavigateToPage(MainWindow.sFrameToolbarName,ToolbarParameter.TAG);
     InitStatusMap();
     mBeckHoff = Utils.GetBeckHoffInstance();
 }
Example #3
0
        public UCSwitch()
        {
            InitializeComponent();
            mBeckHoff = Utils.GetBeckHoffInstance();

            InitStatusMap();
        }
 public PageDebugBucket()
 {
     InitializeComponent();
     Utils.NavigateToPage(MainWindow.sFrameToolbarName, ToolbarParameter.TAG);
     InitStatusMap();
     mBeckHoff = Utils.GetBeckHoffInstance();
 }
Example #5
0
 //private int mBucketCapacity = 1200;
 public UCWarningLights()
 {
     InitializeComponent();
     this.Loaded += new RoutedEventHandler(Page_Loaded);
     this.Unloaded += new RoutedEventHandler(Page_Unloaded);
     mTooltipHelper = new ToolTipHelper(this);
     mBeckHoff = Utils.GetBeckHoffInstance();
 }
Example #6
0
        //private int mBucketCapacity = 1200;

        public UCWarningLights()
        {
            InitializeComponent();
            this.Loaded   += new RoutedEventHandler(Page_Loaded);
            this.Unloaded += new RoutedEventHandler(Page_Unloaded);
            mTooltipHelper = new ToolTipHelper(this);
            mBeckHoff      = Utils.GetBeckHoffInstance();
        }
Example #7
0
        private SortedDictionary<int, ErrorInfo> mSortedWarnningMap = new SortedDictionary<int, ErrorInfo>(); //errorinfo level, plcvarname

        #endregion Fields

        #region Constructors

        private WarnningDataSource()
        {
            mBeckHoff = Utils.GetBeckHoffInstance();
            mBeckHoff.RegisterObserver(TAG, this);

            InitStatusMap();
            InitWarnningList();
        }
        private WarnningDataSource()
        {
            mBeckHoff = Utils.GetBeckHoffInstance();
            mBeckHoff.RegisterObserver(TAG, this);

            InitStatusMap();
            InitWarnningList();
        }
Example #9
0
        public PageParameterUp()
        {
            InitializeComponent();
            Utils.NavigateToPage(MainWindow.sFrameToolbarName, ToolbarParameter.TAG);
            //keyboard.registerObserver(this);

            InitStatusMap();
            mBeckHoff        = Utils.GetBeckHoffInstance();
            mParameterHelper = new PageParameterHelper(this);
        }
Example #10
0
        public PageParameterUp()
        {
            InitializeComponent();
            Utils.NavigateToPage(MainWindow.sFrameToolbarName,ToolbarParameter.TAG);
            //keyboard.registerObserver(this);

            InitStatusMap();
            mBeckHoff = Utils.GetBeckHoffInstance();
            mParameterHelper = new PageParameterHelper(this);
        }
Example #11
0
        public PageParameterDown()
        {
            InitializeComponent();
            //keyboard.registerObserver(this);

            InitStatusMap();
            mBeckHoff = Utils.GetBeckHoffInstance();

            mParameterHelper = new PageParameterHelper(this);
        }
Example #12
0
        public PageParameterDown()
        {
            InitializeComponent();
            //keyboard.registerObserver(this);

            InitStatusMap();
            mBeckHoff = Utils.GetBeckHoffInstance();

            mParameterHelper = new PageParameterHelper(this);
        }
Example #13
0
        public PageParameterMain()
        {
            InitializeComponent();
            Utils.NavigateToPage(MainWindow.sFrameToolbarName, ToolbarParameter.TAG);
            this.Loaded += new RoutedEventHandler(Page_Loaded);
            this.Unloaded += new RoutedEventHandler(Page_Unloaded);

               InitStatusMap();
               mBeckHoff = Utils.GetBeckHoffInstance();
        }
Example #14
0
        public PageHome()
        {
            InitializeComponent();
            mBeckHoff = Utils.GetBeckHoffInstance();

            Utils.NavigateToPage(MainWindow.sFrameToolbarName, ToolbarMain.TAG);

            //data binding
            this.tb_Store_CigNum.DataContext  = this.mDataModel;
            this.tb_Store_percent.DataContext = this.mDataModel;
        }
Example #15
0
        public PageParameterMain()
        {
            InitializeComponent();
            Utils.NavigateToPage(MainWindow.sFrameToolbarName, ToolbarParameter.TAG);
            this.Loaded   += new RoutedEventHandler(Page_Loaded);
            this.Unloaded += new RoutedEventHandler(Page_Unloaded);


            InitStatusMap();
            mBeckHoff = Utils.GetBeckHoffInstance();
        }
Example #16
0
 private void InitBeckHoff()
 {
     try
     {
         mAdsClient.Connect(801);
         mAdsClient.AdsNotificationEx    += new AdsNotificationExEventHandler(adsClient_AdsNotificationEx);
         mAdsClient.AdsStateChanged      += new AdsStateChangedEventHandler(adsClient_AdsStateChanged);
         mAdsClient.AdsNotificationError += new AdsNotificationErrorEventHandler(mAdsClient_AdsNotificationError);
         mBeckHoff = new BeckHoff(mAdsClient);
         mBeckHoff.addAllNotifacations();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message + "设备未运行!");
         Close();
     }
 }
Example #17
0
        public static String GetFormatedPlcValue(String plcVarName)
        {
            BeckHoff beckhoff = GetBeckHoffInstance();
            Object   value;

            beckhoff.plcVarUserdataMap.TryGetValue(plcVarName, out value);
            YF17A.BeckHoff.ThresHold limit;
            beckhoff.plcVarThreadHoldMap.TryGetValue(plcVarName, out limit);
            String content = value.ToString();

            if (limit != null && limit.ratio == 100)
            {
                return(Convert.ToSingle(content).ToString("F2"));
            }
            else
            {
                return(content);
            }
        }
Example #18
0
        private void InitStatusMap()
        {
            BitmapImage mRedLight    = MainWindow.sDisableLight;
            BitmapImage mYellowLight = MainWindow.sEnableLight;

            mBeckHoff = Utils.GetBeckHoffInstance();

            mStatusMap.Add(".Sample_entrance_sensor", new ElementInfo()
            {
                Light = mYellowLight, Flash = false
            });                                                                                                   // Sample_entrance_sensor	Bool	取样入口有烟传感器	B-PSW101	只读	指示灯	I2.3
            mStatusMap.Add(".Emergency_stop", new ElementInfo()
            {
                Light = mRedLight, Flash = false
            });                                                                                         //Emergency_stop	Bool	紧急停止继电器	K01	只读	指示灯/报警条显示	I0.0
            mStatusMap.Add(".DropTransLimitLevel", new ElementInfo()
            {
                Light = mRedLight, Flash = false
            });                                                                                             //Elevater_e_stop	Bool	提升机紧急停止按钮	SB105	只读	指示灯/报警条显示	I1.7
            mStatusMap.Add(".alarm_corner_entrance_jam", new ElementInfo()
            {
                Light = mRedLight, Flash = true
            });                                                                                                 //alarm_corner_entrance_jam	Bool	弯道入口堵塞报警指示		只读	指示灯/报警条显示	M50.1

            mStatusMap.Add(".alarm_transfer_overload", new ElementInfo()
            {
                Light = mRedLight, Flash = true
            });                                                                                              //alarm_transfer_overload	Bool	传送电机过载报警指示		只读	指示灯/报警条显示	M50.3
            mStatusMap.Add(".Transfer_cig_exist", new ElementInfo()
            {
                Light = mYellowLight, Flash = false
            });                                                                                               //Transfer_cig_exist	Bool	高架烟支传感器	B-PSW201	只读	指示灯	I4.2
            mStatusMap.Add(".alarm_downport_entrance_jam", new ElementInfo()
            {
                Light = mRedLight, Flash = true
            });                                                                                                    //alarm_downport_entrance_jam	Bool	下降口入口堵塞报警指示		只读	指示灯/报警条显示	M50.2
            //    mStatusMap.Add(".StoreUnit_e_stop_button", new ElementInfo() { Light = mRedLight, Flash = false });  //StoreUnit_e_stop_button	Bool	存储器紧急停止按钮	SB205	只读	指示灯/报警条显示	I3.5

            mStatusMap.Add(".Slope_empty", new ElementInfo()
            {
                Light = mYellowLight, Flash = true
            });                                                                                      //Slope_empty	Bool	斜向通道空	B-PRX202	只读	指示灯	I4.1
            mStatusMap.Add(".Store_entrance_cig_exist", new ElementInfo()
            {
                Light = mYellowLight, Flash = true
            });                                                                                                    //Store_entrance_cig_exist	Bool	存储器入口有烟传感器	B-PSW301	只读	指示灯	I5.3
            mStatusMap.Add(".alarm_store_entrance_jam", new ElementInfo()
            {
                Light = mRedLight, Flash = true
            });                                                                                                  //alarm_store_entrance_jam	Bool	存储器入口堵塞报警指示		只读	指示灯/报警条显示	M50.5
            mStatusMap.Add(".alarm_store_overload", new ElementInfo()
            {
                Light = mRedLight, Flash = true
            });                                                                                             //alarm_store_overload	Bool	存储器过载报警指示		只读	指示灯/报警条显示	M50.4

            mStatusMap.Add(".Store_full", new ElementInfo()
            {
                Light = mRedLight, Flash = true
            });                                                                                    //Store_full	Bool	存储器满传感器	B-PRX301	只读	指示灯	I5.0
            mStatusMap.Add(".alarm_store_limit_on", new ElementInfo()
            {
                Light = mRedLight, Flash = true
            });                                                                                              //alarm_store_limit_on	Bool	存储器极限位置到达报警指示		只读	指示灯	M60.2

            mStatusMap.Add(".Maker_enable_relay_Q", new ElementInfo()
            {
                Light = mRedLight, Flash = false, Switch = true
            });                                                                                                           //<!--Maker_enable_relay_Q	Bool	卷烟机允许(备用)	K101	只读	指示灯	Q5.4-->
            mStatusMap.Add(".Packer_enable_relay_Q", new ElementInfo()
            {
                Light = mRedLight, Flash = false, Switch = true
            });                                                                                                              // <!--Packer_enable_relay_Q	Bool	包装机允许(备用)	K107	只读	指示灯	Q8.2-->

            mStatusMap.Add(".Store_empty", new ElementInfo()
            {
                Light = mYellowLight, Flash = true
            });                                                                                      //Slope_empty	Bool	斜向通道空	B-PRX202	只读	指示灯	I4.1


            foreach (KeyValuePair <String, ElementInfo> entry in mStatusMap)
            {
                String      key         = entry.Key;
                String      controlName = key.Replace(".", "iv_");
                ElementInfo info        = entry.Value;
                info.Element = panel.FindName(controlName) as FrameworkElement;
                if (info.Element != null)
                {
                    info.Element.Visibility = Visibility.Hidden;
                }

                Image helpIcon = panel.FindName(key.Replace(".", "help_")) as Image;
                if (helpIcon != null)
                {
                    helpIcon.MouseUp += new MouseButtonEventHandler(help_MouseUp);
                }
            }
        }
Example #19
0
        private void InitStatusMap()
        {
            BitmapImage mRedLight = MainWindow.sDisableLight;
            BitmapImage mYellowLight = MainWindow.sEnableLight;

            mBeckHoff = Utils.GetBeckHoffInstance();

            mStatusMap.Add(".Sample_entrance_sensor", new ElementInfo() { Light = mYellowLight, Flash = false }); // Sample_entrance_sensor	Bool	取样入口有烟传感器	B-PSW101	只读	指示灯	I2.3
            mStatusMap.Add(".Emergency_stop", new ElementInfo() { Light = mRedLight, Flash = false });  //Emergency_stop	Bool	紧急停止继电器	K01	只读	指示灯/报警条显示	I0.0
            mStatusMap.Add(".Elevater_e_stop", new ElementInfo() {  Light = mRedLight, Flash = false }); //Elevater_e_stop	Bool	提升机紧急停止按钮	SB105	只读	指示灯/报警条显示	I1.7
            mStatusMap.Add(".alarm_corner_entrance_jam", new ElementInfo() { Light = mRedLight, Flash = true });//alarm_corner_entrance_jam	Bool	弯道入口堵塞报警指示		只读	指示灯/报警条显示	M50.1

            mStatusMap.Add(".alarm_transfer_overload", new ElementInfo() { Light = mRedLight, Flash=true }); //alarm_transfer_overload	Bool	传送电机过载报警指示		只读	指示灯/报警条显示	M50.3
            mStatusMap.Add(".Transfer_cig_exist", new ElementInfo() { Light = mYellowLight, Flash = false }); //Transfer_cig_exist	Bool	高架烟支传感器	B-PSW201	只读	指示灯	I4.2
            mStatusMap.Add(".alarm_downport_entrance_jam", new ElementInfo() { Light = mRedLight, Flash = true }); //alarm_downport_entrance_jam	Bool	下降口入口堵塞报警指示		只读	指示灯/报警条显示	M50.2
            mStatusMap.Add(".StoreUnit_e_stop_button", new ElementInfo() { Light = mRedLight, Flash = false });  //StoreUnit_e_stop_button	Bool	存储器紧急停止按钮	SB205	只读	指示灯/报警条显示	I3.5

            mStatusMap.Add(".Slope_empty", new ElementInfo() { Light = mYellowLight, Flash = false });//Slope_empty	Bool	斜向通道空	B-PRX202	只读	指示灯	I4.1
            mStatusMap.Add(".Store_entrance_cig_exist", new ElementInfo() { Light = mYellowLight, Flash = true }); //Store_entrance_cig_exist	Bool	存储器入口有烟传感器	B-PSW301	只读	指示灯	I5.3
            mStatusMap.Add(".alarm_store_entrance_jam", new ElementInfo() { Light = mRedLight, Flash = true });  //alarm_store_entrance_jam	Bool	存储器入口堵塞报警指示		只读	指示灯/报警条显示	M50.5
            mStatusMap.Add(".alarm_store_overload", new ElementInfo() { Light = mRedLight, Flash = true }); //alarm_store_overload	Bool	存储器过载报警指示		只读	指示灯/报警条显示	M50.4

            mStatusMap.Add(".Store_full", new ElementInfo() { Light = mRedLight, Flash = true });  //Store_full	Bool	存储器满传感器	B-PRX301	只读	指示灯	I5.0
            mStatusMap.Add(".alarm_store_limit_on", new ElementInfo() { Light = mRedLight, Flash = true });  //alarm_store_limit_on	Bool	存储器极限位置到达报警指示		只读	指示灯	M60.2

            mStatusMap.Add(".Maker_enable_relay_Q", new ElementInfo() { Light = mRedLight, Flash = false }); //<!--Maker_enable_relay_Q	Bool	卷烟机允许(备用)	K101	只读	指示灯	Q5.4-->
            mStatusMap.Add(".Packer_enable_relay_Q", new ElementInfo() { Light = mRedLight, Flash = false }); // <!--Packer_enable_relay_Q	Bool	包装机允许(备用)	K107	只读	指示灯	Q8.2-->

            foreach (KeyValuePair<String, ElementInfo>  entry in mStatusMap)
            {
                String key = entry.Key;
                String controlName = key.Replace(".", "iv_");
                ElementInfo info = entry.Value;
                info.Element = panel.FindName(controlName) as FrameworkElement;
                if (info.Element != null)
                {
                    info.Element.Visibility = Visibility.Hidden;
                }

                Image helpIcon = panel.FindName(key.Replace(".", "help_")) as Image;
                if (helpIcon != null)
                {
                    helpIcon.MouseUp += new MouseButtonEventHandler(help_MouseUp);
                }
            }
        }
Example #20
0
        private void InitBeckHoff()
        {
            try
            {
                mAdsClient.Connect(801);
               mAdsClient.AdsNotificationEx += new AdsNotificationExEventHandler(adsClient_AdsNotificationEx);
               mAdsClient.AdsStateChanged += new AdsStateChangedEventHandler(adsClient_AdsStateChanged);
               mAdsClient.AdsNotificationError += new AdsNotificationErrorEventHandler(mAdsClient_AdsNotificationError);
                mBeckHoff = new BeckHoff(mAdsClient);
                mBeckHoff.addAllNotifacations();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "设备未运行!");
                Close();
            }
        }