/*------------------------------------------------------------------------- * 角度線を描画する * ---------------------------------------------------------------------------*/ private void draw_angle_line_all(Vector2 pos, LoopXImage image) { // if (!m_lib.setting.draw_myship_angle) { return; } DrawSettingMyShipAngle flag = m_lib.setting.draw_setting_myship_angle; if ((flag & DrawSettingMyShipAngle.draw_1) != 0) { // 測量から // 精度が高いほど不透明で描画される // 精度が低いときはほとんど見えない int alpha = (int)((255f * (m_db.SpeedCalculator.angle_precision * m_db.SpeedCalculator.angle_precision))); draw_angle_line(pos, image, m_db.SpeedCalculator.angle, Color.FromArgb(alpha, 0, 0, 255)); } if ((is_in_the_sea) && ((flag & DrawSettingMyShipAngle.draw_0) != 0)) { // コンパスから Color color = (is_draw_expect_pos)? Color.Tomato: Color.Black; draw_angle_line(pos, image, m_angle, color); // 速度から求めた到達予想位置 if (m_lib.setting.draw_setting_myship_angle_with_speed_pos) { draw_step_position2(pos, image, m_angle, m_db.SpeedCalculator.speed_map); } } }
/*------------------------------------------------------------------------- * 표시항목の保存 * ---------------------------------------------------------------------------*/ private void save_draw_setting() { { DrawSettingWebIcons flag = 0; flag |= (checkBox100.Checked) ? DrawSettingWebIcons.wind : 0; flag |= (checkBox101.Checked) ? DrawSettingWebIcons.accident_0 : 0; flag |= (checkBox102.Checked) ? DrawSettingWebIcons.accident_1 : 0; flag |= (checkBox103.Checked) ? DrawSettingWebIcons.accident_2 : 0; flag |= (checkBox104.Checked) ? DrawSettingWebIcons.accident_3 : 0; flag |= (checkBox105.Checked) ? DrawSettingWebIcons.accident_4 : 0; m_setting.draw_setting_web_icons = flag; } { DrawSettingMemoIcons flag = 0; flag |= (checkBox200.Checked) ? DrawSettingMemoIcons.wind : 0; flag |= (checkBox201.Checked) ? DrawSettingMemoIcons.memo_0 : 0; flag |= (checkBox202.Checked) ? DrawSettingMemoIcons.memo_1 : 0; flag |= (checkBox203.Checked) ? DrawSettingMemoIcons.memo_2 : 0; flag |= (checkBox204.Checked) ? DrawSettingMemoIcons.memo_3 : 0; flag |= (checkBox205.Checked) ? DrawSettingMemoIcons.memo_4 : 0; flag |= (checkBox206.Checked) ? DrawSettingMemoIcons.memo_5 : 0; flag |= (checkBox207.Checked) ? DrawSettingMemoIcons.memo_6 : 0; flag |= (checkBox208.Checked) ? DrawSettingMemoIcons.memo_7 : 0; flag |= (checkBox209.Checked) ? DrawSettingMemoIcons.memo_8 : 0; flag |= (checkBox210.Checked) ? DrawSettingMemoIcons.memo_9 : 0; flag |= (checkBox211.Checked) ? DrawSettingMemoIcons.memo_10 : 0; flag |= (checkBox212.Checked) ? DrawSettingMemoIcons.memo_11 : 0; m_setting.draw_setting_memo_icons = flag; } { DrawSettingAccidents flag = 0; flag |= (checkBox300.Checked) ? DrawSettingAccidents.accident_0 : 0; flag |= (checkBox301.Checked) ? DrawSettingAccidents.accident_1 : 0; flag |= (checkBox302.Checked) ? DrawSettingAccidents.accident_2 : 0; flag |= (checkBox303.Checked) ? DrawSettingAccidents.accident_3 : 0; flag |= (checkBox304.Checked) ? DrawSettingAccidents.accident_4 : 0; flag |= (checkBox305.Checked) ? DrawSettingAccidents.accident_5 : 0; flag |= (checkBox306.Checked) ? DrawSettingAccidents.accident_6 : 0; flag |= (checkBox307.Checked) ? DrawSettingAccidents.accident_7 : 0; flag |= (checkBox308.Checked) ? DrawSettingAccidents.accident_8 : 0; flag |= (checkBox309.Checked) ? DrawSettingAccidents.accident_9 : 0; flag |= (checkBox310.Checked) ? DrawSettingAccidents.accident_10 : 0; m_setting.draw_setting_accidents = flag; } { DrawSettingMyShipAngle flag = 0; flag |= (checkBox400.Checked) ? DrawSettingMyShipAngle.draw_0 : 0; flag |= (checkBox402.Checked) ? DrawSettingMyShipAngle.draw_1 : 0; m_setting.draw_setting_myship_angle = flag; m_setting.draw_setting_myship_angle_with_speed_pos = checkBox401.Checked; m_setting.draw_setting_myship_expect_pos = checkBox403.Checked; } }
/*------------------------------------------------------------------------- * 각도선을 그리기 * ---------------------------------------------------------------------------*/ private void draw_angle_line_all(Vector2 pos, LoopXImage image) { // if (!m_lib.setting.draw_myship_angle) { return; } DrawSettingMyShipAngle flag = m_lib.setting.draw_setting_myship_angle; if (is_in_the_sea && (flag & DrawSettingMyShipAngle.draw_1) != 0) { // 측량으로부터 // 정확도가 높을수록 불투명하게 그리게 함 // 정확도가 낮으면 거의 보이지 않음 int alpha = (int)((95f + 150f * (m_db.SpeedCalculator.angle_precision))); Color color = Color.FromArgb(alpha, 255, 255, 255); draw_angle_line(pos, image, m_db.SpeedCalculator.angle, color, 2.0f); // 속도로부터 구해진 도달예상위치 if (m_lib.setting.draw_setting_myship_angle_with_speed_pos) { draw_step_position2(pos, image, m_db.SpeedCalculator.angle, m_db.SpeedCalculator.speed_map, color); } } if ((is_in_the_sea) && ((flag & DrawSettingMyShipAngle.draw_0) != 0)) { // 나침반으로부터 Color color = (is_draw_expect_pos) ? Color.Tomato : Color.Black; draw_angle_line(pos, image, m_angle, color, 1.25f); // 속도로부터 구해진 도달예상위치 if (m_lib.setting.draw_setting_myship_angle_with_speed_pos) { draw_step_position2(pos, image, m_angle, m_db.SpeedCalculator.speed_map, color); } } }
/*------------------------------------------------------------------------- * 표시항목の初期化 * ---------------------------------------------------------------------------*/ private void init_draw_setting(DrawSettingPage page) { // @Web icons { DrawSettingWebIcons flag = m_setting.draw_setting_web_icons; checkBox100.Checked = (flag & DrawSettingWebIcons.wind) != 0; checkBox101.Checked = (flag & DrawSettingWebIcons.accident_0) != 0; checkBox102.Checked = (flag & DrawSettingWebIcons.accident_1) != 0; checkBox103.Checked = (flag & DrawSettingWebIcons.accident_2) != 0; checkBox104.Checked = (flag & DrawSettingWebIcons.accident_3) != 0; checkBox105.Checked = (flag & DrawSettingWebIcons.accident_4) != 0; } // Memo icons { DrawSettingMemoIcons flag = m_setting.draw_setting_memo_icons; checkBox200.Checked = (flag & DrawSettingMemoIcons.wind) != 0; checkBox201.Checked = (flag & DrawSettingMemoIcons.memo_0) != 0; checkBox202.Checked = (flag & DrawSettingMemoIcons.memo_1) != 0; checkBox203.Checked = (flag & DrawSettingMemoIcons.memo_2) != 0; checkBox204.Checked = (flag & DrawSettingMemoIcons.memo_3) != 0; checkBox205.Checked = (flag & DrawSettingMemoIcons.memo_4) != 0; checkBox206.Checked = (flag & DrawSettingMemoIcons.memo_5) != 0; checkBox207.Checked = (flag & DrawSettingMemoIcons.memo_6) != 0; checkBox208.Checked = (flag & DrawSettingMemoIcons.memo_7) != 0; checkBox209.Checked = (flag & DrawSettingMemoIcons.memo_8) != 0; checkBox210.Checked = (flag & DrawSettingMemoIcons.memo_9) != 0; checkBox211.Checked = (flag & DrawSettingMemoIcons.memo_10) != 0; checkBox212.Checked = (flag & DrawSettingMemoIcons.memo_11) != 0; } // 재해 { DrawSettingAccidents flag = m_setting.draw_setting_accidents; checkBox300.Checked = (flag & DrawSettingAccidents.accident_0) != 0; checkBox301.Checked = (flag & DrawSettingAccidents.accident_1) != 0; checkBox302.Checked = (flag & DrawSettingAccidents.accident_2) != 0; checkBox303.Checked = (flag & DrawSettingAccidents.accident_3) != 0; checkBox304.Checked = (flag & DrawSettingAccidents.accident_4) != 0; checkBox305.Checked = (flag & DrawSettingAccidents.accident_5) != 0; checkBox306.Checked = (flag & DrawSettingAccidents.accident_6) != 0; checkBox307.Checked = (flag & DrawSettingAccidents.accident_7) != 0; checkBox308.Checked = (flag & DrawSettingAccidents.accident_8) != 0; checkBox309.Checked = (flag & DrawSettingAccidents.accident_9) != 0; checkBox310.Checked = (flag & DrawSettingAccidents.accident_10) != 0; } // 예상선 { DrawSettingMyShipAngle flag = m_setting.draw_setting_myship_angle; checkBox400.Checked = (flag & DrawSettingMyShipAngle.draw_0) != 0; checkBox401.Checked = m_setting.draw_setting_myship_angle_with_speed_pos; checkBox402.Checked = (flag & DrawSettingMyShipAngle.draw_1) != 0; checkBox403.Checked = m_setting.draw_setting_myship_expect_pos; } // 표시するページ설정 if ((int)page < 0) { page = DrawSettingPage.WebIcons; } if (page > DrawSettingPage.MyShipAngle) { page = DrawSettingPage.MyShipAngle; } tabControl1.SelectTab((int)page); }