Пример #1
0
        public static double GetMetersFromOtherUnit(UNIT baseUnit, double value)
        {
            switch (baseUnit)
            {
            case UNIT.METER:
                return(value);

            case UNIT.MILIMETER:
                return(value / 1000);

            case UNIT.INCH:
                return(value * 0.0254);

            case UNIT.YARD:
                return(value * 0.9144);

            case UNIT.NAUTICALMILE:
                return(value * 1852);

            case UNIT.LANDMILE:
                return(value * 1609.344);

            case UNIT.KILOMETER:
                return(value * 1000);

            default:
                throw new ArgumentException("Nie rozpoznano jednostki");
            }
        }
Пример #2
0
        public static double GetLength(double value, UNIT resultUnit)
        {
            switch (resultUnit)
            {
            case UNIT.METER:
                return(value);

            case UNIT.MILIMETER:
                return(value * 1000);

            case UNIT.INCH:
                return(value / 0.0254);

            case UNIT.YARD:
                return(value / 0.9144);

            case UNIT.NAUTICALMILE:
                return(value / 1852);

            case UNIT.LANDMILE:
                return(value / 1609.344);

            case UNIT.KILOMETER:
                return(value / 1000);

            default:
                throw new ArgumentException("Nie rozpoznano jednostki");
            }
        }
 protected void clear()
 {
     NIK.Value = "";
     UNIT.ClearSelection();
     GROUP.ClearSelection();
     FULLNAME.Value = "";
     email.Value    = "";
     email2.Value   = "";
     //emailDivisi.Value = "";
     //emailDevHead.Value = "";
     //emailDirektur.Value = "";
     NOUSER.Value = "";
     //NODEVHEAD.Value = "";
     //NOKADIV.Value = "";
     //NODIREKTUR.Value = "";
     if (GROUP.SelectedValue.Equals("003HEAD"))
     {
         SU_UPLINER.ClearSelection();
     }
     else if (GROUP.SelectedValue.Equals("002PEN"))
     {
         PIC2.ClearSelection();
         SU_UPLINER.ClearSelection();
     }
     else if (GROUP.SelectedValue.Equals("004KADIV"))
     {
         emailDirektur.Value = "";
         NODIREKTUR.Value    = "";
     }
 }
Пример #4
0
        public void UnitAttack(UNIT typeUnit)
        {
            switch (typeUnit)
            {
            case UNIT.BARBARIAN:
                for (int i = 0; i < indexCount; i++)
                {
                    if (_ArrArmys[i] is Barbarian)
                    {
                        _ArrArmys[i].Attack();
                    }
                }
                break;

            case UNIT.GIANT:
                for (int i = 0; i < indexCount; i++)
                {
                    if (_ArrArmys[i] is Giant)
                    {
                        _ArrArmys[i].Attack();
                    }
                }
                break;

            case UNIT.HEALER:
                for (int i = 0; i < indexCount; i++)
                {
                    if (_ArrArmys[i] is Healer)
                    {
                        _ArrArmys[i].Attack();
                    }
                }
                break;
            }
        }
Пример #5
0
        private void UnitAttack(UNIT unit)
        {
            switch (unit)
            {
            case UNIT.BARBARIAN:
                for (int i = 0; i < indexCount; i++)
                {
                    if (arrArmys[i] is Barbarian)
                    {
                        arrArmys[i].Attack();
                    }
                }
                break;

            case UNIT.GIANT:
                for (int i = 0; i < indexCount; i++)
                {
                    if (arrArmys[i] is Giant)
                    {
                        arrArmys[i].Attack();
                    }
                }
                break;

            case UNIT.HEALER:
                for (int i = 0; i < indexCount; i++)
                {
                    if (arrArmys[i] is Healer)
                    {
                        arrArmys[i].Attack();
                    }
                }
                break;
            }
        }
