Ejemplo n.º 1
0
    //
    // Unity Methods
    //

    private void Start()
    {
        inputHandler       = ComponentManager.Instance.Get <InputHandler>();
        inspectorTool      = ComponentManager.Instance.Get <InspectorTool>();
        lineInspectorPanel = inspectorTool.lineInspectorPanel;
        lineInspector      = lineInspectorPanel.lineInspector;
    }
Ejemplo n.º 2
0
    //
    // Unity Methods
    //

    private void Awake()
    {
        // Components
        inspectorTool = ComponentManager.Instance.Get <InspectorTool>();
        translator    = LocalizationManager.Instance;
        LocalizationManager.Instance.OnLanguageChanged += OnLanguageChanged;

        // Initialize dropdowns
        inspectorOutputDropdowns = new InspectorOutputDropdown[]
        {
            new InspectorOutputDropdown(summaryDropdown, summaryOptions),
            new InspectorOutputDropdown(metricsDropdown, metricsOptions)
        };
        InitDropdowns();
        summaryDropdown.onValueChanged.AddListener(UpdatePanel);

        // Initialize properties and summaries
        int maxInspectionCount = inspectorTool.maxInspectionCount;

        propertiesAndSummaries = new PropertiesAndSummaries[maxInspectionCount];
        for (int i = 0; i < maxInspectionCount; ++i)
        {
            propertiesAndSummaries[i] = new PropertiesAndSummaries();
        }

        // Default panel display
        UpdatePanel(SelectedLine);
    }
Ejemplo n.º 3
0
 protected virtual void Start()
 {
     inspectorTool      = ComponentManager.Instance.Get <InspectorTool>();
     lineInspectorPanel = inspectorTool.lineInspectorPanel;
     lineInspector      = lineInspectorPanel.lineInspector;
     inputHandler       = ComponentManager.Instance.Get <InputHandler>();
     canvas             = GameObject.FindGameObjectWithTag("Canvas").GetComponent <Canvas>();
 }
Ejemplo n.º 4
0
    //
    // Public Methods
    //

    public void Init(ToolLayerController toolLayers, ToggleButton inspectionDelPrefab)
    {
        inspectorTool   = ComponentManager.Instance.Get <InspectorTool>();
        map             = ComponentManager.Instance.Get <MapController>();
        this.toolLayers = toolLayers;

        this.inspectionDelPrefab = inspectionDelPrefab;
    }
Ejemplo n.º 5
0
    //
    // Public Methods
    //

    public void Init(ToolLayerController toolLayers, int maxInspectionCount)
    {
        // Initializations
        inspectorTool           = ComponentManager.Instance.Get <InspectorTool>();
        this.maxInspectionCount = maxInspectionCount;

        areaInspector.Init(toolLayers, inspectionDelPrefab);
        InitAreaInspectorInfo();
    }
Ejemplo n.º 6
0
    //
    // Unity Methods
    //

    private void Start()
    {
        inputHandler  = ComponentManager.Instance.Get <InputHandler>();
        inspectorTool = ComponentManager.Instance.Get <InspectorTool>();
        mapController = ComponentManager.Instance.Get <MapController>();

        areaInspectorPanel = inspectorTool.areaInspectorPanel;
        areaInspector      = areaInspectorPanel.areaInspector;
    }
Ejemplo n.º 7
0
        private void OnGUI()
        {
            InspectorTool.Horizontal(() =>
            {
                EditorGUILayout.PrefixLabel("Excel:", EditorStyles.miniBoldLabel);
                DataTableGenerator.DataTablePath = EditorGUILayout.TextField(DataTableGenerator.DataTablePath, EditorStyles.foldout);

                if (InspectorTool.Button("Browse", "", true, 100, 24, EditorStyles.miniButtonRight))
                {
                    string fullPath = UnityEngine.Application.dataPath + DataTableGenerator.DataTablePath;
                    if (!Directory.Exists(fullPath))
                    {
                        fullPath = UnityEngine.Application.dataPath;
                    }
                    DataTableGenerator.DataTablePath = FolderHelper.OpenFilePanel(fullPath);
                }
            });

            InspectorTool.Horizontal(() =>
            {
                EditorGUILayout.PrefixLabel("Output Script:", EditorStyles.miniBoldLabel);
                DataTableGenerator.CSharpCodePath = EditorGUILayout.TextField(DataTableGenerator.CSharpCodePath, EditorStyles.foldout);

                if (InspectorTool.Button("Browse", "", true, 100, 24, EditorStyles.miniButtonRight))
                {
                    string fullPath = UnityEngine.Application.dataPath + DataTableGenerator.CSharpCodePath;
                    if (!Directory.Exists(fullPath))
                    {
                        fullPath = UnityEngine.Application.dataPath;
                    }
                    DataTableGenerator.CSharpCodePath = FolderHelper.OpenFolderPanel(fullPath);
                }
            });

            InspectorTool.Horizontal(() =>
            {
                EditorGUILayout.PrefixLabel("Output Asset:", EditorStyles.miniBoldLabel);
                DataTableGenerator.AssetPath = EditorGUILayout.TextField(DataTableGenerator.AssetPath, EditorStyles.foldout);

                if (InspectorTool.Button("Browse", "", true, 100, 24, EditorStyles.miniButtonRight))
                {
                    string fullPath = UnityEngine.Application.dataPath + DataTableGenerator.AssetPath;
                    if (!Directory.Exists(fullPath))
                    {
                        fullPath = UnityEngine.Application.dataPath;
                    }
                    DataTableGenerator.AssetPath = FolderHelper.OpenFolderPanel(fullPath);
                }
            });

            if (GUILayout.Button("build", EditorStyles.miniButton))
            {
                DataTableGenerator.GenerateDataTables();
                AssetDatabase.Refresh();
            }
        }
