/**
  * create property and parse json
  * @param jsonObject : json to parse
  */
 public DynamicProperty(JSONObject jsonObject) : base()
 {
     try
     {
         //name = NAME.ValueOf(jsonObject.GetString("name").ToUpper().Trim());//toUpperCase().trim());
         System.Enum.TryParse <NAME>(jsonObject.GetString("name").ToUpper().Trim(), out name); // NAME.ValueOf(jsonObject.GetString("name").ToUpper().Trim());
     }
     catch (Java.Lang.Exception e)
     {
         name = NAME.NO_VALID;
     }
     try
     {
         //type = TYPE.valueOf(jsonObject.GetString("type").ToUpper().Trim());//.ToUpperCase().trim());
         System.Enum.TryParse <TYPE>(jsonObject.GetString("type").ToUpper().Trim(), out type);
     }
     catch (Java.Lang.Exception e)
     {
         type = TYPE.NO_VALID;
     }
     try
     {
         value = convertValue(jsonObject.Get("value"));
     }
     catch (Java.Lang.Exception e) { }
 }
Beispiel #2
0
        public DialogPic(string mess, NAME name, bool soundSw = true)
        {
            InitializeComponent();

            this.MouseLeftButtonDown += (sender, e) => this.DragMove();//ウィンドウ全体でドラッグ可能にする

            this.DataContext     = State.VmTestStatus;
            this.soundSw         = soundSw;
            labelMessage.Content = mess;
            testName             = name;

            switch (testName)
            {
            case NAME.書き込みコネクタ:
                PicName = "CN5.jpg";
                break;

            case NAME.通信線取り外し:
                PicName = "通信線.jpg";
                break;

            case NAME.SW1設定_003:
                PicName = "SW1.jpg";
                break;

            case NAME.CN11入れ替え:
                PicName = "CN11.jpg";
                break;

            case NAME.その他:
                PicName = "non2.png";
                break;
            }
        }
        public DialogPic(string mess, NAME name)
        {
            InitializeComponent();

            this.MouseLeftButtonDown += (sender, e) => this.DragMove();//ウィンドウ全体でドラッグ可能にする

            this.DataContext = State.VmTestStatus;
            State.VmTestStatus.DialogMess = mess;
            testName = name;

            switch (testName)
            {
            case NAME.JP1_1:
                PicName = "JP1_1.jpg";
                break;

            case NAME.JP1_2:
                PicName = "JP1_2.jpg";
                break;

            case NAME.PWM_I:
                PicName = "PWM_I.jpg";
                break;

            case NAME.PWM_V:
                PicName = "PWM_V.jpg";
                break;

            case NAME.その他:
                PicName = "non2.png";
                break;
            }
        }
Beispiel #4
0
 public RACE()
 {
     NAME = new NAME();
     FNAM = new FNAM();
     DESC = new DESC();
     RADT = new RADT();
     NPCS = new List <NPCS>();
 }
Beispiel #5
0
 public void TrimFields()
 {
     ID                 = ID.Trim();
     NAME               = NAME.Trim();
     CELLPHONENUMBER    = CELLPHONENUMBER.Trim();
     GENDER             = GENDER.Trim();
     PASSWORD           = PASSWORD.Trim();
     DORMITORYBUILDINGS = DORMITORYBUILDINGS.Trim();
 }
Beispiel #6
0
 public virtual void PrintInfo1()
 {
     Console.Write(NAME.PadRight(30));
     Console.Write(Description.PadRight(40));
     Console.Write(Title.PadRight(35));
     //Console.Write(ItemNum.PadRight(20));
     Console.Write($"${Price}".PadRight(13));
     Console.WriteLine(Quantity);
 }
Beispiel #7
0
 public string ToString(int namePadding)
 {
     return(String.Join(" ", new string[] {
         NAME.PadLeft(namePadding),
         TTL.ToString(),
         CLASS.ToString(),
         TypeString
     }));
 }
        //
        //  1. Enumerate (dir/ls)
        //

        private bool Enumerate(Object obj)
        {
            bool dir = ((FLAGS & (byte)Iso9660FileFlags.Directory) != 0);

            NodeType nodeType = (dir)? NodeType.Directory: NodeType.File;

            ((SortedList)obj).Add(NAME.ToLower(), nodeType); // FIXME: ToLower opt?

            return(false);                                   // GetNextChild
        }
Beispiel #9
0
 public bool Equals(RRBase rrbase)
 {
     if (object.ReferenceEquals(null, rrbase))
     {
         return(false);
     }
     return
         (NAME.Equals(rrbase.NAME) &&
          TypeValue.Equals(rrbase.TypeValue) &&
          CLASS.Equals(rrbase.CLASS) &&
          TTL.Equals(rrbase.TTL));
 }
Beispiel #10
0
 public void TrimFields()
 {
     ID                      = ID.Trim();
     NAME                    = NAME.Trim();
     CELLPHONENUMBER         = CELLPHONENUMBER.Trim();
     GENDER                  = GENDER.Trim();
     PASSWORD                = PASSWORD.Trim();
     CLASSNUMBER             = CLASSNUMBER.Trim();
     DORMITORYADDRESS        = DORMITORYADDRESS.Trim();
     DIRECTORNAME            = DIRECTORNAME.Trim();
     DIRECTORCELLPHONENUMBER = DIRECTORCELLPHONENUMBER.Trim();
 }
    //Get the entire string we want to display
    public string FullEnd()
    {
        string RET_STRING = NAME.GetPlayerName() + "'s Evaluation:\n";

        //Handle Family story
        if (EM.STORY_ENDING[0]) //Good ending
        {
            RET_STRING += "Mom was always the happiest person in the family. She might not have agreed with every way I lived my life, but she always loved me... I see that now. She always wanted me to be a mother... Maybe I'll adopt.\n\n";
        }
        else //Bad ending
        {
            RET_STRING += "Mom was the one to ruin our relationship. She said so many despicable things about Mary, and while I'm not with Mary anymore, it's crazy how backwards she was. I'm a bit sad she's gone, but it's not like she was a big part of my life anyways... I miss her...\n\n";
        }

        //Handle Date story
        if (EM.STORY_ENDING[1])
        {
            RET_STRING += "Turns out, it's hard to really know a person in the beginning. Mike ended up being really creepy, messaging me all the time and trying to go on dates. His rude and inconsiderate behaviour was unacceptable and I am glad to have cut him out of my life.\n\n";
        }
        else
        {
            RET_STRING += "Mike just wouldn't stop messaging me this whole month. He's been saying the most offensive, insensitive drivel I've heard in years; he's almost just as bad as my boss. I should have stopped messaging him earlier on. His actions have gone too far. Hopefully he'll lose interest after a while...\n\n";
        }

        //Handle Job story
        if (EM.STORY_ENDING[2])
        {
            RET_STRING += "My boss was just... too much. He pushed himself onto me despite all my refusal, and while I finally managed to push him away it seems he got me fired at work. There really wasn't anyway it was going to end well. At least I might find a job with a better boss!\n\n";
        }
        else
        {
            RET_STRING += "What am I going to do? My boss is just pushing me around and doing whatever he wants around me. HR won't help, and no one believes me. But if I leave, he said things could get much worse...\n\n";
        }

        //Handle happiness
        //Worst ending
        if (EM.HAPPINESS < BAD_ENDING_THRESHOLD)
        {
            RET_STRING += "I think this bot did more harm than good. My life has gotten so much worse. I'm not sure if I missed some important emails but the way life has been going its like a storm.";
        }//Bad ending
        else if (EM.HAPPINESS < GOOD_ENDING_THRESHOLD)
        {
            RET_STRING += "The AIDE System did a bit of work. I noticed a bit less ads but it still seems like I get scary messages once in a while. I'll keep this software a while longer.";
        }//Good ending
        else
        {
            RET_STRING += "AIDE System has been doing good work! My emails were mostly good, or at the very least, relevant to my life. I love this software.";
        }


        return(RET_STRING);
    }
