private IEnumerator ImportModelRoutine()
        {
            yield return(_explorer.OpenFile("Импорт Модели", null, "obj"));

            if (_explorer.LastResult == null)
            {
                yield break;
            }

            ModelManager.Instance.ImportModel(_explorer.LastResult);
        }
Example #2
0
        private IEnumerator ImportRoutine()
        {
            yield return(_explorer.OpenFile("Импорт 8КВИД", null, "xls"));

            if (_explorer.LastResult == null)
            {
                yield break;
            }


            try
            {
                var kvid8Data = KVID8DataReader.ReadFromFile(_explorer.LastResult);

                Clear();


                var table0 = _tabsAssociations[0].table;
                var table1 = _tabsAssociations[1].table;



                //tab0
                foreach (var(pointID, maxVoltage, fMin, fMax) in kvid8Data.tab0)
                {
                    var panel = (KVID8Tab0Table.KVID8Tab0Panel)table0.AddEmpty(Cell_Clicked);

                    panel.ID.StringValue        = pointID;
                    panel.MaxVoltage.FloatValue = maxVoltage;
                    panel.FrequencyMin.IntValue = fMin;
                    panel.FrequencyMax.IntValue = fMax;
                }

                //tab1
                foreach (var(idES, wireID, maxVoltage, fMin, fMax) in kvid8Data.tab1)
                {
                    var panel = (KVID8Tab1Table.KVID8Tab1Panel)table1.AddEmpty(Cell_Clicked);

                    panel.ID.NullableStringValue     = idES;
                    panel.WireID.NullableStringValue = wireID;
                    panel.MaxVoltage.FloatValue      = maxVoltage;
                    panel.FrequencyMin.IntValue      = fMin;
                    panel.FrequencyMax.IntValue      = fMax;
                }

                _contentscrollrectImage.color = _defaultColor;
            }
            catch (Exception e)
            {
                ErrorDialog.Instance.ShowError("Ошибка при чтении данных", e);
            }
        }
Example #3
0
        private IEnumerator ImportRoutine()
        {
            yield return(_explorer.OpenFile("Импорт 2КВИД", null, "xls"));

            if (_explorer.LastResult == null)
            {
                yield break;
            }



            try
            {
                var tabs = KVID2DataReader.ReadFromFile(_explorer.LastResult);

                Clear();


                foreach (var(tab, productName, center, voltages) in tabs)
                {
                    var headerGroup = AddAssociationAndSelect(tab);

                    headerGroup.header.Panel.X.FloatValue = center.x;
                    headerGroup.header.Panel.Y.FloatValue = center.y;
                    headerGroup.header.Panel.Z.FloatValue = center.z;

                    headerGroup.header0.Panel.ProductName.StringValue = productName;

                    foreach (var(x, y) in voltages)
                    {
                        var panel = (KVID2Table.KVID2Panel)AddRowToCurrentTable();

                        panel.X.NullableFloatValue = x;
                        panel.Y.NullableFloatValue = y;
                    }
                }


                if (_tabsAssociations.Count > 0)
                {
                    Tab_Clicked(_tabsAssociations[0].tab);
                }

                _contentscrollrectImage.color = _defaultColor;
            }
            catch (Exception e)
            {
                ErrorDialog.Instance.ShowError("Ошибка при чтении данных", e);
            }
        }
Example #4
0
        private IEnumerator ImportRoutine()
        {
            yield return(_explorer.OpenFile("Импорт 6КВИД", null, "xls"));

            if (_explorer.LastResult == null)
            {
                yield break;
            }


            try
            {
                var points = KVID6DataReader.ReadFromFile(_explorer.LastResult);
                DeepClear();

                //_points = points;

                //foreach(var point in _points)
                //{
                //    int i;
                //    if (int.TryParse(point.code.Substring(1), out i))
                //    {
                //        if (i > _currentRowIndex) _currentRowIndex = i;
                //    }
                //}



                foreach (var point in points)
                {
                    _points.Add(point.code, point.position);

                    int i;
                    if (int.TryParse(point.code.Substring(1), out i))
                    {
                        if (i > _currentRowIndex)
                        {
                            _currentRowIndex = i;
                        }
                    }
                }

                _saveButton.interactable = _points.Count != 0;
                ActivatePage(0);
            }
            catch (Exception e)
            {
                ErrorDialog.Instance.ShowError("Ошибка при чтении данных", e);
            }
        }
Example #5
0
        private IEnumerator ImportRoutine()
        {
            yield return(_explorer.OpenFile("Импорт 5КВИД", null, "xls"));

            if (_explorer.LastResult == null)
            {
                yield break;
            }


            try
            {
                var data = KVID5DataReader.ReadFromFile(_explorer.LastResult, out bool hasError);

                if (hasError)
                {
                    ErrorDialog.Instance.ShowError("Вводимые данные содержат некорректные значения");
                    yield break;
                }

                Clear();


                foreach (var(code, position, type, iR, oV, oF, bBA, conType) in data)
                {
                    var panel = (KVID5Table.KVID5Panel)AddRowToCurrentTable();

                    panel.Code.StringValue = code;
                    panel.X.FloatValue     = position.x;
                    panel.Y.FloatValue     = position.y;
                    panel.Z.FloatValue     = position.z;

                    panel.Type.StringValue                    = type;
                    panel.InnerResist.NullableIntValue        = iR;
                    panel.OperatingVoltage.NullableIntValue   = oV;
                    panel.OperatingFrequensy.NullableIntValue = oF;
                    panel.ConnectorType.NullableStringValue   = conType;

                    // reference cells
                    panel.BlockBA.SelectOption(bBA);
                }
            }
            catch (Exception e)
            {
                ErrorDialog.Instance.ShowError("Ошибка при чтении данных", e);
            }
        }