public void load() { // Get Values from XML and set these values to the fields Boolean isOkay = UtilitiesIO.GetObjectFromJson(ref m_Settings, ProjectConstants.SETTINGS_FILE); m_Settings.PropertyChanged += m_Settings_PropertyChanged; }
public void loadPBDWorkFlow() { System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog(); dlg.InitialDirectory = Directory.GetCurrentDirectory() + "\\" + ProjectConstants.WORKFLOW_DIR; dlg.Filter = "workflow files (*.work)|*.work"; dlg.FilterIndex = 2; dlg.RestoreDirectory = true; if (dlg.ShowDialog() != DialogResult.OK) { return; } Workflow w = new Workflow(); bool isOkay = UtilitiesIO.GetObjectFromJson(ref w, dlg.FileName); if (!isOkay) { return; } EditWorkflowManager.Instance.CurrentWorkflow = w; //AdminView.Instance.SetWorkflowTextBlockDescription(EditWorkflowManager.Instance.CurrentWorkflow.Description); // set the databinding BackendControl.Instance.refreshGUI(); EditWorkflowManager.Instance.CurrentWorkingStepNumber = EditWorkflowManager.Instance.HighestWorkingStepNumber; }
public bool loadWorkflow(string path) { UtilitiesIO.GetObjectFromJson(ref m_LoadedWorkflow, path); m_LoadedWorkflowFilename = path.Split(Path.DirectorySeparatorChar).Last <String>(); // set all layouts BoxManager.Instance.SetNewLayout(m_LoadedWorkflow.BoxLayout); ObjectDetectionManager.Instance.SetNewLayout(m_LoadedWorkflow.ObjectZoneLayout); AssemblyZoneManager.Instance.SetNewLayout(m_LoadedWorkflow.AssemblyZoneLayout); BackendControl.Instance.refreshGUI(); m_CurrentWorkingStepNumber = 0; StateManager.Instance.SetNewState(this, AllEnums.State.WORKFLOW_LOADED); // log that we loaded the workflow StudyLogger.Instance.logWorkflowLoaded(m_LoadedWorkflow.Id, m_LoadedWorkflow.Name); // remove feedback artifacts from previous stuff SceneManager.Instance.DisplayTempFeedback = false; SceneManager.Instance.TemporaryFeedbackScene.Clear(); StatsManager.Instance.initialize(); OnWorkflowLoaded(); return(true); }
public static ObjectDetectionZonesLayout loadObjectDetectionZoneLayout() { // filechooser System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog(); dlg.InitialDirectory = Directory.GetCurrentDirectory() + "\\" + ProjectConstants.OBJECTDETECTIONZONES_DIR; dlg.Filter = "ozone files (*.ozone)|*.ozone"; dlg.FilterIndex = 2; dlg.RestoreDirectory = true; if (dlg.ShowDialog() == DialogResult.OK) { ObjectDetectionZonesLayout ret = null; bool isOkay = UtilitiesIO.GetObjectFromJson(ref ret, dlg.FileName); if (!isOkay) return null; else return ret; } return null; }
public static BoxLayout loadBoxLayoutFromFile() { BoxLayout ret = null; // filechooser System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog(); dlg.InitialDirectory = Directory.GetCurrentDirectory() + "\\" + ProjectConstants.BOXES_DIR; dlg.Filter = "box files (*.box)|*.box"; dlg.FilterIndex = 2; dlg.RestoreDirectory = true; DialogResult res = dlg.ShowDialog(); //Nullable<bool> result = dlg.ShowDialog(); if (res == DialogResult.OK) { UtilitiesIO.GetObjectFromJson(ref ret, dlg.FileName); } return(ret); }
public static AssemblyZoneLayout loadAssemblyZoneLayoutFromFile() { AssemblyZoneLayout ret = null; // filechooser System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog(); dlg.InitialDirectory = Directory.GetCurrentDirectory() + "\\" + ProjectConstants.ASSEMBLYZONES_DIR; dlg.Filter = "zone files (*.zone)|*.zone"; dlg.FilterIndex = 2; dlg.RestoreDirectory = true; DialogResult res = dlg.ShowDialog(); if (res == DialogResult.OK) { bool isOkay = UtilitiesIO.GetObjectFromJson(ref ret, dlg.FileName); if (!isOkay) { return(null); } } return(ret); }
public Scene.Scene LoadSceneFromFile() { System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog(); dlg.InitialDirectory = Directory.GetCurrentDirectory() + "\\" + ProjectConstants.SCENES_DIR; dlg.Filter = "scene files (*.scene)|*.scene"; dlg.FilterIndex = 2; dlg.RestoreDirectory = true; if (dlg.ShowDialog() != DialogResult.OK) { return(null); } Scene.Scene ret = null; bool isOkay = UtilitiesIO.GetObjectFromJson(ref ret, dlg.FileName); if (!isOkay) { return(null); } return(ret); }