Beispiel #12
0
 public BODY()
 {
     NAME = new NAME();
     MODL = new MODL()
     {
         ModelPath = "\0"
     };
     FNAM = new FNAM()
     {
         FileName = "Argonian\0"
     };
     BYDT = new BYDT();
 }
Beispiel #13
0
        public Grade UpdateGrade(int id, NAME name)
        {
            Grade grade = db.GradeRepository.GetByID(id);

            if (grade != null)
            {
                grade.Name = name;


                db.GradeRepository.Update(grade);
                db.Save();
            }
            return(grade);
        }
Beispiel #14
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (NAME.Length != 0)
            {
                hash ^= NAME.GetHashCode();
            }
            if (Reps != 0)
            {
                hash ^= Reps.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Beispiel #15
0
        private static void SetSourc(NAME name)
        {
            switch (name)
            {
            case NAME.I_1:
                Set7012Source(SOURCE_CH.I1);
                break;

            case NAME.I_2:
                Set7012Source(SOURCE_CH.I2);
                break;

            case NAME.I_3:
                Set7012Source(SOURCE_CH.I3);
                break;

            case NAME.I_4:
                Set7012Source(SOURCE_CH.I4);
                break;
            }
        }
Beispiel #16
0
 void Init(PC pc)
 {
     ID   = pc.ID;
     NAME = pc.PCNAME;
     if (!string.IsNullOrEmpty(pc.CURRENT))
     {
         STATUS = pc.CURRENT.Split(new string[] { "   :" }, StringSplitOptions.RemoveEmptyEntries).Last().Trim();
     }
     VERSION  = pc.TESTREQUEST != null ? pc.TESTREQUEST.FIPVERSION.VERSION : "";
     STARTED  = pc.STARTED == null ? "" : pc.STARTED.GetValueOrDefault().ToString(IdBasedObject.defDateTimeFormat, CultureInfo.InvariantCulture);
     PCPING   = pc.PCPING == null ? "" : pc.PCPING.GetValueOrDefault().ToString(IdBasedObject.defDateTimeFormat, CultureInfo.InvariantCulture);
     PAUSEDBY = pc.PERSON == null ? "" : pc.PERSON.PHONE;
     string[] parts = NAME.ToUpper().Split('X');
     if (parts.Length > 1)
     {
         IP = "192.168.0.1" + parts[1];
     }
     ACTIONFLAG = pc.ACTIONFLAG.GetValueOrDefault(0);
     SCHEDULES  = pc.SCHEDULES.GetValueOrDefault(0);
     HOSTID     = pc.HOST_ID.GetValueOrDefault(-1);
 }
Beispiel #17
0
        static void Main(string[] args)
        {
            const string NAME    = "BARLAN 123456789";
            const string VOWEL   = "AEIOU";
            const string NUM     = "0123456789";
            const string SURNAME = "URIZARTORRICO";


            foreach (var surname in SURNAME)
            {
                if (VOWEL.IndexOf(surname) >= 0)
                {
                    Console.WriteLine("The letter " + surname + " is vowel");
                }
                else if (NUM.IndexOf(surname) >= 0)
                {
                    Console.WriteLine("The names of the persons not content numbers ");
                }
                else
                {
                    Console.WriteLine("The letter " + surname + " is a consonat");
                }
            }
            foreach (var name in NAME)
            {
                if (NUM.IndexOf(name) >= 0)
                {
                    Console.WriteLine(name + " People's name doesn't have  a number");
                }
                else if (NAME.IndexOf(name) >= 0)
                {
                    Console.WriteLine();
                }
                else
                {
                    Console.WriteLine("The letter " + name + " is a consonat");
                }
            }
        }
Beispiel #18
0
        public override Dictionary <string, object> SaveToDict()
        {
            var dict = new Dictionary <string, object>();

            dict.Add(GDMConstants.SchemaKey, "goddess");

            dict.Merge(true, star.ToGDEDict(starKey));
            dict.Merge(true, volume.ToGDEDict(volumeKey));
            dict.Merge(true, exp.ToGDEDict(expKey));
            dict.Merge(true, rune0.ToGDEDict(rune0Key));
            dict.Merge(true, rune1.ToGDEDict(rune1Key));
            dict.Merge(true, rune2.ToGDEDict(rune2Key));
            dict.Merge(true, rune3.ToGDEDict(rune3Key));
            dict.Merge(true, index.ToGDEDict(indexKey));
            dict.Merge(true, skillGrade.ToGDEDict(skillGradeKey));
            dict.Merge(true, id.ToGDEDict(idKey));
            dict.Merge(true, NAME.ToGDEDict(NAMEKey));

            dict.Merge(true, UseTeamId.ToGDEDict(UseTeamIdKey));

            dict.Merge(true, attitube.ToGDEDict(attitubeKey));
            return(dict);
        }
Beispiel #19
0
        public static async Task <bool> CheckInputI(NAME name)
        {
            await Task.Delay(1500);

            bool result   = false;
            bool result下限 = false;
            bool result上限 = false;

            string resultData = "";

            const int SampleCnt = 5;

            var ListData = new List <double>();

            State.VmTestStatus.TestLog += $" {name.ToString()} 10mA確認";

            //ラムダ式の定義■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
            Action GetData = () =>
            {
                General.ClearCommlog();
                Target.SendData("I_IN");

                while (true)//取り込んだ通信データが規定行数(サンプリング数)になるまで待つ
                {
                    if (Flags.ClickStopButton)
                    {
                        return;
                    }
                    if (General.CountNewline() == SampleCnt + 2)
                    {
                        break;
                    }
                }
                Target.Escape();
                int offset = 0;
                switch (name)
                {
                case NAME.I_1:
                    offset = 1;
                    break;

                case NAME.I_2:
                    offset = 2;
                    break;

                case NAME.I_3:
                    offset = 3;
                    break;

                case NAME.I_4:
                    offset = 4;
                    break;
                }


                int 検索開始位置 = 0;
                var log    = State.VmComm.RX;
                foreach (var i in Enumerable.Range(0, SampleCnt))
                {
                    int FoundIndex = log.IndexOf("I_IN,", 検索開始位置);
                    int 改行位置       = log.IndexOf("\r\n", FoundIndex);
                    var 取り出し1行     = log.Substring(FoundIndex, 改行位置 - FoundIndex);
                    var dataList   = 取り出し1行.Split(',');

                    ListData.Add(Double.Parse(dataList[offset]));
                    検索開始位置 = FoundIndex + 1;
                }
            };

            //■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

            try
            {
                return(await Task <bool> .Run(() =>
                {
                    SetSourc(name);
                    Sleep(1000);

                    //電源ONする処理
                    General.PowerSupply(true);
                    if (!General.CheckDemo表示())
                    {
                        return false;
                    }

                    HIOKI7012.OutDcI(10.000);
                    Sleep(2000);
                    GetData();
                    Sleep(500);
                    HIOKI7012.StopSource();
                    General.PowerSupply(false);

                    result下限 = ListData.All(data => data >= State.TestSpec.I_10mA_Min);
                    result上限 = ListData.All(data => data <= State.TestSpec.I_10mA_Max);
                    result = result下限 && result上限;

                    ListData.Sort();
                    if (result)
                    {
                        resultData = ListData[SampleCnt / 2].ToString("F3") + "mA";//中央値
                    }
                    else
                    {
                        if (!result下限)
                        {
                            resultData = ListData[0].ToString("F3") + "mA";//Min
                        }
                        else
                        {
                            resultData = ListData[SampleCnt - 1].ToString("F3") + "mA";//Max
                        }
                    }

                    return result;
                }));
            }
            catch
            {
                return(false);
            }
            finally
            {
                State.VmTestStatus.TestLog += result? "---PASS\r\n" :"---FAIL\r\n";
                HIOKI7012.StopSource();
                General.PowerSupply(false);

                switch (name)
                {
                case NAME.I_1:
                    State.VmTestResults.I1_10mA    = resultData;
                    State.VmTestResults.ColI1_10mA = result ? OffBrush : NgBrush;
                    break;

                case NAME.I_2:
                    State.VmTestResults.I2_10mA    = resultData;
                    State.VmTestResults.ColI2_10mA = result ? OffBrush : NgBrush;
                    break;

                case NAME.I_3:
                    State.VmTestResults.I3_10mA    = resultData;
                    State.VmTestResults.ColI3_10mA = result ? OffBrush : NgBrush;
                    break;

                case NAME.I_4:
                    State.VmTestResults.I4_10mA    = resultData;
                    State.VmTestResults.ColI4_10mA = result ? OffBrush : NgBrush;
                    break;
                }
            }
        }
Beispiel #20
0
        /// <summary> 转换成SimON格式的项 </summary>
        public WELLCTRL ConvertToSimON(OPT.Product.SimalorManager.Item item, DATES date, List <NAME> histNames)
        {
            WELLCTRL well = new WELLCTRL("WELLCTRL");

            if (item is WCONPROD.ItemHY)
            {
                WCONPROD.ItemHY nIt = item as WCONPROD.ItemHY;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.jm0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.jm0 + "未找到对应的历史信息!");
                    return(null);
                }


                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;
                dayitem.Csl1  = nIt.rcsl4;
                dayitem.Cql2  = nIt.rcql5;
                dayitem.Cyl3  = nIt.rcyl3;
                dayitem.Cyl7  = nIt.liqutPro6;
                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.jm0;
                well.Jcyblxz2  = nIt.rcsl4;

                //  产水
                if (nIt.kzms2 == "WATER")
                {
                    well.Jcyblxz2 = nIt.rcsl4;
                    well.ProType  = SimONProductType.WRAT;
                }
                if (nIt.kzms2 == "GRAT")
                {
                    //  产气
                    well.Jcyblxz2 = nIt.rcql5;
                    well.ProType  = SimONProductType.GRAT;
                }
                if (nIt.kzms2 == "ORAT")
                {
                    //  产油
                    well.Jcyblxz2 = nIt.rcyl3;
                    well.ProType  = SimONProductType.ORAT;
                }

                if (nIt.kzms2 == "LRAT")
                {
                    //  产液
                    well.Jcyblxz2 = (nIt.rcyl3.ToDouble() + nIt.rcsl4.ToDouble()).ToString();
                    well.ProType  = SimONProductType.LRAT;
                }
                #endregion
            }
            else if (item is WCONHIST.Item)
            {
                WCONHIST.Item nIt = item as WCONHIST.Item;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.wellName0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.wellName0 + "未找到对应的历史信息!");
                    return(well);
                }
                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;
                dayitem.Csl1  = nIt.waterPro4;
                dayitem.Cql2  = nIt.gasPro5;
                dayitem.Cyl3  = nIt.oilPro3;
                dayitem.Cyl7  = (nIt.waterPro4.ToDouble() + nIt.oilPro3.ToDouble()).ToString();
                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.wellName0;
                well.Jcyblxz2  = nIt.waterPro4;


                //  产水
                if (nIt.ctrlModel2 == "WATER")
                {
                    well.Jcyblxz2 = nIt.waterPro4;
                    well.ProType  = SimONProductType.WRAT;
                }
                if (nIt.ctrlModel2 == "GRAT")
                {
                    //  产气
                    well.Jcyblxz2 = nIt.gasPro5;
                    well.ProType  = SimONProductType.GRAT;
                }
                if (nIt.ctrlModel2 == "ORAT")
                {
                    //  产油
                    well.Jcyblxz2 = nIt.oilPro3;
                    well.ProType  = SimONProductType.ORAT;
                }

                if (nIt.ctrlModel2 == "LRAT")
                {
                    //  产液
                    well.Jcyblxz2 = (nIt.waterPro4.ToDouble() + nIt.oilPro3.ToDouble()).ToString();
                    well.ProType  = SimONProductType.LRAT;
                }
                #endregion
            }

            else if (item is WCONINJE.ItemHY)
            {
                WCONINJE.ItemHY nIt = item as WCONINJE.ItemHY;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.jm0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.jm0 + "未找到对应的历史信息!");
                    return(well);
                }


                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;

                if (nIt.zrltlx1 == "WATER")
                {
                    dayitem.Zsl4 = nIt.rzrl4;
                }
                else
                {
                    dayitem.Zql5 = nIt.rzrl4;
                }

                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.jm0;


                if (nIt.zrltlx1 == "WATER")
                {
                    //well.Jcyblxz2 = nIt.rzrl4;
                    well.Jcyblxz2 = nIt.rzrl4;
                    well.ProType  = SimONProductType.WIR;
                }
                else
                {
                    //well.Jcyblxz2 = nIt.rzrl4;
                    //well.Jkkz1 = "6";

                    well.Jcyblxz2 = nIt.rzrl4;
                    well.ProType  = SimONProductType.GIR;
                }

                #endregion
            }
            else if (item is WCONINJH.Item)
            {
                WCONINJH.Item nIt = item as WCONINJH.Item;

                #region - 转换历史数据 -

                NAME name = histNames.Find(l => l.WellName == nIt.jm0);

                if (name == null)
                {
                    LogProviderHandler.Instance.OnRunLog("当前日期:" + date.DateTime + "井" + nIt.jm0 + "未找到对应的历史信息!");
                    return(well);
                }


                DAYS days = name.Find <DAYS>();

                if (days == null)
                {
                    days = new DAYS("DAYS");
                    name.Add(days);
                }
                DAYS.Item dayitem = new DAYS.Item();
                dayitem.Time0 = date.DateTime;

                if (nIt.zrltlx1 == "WATER")
                {
                    dayitem.Zsl4 = nIt.rzrl3;
                }
                else
                {
                    dayitem.Zql5 = nIt.rzrl3;
                }

                days.Items.Add(dayitem);

                #endregion

                #region - 转换数模数据 -

                well.WellName0 = nIt.jm0;

                if (nIt.zrltlx1 == "WATER")
                {
                    well.Jcyblxz2 = nIt.rzrl3;
                    //well.Jkkz1 = "7";
                    well.ProType = SimONProductType.WIBHP;
                }
                else
                {
                    well.Jcyblxz2 = nIt.rzrl3;
                    //well.Jkkz1 = "8";
                    well.ProType = SimONProductType.GIBHP;
                }

                #endregion
            }

            return(well);
        }