Пример #6
0
        public static double GetMass(double kilos, UNIT resultUnit)
        {
            switch (resultUnit)
            {
            case UNIT.KILOGRAM:
                return(kilos);

            case UNIT.GRAM:
                return(kilos / 1000);

            case UNIT.TON:
                return(kilos * 1000);

            case UNIT.CENTAL:
                return(kilos * 100);

            case UNIT.POUND:
                return(kilos * 0.453592);

            case UNIT.OUNCE:
                return(kilos * 0.02835);

            default:
                throw new ArgumentException("Nie rozpoznano jednostki");
            }
        }
Пример #7
0
        private List <UNIT> MapUNIT(DataTable dt)
        {
            List <UNIT> rs = new List <UNIT>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                UNIT obj = new UNIT();
                if (dt.Columns.Contains("Unit_ID"))
                {
                    obj.Unit_ID = (dt.Rows[i]["Unit_ID"].ToString());
                }
                if (dt.Columns.Contains("Unit_Name"))
                {
                    obj.Unit_Name = (dt.Rows[i]["Unit_Name"].ToString());
                }
                if (dt.Columns.Contains("Description"))
                {
                    obj.Description = (dt.Rows[i]["Description"].ToString());
                }
                if (dt.Columns.Contains("Active"))
                {
                    obj.Active = bool.Parse(dt.Rows[i]["Active"].ToString());
                }

                rs.Add(obj);
            }
            return(rs);
        }
Пример #8
0
    internal override void OptionExtensions_OnLEFTCLICK(bool hold)
    {
        if (!hold)
        {
            if (movingUnitState == OPTIONS.MoveTo)
            {
                MoveToPoint     = MouseEvents.State.Position.AsWorldPointOnMap;
                MovingDirection = MoveToPoint;
                SetKinematic();
                IsMoving = true;

                UNIT.Options.UnlockFocus();
            }
            else if (movingUnitState == OPTIONS.Guard)
            {
                if (UNIT.IsAllied(MouseEvents.State.Position.AsUnitUnderCursor.gameObject))
                {
                    Target      = MouseEvents.State.Position.AsUnitUnderCursor.SetInteracting(this.gameObject);
                    MoveToPoint = Target.transform.position;
                    IsGuarding  = true;
                    UNIT.Options.UnlockAndDestroyFocus();
                }
            }
            else if (movingUnitState == OPTIONS.Patrol)
            {
                WayPoints.Add(MouseEvents.State.Position.AsWorldPointOnMap);
                IsMoving = true;

                UNIT.Options.UnlockAndDestroyFocus();
            }
        }
    }
Пример #9
0
        public static double GetKilosFromOtherUnit(UNIT baseUnit, double value)
        {
            switch (baseUnit)
            {
            case UNIT.KILOGRAM:
                return(value);

            case UNIT.GRAM:
                return(value * 1000);

            case UNIT.TON:
                return(value / 1000);

            case UNIT.CENTAL:
                return(value / 100);

            case UNIT.POUND:
                return(value / 0.453592);

            case UNIT.OUNCE:
                return(value / 0.02835);

            default:
                throw new ArgumentException("Nie rozpoznano jednostki");
            }
        }
Пример #10
0
 /// <summary>
 /// Constructor. Sets default initialization parameters recommended for Unity.
 /// </summary>
 public InitParameters()
 {
     this.inputType              = sl.INPUT_TYPE.INPUT_TYPE_USB;
     this.resolution             = RESOLUTION.HD720;
     this.cameraFPS              = 60;
     this.cameraID               = 0;
     this.pathSVO                = "";
     this.svoRealTimeMode        = false;
     this.coordinateUnit         = UNIT.METER;
     this.coordinateSystem       = COORDINATE_SYSTEM.IMAGE;
     this.depthMode              = DEPTH_MODE.PERFORMANCE;
     this.depthMinimumDistance   = -1;
     this.cameraImageFlip        = false;
     this.cameraDisableSelfCalib = false;
     this.cameraBufferCountLinux = 4;
     this.sdkVerbose             = false;
     this.sdkGPUId               = -1;
     this.sdkVerboseLogFile      = "";
     this.enableRightSideMeasure = false;
     this.depthStabilization     = true;
     this.optionalSettingsPath   = "";
     this.cameraDisableIMU       = false;
     this.ipStream               = "";
     this.portStream             = 30000;
 }
