Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Version 0.1a
- import java.io.*;
- import java.time.*;
- import java.util.*;
- import java.nio.file.*;
- import org.apache.poi.xwpf.usermodel.*;
- import java.time.format.DateTimeFormatter;
- public class Operational_Functional_Block {
- public static class Main_Code_regular {
- }
- public static class Main_Code_Advanced {
- }
- public static void main(String[] args) throws IOException {
- String lbrk = "////////////////////////////////////////////////////////////////";
- String[] engine_Name1 = {"\"Argosy\"", "\"Galileo\"", "\"Callisto\"", "\"Nauka\"",
- "\"Rassvet\"", "\"Zvezda\"", "\"Zarya\"", "\"Orion\"", "\"Ares\"", "\"Delta\"", "\"Atlas\"",
- "\"Daedalus\"", "\"Baltia\"", "\"Dizhou\"", "\"Hermes\"", "\"Icarus\"", "\"Connestoga\"", "\"Yupiter\"",
- "\"Emphasis\"", "\"Olympus\"", "\"Kronos\"", "\"Helios\"", "\"Alabaster\"", "\"Falcon\"",
- "\"Eagle\"", "\"Endeavour\"", "\"Atlantis\"", "\"Cygnus\"", "\"Apollo\"", "\"Horizon\"",
- "\"Pioneer\"", "\"Voyager\"", "\"Exploration\"", "\"Expedition\"", "\"Vulcan\"",
- "\"Federation\"", "\"Sojourner\"", "\"Nautilus\"", "\"Jubilance\"", "\"Lagrange\"",
- "\"Prometheus\"", "\"Tellus\"", "\"Alpha\"", "\"Delta\"", "\"Proton\"", "\"Neutron\"",
- "\"Electron\"", "\"Pluton\"", "\"Poodle\"", "\"Skipper\"", "\"Convair\"", "\"Nexus\"",
- "\"Vector\"", "\"Terrier\"", "\"Rhino\"", "\"Panther\"", "\"Goliath\"", "\"Juno\"", "\"Shrimp\"",
- "\"Thumper\"", "\"Mainsail\"", "\"Dart\"", "\"Twitch\"", "\"Stratus\"", "\"Oscar\"",
- "\"Sentinel\"", "\"Pegasus\"", "\"Kelus\"", "\"Starshot\"", "\"Vernor\"", "\"Mammoth\"",
- "\"Douglas\"", "\"Heimdall\"", "\"Dynetics\"", "\"Pathfinder\"", "\"Horizon\"", "\"Poisk\"",
- "\"Pirs\"", "\"Philae\"", "\"Mariner\"", "\"Centaur\"", "\"Orel\"", "\"Pratt\"", "\"Hyperion\"",
- "\"Sagittarius\"", "\"Apollo\"", "\"Bryton\"", "\"Volga\"", "\"Harmony\"", "\"Cassini\"", "\"Contour\"",
- "\"Altair\"", "\"Dream\"", "\"Baikal\"", "\"Zenith\"", "\"Urpinod\"", "\"Bernal\"", "\"Condor\"",
- "\"Athena\"", "\"Astra\"", "\"Aerolus\"", "\"Rombus\"", "\"Lunokhod\"", "\"Fregat\"", "\"Glonass\"",
- "\"Dragon\"", "\"Salyut\"", "\"Starliner\"", "\"Skylab\"", "\"Briz\"", "\"Colombus\"", "\"Rosetta\"",
- "\"Redstone\"", "\"Antares\"", "\"Philae\"", "\"Prospero\"", "\"Leonardo\"", "\"Parker\"", "\"Dyson\"",
- "\"Oberon\"", "\"DragonFly\"", "\"Energia\"", "\"Buran\"", "\"Urgan\"", "\"Angara\"", "\"Vostok\"",
- "\"Voskhod\"", "\"Shenzhou\"", "\"Ingenuity\"", "\"Oberon\"", "\"Discovery\"", "\"Horizon\"",
- "\"Cerasus\"", "\"Progress\"", "\"Unity\"", "\"Surveyor\"", "\"Prospector\"", "\"Ikar\"", "\"Redstone\"",
- "\"Lapis\"", "\"Caesius\"", "\"Iridium\"", "\"Daedlus\"", "\"Aelita\"", "\"Beta\"", "\"Gamma\"",
- "\"Alpha\"", "\"Epsilon\"", "\"Omega\"", "\"Discoverer\"", "\"Explorer\"", "\"Hornet\"", "\"Serenity\"",
- "\"Ariane\"", "\"Hornet\"", "\"Asimov\"", "\"Pegasus\"", "\"Venture\"", "\"Antares\"", "\"Star\"",
- "\"Archimedes\"", "\"Hera\"", "\"Iris\"", "\"Titan\"", "\"Artemis\"", "\"Phoenix\"", "\"Ross\"",
- "\"Sarychev\"", "\"Nemesis\"", "\"Heimdall\"", "\"Sturt\"", "\"Odin\"", "\"Aethelred\"", "\"Vesper\"",
- "\"Aces\"", "\"Argon\"", "\"Olympia\"", "\"Perseus\"", "\"Chyron\"", "\"Proxima\"", "\"Arminus\"",
- "\"Destiny\"", "\"Valient\"", "\"FireFly\"", "\"Obsidian\"", "\"Leviathan\"", "\"Magellan\"", "\"Voyager\"",
- "\"Mariner\"", "\"Joist\"", "\"Crimson\"", "\"Fortune\"", "\"Vanguard\"", "\"Aurora\"", "\"Ulysses\"",
- "\"Crusader\"", "\"Python\"", "\"Kuiper\"", "\"Insurgent\"", "\"Pathfinder\"", "\"Kvant\"", "\"Spektr\"",
- "\"Cassini\"", "\"Zemlya\"", "\"Dawn\"", "\"Kepler\"", "\"Parom\"", "\"Elektron\"", "\"Aeonian\"",
- "\"Node\"", "\"Burya\"", "\"Voyager\"", "\"Ceres\"", "\"Bayern\"", "\"Chasovoy\"", "\"Copernicus\"",
- "\"Quaoar\"", "\"Minotaur\"", "\"Agena\"", "\"Thor\"", "\"Vega\"", "\"Scout\"", "\"Coeus\"", "\"Minerva\"",
- "\"Kratos\"", "\"Neith\"", "\"Omoikane\"", "\"Gayamun\"", "\"Odin\"", "\"Kronos\"", "\"Hope\"", "\"Polet\"",
- "\"Polyot\"", "\"Sputnik\"", "\"Clementine\"", "\"Sojourner\"", "\"Ingenuity\"", "\"Perseverence\"", "\"Insider\"",
- "\"Onatchesko\"", "\"Atlantis\"", "\"Tsyklon\"", "\"Zenit\"", "\"Almaz\"", "\"Soyuz\"", "\"Molniya\"", "\"Kosmos\"",
- "\"Oreol\"", "\"Yantar\"", "\"Foton\"", "\"Meteor\"", "\"Ekran\"", "\"Strela\"", "\"Bion\"", "\"Piroda\"",
- "\"Salyut\"", "\"Strela\"", "\"Luch\"", "\"Potok\"", "\"Prognoz\"", "\"Orlets\"", "\"Etalon\"", "\"Astron\"",
- "\"Efir\"", "\"Kometa\"", "\"Fram\"", "\"Zemlya\"", "\"Gorizont\"", "\"Arkon\"", "\"Gamma\"", "\"Ekspress\"",
- "\"Gonets\"", "\"Taifun\"", "\"Okean\"", "\"Reflektor\"", "\"Kolibr\"", "\"Sever\"", "\"Comet\"",
- "\"Roton\"", "\"Solaris\"", "\"Altaris\"", "\"Ithacus\"", "\"Dekto\"", "\"Dream\"", "\"Impuls\"",
- "\"Vremya\"", "\"Portal\"", "\"Zodiak\"", "\"Slava\"", "\"Inertsiya\"", "\"Stimuls\"", "\"Ambross\"",
- "\"Amal\"", "\"Thea\"", "\"Orphelia\"", "\"Polyot\"", "\"Mudrost\"", "\"Carrack\"", "\"Artak\"",
- "\"Questar\"", "\"Artyom\"", "\"Tsyclon\"", "\"Ascension\"", "\"Tenacity\"", "\"Contour\"", "\"Zephyr\"",
- "\"Atlanta\"", "\"Polaris\"", "\"Aeolus\"", "\"Mayak\"", "\"Pamir\"", "\"Taimyr\"", "\"Cheget\"", "\"Sirius\"",
- "\"Uragan\"", "\"Agat\"", "\"Skiph\"", "\"Kristall\"", "\"Altair\"", "\"Uran\"", "\"Ingul\"", "\"Carat\"",
- "\"Pulsar\"", "\"Titan\"", "\"Eridanus\"", "\"Parus\"", "\"Cepheus\"", "\"Varagian\"", "\"Olympus\"",
- "\"Tarkhaniy\"", "\"Astraeus\"", "\"Antares\"", "\"Kazbek\"", "\"Burlak\"", "\"Borei\"", "\"Favor\"",
- "\"Rubin\"", "\"Almaz\"", "\"Granit\"", "\"Ruby\"", "\"Sokol\"", "\"Argon\"", "\"Kavkaz\"", "\"Ural\"",
- "\"Berkut\"", "\"Dunay\"", "\"Yastreb\"", "\"Terek\"", "\"Radon\"", "\"Taymyr\"", "\"Pamir\"", "\"Photon\"",
- "\"Elbrus\"", "\"Isayiev\"", "\"Shmel\"", "\"Kobra\"", "\"Shturn\"", "\"Metis\"", "\"Malyutka\"", "\"Fleyta\"",
- "\"Konkurs\"", "\"Bastion\"", "\"Svir\"", "\"Ataka\"", "\"Vodopad\"", "\"Veter\"", "\"Vyuga\"", "\"Vulga\"",
- "\"Tochka\"", "\"Oka\"", "\"Dvina\"", "\"Almaz\"", "\"Araks\"", "\"Kanopus\"", "\"Kliper\"", "\"Kobalt\"",
- "\"Siluet\"", "\"Kondor\"", "\"Lotos\"", "\"Luch\"", "\"Mir\"", "\"Neman\"", "\"Obzor\"", "\"Okean\"", "\"Oko\"",
- "\"Oktan\"", "\"Orlets\"", "\"Poisk\"", "\"Potok\"", "\"Pirs\"", "\"Prognoz\"", "\"Resurs\"", "\"Rodnik\"",
- "\"Romb\"", "\"Kapustin\"", "\"Oplot\"", "\"Tsygan\"", "\"Teplokhod\"", "\"Sokosha\"", "\"Rubezh\"", "\"Topol\"",
- "\"Zircon\"", "\"Moskva\"", "\"Tryol\"", "\"Ustinov\"", "\"Belyayev\"", "\"Novorod\"", "\"Argos\"", "\"Dreadnought\"",
- "\"Nerthus\"", "\"Janus\"", "\"Hephaestus\"", "\"Themis\"", "\"Chronos\"", "\"Tethys\"", "\"Minos\"", "\"Visionalis\"",
- "\"Autumn\"", "\"Resilience\"", "\"Aelita\"", "\"Rheus\"", "\"Solntspek\"", "\"Spitzer\"", "\"Cartago\"", "\"Liberty\"",
- "\"Melibea\"", "\"Spartacus\"", "\"Pulsar\"", "\"Fusion\"", "\"Reliant\"", "\"Thunder\"", "\"Novo\"", "\"Granis\"",
- "\"Panthera\"", "\"Nematoda\"", "\"Anelida\"", "\"Chordata\"", "\"Tetrapoda\"", "\"Cyclero\"", "\"Carrier\"", "\"Saturn\"",
- "\"Gaia\"", "\"Irtysh\"", "\"Wyvern\"", "\"Tarsier\"", "\"Alpina\"", "\"Espadon\"", "\"Parlos\"", "\"Nebula\"",
- "\"Lazarus\"", "\"Rufus\"", "\"Dornier\"", "\"Argus\"", "\"Kybau\"", "\"Kalau\"", "\"Chasvoy\"", "\"Zephyr\"",
- "\"Temny\"", "\"Gorizont\"", "\"Yars\"", "\"Krugazor\"", "\"Soprotivlenye\"", "\"Shtil\"", "\"Layner\"", "\"Bulava\"",
- "\"Vysota\"", "\"Volna\""};
- String[] engine_Cycle = {"Gas Generator", "Staged Combustion (oxidizer Rich)", "Staged Combustion (Fuel Rich)",
- "Expander (Open)", "Expander (Closed)", "Dual Expander (Open)", "Dual Expander (Closed)",
- "Pressure-Fed", "Full Flow Staged", "Electric Pump Fed", "Combustion Tap Off",
- "Monopropellant (Cold Gas)", "Monopropellant (Decomposition)", "Gas Core", "Liquid Core",
- "Solid Core", "Pulsed Nuclear", "Pebble-Bed", "Nuclear SaltWater"};
- String[] propellant_List1 = {"H2O2 (Hydrogen Peroxide)", "N2H4 (Hydrazine)", "NH2OH+NO3 (Hydroxyl ammonium nitrate)"};
- String[] propellant_List2 = {"Nitrogen (N2)", "Helium (He)", "Carbon Dioxide (CO2)", "Ammonia (NH3)", "Hydrogen (H2)",
- "Methane (CH4)"};
- String[] propellant_List3 = {"Hydrogen (H2)", "Helium (He)", "Nitrogen (N2)", "Hydrogen (H)", "Ammonia (NH3)",
- "Water (H2O)", "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)",
- "Methane (CH4)"};
- String[] altitude_Of_Operation = {"0-10 km (Sea Level)", "20-30 km (Medium Atmosphere)",
- "30-80 km (High Atmosphere)", "80 km+ (Vacuum)", "Any Altitude (0-80 km+)"};
- String[] tank_Repressurisation = {"Autogenously", "using Inert gas"};
- String[] nozzle_Type_List1 = {"De Laval Cone (Without Nozzle Extension)",
- "De Laval Bell (Without Nozzle Extension)"};
- String[] firstPart = {"RD", "RS", "AJ", "XLR", "NK", "RL", "KDTU", "AR", "BE", "MV",
- "YF", "PKA", "TQ", "MJ", "XS", "LM10", "HM", "LE", "LRE", "CE", "DST",
- "DOK", "KDU", "KRD", "R", "RO"};
- File org = new File("C:/Users/Public/Operational_Functional_Block/src/GeneratedFiles");
- org.mkdir();
- // -------------------------------------
- File pathn1 = new File("C:/Users/Public/Operational_Functional_Block/src/GeneratedFiles/obf_rex.docx");
- if (!(new File(String.valueOf(pathn1)).exists())) {
- XWPFDocument docx1 = new XWPFDocument();
- XWPFParagraph par1 = docx1.createParagraph();
- par1.setAlignment(ParagraphAlignment.CENTER);
- XWPFRun run1 = par1.createRun();
- run1.setText("Rocket Engine Generator");
- run1.setFontFamily("Calibri");
- run1.setBold(true);
- run1.setFontSize(33);
- run1.setTextPosition(60);
- // -----------------------------------------------------------------------------
- XWPFParagraph par2 = docx1.createParagraph();
- par2.setAlignment(ParagraphAlignment.RIGHT);
- XWPFRun run2 = par2.createRun();
- LocalDateTime date = LocalDateTime.now();
- DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd MMM yyyy, HH:mm:ss");
- String dt = date.format(formatter);
- run2.setText("Created on: " + dt);
- run2.setFontFamily("Calibri");
- run2.setBold(true);
- run2.setFontSize(10);
- run2.setTextPosition(60);
- // ----------------------------------------------------------------------------------------------------
- try (FileOutputStream out1 = new FileOutputStream(String.valueOf(pathn1))) {
- docx1.write(out1);
- out1.close();
- docx1.close();
- }
- }
- Scanner mstr_cmds = new Scanner(System.in);
- String mstr_cmd = "";
- // First Logic
- String std_cmd;
- while (!mstr_cmd.equals("N")) {
- System.out.println("Do you want to generate a new engine? [Y/N]");
- System.out.print("> ");
- mstr_cmd = mstr_cmds.next();
- if (mstr_cmd.equalsIgnoreCase("N") || mstr_cmd.equalsIgnoreCase("NO")) {
- System.exit(0);
- } else if (mstr_cmd.equalsIgnoreCase("Y") || mstr_cmd.equalsIgnoreCase("YES")) {
- Scanner std_cmdMC = new Scanner(System.in);
- System.out.println("""
- How do you want to configure the app:
- Advanced - For more experienced users with a good grasp on rocketry
- Standard - For users looking for quick rocket engine generation process
- """);
- System.out.print("> ");
- std_cmd = std_cmdMC.next();
- if (std_cmd.equalsIgnoreCase("Advanced")) {
- Scanner eng_name = new Scanner(System.in);
- System.out.println("Input a name for your engine");
- System.out.print("> ");
- String eng_name_final = eng_name.next();
- // ----------------------------------------------------
- Scanner eng_cycle = new Scanner(System.in);
- System.out.println("Input an preferred engine cycle");
- System.out.print("> ");
- String eng_cycle_final = eng_cycle.next();
- boolean isEngineCycle = false;
- for (String index1 : engine_Cycle) {
- if (eng_cycle_final.equals(index1)) {
- isEngineCycle = true;
- break;
- }
- }
- // -----------------------------------------------------
- if (eng_cycle_final.equals("")) {
- } else if (eng_cycle_final.equals("")) {
- } else if (eng_cycle_final.equals("")) {
- } else if (eng_cycle_final.equals("")) {
- } else if (eng_cycle_final.equals("")) {
- } else if (eng_cycle_final.equals("")) {
- } else if (eng_cycle_final.equals("")) {
- } else if (eng_cycle_final.equals("")) {
- }
- Scanner eng_oxid = new Scanner(System.in);
- System.out.println("Input an preferred engine oxidizer \n" +
- "(Note: it has to be appropriate for the engine cycle)");
- System.out.print("> ");
- String eng_oxid_final = eng_oxid.next();
- boolean isOxidizer = false;
- for (String index1 : engine_Cycle) {
- if (eng_oxid_final.equals(index1)) {
- isOxidizer = true;
- break;
- }
- }
- // -----------------------------------------------------
- if (eng_oxid_final.equals("")) {
- } else if (eng_oxid_final.equals("")) {
- } else if (eng_oxid_final.equals("")) {
- } else if (eng_oxid_final.equals("")) {
- } else if (eng_oxid_final.equals("")) {
- } else if (eng_oxid_final.equals("")) {
- } else if (eng_oxid_final.equals("")) {
- } else if (eng_oxid_final.equals("")) {
- }
- Scanner eng_fuel = new Scanner(System.in);
- System.out.println("Input an preferred engine fuel \n" +
- "(Note: it has to be appropriate for the engine cycle and oxidizer)");
- System.out.print("> ");
- System.out.print("> ");
- String eng_fuel_final = eng_fuel.next();
- boolean isFuel = false;
- for (String index1 : ) {
- if (eng_fuel_final.equals(index1)) {
- isFuel = true;
- break;
- }
- }
- // -----------------------------------------------------
- Scanner eng_aoo = new Scanner(System.in);
- System.out.println("Input an altitude of operation \n" +
- "(Note: This will be important for nozzles)");
- System.out.print("> ");
- String eng_aoo_final = eng_aoo.next();
- boolean isAOO = false;
- for (String index1 : altitude_Of_Operation) {
- if (eng_aoo_final.equals(index1)) {
- isAOO = true;
- break;
- }
- }
- // -----------------------------------------------------
- Scanner eng_nzl = new Scanner(System.in);
- System.out.println("Input an preferred nozzle type \n" +
- "(Note: This relates to the altitude of operation)");
- System.out.print("> ");
- String eng_nzl_final = eng_nzl.next();
- boolean isNozzle = false;
- for (String index1 : nozzle_Type_List1) {
- if (eng_nzl_final.equals(index1)) {
- isNozzle = true;
- break;
- }
- }
- // -----------------------------------------------------
- Scanner eng_tnk_rprs = new Scanner(System.in);
- System.out.println("Input an preferred tank repressurisation \n" +
- "(Note: This loosely relates to the engine cycle)");
- System.out.print("> ");
- String eng_tnk_rprs_final = eng_tnk_rprs.next();
- boolean isTankRepressurisationMethod = false;
- for (String index1 : engine_Cycle) {
- if (eng_tnk_rprs_final.equals(index1)) {
- isTankRepressurisationMethod = true;
- break;
- }
- }
- // -----------------------------------------------------
- System.out.println(lbrk + "\n" + "Your Engine is called: " + eng_name_final + "\n");
- System.out.println("Your Engine Cycle is: " + eng_cycle_final);
- System.out.println("Your oxidizer is: " + eng_oxid_final);
- System.out.println("Your Fuel is: " + eng_fuel_final);
- System.out.println("Your Altitude of operation is: " + eng_aoo_final);
- System.out.println("Your engine's nozzle type should be : " + eng_nzl_final);
- System.out.println("Tank repressurisation would be done " + eng_tnk_rprs_final + "\n");
- // ------------------------------------------------------
- } else if (std_cmd.equalsIgnoreCase("Standard")) {
- System.out.println("Standard");
- }
- } else {
- while (!(mstr_cmd.equalsIgnoreCase("Y") && mstr_cmd.equalsIgnoreCase("N"))) {
- System.out.println("Wrong input!Please input an appropriate command [Y/N] ot [YES/NO]");
- System.out.print("> ");
- mstr_cmd = mstr_cmds.next();
- if (mstr_cmd.equalsIgnoreCase("Y") || mstr_cmd.equalsIgnoreCase("N") || mstr_cmd.equalsIgnoreCase("YES") || mstr_cmd.equalsIgnoreCase("NO")) {
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment