/// <summary> /// Constructor /// </summary> public ucGraph3DViewer() { InitializeComponent(); try { if (LicenseManager.UsageMode != LicenseUsageMode.Designtime) { log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo("Graph3DLib.dll.config")); _ResManager = new ResourceManager(typeof(global::Graph3DLib.Properties.Resources)); _Log4NetClass = new LogClass(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); Point3D camerapos = new Point3D(MachineConfig.ReadDoubleValue("CamX"), MachineConfig.ReadDoubleValue("CamY"), MachineConfig.ReadDoubleValue("CamZ")); sliderCamX.Value = camerapos.X; sliderCamY.Value = camerapos.Y; sliderCamZ.Value = camerapos.Z; txtCamX.Text = sliderCamX.Value.ToString(); txtCamY.Text = sliderCamY.Value.ToString(); txtCamZ.Text = sliderCamZ.Value.ToString(); _RotateSpeed = 7.5; SetCamera(camerapos); _ZoomValue = 0; _MaxZoom = MachineConfig.ReadIntValue("MaxZoom"); _MinZoom = MachineConfig.ReadIntValue("MinZoom"); _TransparentValue = MachineConfig.ReadDoubleValue("TranparentValue"); _InitSize = camera.Position; _MachineModel = new MachineModel(); _MachineModel.Create(); _TopPlateBasePos = _MachineModel.UpperPlatePos; _BottomPlateBasePos = _MachineModel.LowerPlatePos; viewport.Children.Add(_MachineModel.CurrentModel); Color background = MachineConfig.ReadColorValue("ColorBackground"); SolidColorBrush backgroundbrush = new SolidColorBrush(background); backgroundbrush.Freeze(); this.Background = backgroundbrush; _AnimationSpeed = 1; _ThreadAnimation = new ThreadAnimation(); _ThreadAnimation.OnAnimationCreated += OnAnimationCreated; _GraphController = new GraphController(_MachineModel); ReadConfigSensorHighLowValue(); _MeterTimer = new System.Timers.Timer(); _MeterTimer.Elapsed += new System.Timers.ElapsedEventHandler(MeterTimer_Elapsed); _MeterTimer.Interval = 1; circularMeter.OutOfRangeComplete += new EventHandler(circularGraph1_OutOfRangeComplete); this.IsPanelShow = Convert.ToBoolean(MachineConfig.ReadStringValue("IsPanelShow")); this.SelectLanguage = LanguageMode.Japanese; } } catch (Exception ex) { _Log4NetClass.ShowError(ex.ToString(), "Mainform Consturctor"); } }
/// <summary> /// Constructor /// </summary> /// <param name="machineModel">machine model</param> public GraphController(MachineModel machineModel) { _MachineModel = machineModel; _GraphRawData = new List<double[]>(); //_HighValue = MachineConfig.ReadDoubleValue("SensorHighValue"); //_LowValue = MachineConfig.ReadDoubleValue("SensorLowValue"); _LowerLimit = (_MachineModel.LowerPlatePos.Y + _MachineModel.LowerPlatePos.SizeY); _DataHeight = (_HighValue - _LowValue); _UpperPlatePosY = _MachineModel.UpperPlatePos.Y; _MaxOffsetY = Math.Abs(_UpperPlatePosY - _LowerLimit); _MaxOffsetXZ = 15; _MaxScaleXZ = 3; _OverLimitPosition = new List<System.Windows.Point>(); _TranslateData = new List<TranslateData>[6]; _UpperModelPositions = _MachineModel.UpperModelsPosition; _DataScaleforEachObject = new double[6]; _Tranform3DGroups = CreateTranform3DGroups(); for (int i = 0; i < 6; i++) { _TranslateData[i] = new List<TranslateData>(); } }