Beispiel #21
0
        /// <summary> 将Eclipse完井数据转换成SimON完井数据 </summary>
        void ConvertCompadat(WELLCTRL well, List <NAME> names, List <BaseKey> basekey, List <WPIMULT> wpimult, List <PERF> compTemps)
        {
            List <BaseKey> compdats = basekey.FindAll(l => l is COMPDAT).ToList();

            //List<WELOPEN> welopen

            if (string.IsNullOrEmpty(well.WellName0) && compdats != null && compdats.Count > 0)
            {
                COMPDAT c = compdats.FirstOrDefault() as COMPDAT;
                well.WellName0 = c.Items.FirstOrDefault().jm0;
            }

            NAME name = names.Find(l => l.WellName == well.WellName0);

            //  添加完井数据
            foreach (BaseKey c in basekey)
            {
                if (c is COMPDAT)
                {
                    COMPDAT com = c as COMPDAT;

                    foreach (COMPDAT.Item citem in com.Items)
                    {
                        if (citem.jm0 != well.WellName0)
                        {
                            continue;
                        }

                        #region - SCh数据 -

                        PERF perf = new PERF("PERF");
                        perf.WellName = well.WellName0;
                        perf.I0       = citem.i1;
                        perf.J1       = citem.j2;
                        perf.K12      = citem.swg3;
                        perf.K23      = citem.xwg4;
                        perf.Kgbs4    = citem.kgbz5;
                        perf.Jzs6     = citem.ljyz7;
                        perf.WjfxX7   = citem.skfx12 == "X" ? "DX" : "0";
                        perf.WjfxY8   = citem.skfx12 == "Y" ? "DY" : "0";
                        perf.WjfxZ9   = citem.skfx12 == "Z" ? "DZ" : "0";
                        perf.Bp10     = citem.bpxs10;

                        // Todo :查找井指数乘子
                        foreach (WPIMULT wp in wpimult)
                        {
                            var v = wp.Items.Find(l => l.jm0 == well.WellName0);

                            if (v != null)
                            {
                                perf.Jzscz5 = v.jzscz1;
                                break;
                            }
                        }


                        // Todo :增加前先删除存在的重复数据
                        well.DeleteAll <PERF>(l => l.I0 == perf.I0 && l.J1 == perf.J1 && l.K12 == perf.K12);

                        well.Add(perf);

                        #endregion

                        #region - WELL数据 -

                        NAME.Item nameItem = new NAME.Item();
                        nameItem.i0    = citem.i1;
                        nameItem.j1    = citem.j2;
                        nameItem.k12   = citem.swg3;
                        nameItem.k23   = citem.xwg4;
                        nameItem.kgbz4 = citem.kgbz5;
                        //nameItem.wi5 = "NA";// v.Value.skin.Value.Value.ToString();
                        //nameItem.dx6 = v.Value.wellIndex.Value.GetValue(v.Value.wellIndex.GetUnitValue(_ecl)).ToString();
                        //nameItem.dy7 = v.Value.wellDirection.Value.Value == "X" ? "0" : v.Value.wellDirection.Value.Value == "Y" ? "1" : "2";
                        nameItem.bpxs9 = citem.bpxs10;
                        nameItem.jj10  = (citem.jtnj8.ToDouble() / 2).ToString();
                        name.Items.Add(nameItem);
                        #endregion


                        // Todo :将当前时间点下 WELOPEN前增加到数据中
                        compTemps.Add(perf);
                    }
                }
                else if (c is WELOPEN)
                {
                    WELOPEN wp = c as WELOPEN;
                    if (wp.Items == null || wp.Items.Count == 0)
                    {
                        continue;
                    }
                    var vs = wp.Items.FindAll(l => l.jm0 == well.WellName0 || l.jm0 == KeyConfiger.EclipseDefalt);
                    if (vs == null || vs.Count == 0)
                    {
                        continue;
                    }
                    WELOPEN.Item v = vs.Last();
                    if (v == null)
                    {
                        continue;
                    }

                    // WELOPEN
                    //'G13' 'SHUT' 0 0 0 2 * /
                    // /

                    // Todo :查找之前所有完井
                    var coms = compTemps.FindAll(l => l.WellName == well.WellName0);

                    Predicate <PERF> match = l => true;

                    // Todo :0 或 *表示默认值全都取
                    if (v.i2 != KeyConfiger.EclipseDefalt && v.i2 != "0")
                    {
                        match += l => l.I0 == v.i2;
                    }

                    if (v.j3 != KeyConfiger.EclipseDefalt && v.j3 != "0")
                    {
                        match += l => l.J1 == v.j3;
                    }

                    if (v.k4 != KeyConfiger.EclipseDefalt && v.k4 != "0")
                    {
                        match += l => l.K12 == v.k4;
                    }

                    var findComs = coms.FindAll(match);

                    // Todo :增加WELOPEN控制的完井
                    foreach (var item in findComs)
                    {
                        PERF perf = item.Copy();
                        perf.Kgbs4 = v.jz1;
                        // Todo :增加前先删除存在的重复数据
                        well.DeleteAll <PERF>(l => l.I0 == item.I0 && l.J1 == item.J1 && l.K12 == item.K12);
                        well.Add(perf);
                    }
                }
            }
        }
