12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using Aitex.Core.Util;
- using Aitex.Core.RT.Log;
- using Aitex.Core.UI.ControlDataContext;
- namespace Aitex.Core.UI.Control
- {
- /// <summary>
- /// Interaction logic for MOGeneral.xaml
- /// </summary>
- public partial class MOGeneral : UserControl
- {
- MOLineDataItem MoLineData { get { return (this.DataContext as MOSourceDataItem).LineData; } }
- public MOGeneral()
- {
- InitializeComponent();
- }
- public static readonly DependencyProperty IsManualModeProperty = DependencyProperty.Register(
- "IsManualModeValve3", typeof(bool), typeof(MOGeneral),
- new FrameworkPropertyMetadata(true, FrameworkPropertyMetadataOptions.AffectsRender));
- /// <summary>
- /// Valve_Top on/off status
- /// </summary>
- public bool IsManualModeValve3
- {
- get
- {
- return (bool)GetValue(IsManualModeProperty);
- }
- set
- {
- SetValue(IsManualModeProperty, value);
- }
- }
- private void RecMOSource_MouseEnter(object sender, MouseEventArgs e)
- {
- RecMOSource.Opacity = 0.5;
- if (MoLineData != null)
- {
- string tooltipStr = string.Format("{0}\n\n原始重量:{1}克\n已使用量:{2}克\n剩余重量:{3}克\n剩余比例:{4}\n余量状态:{5}",
- MoLineData.DisplayName,
- MoLineData.MoTotalWeight.ToString("F2"),
- MoLineData.MoUsedWeight.ToString("F2"),
- MoLineData.MoRemainedWeight.ToString("F2"),
- (MoLineData.MoRemainedPercentage * 100).ToString("F1") + "%",
- MoLineData.IsMoRemainedWeightAlarm ? "报警" : "正常");
- this.ToolTip = tooltipStr;
- }
- }
- private void RecMOSource_MouseLeave(object sender, MouseEventArgs e)
- {
- RecMOSource.Opacity = 1;
- }
- }
- }
|