Пример #11
0
        public void EditUnit(int id, string name)
        {
            UNIT slctd_unit = db.UNITS.Find(id);

            slctd_unit.NAME = name;
            db.SaveChanges();
        }
Пример #12
0
        private int readGroup(string[] lines, List <UNIT> list)
        {
            int group_start = find_line(lines, "\"GROUP\",\"UNIT\"");

            if (group_start == NOT_FOUND)
            {
                return(-1);
            }

            string[] header = lines[group_start + 1].QuoteSplit();
            string[] units  = lines[group_start + 2].QuoteSplit();
            string[] type   = lines[group_start + 3].QuoteSplit();

            addUNITS(units);
            addTYPES(type);

            for (int i = group_start + 4; i < lines.Count(); i++)
            {
                string line = lines[i];
                if (line.Length == 0)
                {
                    return(i);
                }
                string[] values = line.QuoteSplit();
                UNIT     p      = new UNIT();
                setValues(header, values, p);
                list.Add(p);
            }
            return(0);
        }
Пример #13
0
            //********************************************************************************************
            //
            //********************************************************************************************

            public Coord ToDD()
            {
                if (m_unit == UNIT.DD)
                {
                    return(this);
                }

                if (m_unit >= UNIT.DDM)
                {
                    m_deg += (m_min / 60.0f);
                }

                if (m_unit >= UNIT.DMS)
                {
                    m_deg += (m_sec / 3600.0f);
                }

                m_min = 0.0f;

                m_sec = 0.0f;

                m_unit = UNIT.DD;

                return(this);
            }
Пример #14
0
        public string SinhMaDonVi()
        {
            string MaKhachHang, MaTam;

            MaKhachHang = "";
            MaTam       = "";
            objunit     = new UNITController().UNIT_Top1();
            MaTam       = objunit.Unit_ID;
            if (MaTam != "")
            {
                long NumberKhuVuc = long.Parse(MaTam.Substring(2, 6)) + 1;
                MaKhachHang = NumberKhuVuc.ToString();
                for (int i = NumberKhuVuc.ToString().Length; i < 6; i++)
                {
                    MaKhachHang = "0" + MaKhachHang;
                    //MessageBox.Show(MaKhuVuc);
                }
                MaKhachHang = "DV" + MaKhachHang;
            }
            else
            {
                MaKhachHang = "DV000001";
            }
            return(MaKhachHang);
        }
Пример #15
0
        private void simpleButton3_Click(object sender, EventArgs e)
        {
            UNIT objunit = new UNIT();
            int  rs      = -1;

            if (gridView1.RowCount > 0)
            {
                for (int i = 0; i < gridView1.RowCount; i++)
                {
                    objunit.Unit_ID     = gridView1.GetRowCellValue(i, gridView1.Columns[0]).ToString();
                    objunit.Unit_Name   = gridView1.GetRowCellValue(i, gridView1.Columns[1]).ToString();
                    objunit.Description = gridView1.GetRowCellValue(i, gridView1.Columns[2]).ToString();
                    objunit.Active      = true;
                    rs = new UNITController().UNIT_Insert(objunit);
                    if (rs == -1)
                    {
                        MessageBox.Show("Lưu Thất Bại", "Thông Báo");
                        break;
                    }
                }
                if (rs > -1)
                {
                    MessageBox.Show("Lưu Thành công", "Thông Báo");
                }
                else
                {
                    MessageBox.Show("Lưu Thất bại", "Thông Báo");
                }
                frmdonvi.RefreshData();
            }
        }