Beispiel #22
0
 Temp.Temp TranslateExpr(NAME expr)
 {
     Temp.Temp result = new Temp.Temp();
     InstrList.Add(new MoveLabel(result, new Label(expr.Label)));
     return result;
 }
Beispiel #23
0
        /// <summary> 将Eclipse生产数据转换成SimON生产数据 </summary>
        public SCHEDULE ConvertToSimON(SCHEDULE sch, WELL location, DateTime startTime, BaseFile history)
        {
            // Todo :保存SCH

            SCHEDULE schedule = new SCHEDULE("SCHEDULE");

            List <string> wellNames = new List <string>();

            List <WELSPECS> ws = sch.FindAll <WELSPECS>();

            // Todo :查找所有井名
            ws.ForEach(l => wellNames.AddRange(l.Items.Select(k => k.jm0)));

            List <NAME> histNames = new List <NAME>();

            // Todo :初始化名称 生产_historyproduction.dat
            wellNames.ForEach(l => histNames.Add(new NAME("NAME")
            {
                WellName = l
            }));

            histNames.ForEach(l => history.Key.Add(l));


            // Todo :初始化完井WELL数据
            List <NAME> names = new List <NAME>();

            wellNames.ForEach(l => names.Add(new NAME("NAME")
            {
                WellName = l
            }));

            names.ForEach(l => location.Add(l));

            List <DATES> ds = sch.FindAll <DATES>();

            string format = "井名:{0} ({1},{2})";

            // Todo :添加起始信息到时间步
            DATES start = new DATES("DATES", startTime);

            sch.DeleteAll <DATES>();

            start.AddRange <BaseKey>(sch.Keys);

            ds.Insert(0, start);

            List <PERF> comAllTemp = new List <PERF>();

            foreach (DATES d in ds)
            {
                // Todo :对缓存中完井井名去重复取最后一条
                var distincts = comAllTemp.GroupBy(l => l.WellName + l.I0 + l.J1 + l.K12).ToList();
                comAllTemp.Clear();
                foreach (var item in distincts)
                {
                    comAllTemp.Add(item.Last());
                }

                //  创建SimON日期
                TIME time = new TIME("TIME");
                time.Date = d.DateTime;
                schedule.Add(time);

                var wconprod = d.FindAll <WCONPROD>();
                var wconhist = d.FindAll <WCONHIST>();
                var wconinje = d.FindAll <WCONINJE>();
                var wconinjh = d.FindAll <WCONINJH>();

                //  完井数据(考虑到排序)
                List <BaseKey> compdats = d.FindAll <BaseKey>(l => l is COMPDAT || l is WELOPEN);

                List <WPIMULT> wpimult = d.FindAll <WPIMULT>();

                List <WELOPEN> welopen = d.FindAll <WELOPEN>();

                #region - 添加没有生产信息的完井 -
                //  添加完井数据
                foreach (BaseKey c in compdats)
                {
                    if (c is COMPDAT)
                    {
                        COMPDAT com = c as COMPDAT;

                        foreach (COMPDAT.Item citem in com.Items)
                        {
                            // Todo :过滤有生产数据的,用后面方法处理
                            if (wconprod.Exists(l => l.Items.Exists(k => k.jm0 == citem.jm0)))
                            {
                                continue;
                            }
                            if (wconhist.Exists(l => l.Items.Exists(k => k.wellName0 == citem.jm0)))
                            {
                                continue;
                            }
                            if (wconinje.Exists(l => l.Items.Exists(k => k.jm0 == citem.jm0)))
                            {
                                continue;
                            }
                            if (wconinjh.Exists(l => l.Items.Exists(k => k.jm0 == citem.jm0)))
                            {
                                continue;
                            }

                            WELLCTRL well = time.Find <WELLCTRL>(l => l.WellName0 == citem.jm0);

                            if (well == null)
                            {
                                // Todo :创建一个空的生产信息
                                well           = new WELLCTRL("WELLCTRL");
                                well.ProType   = SimONProductType.NA;
                                well.WellName0 = citem.jm0;
                                time.Add(well);
                            }

                            NAME name = names.Find(l => l.WellName == well.WellName0);

                            #region - SCh数据 -

                            PERF perf = new PERF("PERF");
                            perf.WellName = well.WellName0;
                            perf.I0       = citem.i1;
                            perf.J1       = citem.j2;
                            perf.K12      = citem.swg3;
                            perf.K23      = citem.xwg4;
                            perf.Kgbs4    = citem.kgbz5;
                            perf.Jzs6     = citem.ljyz7;
                            perf.WjfxX7   = citem.skfx12 == "X" ? "DX" : "0";
                            perf.WjfxY8   = citem.skfx12 == "Y" ? "DY" : "0";
                            perf.WjfxZ9   = citem.skfx12 == "Z" ? "DZ" : "0";
                            perf.Bp10     = citem.bpxs10;

                            // Todo :查找井指数乘子
                            foreach (WPIMULT wp in wpimult)
                            {
                                var v = wp.Items.Find(l => l.jm0 == well.WellName0);

                                if (v != null)
                                {
                                    perf.Jzscz5 = v.jzscz1;
                                    break;
                                }
                            }

                            // Todo :增加前先删除存在的重复数据
                            well.DeleteAll <PERF>(l => l.I0 == perf.I0 && l.J1 == perf.J1 && l.K12 == perf.K12);
                            well.Add(perf);

                            #endregion

                            #region - WELL数据 -

                            NAME.Item nameItem = new NAME.Item();
                            nameItem.i0    = citem.i1;
                            nameItem.j1    = citem.j2;
                            nameItem.k12   = citem.swg3;
                            nameItem.k23   = citem.xwg4;
                            nameItem.kgbz4 = citem.kgbz5;
                            //nameItem.wi5 = "NA";// v.Value.skin.Value.Value.ToString();
                            //nameItem.dx6 = v.Value.wellIndex.Value.GetValue(v.Value.wellIndex.GetUnitValue(_ecl)).ToString();
                            //nameItem.dy7 = v.Value.wellDirection.Value.Value == "X" ? "0" : v.Value.wellDirection.Value.Value == "Y" ? "1" : "2";
                            nameItem.bpxs9 = citem.bpxs10;
                            nameItem.jj10  = (citem.jtnj8.ToDouble() / 2).ToString();
                            name.Items.Add(nameItem);
                            #endregion

                            comAllTemp.Add(perf);
                        }
                    }
                    else if (c is WELOPEN)
                    {
                        WELOPEN wp = c as WELOPEN;

                        foreach (var v in wp.Items)
                        {
                            // Todo :过滤有生产数据的,用后面方法处理
                            if (wconprod.Exists(l => l.Items.Exists(k => k.jm0 == v.jm0)))
                            {
                                continue;
                            }
                            if (wconhist.Exists(l => l.Items.Exists(k => k.wellName0 == v.jm0)))
                            {
                                continue;
                            }
                            if (wconinje.Exists(l => l.Items.Exists(k => k.jm0 == v.jm0)))
                            {
                                continue;
                            }
                            if (wconinjh.Exists(l => l.Items.Exists(k => k.jm0 == v.jm0)))
                            {
                                continue;
                            }
                            // WELOPEN
                            //'G13' 'SHUT' 0 0 0 2 * /
                            // /

                            // Todo :查找之前所有完井
                            var coms = comAllTemp.FindAll(l => l.WellName == v.jm0);

                            Predicate <PERF> match = l => true;

                            // Todo :0 或 *表示默认值全都取
                            if (v.i2 != KeyConfiger.EclipseDefalt && v.i2 != "0")
                            {
                                match += l => l.I0 == v.i2;
                            }

                            if (v.j3 != KeyConfiger.EclipseDefalt && v.j3 != "0")
                            {
                                match += l => l.J1 == v.j3;
                            }

                            if (v.k4 != KeyConfiger.EclipseDefalt && v.k4 != "0")
                            {
                                match += l => l.K12 == v.k4;
                            }

                            var findComs = coms.FindAll(match);

                            WELLCTRL well = time.Find <WELLCTRL>(l => l.WellName0 == v.jm0);
                            if (well == null)
                            {
                                // Todo :创建一个空的生产信息
                                well           = new WELLCTRL("WELLCTRL");
                                well.ProType   = SimONProductType.NA;
                                well.WellName0 = v.jm0;
                                time.Add(well);
                            }

                            // Todo :增加WELOPEN控制的完井
                            foreach (var fitem in findComs)
                            {
                                PERF perf = fitem.Copy();
                                perf.Kgbs4 = v.jz1;
                                // Todo :增加前先删除存在的重复数据
                                well.DeleteAll <PERF>(l => l.I0 == fitem.I0 && l.J1 == fitem.J1 && l.K12 == fitem.K12);
                                well.Add(perf);
                            }
                        }
                    }

                    //this.ConvertCompadat(well, names, compdats, wpimult, comAllTemp);
                }

                #endregion


                foreach (var item in wconprod)
                {
                    foreach (WCONPROD.ItemHY it in item.Items)
                    {
                        //  生产数据
                        WELLCTRL well = new WELLCTRL("WELLCTRL");

                        well.WellName0 = it.jm0;

                        well = this.ConvertToSimON(it, d, histNames);

                        if (well != null)
                        {
                            this.ConvertCompadat(well, names, compdats, wpimult, comAllTemp);

                            time.Add(well);
                        }
                    }
                }


                foreach (var item in wconhist)
                {
                    foreach (WCONHIST.Item it in item.Items)
                    {
                        //  生产数据
                        WELLCTRL well = new WELLCTRL("WELLCTRL");

                        well.WellName0 = it.wellName0;

                        well = this.ConvertToSimON(it, d, histNames);

                        this.ConvertCompadat(well, names, compdats, wpimult, comAllTemp);

                        time.Add(well);
                    }
                }


                foreach (var item in wconinje)
                {
                    foreach (WCONINJE.ItemHY it in item.Items)
                    {
                        //  生产数据
                        WELLCTRL well = new WELLCTRL("WELLCTRL");

                        well.WellName0 = it.jm0;

                        well = this.ConvertToSimON(it, d, histNames);

                        this.ConvertCompadat(well, names, compdats, wpimult, comAllTemp);

                        time.Add(well);
                    }
                }

                foreach (var item in wconinjh)
                {
                    foreach (WCONINJH.Item it in item.Items)
                    {
                        //  生产数据
                        WELLCTRL well = new WELLCTRL("WELLCTRL");

                        well.WellName0 = it.jm0;

                        well = this.ConvertToSimON(it, d, histNames);

                        this.ConvertCompadat(well, names, compdats, wpimult, comAllTemp);

                        time.Add(well);
                    }
                }

                //// Todo :将之前的完井信息都加入到缓存中
                //foreach (var item in compdats)
                //{
                //    comAllTemp.AddRange(item.Items);
                //}
            }

            return(schedule);
        }
