Ejemplo n.º 1
0
        public void UpdateAspectSettingList(AspectSetting[] list)
        {
            aspectSettingList = list;
            int index = aspectSelect.SelectedIndex;


            natallist[0].isDisp = list[index].disp_n_sun;
            natallist[1].isDisp = list[index].disp_n_moon;
            natallist[2].isDisp = list[index].disp_n_mercury;
            natallist[3].isDisp = list[index].disp_n_venus;
            natallist[4].isDisp = list[index].disp_n_mars;
            natallist[5].isDisp = list[index].disp_n_jupiter;
            natallist[6].isDisp = list[index].disp_n_saturn;
            natallist[7].isDisp = list[index].disp_n_uranus;
            natallist[8].isDisp = list[index].disp_n_neptune;
            natallist[9].isDisp = list[index].disp_n_pluto;
            natallist[0].isAspectDisp = list[index].aspect_n_sun;
            natallist[1].isAspectDisp = list[index].aspect_n_moon;
            natallist[2].isAspectDisp = list[index].aspect_n_mercury;
            natallist[3].isAspectDisp = list[index].aspect_n_venus;
            natallist[4].isAspectDisp = list[index].aspect_n_mars;
            natallist[5].isAspectDisp = list[index].aspect_n_jupiter;
            natallist[6].isAspectDisp = list[index].aspect_n_saturn;
            natallist[7].isAspectDisp = list[index].aspect_n_uranus;
            natallist[8].isAspectDisp = list[index].aspect_n_neptune;
            natallist[9].isAspectDisp = list[index].aspect_n_pluto;

            if (progresslist != null)
            {
                progresslist[0].isDisp = list[index].disp_p_sun;
                progresslist[1].isDisp = list[index].disp_p_moon;
                progresslist[2].isDisp = list[index].disp_p_mercury;
                progresslist[3].isDisp = list[index].disp_p_venus;
                progresslist[4].isDisp = list[index].disp_p_mars;
                progresslist[5].isDisp = list[index].disp_p_jupiter;
                progresslist[6].isDisp = list[index].disp_p_saturn;
                progresslist[7].isDisp = list[index].disp_p_uranus;
                progresslist[8].isDisp = list[index].disp_p_neptune;
                progresslist[9].isDisp = list[index].disp_p_pluto;
                progresslist[0].isAspectDisp = list[index].aspect_p_sun;
                progresslist[1].isAspectDisp = list[index].aspect_p_moon;
                progresslist[2].isAspectDisp = list[index].aspect_p_mercury;
                progresslist[3].isAspectDisp = list[index].aspect_p_venus;
                progresslist[4].isAspectDisp = list[index].aspect_p_mars;
                progresslist[5].isAspectDisp = list[index].aspect_p_jupiter;
                progresslist[6].isAspectDisp = list[index].aspect_p_saturn;
                progresslist[7].isAspectDisp = list[index].aspect_p_uranus;
                progresslist[8].isAspectDisp = list[index].aspect_p_neptune;
                progresslist[9].isAspectDisp = list[index].aspect_p_pluto;
            }

            if (transitlist != null)
            {
                transitlist[0].isDisp = list[index].disp_t_sun;
                transitlist[1].isDisp = list[index].disp_t_moon;
                transitlist[2].isDisp = list[index].disp_t_mercury;
                transitlist[3].isDisp = list[index].disp_t_venus;
                transitlist[4].isDisp = list[index].disp_t_mars;
                transitlist[5].isDisp = list[index].disp_t_jupiter;
                transitlist[6].isDisp = list[index].disp_t_saturn;
                transitlist[7].isDisp = list[index].disp_t_uranus;
                transitlist[8].isDisp = list[index].disp_t_neptune;
                transitlist[9].isDisp = list[index].disp_t_pluto;
                transitlist[0].isAspectDisp = list[index].aspect_t_sun;
                transitlist[1].isAspectDisp = list[index].aspect_t_moon;
                transitlist[2].isAspectDisp = list[index].aspect_t_mercury;
                transitlist[3].isAspectDisp = list[index].aspect_t_venus;
                transitlist[4].isAspectDisp = list[index].aspect_t_mars;
                transitlist[5].isAspectDisp = list[index].aspect_t_jupiter;
                transitlist[6].isAspectDisp = list[index].aspect_t_saturn;
                transitlist[7].isAspectDisp = list[index].aspect_t_uranus;
                transitlist[8].isAspectDisp = list[index].aspect_t_neptune;
                transitlist[9].isAspectDisp = list[index].aspect_t_pluto;
            }



            chartRefreshNoCalc();
        }
