public Boolean Compare(ref clsUnit Unit_In) //----------------------------------------- { bool mblnVal_Changed = false; int pRetValue = 0; if (modMain.CompareVar(Unit_In.mSystem.ToString(), mSystem.ToString(), pRetValue) > 0) { mblnVal_Changed = true; } return(mblnVal_Changed); }
//....Class Constructor //public clsProduct(clsUnit.eSystem UnitSystem_In, clsBearing.eType Type_In, clsBearing_Radial_FP.eDesign Design_In, // clsEndConfig.eType [] EndConfigType_In, clsDB DB_In) ////================================================================================================================ //{ // mUnit.System = UnitSystem_In; // //Main Component. // //--------------- // // // if (Type_In == clsBearing.eType.Radial) // { // if (Design_In == clsBearing_Radial.eDesign.Flexure_Pivot) // { // mBearing = new clsBearing_Radial_FP(UnitSystem_In, Type_In, Design_In, DB_In, this); // } // } // //End Configurations: // //------------------- // // // mEndConfig = new clsEndConfig[2]; // for (int i = 0; i < 2; i++) // { // if (EndConfigType_In [i]== clsEndConfig.eType.Seal) //....End Seal. // { // mEndConfig[i] = new clsSeal (UnitSystem_In, EndConfigType_In [i], DB_In, this); // } // else if (EndConfigType_In[i] == clsEndConfig.eType.Thrust_Bearing_TL) //....End TB. // { // mEndConfig[i] = new clsBearing_Thrust_TL (UnitSystem_In, EndConfigType_In [i], DB_In, this); // } // } // //Accessories. // //--------------- // // // mAccessories = new clsAccessories(); //} public clsProduct(clsUnit.eSystem UnitSystem_In, clsDB DB_In) //=========================================================== { //PB 23JAN13. At the time of instantiation of this object, the Bearing Type & Bearing Design, EndConfig [0,1] Types are //....known. Hence, instantiate mBearing & mEndConfig [0,1] using the above info. To be done in the future. // Initialize. // ----------- // //....Unit System. mUnit = new clsUnit(); //....Default unit = English (automatically). mUnit.System = UnitSystem_In; //....Bearing. //mBearing = new clsBearing_Radial_FP(clsUnit.eSystem.English, clsBearing.eType.Radial, // clsBearing_Radial.eDesign.Flexure_Pivot, DB_In, this); mBearing = new clsBearing_Radial_FP(mUnit.System, clsBearing.eType.Radial, clsBearing_Radial.eDesign.Flexure_Pivot, DB_In, this); //....End Configurations: clsEndConfig.eType[] pEndConfig = new clsEndConfig.eType[2]; for (int i = 0; i < pEndConfig.Length; i++) { pEndConfig[i] = clsEndConfig.eType.Seal; //....Default cofigs = [Seal, Seal] } mEndConfig = new clsEndConfig[2]; for (int i = 0; i < 2; i++) { mEndConfig[i] = new clsSeal(mUnit.System, pEndConfig[i], DB_In, this); } //....Accessories. mAccessories = new clsAccessories(); }
//-------------------------------------- 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(); }