Ejemplo n.º 8
0
    //
    // Unity Methods
    //

    private void Start()
    {
        trigger       = GetComponent <EventTrigger>();
        enter         = new EventTrigger.Entry();
        enter.eventID = EventTriggerType.PointerEnter;
        exit          = new EventTrigger.Entry();
        exit.eventID  = EventTriggerType.PointerExit;

        inspectorTool = ComponentManager.Instance.Get <InspectorTool>();
    }
Ejemplo n.º 9
0
    //
    // Public Methods
    //

    public void Init(ToolLayerController toolLayers, Canvas canvas, int maxInspectionCount)
    {
        // Initializations
        inspectorTool           = ComponentManager.Instance.Get <InspectorTool>();
        this.canvas             = canvas;
        this.maxInspectionCount = maxInspectionCount;

        lineInspector.Init(toolLayers, endPtPrefab, inspectionDelPrefab, canvas);
        InitLineInspectorInfo();
    }
    //
    // Unity Methods
    //

    private IEnumerator Start()
    {
        // Copy material to avoid serializing width/height changes
        var image = GetComponent <Image>();

        material = new Material(image.material);

        image.RegisterDirtyMaterialCallback(OnMaterialChange);
        image.material = material;

        rt           = GetComponent <RectTransform>();
        invRectWidth = 1f / rt.rect.width;

        UpdateTransectSize();

        highlightHalfWidth = highlight.rect.width * 0.5f;

        // Wait InitialFrames frame for UI to finish layout, so that charts have the right size for the shader
        yield return(WaitFor.Frames(WaitFor.InitialFrames));

        /*- var transectLocator = ComponentManager.Instance.GetOrNull<TransectLocator>();
         * if (transectLocator != null)
         * {
         *              transectLocator.OnLocatorChange += OnLocatorChange;
         * }*/

        map           = ComponentManager.Instance.Get <MapController>();
        inspectorTool = ComponentManager.Instance.Get <InspectorTool>();
        if (map != null)
        {
            gridLayerController = map.GetLayerController <GridLayerController>();
            if (gridLayerController != null)
            {
                gridLayerController.OnShowGrid += OnShowGrid;

                foreach (var mapLayer in gridLayerController.mapLayers)
                {
                    if (layerCharts.ContainsKey(mapLayer.Grid))
                    {
                        continue;
                    }

                    Add(mapLayer.Grid, mapLayer.Grid.patch.DataLayer.Color, layerCharts, chartsContainer);
                    if (lineInfo != null)
                    {
                        UpdateGridData(mapLayer.Grid);
                    }
                }
            }
        }

        var siteBrowser = ComponentManager.Instance.Get <SiteBrowser>();

        siteBrowser.OnBeforeActiveSiteChange += OnBeforeActiveSiteChange;
    }
