//************************ private void Initialize_LocalObjects() //===================================== { //....PB 22JAN13. The following "Unit" assignment should be cascaded down automatically from mProject. //....Project. mProject = new clsProject(clsUnit.eSystem.English); //....Operating Conditions. mOpCond = new clsOpCond(); }
//------------------------ public void Restore_SessionData(ref clsProject Project_In, ref clsOpCond OpCond_In, string FilePath_In) //====================================================================================================== { try { Split_SessionFile(); Project_In = (clsProject)modMain.gProject.Deserialize(FilePath_In); OpCond_In = (clsOpCond)modMain.gOpCond.Deserialize(FilePath_In); Delete_ObjFiles(FilePath_In); } catch (Exception pEXP) { } }
private void Initialize_LocalObject() //=================================== { //....Operating Condition. mOpCond = new clsOpCond(); //BG 21DEC12 ////....End Config. //clsEndConfig.eType[] pEndConfig = new clsEndConfig.eType[2]; //for (int i = 0; i < pEndConfig.Length; i++) // pEndConfig[i] = clsEndConfig.eType.Seal; //....Project. //mProject = new clsProject(clsUnit.eSystem.Metric, clsBearing.eType.Radial, // clsBearing_Radial.eDesign.Flexure_Pivot, pEndConfig, modMain.gDB); mProject = new clsProject(modMain.gProject.Unit.System); mProject.Product = new clsProduct(mProject.Unit.System, modMain.gDB); }
//--------------------------------------------------------------------------- // UTILITY ROUTINES - END ' //--------------------------------------------------------------------------- #endregion #region "SESSION SAVE/RESTORE RELATED ROUTINES:" //----------------------------------------- #region "SAVE SESSION:" //-------------------- public void Save_SessionData(clsProject Project_In, clsOpCond OpCond_In) //================================================================================================= { try { string pFilePath = mFileName_BearingCAD.Remove(mFileName_BearingCAD.Length - 11); // mFileName_BearingCAD; Boolean pProject = Project_In.Serialize(pFilePath); Boolean pOpCond = OpCond_In.Serialize(pFilePath); //....Merge two Binary files created for two different objects. Merge_ObjFiles(pFilePath); //....Delete two Binary files. Delete_ObjFiles(pFilePath); } catch (Exception pEXP) { } }
private Double Calc_AngStart_Web(clsOpCond OpCond_In) //=================================================== { //PB 25JAN12. This routine has a few conflicting/confusing relationship. To be discussed with HK. //....Ref. Radial_Rev11_27OCT11: Col. IY. Double pPadCount = mCurrent_Bearing_Radial_FP.Pad.Count; Double pPivotOffset = mCurrent_Bearing_Radial_FP.Pad.Pivot.Offset; Double pPadAngle = mCurrent_Bearing_Radial_FP.Pad.Angle(); Double pVal = 0.0F; if (OpCond_In.Rot_Directionality == clsOpCond.eRotDirectionality.Uni) { pVal = 0.5 * (360 / pPadCount) + ((pPivotOffset - 50) / 100) * pPadAngle; } else if (OpCond_In.Rot_Directionality == clsOpCond.eRotDirectionality.Bi) { pVal = 0.5 * (360 / pPadCount); } return(pVal); }
public Double Ang_Offset(clsOpCond OpCond_In) //=========================================== { //PB 25JAN12. This routine has a few conflicting/confusing relationship. //....Ref. Radial_Rev11_27OCT11: Col. IW Double pVal = 0.0F; Double pPadAngle = mCurrent_Bearing_Radial_FP.Pad.Angle(); Double pPivotOffset = 0.0F; if (OpCond_In.Rot_Directionality == clsOpCond.eRotDirectionality.Uni) { pPivotOffset = mCurrent_Bearing_Radial_FP.Pad.Pivot.Offset; pVal = ((100 - pPivotOffset) / 100) * pPadAngle; } else if (OpCond_In.Rot_Directionality == clsOpCond.eRotDirectionality.Bi) { pVal = 0.5 * mCurrent_Bearing_Radial_FP.Pad.Angle(); } return(pVal); //BG 07MAY12 //return modMain.MRound(pVal, 1); }
//-------------------------------------- public void Read_CustEnqySheet(clsOpCond OpCond_In) //==================================================== { PdfReader pPdfDocu = new PdfReader(mFilePath_CustEnqSheet); AcroFields pPDFField = pPdfDocu.AcroFields; clsUnit pUnit = new clsUnit(); // Project Related Data // --------------------- mCustomer.Name = pPDFField.GetField("Name"); mCustomer.MachineDesc = pPDFField.GetField("Machine Description"); // Operating Condition Related Data // -------------------------------- //....Load Angle. Double pLoadAng = 0.0F; pLoadAng = modMain.ConvTextToDouble(pPDFField.GetField("Load_Angle")); OpCond_In.Radial_LoadAng = pLoadAng; //....Speed. //...Min,Max Val in Eng. //Double[] pSpeed = new Double[2]; //pSpeed[0] = modMain.ConvTextToDouble(pPDFField.GetField("Op_Speed_Min")); //pSpeed[1] = modMain.ConvTextToDouble(pPDFField.GetField("Op_Speed_Max")); //BG 22NOV11 int[] pSpeed = new int[2]; pSpeed[0] = modMain.ConvTextToInt(pPDFField.GetField("Op_Speed_Min")); pSpeed[1] = modMain.ConvTextToInt(pPDFField.GetField("Op_Speed_Max")); //...Nominal Val in Eng. //Double pSpeed_Nom = 0.0F; //pSpeed_Nom = modMain.ConvTextToDouble(pPDFField.GetField("Op_Speed_Nom")); //BG 22NOV11 int pSpeed_Nom = 0; pSpeed_Nom = modMain.ConvTextToInt(pPDFField.GetField("Op_Speed_Nom")); //....Assign Values. if (pSpeed[0] != 0.0F && pSpeed[1] != 0.0F) { ////OpCond_In.Speed_Range[0] = pSpeed[0]; ////OpCond_In.Speed_Range[1] = pSpeed[1]; } else { ////OpCond_In.Speed_Range[0] = pSpeed_Nom; ////OpCond_In.Speed_Range[1] = pSpeed_Nom; } //....Load //...Min,Max Val in Eng. Double[] pLoad = new Double[2]; pLoad[0] = modMain.ConvTextToDouble(pPDFField.GetField("Op_Load_Min")); pLoad[1] = modMain.ConvTextToDouble(pPDFField.GetField("Op_Load_Max")); //...Nominal Val in Eng. Double pLoad_Nom = 0.0F; pLoad_Nom = modMain.ConvTextToDouble(pPDFField.GetField("Op_Load_Nom")); //...Min,Max Val in Met. Double[] pLoad_Met = new Double[2]; pLoad_Met[0] = (Double)pUnit.CFac_Load_MetToEng(modMain.ConvTextToDouble(pPDFField.GetField("Op_Load_Met_Min"))); pLoad_Met[1] = (Double)pUnit.CFac_Load_MetToEng(modMain.ConvTextToDouble(pPDFField.GetField("Op_Load_Met_Max"))); //...Nominal Val in Met. Double pLoad_Met_Nom = 0.0F; pLoad_Met_Nom = (Double)pUnit.CFac_Load_MetToEng(modMain.ConvTextToDouble(pPDFField.GetField("Op_Load_Met_Nom"))); //....Assign Values. if (pLoad[0] != 0.0F && pLoad[1] != 0.0F) //--------------------------------------- { ////OpCond_In.Radial_Load_Range[0] = pLoad[0]; ////OpCond_In.Radial_Load_Range[1] = pLoad[1]; } else if (pLoad_Nom != 0.0F) //------------------------- { ////OpCond_In.Radial_Load_Range[0] = pLoad_Nom; ////OpCond_In.Radial_Load_Range[1] = pLoad_Nom; } else if (pLoad_Met[0] != 0.0F && pLoad_Met[1] != 0.0F) //---------------------------------------------------- { ////OpCond_In.Radial_Load_Range[0] = pLoad_Met[0]; ////OpCond_In.Radial_Load_Range[1] = pLoad_Met[1]; } else if (pLoad_Met_Nom != 0.0F) //----------------------------- { ////OpCond_In.Radial_Load_Range[0] = pLoad_Met_Nom; ////OpCond_In.Radial_Load_Range[1] = pLoad_Met_Nom; } //....Pressure //....Val in Eng. Double pPress = 0.0F; pPress = modMain.ConvTextToDouble(pPDFField.GetField("Pressure")); //....Val in Met. Double pPress_Met = 0.0F; pPress_Met = (Double)pUnit.CFac_Press_MetToEng(modMain.ConvTextToDouble(pPDFField.GetField("Pressure_Met"))); ////if (pPress != 0.0F) //// OpCond_In.OilSupply_Press = pPress; ////else if (pPress_Met != 0.0F) //// OpCond_In.OilSupply_Press = pPress_Met; //....Tempurature //....Val in Eng. Double pTemp = 0.0F; pTemp = modMain.ConvTextToDouble(pPDFField.GetField("Temperature")); //....Val in Met. Double pTemp_Met = 0.0F; pTemp_Met = (Double)pUnit.CFac_Temp_MetToEng(modMain.ConvTextToDouble(pPDFField.GetField("Temperature_Met"))); ////if (pPress != 0.0F) //// OpCond_In.OilSupply_Temp = pTemp; ////else if (pPress_Met != 0.0F) //// OpCond_In.OilSupply_Temp = pTemp_Met; //////.....Lube Type ////OpCond_In.OilSupply_Lube_Type = pPDFField.GetField("Type"); //////.....OilSupply Type ////string pOilType = pPDFField.GetField("OilSupply_Type"); ////if (pOilType == "Pressurized") //// OpCond_In.OilSupply_Type = "Pressurized"; ////else if (pOilType != "" && pOilType != null) ////{ //// MessageBox.Show("Please change oilsupply type, this is not supported in this version"); //// OpCond_In.OilSupply_Type = "Pressurized"; ////} ////else //// OpCond_In.OilSupply_Type = "Pressurized"; //....Directionality String pRot_Directionality = pPDFField.GetField("Directionality"); if (pRot_Directionality == "Uni") { OpCond_In.Rot_Directionality = (clsOpCond.eRotDirectionality)Enum.Parse(typeof(clsOpCond.eRotDirectionality), "Uni"); } else if (pRot_Directionality == "Bi") { OpCond_In.Rot_Directionality = (clsOpCond.eRotDirectionality)Enum.Parse(typeof(clsOpCond.eRotDirectionality), "Bi"); } else if (pRot_Directionality == "" && pRot_Directionality == null) { OpCond_In.Rot_Directionality = (clsOpCond.eRotDirectionality)Enum.Parse(typeof(clsOpCond.eRotDirectionality), "Bi"); } // Bearing Related Data. // --------------------- //....Type String pBearingType = pPDFField.GetField("BearingType").Trim(); //mRadialType = (eRadialType)Enum.Parse(typeof(eRadialType), pBearingType); if (pBearingType != null) { if (pBearingType != clsBearing_Radial.eDesign.Flexure_Pivot.ToString().Replace("_", " ").Trim()) { System.Windows.Forms.MessageBox.Show("This type not supported in this version"); } else if (pBearingType == clsBearing_Radial.eDesign.Flexure_Pivot.ToString().Replace("_", " ")) { pBearingType = pBearingType.Replace(" ", "_").Trim(); ((clsBearing_Radial_FP)mProduct.Bearing).Design = (clsBearing_Radial_FP.eDesign)Enum.Parse(typeof(clsBearing_Radial_FP.eDesign), pBearingType); } } //Bearing_In.TypeRadial = "Flexure Pivot"; //....Split Config String pSplitConfig = pPDFField.GetField("SplitConfig"); //if (pSplitConfig == "Yes") // Bearing_In.SplitConfig = true; //else if (pSplitConfig == "No") // Bearing_In.SplitConfig = false; //else if (pSplitConfig == "" && pSplitConfig == null) // Bearing_In.SplitConfig = true; if (pSplitConfig == "Yes") { ((clsBearing_Radial_FP)mProduct.Bearing).SplitConfig = true; } else if (pSplitConfig == "No") { ((clsBearing_Radial_FP)mProduct.Bearing).SplitConfig = false; } else if (pSplitConfig == "" || pSplitConfig == null) { ((clsBearing_Radial_FP)mProduct.Bearing).SplitConfig = true; } pPdfDocu.Close(); }
private void SetLocalObject() //=========================== { mOpCond = (clsOpCond)modMain.gOpCond.Clone(); }