Ejemplo n.º 2
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            // コンフィグ読み込み
            config = new ConfigData();
            setting = new Settings();
            aspectSettingList = new AspectSetting[10];
            for (int i = 0; i< 9; i++)
            {
                aspectSettingList[i] = new AspectSetting();
            }

            // 表示設定
            for (int i = 0; i < 10; i++)
            {
                if (File.Exists(aspect_filename + i.ToString() + ".xml"))
                {
                    XmlSerializer serializer = new XmlSerializer(typeof(AspectSetting));
                    FileStream fs = new FileStream(aspect_filename + i.ToString() + ".xml", FileMode.Open);
                    aspectSettingList[i] = (AspectSetting)serializer.Deserialize(fs);
                    fs.Close();
                    if (aspectSettingList[i].dispname == null)
                    {
                        aspectSelect.Items.Add("表示設定" + i.ToString());
                    } else
                    {
                        aspectSelect.Items.Add(aspectSettingList[i].dispname);
                    }
                } else
                {
                    aspectSettingList[i] = new AspectSetting() { dispname = "表示設定" + i.ToString() };
                    if (!Directory.Exists(Path.GetDirectoryName(aspect_filename + i.ToString() + ".xml")))
                    {
                        Directory.CreateDirectory(Path.GetDirectoryName(aspect_filename));
                    }
                    XmlSerializer serializer = new XmlSerializer(typeof(AspectSetting));
                    FileStream fs = new FileStream(aspect_filename + i.ToString() + ".xml", FileMode.Create);
                    StreamWriter sw = new StreamWriter(fs);
                    serializer.Serialize(sw, aspectSettingList[i]);
                    sw.Close();
                    fs.Close();

                    aspectSelect.Items.Add("表示設定" + i.ToString());
                }
            }

            string name = "現在";
            int year = DateTime.Now.Year;
            int month = DateTime.Now.Month;
            int day = DateTime.Now.Day;
            int hour = DateTime.Now.Hour;
            int minute = DateTime.Now.Minute;
            int second = DateTime.Now.Second;
            string birth = String.Format("{0}年{1}月{2}日 {3:00}:{4:00}:{5:00}",
                        year.ToString(),
                        month.ToString(),
                        day.ToString(),
                        hour.ToString(),
                        minute.ToString(),
                        second.ToString()
                    );
            string place = "東京都中央区";
            double lat = 35.670587;
            double lng = 139.772003;
            if (!File.Exists(filename))
            {
                // 初期データ
                setMainData(name, birth, place, lat, lng);
                setMainEventData(name, birth, place, lat, lng);
            }
            else
            {
                XmlSerializer serializer = new XmlSerializer(typeof(ConfigData));
                FileStream fs = new FileStream(filename, FileMode.Open);
                config = (ConfigData)serializer.Deserialize(fs);
                fs.Close();

                if (config.lat == 0 || config.lng == 0)
                {
                    // 初期データ
                    setMainData(name, birth, place, lat, lng);
                } else
                {
                    place = config.defaultPlace;
                    lat = config.lat;
                    lng = config.lng;
                    setMainData(name,
                        birth,
                        place,
                        lat,
                        lng);
                }
                setMainEventData(name, birth, place, lat, lng);

            }
            if (config.ephepath == null)
            {
                config.ephepath = System.Windows.Forms.Application.StartupPath + @"\ephe"; ;
            }

            // デフォルトデータ
            setNatalData(year, month, day, hour, minute, second, lat, lng);
            setTransitData(year, month, day, hour, minute, second, lat, lng);
            // 計算
            calc = new AstroCalc(config);

            // 表示(comboBoxのindexChangeで再描画)
            aspectSelect.SelectedIndex = 0;
            aspectSetting = aspectSettingList[0];

        }
Ejemplo n.º 3
0
 private void aspectSelect_SelectedIndexChanged(object sender, EventArgs e)
 {
     aspectSetting = aspectSettingList[((ComboBox)sender).SelectedIndex];
     chartRefresh();
 }
Ejemplo n.º 4
0
 public void ChangeSettingCombo(AspectSetting[] setList)
 {
     aspectSettingList = setList;
     Enumerable.Range(0, 10).ToList().ForEach(index => { aspectSelect.Items[index] = aspectSettingList[index].dispname; });
 }