Beispiel #24
0
        }                                               //manually

        ///<summary>Int value doesnt matter, ex `.ToString(1);`</summary>
        public override string ToString()
        {
            return(string.Format("new PokemonData({0} {1} {2} {3} {4} {5} {6} {7} {8} {9} " +
                                 "{10} {11} {12} {13} {14} {15} {16} {17} {18} {19} " +
                                 "{20} {21} {22} {23} {24} {25} {26} {27} {28} {29} " +
                                 "{30} {31}),",
                                 NAME == null ? ""                   : "\nId: Pokemons." + System.Text.RegularExpressions.Regex.Replace(NAME.ToUpper().Replace('-', '_'), @"[\.']", ""),
                                 RegionalDex == null ? ""            : ",\n//regionalDex: new int[]{" + RegionalDex + "}",
                                 Type1 == null || Type1 == "NONE" ? "" : ",\ntype1: Types." + Type1,
                                 Type2 == null || Type2 == "NONE" ? "" : ",\ntype2: Types." + Type2,
                                 Ability1 == null || Ability1 == "NONE" ? "" : ",\nability1: Abilities." + Ability1,
                                 Ability2 == null || Ability2 == "NONE" ? "" : ",\nability2: Abilities." + Ability2,
                                 HiddenAbility == null || HiddenAbility == "NONE" ? "" : ",\nhiddenAbility: Abilities." + HiddenAbility,
                                 MaleRatio == null ? ""              : ",\nmaleRatio: " + MaleRatio,
                                 CatchRate == null ? ""              : ",\ncatchRate: " + CatchRate,
                                 EggGroup1 == null || EggGroup1 == "NONE" ? "" : ",\neggGroup1: EggGroups." + EggGroup1,
                                 EggGroup2 == null || EggGroup2 == "NONE" ? "" : ",\neggGroup2: EggGroups." + EggGroup2,
                                 HatchTime == null ? ""              : ",\nhatchTime: " + HatchTime,
                                 Height == null ? ""                 : ",\nheight: " + Height,
                                 Weight == null ? ""                 : ",\nweight: " + Weight,
                                 LevelingRate == null ? ""           : ",\nlevelingRate: LevelingRate." + LevelingRate,//\n" +
                                 PokedexColor == null ? ""           : ",\npokedexColor: Color." + PokedexColor,
                                 BaseFriendship == null ? ""         : ",\nbaseFriendship: " + BaseFriendship,
                                 EXPYield == null ? ""               : ",\nbaseExpYield: " + EXPYield,
                                 BSHP == null ? ""                   : ",\nbaseStatsHP: " + BSHP,
                                 BSATK == null ? ""                  : ",baseStatsATK: " + BSATK,
                                 BSDEF == null ? ""                  : ",baseStatsDEF: " + BSDEF,
                                 BSSPA == null ? ""                  : ",baseStatsSPA: " + BSSPA,
                                 BSSPD == null ? ""                  : ",baseStatsSPD: " + BSSPD,
                                 BSSPE == null ? ""                  : ",baseStatsSPE: " + BSSPE,//\n" +
                                 EYHP == null || EYHP == "0" ? ""    : ",\nevHP: " + EYHP,
                                 EYATK == null || EYATK == "0" ? ""  : ",\nevATK: " + EYATK,
                                 EYDEF == null || EYDEF == "0" ? ""  : ",\nevDEF: " + EYDEF,
                                 EYSPA == null || EYSPA == "0" ? ""  : ",\nevSPA: " + EYSPA,
                                 EYSPD == null || EYSPD == "0" ? ""  : ",\nevSPD: " + EYSPD,
                                 EYSPE == null || EYSPE == "0" ? ""  : ",\nevSPE: " + EYSPE, //\n" +
                                                                                             //NAME == null? "" : "$"luminance: "+Luminance,\n" +
                                 ",\nmovesetmoves: new PokemonMoveset[] " +
                                                                                             //$"\n" +
                                 "{\n" +
                                                                                             //trimend goes on last value, but there's also a comma before every value so it's fine
                                                                                             //it balances out the extra, and also if the value is null, you're not left with additional
                                                                                             //or dangling commas to trigger any errors.
                                 Moves.Replace("'", "").TrimEnd(',') + "\n" +
                                 "}",
                                 //$"\n" +
                                 PokemonEvolution == null ? "" : ",\nevolution: new IPokemonEvolution[] {" + PokemonEvolution.TrimEnd(',') + "\n}"
                                 //,HeldItem == null? "" : "heldItem: "+HeldItem +","
                                 ));
        }