Пример #16
0
        private void Save()
        {
            try
            {
                var Unit = _UnitRepo.GetById(id);
                if (id > 0 && Unit != null)
                {
                    Unit.NAME = txtName.Value;
                    Unit.NOTE = txtNote.Value;

                    _UnitRepo.Update(Unit);
                }
                else
                {
                    Unit      = new UNIT();
                    Unit.NAME = txtName.Value;
                    Unit.NOTE = txtNote.Value;

                    _UnitRepo.Create(Unit);
                }
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                Response.Redirect("don-vi.aspx");
            }
        }
Пример #17
0
    private void setupTextValue(int value, UNIT _unit)
    {
        string symbol;
        string unit;

        switch (_unit)
        {
        case UNIT.HP:
            unit = "HP";
            break;

        case UNIT.SCORE:
        case UNIT.EMPTY:
        default:
            unit = "";
            break;
        }

        if (value >= 0)
        {
            symbol = "+";
            GetComponent <Text>().color = Color.green;
        }
        else
        {
            symbol = "";
            GetComponent <Text>().color = Color.red;
        }
        textCmp.text = $"{symbol}{value}{unit}";
    }
Пример #18
0
 private string WxVoiceAnalytical(WxXmlModel wxXmlModel, string token, string wxToken)
 {
     Console.WriteLine("WxVoiceAnalytical_Recognition>>" + wxXmlModel.Recognition);
     // string url = string.Format(WechatGetMediaUrl, wxToken, wxXmlModel.MediaId);
     if (string.IsNullOrEmpty(wxXmlModel.Recognition))
     {
         wxXmlModel.Content = "无法识别您说的话哦,请在说一遍";
     }
     else if (wxXmlModel.Recognition.Contains("是什么垃圾"))
     {
         string rubbishName = DisposeName(wxXmlModel.Recognition, "是什么垃圾");
         wxXmlModel.Content = RubbishDispose(rubbishName);
     }
     else if (IsAddRubbishType(wxXmlModel.Recognition))
     {
         wxXmlModel.Content = AddRubbish(wxXmlModel.Recognition);
     }
     else
     {
         if (!LoveLan.IsWXLoveLan(ref wxXmlModel))
         {
             wxXmlModel.Content = UNIT.GetResponseMessage(wxXmlModel.Recognition, wxXmlModel.FromUserName, token);
         }
     }
     return(WeChatXml.ResponseXML(wxXmlModel));
 }
Пример #19
0
 private int setValues(string[] header, string[] values, UNIT p)
 {
     try {
         for (int i = 0; i < header.Count(); i++)
         {
             if (header[i] == "FILE_FSET")
             {
                 p.FILE_FSET = values[i];
             }
             if (header[i] == "UNIT_DESC")
             {
                 p.UNIT_DESC = values[i];
             }
             if (header[i] == "UNIT_REM")
             {
                 p.UNIT_REM = values[i];
             }
             if (header[i] == "UNIT_UNIT")
             {
                 p.UNIT_UNIT = values[i];
             }
         }
     } catch {
         return(-1);
     }
     return(0);
 }
Пример #20
0
 public void Load_Data(UNIT objunit)
 {
     this.objunit        = objunit;
     txtMa.Text          = objunit.Unit_ID;
     txtTenKV.Text       = objunit.Unit_Name;
     txtGhiChu.Text      = objunit.Description;
     checkactive.Checked = objunit.Active;
 }
Пример #21
0
 void OnTriggerExit(Collider other)
 {
     if (UNIT.IsEnemy(other.gameObject))
     {
         UNIT.ALARM--;
         Targets.Remove(other.transform.position);
     }
 }
Пример #22
0
 protected void clear()
 {
     REPORTID.Value = "";
     UNIT.ClearSelection();
     INSTANSIID.ClearSelection();
     PERIODE.ClearSelection();
     REPORTNAME.Value = "";
 }