Ejemplo n.º 5
0
        // 違うリストのアスペクトを計算する
        public List<PlanetData> AspectCalcOther(AspectSetting a_setting, List<PlanetData> fromList, List<PlanetData> toList, int listKind)
        {
            // if (natal-natal)
            for (int i = 0; i < fromList.Count - 1; i++)
            {
                for (int j = 0; j < toList.Count - 1; j++)
                {
                    // 90.0 と 300.0では210度ではなく150度にならなければいけない
                    double aspect_degree = fromList[i].absolute_position - toList[j].absolute_position;

                    if (aspect_degree > 180)
                    {
                        aspect_degree = fromList[j].absolute_position + 360 - toList[i].absolute_position;
                    }
                    if (aspect_degree < 0)
                    {
                        aspect_degree = Math.Abs(aspect_degree);
                    }


                    foreach (AspectKind kind in Enum.GetValues(typeof(AspectKind)))
                    {
                        if (listKind == 1)
                        {
                            // progress
                            if (i == Common.ZODIAC_SUN)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_soft_1st)
                                {
                                    fromList[i].progressAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = toList[j].no });
                                    break;
                                } else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_hard_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_hard_1st)
                                {
                                    fromList[i].progressAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = toList[j].no });
                                    break;
                                }
                            } else if (i == Common.ZODIAC_MOON)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_soft_1st)
                                {
                                    fromList[i].progressAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = toList[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_1st &&
                                  aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_1st)
                                {
                                    fromList[i].progressAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = toList[j].no });
                                    break;
                                }

                            }
                            else
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_soft_1st)
                                {
                                    fromList[i].progressAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = toList[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_hard_1st &&
                                     aspect_degree > getDegree(kind) - a_setting.orb_nn_other_hard_1st)
                                {
                                    fromList[i].progressAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = toList[j].no });
                                    break;
                                }

                            }
                        } else
                        {
                            // transit
                            if (i == Common.ZODIAC_SUN)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_soft_1st)
                                {
                                    fromList[i].transitAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = toList[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_hard_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_hard_1st)
                                {
                                    fromList[i].transitAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = toList[j].no });
                                    break;
                                }
                            }
                            else if (i == Common.ZODIAC_MOON)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_soft_1st)
                                {
                                    fromList[i].transitAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind ,soft_hard  = 2, target_no = toList[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_1st)
                                {
                                    fromList[i].transitAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = toList[j].no });
                                    break;
                                }

                            }
                            else
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_soft_1st)
                                {
                                    fromList[i].transitAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = toList[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_hard_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_hard_1st)
                                {
                                    fromList[i].transitAspects.Add(new Aspect() { target_position = toList[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = toList[j].no });
                                    break;
                                }

                            }
                        }
                    }

                }
            }

            return fromList;
        }
Ejemplo n.º 6
0
        // 同じリストのアスペクトを計算する
        public List<PlanetData> AspectCalcSame(AspectSetting a_setting, List<PlanetData> list)
        {
            // if (natal-natal)
            for (int i = 0; i < list.Count - 2; i++)
            {
                if (!list[i].isAspectDisp)
                {
                    continue;
                }
                for (int j = i + 1; j < list.Count - 1; j++)
                {
                    if (!list[j].isAspectDisp)
                    {
                        continue;
                    }

                    // 90.0 と 300.0では210度ではなく150度にならなければいけない
                    double aspect_degree = list[i].absolute_position - list[j].absolute_position;

                    if (aspect_degree > 180)
                    {
                        aspect_degree = list[j].absolute_position + 360 - list[i].absolute_position;
                    }
                    if (aspect_degree < 0)
                    {
                        aspect_degree = Math.Abs(aspect_degree);
                    }

                    foreach (AspectKind kind in Enum.GetValues(typeof(AspectKind)))
                    {
                        if (i == Common.ZODIAC_SUN)
                        {
                            if (kind == AspectKind.CONJUNCTION ||
                                kind == AspectKind.OPPOSITION ||
                                kind == AspectKind.TRINE ||
                                kind == AspectKind.SQUARE ||
                                kind == AspectKind.SESQUIQUADRATE)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_soft_1st)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_hard_1st &&
                                  aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_hard_1st)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            } else if (kind == AspectKind.INCONJUNCT)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_soft_150 &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_soft_150)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_hard_150 &&
                                  aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_hard_150)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            } else
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_soft_2nd &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_soft_2nd)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_sun_hard_2nd &&
                                  aspect_degree > getDegree(kind) - a_setting.orb_nn_sun_hard_2nd)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            }

                        }
                        else if (i == Common.ZODIAC_MOON)
                        {
                            if (kind == AspectKind.CONJUNCTION ||
                                kind == AspectKind.OPPOSITION ||
                                kind == AspectKind.TRINE ||
                                kind == AspectKind.SQUARE ||
                                kind == AspectKind.SESQUIQUADRATE)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_1st)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_1st)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            } else if (kind == AspectKind.INCONJUNCT)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_150 &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_150)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_150 &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_150)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            } else
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_2nd &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_2nd)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_moon_hard_2nd &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_moon_hard_2nd)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            }

                        }
                        else
                        {
                            if (kind == AspectKind.CONJUNCTION ||
                                kind == AspectKind.OPPOSITION ||
                                kind == AspectKind.TRINE ||
                                kind == AspectKind.SQUARE ||
                                kind == AspectKind.SESQUIQUADRATE)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_soft_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_soft_1st)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_hard_1st &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_hard_1st)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            } else if (kind == AspectKind.INCONJUNCT)
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_soft_150 &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_soft_150)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_hard_150 &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_hard_150)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            } else
                            {
                                if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_soft_2nd &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_soft_2nd)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 2, target_no = list[j].no });
                                    break;
                                }
                                else if (aspect_degree < getDegree(kind) + a_setting.orb_nn_other_hard_2nd &&
                                    aspect_degree > getDegree(kind) - a_setting.orb_nn_other_hard_2nd)
                                {
                                    list[i].aspects.Add(new Aspect() { target_position = list[j].absolute_position, aspect_kind = kind, soft_hard = 1, target_no = list[j].no });
                                    break;
                                }
                            }
                        }
                    }

                }
            }

            return list;
        }
Ejemplo n.º 7
0
 public DisplayForm(MainForm mainform, AspectSetting[] aspectSettingList)
 {
     this.mainform = mainform;
     this.aspectSettingList = aspectSettingList;
     InitializeComponent();
 }