private void DrawPositionedCylinder(PositionedCylinder _positionedCylinder, double crankshaftRotation_deg) { Stroke _stroke = _positionedCylinder.GetStroke(crankshaftRotation_deg); Color _color; #region "določimo barvo glede na takt" if (_stroke.Equals(Stroke.Intake)) { _color = this.intakeColor; } else if (_stroke.Equals(Stroke.Compression)) { _color = this.compressionColor; } else if (_stroke.Equals(Stroke.Combustion)) { _color = this.combustionColor; } else if (_stroke.Equals(Stroke.Exhaust)) { _color = this.exhaustColor; } else if (_stroke.Equals(Stroke.WashCompression)) { _color = this.washCompressionColor; } else if (_stroke.Equals(Stroke.CombustionExhaust)) { _color = this.combustionExhaustColor; } else { _color = this.blackColor; } #endregion "določimo barvo glede na takt" double _crankThrowRotation_deg = _positionedCylinder.GetAbsoluteCrankThrowRotation_deg(crankshaftRotation_deg); _crankThrowRotation_deg = EngineDesigner.Common.Mathematics.GetAbsoluteAngle_deg(_crankThrowRotation_deg, true); base.DrawLine( _crankThrowRotation_deg, null, _color, false, this.lineThickness); base.DrawMarker( _crankThrowRotation_deg, _positionedCylinder.Position.ToString(), _color, false, MarkerStyle.Circle, this.lineThickness * 5); }
protected override Polygon GetCrankThrowView(PositionedCylinder _positionedCylinder, double _crankshaftRotation_deg) { double _absoluteCrankThrowRotation_deg = _positionedCylinder.GetAbsoluteCrankThrowRotation_deg(_crankshaftRotation_deg); double _absoluteCrankThrowRotation_rad = Conversions.DegToRad(_absoluteCrankThrowRotation_deg); return(Polygon.Line( 0d, 0d, Math.Sin(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm, Math.Cos(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm)); }
protected override Polygon GetCrankThrowView(PositionedCylinder _positionedCylinder, double _crankshaftRotation_deg) { double _TDC = (Math.Cos(Conversions.DegToRad(_positionedCylinder.GetAbsoluteCrankThrowRotation_deg(_crankshaftRotation_deg))) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm); return(Polygon.Line( _positionedCylinder.Offset_mm, 0, _positionedCylinder.Offset_mm, _TDC)); }
protected override Polygon GetConnectingRodView(PositionedCylinder _positionedCylinder, double _crankshaftRotation_deg) { double _absoluteCrankThrowRotation_deg = _positionedCylinder.GetAbsoluteCrankThrowRotation_deg(_crankshaftRotation_deg); double _absoluteCrankThrowRotation_rad = Conversions.DegToRad(_absoluteCrankThrowRotation_deg); double _cylinderRelativeCrankThrowRotation_deg = _positionedCylinder.GetCylinderRelativeCrankThrowRotation_deg(_crankshaftRotation_deg); double _pistonTravelFromCeter_mm = _positionedCylinder.GetPistonTravelFromCrankCenter_mm(_cylinderRelativeCrankThrowRotation_deg); double _offset_rad = Conversions.DegToRad(_positionedCylinder.Tilt_deg); //zgornja točka ojnice double _xTDC = (Math.Sin(_offset_rad) * _pistonTravelFromCeter_mm); double _yTDC = (Math.Cos(_offset_rad) * _pistonTravelFromCeter_mm); //spodnja točka ojnice double _xBDC = (Math.Sin(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm); double _yBDC = (Math.Cos(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm); return(Polygon.Line(_xTDC, _yTDC, _xBDC, _yBDC)); }
protected override Polygon GetConnectingRodView(PositionedCylinder _positionedCylinder, double _crankshaftRotation_deg) { double _cylinderRelativeCrankThrowRotation_deg = _positionedCylinder.GetCylinderRelativeCrankThrowRotation_deg(_crankshaftRotation_deg); double _offset_rad = Conversions.DegToRad(_positionedCylinder.Tilt_deg); double _cosOffset = Math.Cos(_offset_rad); double _pistonTravelFromCeter_mm = _positionedCylinder.GetPistonTravelFromCrankCenter_mm(_cylinderRelativeCrankThrowRotation_deg); double _absoluteCrankThrowRotation_deg = _positionedCylinder.GetAbsoluteCrankThrowRotation_deg(_crankshaftRotation_deg); double _absoluteCrankThrowRotation_rad = Conversions.DegToRad(_absoluteCrankThrowRotation_deg); double _TDC = (_cosOffset * _pistonTravelFromCeter_mm); double _BDC = (Math.Cos(_absoluteCrankThrowRotation_rad) * _positionedCylinder.CrankThrow.CrankRotationRadius_mm); return(Polygon.Line( _positionedCylinder.Offset_mm, _TDC, _positionedCylinder.Offset_mm, _BDC)); }