Beispiel #25
0
 public BrowserDriver(NAME driver)
 {
     bDriver = driver;
 }
Beispiel #26
0
 void PrintExp(NAME e, int d)
 {
     Indent(d); Say("NAME "); Say(e.Label.ToString());
 }
Beispiel #27
0
        public static async Task <bool> SetInputI(NAME name)
        {
            bool result第一調整点 = false;
            bool result第二調整点 = false;

            string Data第一調整点 = "";
            string Data第二調整点 = "";

            string Data第一調整点再 = "";
            string Data第二調整点再 = "";

            State.VmTestStatus.TestLog += $" {name.ToString()} 調整";

            //ローカルの定義■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
            string GetData(string command)
            {
                General.ClearCommlog();
                Target.SendData(command);

                while (true)//取り込んだ通信データが規定行数(サンプリング数)になるまで待つ
                {
                    if (Flags.ClickStopButton)
                    {
                        return(null);
                    }
                    if (General.CountNewline() == 2)
                    {
                        break;
                    }
                }
                Target.Escape();
                Sleep(1000);
                var log        = State.VmComm.RX;
                int FoundIndex = log.IndexOf(command + ",");
                int 改行位置       = log.IndexOf("\r\n", FoundIndex);
                var 取り出し1行     = log.Substring(FoundIndex, 改行位置 - FoundIndex);
                var dataList   = 取り出し1行.Split(',');

                return(dataList[2].Substring(1));//一文字目がスペースなので削除
            };

            List <string> GetData再(string command)
            {
                General.ClearCommlog();
                Target.SendData(command);

                while (true)//取り込んだ通信データが規定行数(サンプリング数)になるまで待つ
                {
                    if (Flags.ClickStopButton)
                    {
                        return(null);
                    }
                    if (General.CountNewline() == 2)
                    {
                        break;
                    }
                }
                Target.Escape();
                Sleep(1000);
                var log        = State.VmComm.RX;
                int FoundIndex = log.IndexOf(command + ",");
                int 改行位置       = log.IndexOf("\r\n", FoundIndex);
                var 取り出し1行     = log.Substring(FoundIndex, 改行位置 - FoundIndex);
                var dataList   = 取り出し1行.Split(',');

                return(new List <string>()
                {
                    dataList[1].Substring(1), dataList[2].Substring(1)
                });                                                                               //一文字目がスペースなので削除
            };
            //■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

            try
            {
                return(await Task <bool> .Run(() =>
                {
                    SetSourc(name);
                    Sleep(1000);

                    string command = "";
                    switch (name)
                    {
                    case NAME.I_1:
                        //MessageBox.Show("CN2にシグナルソース(電流端子)を接続してください");
                        command = "I1";
                        break;

                    case NAME.I_2:
                        //MessageBox.Show("CN4にシグナルソース(電流端子)を接続してください");
                        command = "I2";
                        break;

                    case NAME.I_3:
                        //MessageBox.Show("CN6にシグナルソース(電流端子)を接続してください");
                        command = "I3";
                        break;

                    case NAME.I_4:
                        //MessageBox.Show("CN8にシグナルソース(電流端子)を接続してください");
                        command = "I4";
                        break;
                    }
                    Sleep(500);

                    //電源ONする処理
                    General.PowerSupply(true);
                    if (!General.CheckDemo表示())
                    {
                        return false;
                    }

                    HIOKI7012.OutDcI(0.000);
                    Sleep(2000);
                    Data第一調整点 = GetData(command + "1");
                    if (Data第一調整点 == null)
                    {
                        return false;
                    }
                    Sleep(500);

                    HIOKI7012.OutDcI(20.000);
                    Sleep(2000);
                    Data第二調整点 = GetData(command + "2");
                    if (Data第二調整点 == null)
                    {
                        return false;
                    }
                    Sleep(500);
                    HIOKI7012.StopSource();

                    General.PowerSupply(false);
                    Sleep(1000);

                    //電源ONする処理
                    General.PowerSupply(true);
                    if (!General.CheckDemo表示())
                    {
                        return false;
                    }

                    var ListData再 = GetData再("@" + command + "*");
                    if (ListData再 == null)
                    {
                        return false;
                    }

                    Data第一調整点再 = ListData再[0];
                    Data第二調整点再 = ListData再[1];

                    result第一調整点 = Data第一調整点 == Data第一調整点再;
                    result第二調整点 = Data第二調整点 == Data第二調整点再;

                    return result第一調整点 && result第二調整点;
                }));
            }
            catch
            {
                return(false);
            }
            finally
            {
                State.VmTestStatus.TestLog += result第一調整点 && result第二調整点? "---PASS\r\n" :"---FAIL\r\n";
                HIOKI7012.StopSource();
                General.PowerSupply(false);

                switch (name)
                {
                case NAME.I_1:
                    State.VmTestResults.I1_1      = Data第一調整点 + "h";
                    State.VmTestResults.I1_2      = Data第二調整点 + "h";
                    State.VmTestResults.I1_1RE    = Data第一調整点再 + "h";
                    State.VmTestResults.I1_2RE    = Data第二調整点再 + "h";
                    State.VmTestResults.ColI1_1   = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI1_2   = result第二調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI1_1RE = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI1_2RE = result第二調整点 ? OffBrush : NgBrush;
                    break;

                case NAME.I_2:
                    State.VmTestResults.I2_1      = Data第一調整点 + "h";
                    State.VmTestResults.I2_2      = Data第二調整点 + "h";
                    State.VmTestResults.I2_1RE    = Data第一調整点再 + "h";
                    State.VmTestResults.I2_2RE    = Data第二調整点再 + "h";
                    State.VmTestResults.ColI2_1   = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI2_2   = result第二調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI2_1RE = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI2_2RE = result第二調整点 ? OffBrush : NgBrush;
                    break;

                case NAME.I_3:
                    State.VmTestResults.I3_1      = Data第一調整点 + "h";
                    State.VmTestResults.I3_2      = Data第二調整点 + "h";
                    State.VmTestResults.I3_1RE    = Data第一調整点再 + "h";
                    State.VmTestResults.I3_2RE    = Data第二調整点再 + "h";
                    State.VmTestResults.ColI3_1   = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI3_2   = result第二調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI3_1RE = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI3_2RE = result第二調整点 ? OffBrush : NgBrush;
                    break;

                case NAME.I_4:
                    State.VmTestResults.I4_1      = Data第一調整点 + "h";
                    State.VmTestResults.I4_2      = Data第二調整点 + "h";
                    State.VmTestResults.I4_1RE    = Data第一調整点再 + "h";
                    State.VmTestResults.I4_2RE    = Data第二調整点再 + "h";
                    State.VmTestResults.ColI4_1   = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI4_2   = result第二調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI4_1RE = result第一調整点 ? OffBrush : NgBrush;
                    State.VmTestResults.ColI4_2RE = result第二調整点 ? OffBrush : NgBrush;
                    break;
                }
            }
        }