Ejemplo n.º 11
0
    //
    // Unity Methods
    //

    private void Awake()
    {
        // Components
        var componentManager = ComponentManager.Instance;

        inspectorTool       = componentManager.Get <InspectorTool>();
        contoursTool        = componentManager.Get <ContoursTool>();
        dataLayers          = componentManager.Get <DataLayers>();
        gridLayerController = inspectorTool.Map.GetLayerController <GridLayerController>();
        translator          = LocalizationManager.Instance;

        areaPSUIRef.Init(translator);
        contourPSUIRef.Init(translator);

        // Initialize dropdowns
        inspectorOutputDropdowns = new InspectorOutputDropdown[]
        {
            new InspectorOutputDropdown(areaTypeDropdown, AreaTypeOptions),
            new InspectorOutputDropdown(areaPSUIRef.summaryDropdown, PSO.AreaSummaryOptions),
            new InspectorOutputDropdown(areaPSUIRef.metricsDropdown, PSO.MetricsOptions),
        };
        InitDropdowns();

        // Initialize properties and summaries
        int maxInspectionCount = inspectorTool.maxInspectionCount;

        areaPS = new AreaPS[maxInspectionCount];
        for (int i = 0; i < maxInspectionCount; ++i)
        {
            areaPS[i] = new AreaPS();
        }
        contourPS = new ContourPS();

        // Initialize listeners
        gridLayerController.OnShowGrid += OnShowGrid;
        LocalizationManager.Instance.OnLanguageChanged += OnLanguageChanged;
        areaTypeDropdown.onValueChanged.AddListener(UpdatePropertiesAndSummariesPanel);
        areaPSUIRef.summaryDropdown.onValueChanged.AddListener(UpdateAreaPanel);
        areaPSUIRef.computeCorrelationButton.onClick.AddListener(OnComputeCorrelationClicked);

        // Update panels
        UpdatePropertiesAndSummariesPanel(Area);
        UpdateAreaPanel(AreaPS.SelectedArea);
        UpdateContourPanel();

        ResetAndClearOutput();

        // If contours tool is already open and there is a selected contour
        if (contoursTool != null && inspectorTool.InspectOutput != null)
        {
            inspectorTool.InspectOutput.AreaOutput.UpdateContourInspectorOutput(dataLayers);
        }
    }
Ejemplo n.º 12
0
    //
    // Public Methods
    //

    public void Init(ToolLayerController toolLayers, ToggleButton endPtPrefab, ToggleButton inspectionDelPrefab, Canvas canvas)
    {
        inputHandler  = ComponentManager.Instance.Get <InputHandler>();
        inspectorTool = ComponentManager.Instance.Get <InspectorTool>();
        map           = ComponentManager.Instance.Get <MapController>();

        this.toolLayers = toolLayers;
        this.canvas     = canvas;

        this.endPtPrefab         = endPtPrefab;
        this.inspectionDelPrefab = inspectionDelPrefab;
    }
    //
    // Unity Methods
    //

    private void Awake()
    {
        // Components
        var componentManager = ComponentManager.Instance;

        inspectorTool       = componentManager.Get <InspectorTool>();
        dataLayers          = componentManager.Get <DataLayers>();
        gridLayerController = inspectorTool.Map.GetLayerController <GridLayerController>();
        translator          = LocalizationManager.Instance;

        linePSUIRef.Init(translator);

        // Initialize dropdowns
        inspectorOutputDropdowns = new InspectorOutputDropdown[]
        {
            new InspectorOutputDropdown(linePSUIRef.summaryDropdown, PSO.LineSummaryOptions),
            new InspectorOutputDropdown(linePSUIRef.metricsDropdown, PSO.MetricsOptions)
        };
        InitDropdowns();

        // Initialize properties and summaries
        int maxInspectionCount = inspectorTool.maxInspectionCount;

        linePS = new LinePS[maxInspectionCount];
        for (int i = 0; i < maxInspectionCount; ++i)
        {
            linePS[i] = new LinePS();
        }

        // Initialize listeners
        gridLayerController.OnShowGrid += OnShowGrid;
        LocalizationManager.Instance.OnLanguageChanged += OnLanguageChanged;
        linePSUIRef.summaryDropdown.onValueChanged.AddListener(UpdateLinePanel);
        linePSUIRef.computeCorrelationButton.onClick.AddListener(OnComputeCorrelationClicked);

        // Default panel display
        UpdateLinePanel(LinePS.SelectedLine);
    }
    private void Start()
    {
        // Get Components
        image              = GetComponent <Image>();
        rectTransform      = GetComponent <RectTransform>();
        mapViewArea        = ComponentManager.Instance.Get <MapViewArea>();
        inspectorTool      = ComponentManager.Instance.Get <InspectorTool>();
        areaInspectorPanel = inspectorTool.areaInspectorPanel;

        rectTransform.sizeDelta = new Vector2(inspectionDelete.texture.width * 0.5f, inspectionDelete.texture.height * 0.5f);

        // Add hover event
        hoverHandler          = GetComponent <HoverHandler>();
        hoverHandler.OnHover += OnPointerHover;

        // Add click event
        EventTrigger trigger = GetComponent <EventTrigger>();

        EventTrigger.Entry click = new EventTrigger.Entry();
        click.eventID = EventTriggerType.PointerClick;
        click.callback.AddListener((data) => { areaInspectorPanel.OnRemoveAreaInspection(areaInfo); });
        trigger.triggers.Add(click);
    }