Example #1
0
        public MainWindow()
        {
            BIMRLCommon BIMRLCommonRef = new BIMRLCommon();

            InitializeComponent();

            // Connect to Oracle DB
            DBOperation.refBIMRLCommon = BIMRLCommonRef;      // important to ensure DBoperation has reference to this object!!
            if (DBOperation.Connect() == null)
            {
                BIMRLErrorDialog erroDlg = new BIMRLErrorDialog(BIMRLCommonRef);
                erroDlg.ShowDialog();
                return;
            }

            BIMRLQueryModel      _qModel   = new BIMRLQueryModel(BIMRLCommonRef);
            List <BIMRLFedModel> fedModels = new List <BIMRLFedModel>();

            fedModels = _qModel.getFederatedModels();

            DataGrid_Oracle.AutoGenerateColumns = true;
            DataGrid_Oracle.IsReadOnly          = true;
            DataGrid_Oracle.ItemsSource         = fedModels;
            DataGrid_Oracle.MinRowHeight        = 20;
            Button_Copy.IsEnabled = false;

            DataGrid_Cassandra.IsReadOnly          = true;
            DataGrid_Cassandra.AutoGenerateColumns = true;
            DataGrid_Cassandra.MinRowHeight        = 20;

            QueryCassDB          qCDB      = new QueryCassDB();
            List <BIMRLFedModel> modelList = qCDB.getCassFedModels();

            DataGrid_Cassandra.ItemsSource = modelList;
        }
Example #2
0
        public DiffModels()
        {
            InitializeComponent();
            DBOperation.refBIMRLCommon = BIMRLCommonRef;   // important to ensure DBoperation has reference to this object!!
            try
            {
                DBOperation.ExistingOrDefaultConnection();
            }
            catch
            {
                if (DBOperation.UIMode)
                {
                    BIMRLErrorDialog erroDlg = new BIMRLErrorDialog(BIMRLCommonRef);
                    erroDlg.ShowDialog();
                }
                else
                {
                    Console.Write(BIMRLCommonRef.ErrorMessages);
                }
                return;
            }

            BIMRLQueryModel            qModel    = new BIMRLQueryModel(BIMRLCommonRef);
            IList <FederatedModelInfo> fedModels = qModel.getFederatedModels();

            dataGrid_ModelList.AutoGenerateColumns = true;
            dataGrid_ModelList.IsReadOnly          = true;
            dataGrid_ModelList.ItemsSource         = fedModels;
            dataGrid_ModelList.MinRowHeight        = 20;

            button_1stModel.IsEnabled = false;
            button_2ndModel.IsEnabled = false;
            button_Run.IsEnabled      = false;
        }
        public BIMRL_ETLWindow()
        {
            InitializeComponent();
            WindowTitle = "BIMRL ETL Environment";
            BIMRLCommonRef.resetAll();

            try
            {
                // Connect to Oracle DB
                DBOperation.refBIMRLCommon = BIMRLCommonRef;     // important to ensure DBoperation has reference to this object!!
                DBOperation.ExistingOrDefaultConnection();
            }
            catch
            {
                BIMRLErrorDialog erroDlg = new BIMRLErrorDialog(BIMRLCommonRef);
                erroDlg.ShowDialog();
                return;
            }

            _qModel   = new BIMRLQueryModel(BIMRLCommonRef);
            fedModels = _qModel.getFederatedModels();
            DataGrid_FedModels.AutoGenerateColumns = true;
            DataGrid_FedModels.IsReadOnly          = true;
            DataGrid_FedModels.ItemsSource         = fedModels;
            DataGrid_FedModels.MinRowHeight        = 20;

            // Temp: disabled first for testing
            Button_genX3D.IsEnabled     = false; // Disable Gen X3D button until the file name is filled
            Button_EnhanceSpB.IsEnabled = false;
            Button_genGraph.IsEnabled   = false;
        }
        private void Button_OK_Click(object sender, RoutedEventArgs e)
        {
            DBOperation.DBUserID       = TextBox_DBUserID.Text;
            DBOperation.DBPassword     = TextBox_DBPassword.Text;
            DBOperation.DBConnecstring = TextBox_DBConn.Text;

            _bimrlCommon.resetAll();

            // Connect to Oracle DB
            DBOperation.refBIMRLCommon = _bimrlCommon;      // important to ensure DBoperation has reference to this object!!
            if (DBOperation.Connect() == null)
            {
                BIMRLErrorDialog erroDlg = new BIMRLErrorDialog(_bimrlCommon);
                erroDlg.ShowDialog();
                return;
            }

            // For object selections for Space Boundary
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_BeamSB.Content.ToString().ToUpper(), CB_BeamSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_ColumnSB.Content.ToString().ToUpper(), CB_ColumnSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_CurtainWallSB.Content.ToString().ToUpper(), CB_CurtainWallSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_CoveringSB.Content.ToString().ToUpper(), CB_CoveringSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_DoorSB.Content.ToString().ToUpper(), CB_DoorSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_MemberSB.Content.ToString().ToUpper(), CB_MemberSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_OpeningSB.Content.ToString().ToUpper(), CB_OpeningSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_PlateSB.Content.ToString().ToUpper(), CB_PlateSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_RailingSB.Content.ToString().ToUpper(), CB_RailingSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, "IFCRAMP", CB_RampSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, "IFCRAMPFLIGHT", CB_RampSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_RoofSB.Content.ToString().ToUpper(), CB_RoofSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_SlabSB.Content.ToString().ToUpper(), CB_SlabSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_SpaceSB.Content.ToString().ToUpper(), CB_SpaceSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, "IFCSTAIR", CB_StairSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, "IFCSTAIRFLIGHT", CB_StairSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, "IFCWALL", CB_WallSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, "IFCWALLSTANDARDCASE", CB_WallSB.IsChecked.Value);
            registerObjectType(DBOperation.objectForSpaceBoundary, CB_WindowSB.Content.ToString().ToUpper(), CB_WindowSB.IsChecked.Value);

            // For object selections for Connection (e.g. Envelop)
            registerObjectType(DBOperation.objectForConnection, CB_BeamConn.Content.ToString().ToUpper(), CB_BeamConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_ColumnConn.Content.ToString().ToUpper(), CB_ColumnConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_CurtainWallConn.Content.ToString().ToUpper(), CB_CurtainWallConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_CoveringConn.Content.ToString().ToUpper(), CB_CoveringConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_DoorConn.Content.ToString().ToUpper(), CB_DoorConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_MemberConn.Content.ToString().ToUpper(), CB_MemberConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_OpeningConn.Content.ToString().ToUpper(), CB_OpeningConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_PlateConn.Content.ToString().ToUpper(), CB_PlateConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_RailingConn.Content.ToString().ToUpper(), CB_RailingConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, "IFCRAMP", CB_RampConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, "IFCRAMPFLIGHT", CB_RampConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_RoofConn.Content.ToString().ToUpper(), CB_RoofConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_SlabConn.Content.ToString().ToUpper(), CB_SlabConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_SpaceConn.Content.ToString().ToUpper(), CB_SpaceConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, "IFCSTAIR", CB_StairConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, "IFCSTAIRFLIGHT", CB_StairConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, "IFCWALL", CB_WallConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, "IFCWALLSTANDARDCASE", CB_WallConn.IsChecked.Value);
            registerObjectType(DBOperation.objectForConnection, CB_WindowConn.Content.ToString().ToUpper(), CB_WindowConn.IsChecked.Value);

            Close();
        }