Beispiel #28
0
 Temp.Temp TranslateExpr(NAME expr)
 {
     Temp.Temp result = new Temp.Temp();
     InstrList.Add(new MoveLabel(result, new Label(expr.Label)));
     return(result);
 }
 LOG ON (NAME = FinanceManager_Log, 
 FILENAME = '{AppDomain.CurrentDomain.BaseDirectory}\FinanceManager_Log.ldf', 
Beispiel #30
0
 LOG ON 
( NAME = N'UserInfor_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\UserInfor_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
Beispiel #31
0
        private void OpenXmlPTP(Stream stream)
        {
            XDocument xDoc = XDocument.Load(stream, LoadOptions.PreserveWhitespace);

            XElement MSG1Doc = xDoc.Element("MSG1");

            foreach (var NAME in MSG1Doc.Element("CharacterNames").Elements())
            {
                int    Index         = Convert.ToInt32(NAME.Attribute("Index").Value);
                string OldNameSource = NAME.Element("OldNameSource").Value;
                string NewName       = NAME.Element("NewName").Value;

                Names.Add(new PTPName(Index, OldNameSource, NewName));
            }

            foreach (var Message in MSG1Doc.Element("MSG").Elements())
            {
                int    Index = Convert.ToInt32(Message.Attribute("Index").Value);
                int    Type  = Message.Element("Type").Value == "MSG" ? 0 : 1;
                string Name  = Message.Element("Name").Value;
                int    CharacterNameIndex = Convert.ToInt32(Message.Element("CharacterNameIndex").Value);

                PTPMSG temp = new PTPMSG(Index, Type, Name, CharacterNameIndex);
                Msg.Add(temp);

                foreach (var Strings in Message.Element("MessageStrings").Elements())
                {
                    int    StringIndex = Convert.ToInt32(Strings.Attribute("Index").Value);
                    string NewString   = Strings.Element("NewString").Value;

                    PTPMSGstr temp2 = new PTPMSGstr(StringIndex, NewString)
                    {
                        CharacterIndex = CharacterNameIndex
                    };
                    temp.Strings.Add(temp2);

                    foreach (var Prefix in Strings.Elements("PrefixBytes"))
                    {
                        int    PrefixIndex = Convert.ToInt32(Prefix.Attribute("Index").Value);
                        string PrefixType  = Prefix.Attribute("Type").Value;
                        string PrefixBytes = Prefix.Value;

                        temp2.Prefix.Add(new TextBaseElement(PrefixType == "Text" ? true : false, StringTool.SplitString(PrefixBytes, '-')));
                    }

                    foreach (var Old in Strings.Elements("OldStringBytes"))
                    {
                        int    OldIndex = Convert.ToInt32(Old.Attribute("Index").Value);
                        string OldType  = Old.Attribute("Type").Value;
                        string OldBytes = Old.Value;

                        temp2.OldString.Add(new TextBaseElement(OldType == "Text" ? true : false, StringTool.SplitString(OldBytes, '-')));
                    }

                    foreach (var Postfix in Strings.Elements("PostfixBytes"))
                    {
                        int    PostfixIndex = Convert.ToInt32(Postfix.Attribute("Index").Value);
                        string PostfixType  = Postfix.Attribute("Type").Value;
                        string PostfixBytes = Postfix.Value;

                        temp2.Postfix.Add(new TextBaseElement(PostfixType == "Text" ? true : false, StringTool.SplitString(PostfixBytes, '-')));
                    }
                }
            }
        }
Beispiel #32
0
    // Update is called once per frame
    void Update()
    {
        switch (currentTypingState)
        {
        case TypingState.Idle:     //if it needs to be idle

            break;

        case TypingState.Setup:     //setup the line that needs to be displayed
            //call whatever function that will give us the right line to be displayed
            //call to get the stop index
            //call to get the delete index

            float HAPPINESS = GameObject.Find("GameManager").GetComponent <EmailManager>().HAPPINESS;
            int   WEEK      = GameObject.Find("GameManager").GetComponent <EmailManager>().WEEK;

            if (WEEK != 0)
            {
                currentLine = WeeklyMessages[WEEK];
                if (HAPPINESS <= BadThreshold[WEEK])
                {
                    currentLine += WeeklyHappinessMessages[WEEK];
                }
                else if (HAPPINESS >= GoodThreshold[WEEK])
                {
                    currentLine += WeeklyHappinessMessages[WEEK + 1];
                }
                else
                {
                    currentLine += WeeklyHappinessMessages[WEEK + 2];
                }
                currentLine = currentLine.Replace("NAME", NAME.GetPlayerName());
            }
            else
            {
                currentLine = "Hey there NAME. Let's get to work ok? I need you to make sure I receive emails from work and my family. If you think some are important, tag them as such. Anything you think is not relevant to me, you can just delete. \n Oky Thanks :)";
                currentLine = currentLine.Replace("NAME", NAME.GetPlayerName());
            }

            waitTime = 0.03f;
            setCurrentState(TypingState.Typing);     //move on to typing
            break;

        case TypingState.Typing:     //when the text needs to be displayed letter by letter
            if (currentLetterIndex < currentLine.Length && currentLetterIndex != stopIndex && getStateElapsed() > waitTime)
            {
                UI_Text.text       += currentLine[currentLetterIndex];
                currentLetterIndex += 1;
                waitTime           += 0.03f;
            }
            else if (stopIndex != -1 && currentLetterIndex == stopIndex)
            {
                waitTime = 0.03f;
                setCurrentState(TypingState.Stop);
            }

            break;

        case TypingState.Reset:      //Once dialogue is no longer displayed and needs to be reset
            currentLetterIndex = 0;  //set letter index to 0
            currentLine        = ""; //reset the current line being displayed
            if (UI_Text != null)
            {
                UI_Text.text = "";
            }
            setCurrentState(TypingState.Idle);
            break;

        case TypingState.Stop:     //if there needs to be a pause in the display of the text
            if (getStateElapsed() > 1f)
            {
                setCurrentState(TypingState.Delete);
            }
            break;

        case TypingState.Delete:     //if there needs a part of the current text to be deleted and replaced
            if (currentDeleteCount != deleteIndex)
            {
                UI_Text.text        = UI_Text.text.Substring(0, UI_Text.text.Length - 1);
                currentDeleteCount += 1;
            }
            else
            {
                currentDeleteCount  = 0;
                UI_Text.text       += currentLine[currentLetterIndex];
                currentLetterIndex += 1;
                setCurrentState(TypingState.Typing);
            }
            break;
        }
    }