Пример #23
0
 public float As(UNIT unit)
 {
     if (m_unit != unit)
     {
         return((m_unit == UNIT.RAD) ? (m_value * Mathf.Rad2Deg) : (m_value * Mathf.Rad2Deg));
     }
     return(m_value);
 }
 public static Unit Get(UNIT unit)
 {
     return(new Unit
     {
         Id = unit.ID,
         Name = unit.NAME
     });
 }
Пример #25
0
        public ActionResult DeleteConfirmed(int id)
        {
            UNIT uNIT = db.UNITS.Find(id);

            db.UNITS.Remove(uNIT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #26
0
            //********************************************************************************************
            //
            //********************************************************************************************

            public Coord ConvertTo(UNIT unit)
            {
                if (m_unit != unit)
                {
                    FromAngle(ToDD().m_deg, unit);
                }

                return(this);
            }
Пример #27
0
        public string WxImageAnalytical(WxXmlModel wxXmlModel, string token, string wxToken)
        {
            string url = string.Format(WechatGetMediaUrl, wxToken, wxXmlModel.MediaId);

            byte[] data = NetHelper.HttpGetByte(url);
            wxXmlModel.Content = UNIT.GetImageDisposeStr(data, token);
            wxXmlModel.MsgType = "text";
            return(WeChatXml.ResponseXML(wxXmlModel));
        }
Пример #28
0
 public void Setup(int value, Vector3 position, UNIT unit)
 {
     setupParent();
     setupTextValue(value, unit);
     transform.position = position;
     textCmp.CrossFadeAlpha(0, textFadeSpeed, false);
     _           = StartCoroutine(Recycle());
     initialized = true;
 }
Пример #29
0
 //добавление строки
 private void AddData(Object o)
 {
     newRow = new UNIT();
     newRow.UNIT_VALUE = "";
     data.Add(newRow);
     selectedRow = newRow;
     isEnabled = true;
     focus(); //установка фокуса на имени
 }
Пример #30
0
    internal override void OptionExtensions_OnLEFTCLICK(bool hold)
    {
        if (!hold)
        {
            if (attackState == OPTIONS.Attack)
            {
                UnitScript otherUnit = MouseEvents.State.Position.AsUnitUnderCursor;
                if (otherUnit)
                {
                    if (UNIT.IsEnemy(otherUnit))
                    {
                        UNIT.Options.Target      = otherUnit.gameObject;
                        UNIT.Options.MoveToPoint = UNIT.Options.Target.transform.position;
                        if (!UNIT.IsABuilding)
                        {
                            GetComponent <Movability>().IsMoving = true;
                        }
                        IsAttacking = true;
                    }
                    else if (UNIT.IsAllied(otherUnit))
                    {
                        this.UNIT.Options.Target = otherUnit.SetInteracting(this.gameObject);
                        if (otherUnit.Options.IsAttacking)
                        {
                            this.UNIT.Options.Target = otherUnit.Options.Target;
                            IsAttacking = true;
                            UNIT.Options.MoveAsGroup(otherUnit.gameObject);
                        }
                    }

                    UNIT.Options.UnlockFocus();
                }
            }
            else if (attackState == OPTIONS.Conquer)
            {
                UNIT.Options.MoveToPoint = MouseEvents.State.Position;

                if (!GetComponent <Gunner>())
                {
                    this.gameObject.AddComponent <Gunner>();
                }

                if (!UNIT.IsABuilding)
                {
                    GetComponent <Movability>().IsMoving = true;
                }

                IsDefending  = false;
                IsAttacking  = true;
                IsConquering = true;
                GetComponent <Gunner>().FireAtWill = true;

                UNIT.Options.UnlockFocus();
            }
        }
    }
Пример #31
0
 partial void DeleteUNIT(UNIT instance);
Пример #32
0
 partial void InsertUNIT(UNIT instance);
Пример #33
0
 partial void UpdateUNIT(UNIT instance);