Esempio n. 1
0
    void DrawValue(NoiseValue module)
    {
        Rect r = Box(module.editorPos, module.type == NoiseValueType.Number ? 3 : 2, module);

        EditorGUI.BeginDisabledGroup(add == module);
        GUILayout.BeginArea(new Rect(r.x + 16, r.y + 5, r.width - 32, r.height - 10));

        EditorGUILayout.LabelField(module.type.ToString(), EditorStyles.boldLabel);
        module.type = (NoiseValueType)EditorGUILayout.EnumPopup("Value Type", module.type);
        if (module.type == NoiseValueType.Number)
        {
            module.value = EditorGUILayout.DoubleField("Value", module.value);
        }

        GUILayout.EndArea();

        ConnectionOutputButton(module, new Vector3(r.xMax, r.center.y));
        EditorGUI.EndDisabledGroup();
    }
Esempio n. 2
0
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            {
                Point      p          = sortControlPoints[currentPointIndex].Point;
                CleanValue cleanValue = sortControlPoints[currentPointIndex].Point.CleanValue;
                NoiseValue noiseValue = sortControlPoints[currentPointIndex].Point.NoiseValue;

                p.CleanValue = cleanValue;
                p.NoiseValue = noiseValue;

                sortControlPoints[currentPointIndex].Point.CleanValue.frequency1  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal1") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency2  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal2") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency3  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal3") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency4  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal4") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency5  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal5") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency6  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal6") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency7  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal7") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency8  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal8") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency9  = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal9") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency10 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal11") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency11 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal11") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency12 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal12") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency13 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal13") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency14 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal14") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency15 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal15") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency16 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal16") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency17 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal17") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency18 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal18") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency19 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal19") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.CleanValue.frequency20 = float.Parse((currentPointEdit.mainTable.FindName("cleanSignal20") as TextBox).Text);

                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency1  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal1") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency2  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal2") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency3  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal3") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency4  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal4") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency5  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal5") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency6  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal6") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency7  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal7") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency8  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal8") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency9  = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal9") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency10 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal10") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency11 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal11") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency12 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal12") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency13 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal13") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency14 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal14") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency15 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal15") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency16 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal16") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency17 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal17") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency18 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal18") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency19 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal19") as TextBox).Text);
                sortControlPoints[currentPointIndex].Point.NoiseValue.frequency20 = float.Parse((currentPointEdit.mainTable.FindName("noiseSignal20") as TextBox).Text);

                sortControlPoints[currentPointIndex].point_id    = p.id;
                sortControlPoints[currentPointIndex].premises_id = premisesId;
                sortControlPoints[currentPointIndex].description = "";
                ControlPoints cp = null;

                if (sortControlPoints[currentPointIndex].id == 0)
                {
                    cp = Helper.Connection.ControlPoints.Add(sortControlPoints[currentPointIndex]);
                }
                else
                {
                    cp = sortControlPoints[currentPointIndex];
                }

                History history = new History();
                history.Clients       = Helper.currentClient;
                history.changes_date  = (DateTime)DateTime.Now;
                history.ControlPoints = cp;
                Helper.Connection.History.Add(history);

                Helper.Connection.SaveChanges();
            }
        }