Beispiel #1
0
/////////////////////////////////////////
// open catalogue
void CComDlg::on_pushButton_3_clicked()
/////////////////////////////////////////
{
  if (tComets.count() != 0)
  {
    if (msgBoxQuest(this, cSaveQuest) == QMessageBox::Yes)
    {
      comSave(curCometCatName, this);
    }
  }

  deleteTracking(MO_COMET);
  releaseHoldObject(MO_COMET);
  pcMainWnd->removeQuickInfo(MO_COMET);
  g_comAstChanged = true;

  comClear();

  QString name = QFileDialog::getOpenFileName(this, tr("Open a File"),
                                              QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/data/catalogue/comets", "Comets file (*.cdf)");

  if (name.isEmpty())
  {
    fillList();
    updateDlg();
    return;
  }

  comLoad(name);
  fillList();
  updateDlg();
}
Beispiel #2
0
void CCamSettingDlg::OnBnClickedBnCcdParamSave()
{
	// TODO: Add your control notification handler code here
	CameraSaveParameter(m_param_team);

	updateDlg();
}
Beispiel #3
0
CComDlg::CComDlg(QWidget *parent) :
  QDialog(parent),
  ui(new Ui::CComDlg)
{
  cSaveQuest = tr("Save current catalogue to disc?");

  ui->setupUi(this);
  setWindowFlags(((windowFlags() | Qt::CustomizeWindowHint)
                    & ~Qt::WindowCloseButtonHint));

  QStandardItemModel *model = new QStandardItemModel(0, 1, NULL);

  model->setHeaderData(0, Qt::Horizontal, QObject::tr("Name"));
  ui->listView->setModel(model);
  ui->listView->activateWindow();

  fillList();
  updateDlg();

  QShortcut *sh1 = new QShortcut(QKeySequence(Qt::Key_Delete), ui->listView, 0, 0,  Qt::WidgetShortcut);
  connect(sh1, SIGNAL(activated()), this, SLOT(slotDelete()));

  ui->widget->setModel((QSortFilterProxyModel *)ui->listView->model(), 0);
  connect(ui->widget, SIGNAL(sigSetSelection(QModelIndex&)), this, SLOT(slotSelChange(QModelIndex&)));
}
Beispiel #4
0
/////////////////////////////////////////
// edit comet
void CComDlg::on_pushButton_5_clicked()
/////////////////////////////////////////
{
  QStandardItemModel *model = (QStandardItemModel *)ui->listView->model();

  QModelIndexList il = ui->listView->selectionModel()->selectedIndexes();
  if (il.count() == 0)
    return;

  QStandardItem *item = model->itemFromIndex(il.at(0));
  int index = item->row();

  comet_t *a = &tComets[index];

  CComEdit dlg(this, false, a);

  if (dlg.exec() == DL_OK)
  {
    item->setText(a->name);
    if (a->perihelionDate < minJD) minJD = a->perihelionDate;
    if (a->perihelionDate > maxJD) maxJD = a->perihelionDate;
  }

  updateDlg();
}
Beispiel #5
0
void CCamSettingDlg::OnBnClickedRbCcdParamD()
{
	// TODO: Add your control notification handler code here
	CameraReadParameter(PARAMETER_TEAM_D);
	m_param_team=PARAMETER_TEAM_D;
	theApp.m_CCD.m_param_team=PARAMETER_TEAM_D;

	updateDlg();
}
Beispiel #6
0
void CComDlg::on_pushButton_7_clicked()
/////////////////////////////////////////
{
  int type;

  if (tComets.count() != 0)
  {
    AstComDownTypeDlg dlg;

    if (dlg.exec() == DL_CANCEL)
    {
      return;
    }

    type = dlg.m_type;

    if (type == ACDT_REMOVE)
    {
      if (msgBoxQuest(this, cSaveQuest) == QMessageBox::Yes)
      {
        astSave(curCometCatName, this);
      }
      astClear();
    }
  }
  else
  {
    type = ACDT_REMOVE;
  }

  deleteTracking(MO_COMET);
  releaseHoldObject(MO_COMET);
  pcMainWnd->removeQuickInfo(MO_COMET);
  g_comAstChanged = true;

  QList <comet_t> tNew;

  CDownloadMPC *dlg = new CDownloadMPC(this, &tNew);

  if (dlg->exec() == DL_CANCEL)
  {
    delete dlg; // delete dlg before clearing
  }
  else
  {
    delete dlg;
    updateComets(tNew, tComets, type);
  }

  fillList();
  updateDlg();
}
Beispiel #7
0
void CComDlg::slotDelete()
////////////////////////////
{
  QStandardItemModel *model = (QStandardItemModel *)ui->listView->model();

  QModelIndexList il = ui->listView->selectionModel()->selectedIndexes();
  if (il.count() == 0)
    return;

  QStandardItem *item = model->itemFromIndex(il.at(0));
  int index = item->row();

  model->removeRow(il.at(0).row());
  tComets.removeAt(index);
  updateDlg();
}
Beispiel #8
0
/////////////////////////////////////////
// remove all
void CComDlg::on_pushButton_4_clicked()
/////////////////////////////////////////
{
  if (tComets.count() != 0)
  {
    if (msgBoxQuest(this, cSaveQuest) == QMessageBox::Yes)
    {
      comSave(curCometCatName, this);
    }
  }

  deleteTracking(MO_COMET);
  releaseHoldObject(MO_COMET);
  pcMainWnd->removeQuickInfo(MO_COMET);
  g_comAstChanged = true;

  comClear();
  fillList();
  updateDlg();
}
Beispiel #9
0
void MainWindow::downloadUpdates(QString repo, int versionId, bool installOnExit)
{
	QLOG_INFO() << "Downloading updates.";
	// TODO: If the user chooses to update on exit, we should download updates in the
	// background.
	// Doing so is a bit complicated, because we'd have to make sure it finished downloading
	// before actually exiting MultiMC.
	ProgressDialog updateDlg(this);
	DownloadUpdateTask updateTask(repo, versionId, &updateDlg);
	// If the task succeeds, install the updates.
	if (updateDlg.exec(&updateTask))
	{
		UpdateFlags baseFlags = None;
		if(BuildConfig.UPDATER_DRY_RUN)
			baseFlags |= DryRun;
		if (installOnExit)
			MMC->installUpdates(updateTask.updateFilesDir(), baseFlags | OnExit);
		else
			MMC->installUpdates(updateTask.updateFilesDir(), baseFlags | RestartOnFinish);
	}
}
Beispiel #10
0
// CCamSettingDlg message handlers
BOOL CCamSettingDlg::OnInitDialog()
{
	CDialogEx::OnInitDialog();

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	m_hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon

	// TODO: Add extra initialization here
	SetDlgItemText(IDC_ED_PATH2SAVE,theApp.m_CCD.m_path2save.c_str());
	
	//Gamma range (0.20 - 1.50)
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_GAMMA))->SetRange(20,150);
	//contrast range (0 - 255)
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_CONTRAST))->SetRange(0,255);
	//AETARGET range
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_AETARGET))->SetRange(40,180);
	//Exposure Time range
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_EXPOSURETIME))->SetRange(1,1068*10);
	
	//RGAIN
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_RGAIN))->SetRange(0,255);
	//GGAIN
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_GGAIN))->SetRange(0,255);
	//BGAIN
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_BGAIN))->SetRange(0,255);
	//Saturation
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_SATURATION))->SetRange(0,255);
	//exposure gain
	((CSliderCtrl *)GetDlgItem(IDC_SD_CCD_EXPOSUREGAIN))->SetRange(1,0x3ff);

	//
	((CComboBox *)GetDlgItem(IDC_CB_CCD_FRAMESPEED))->AddString(_T("12.5fps"));
	((CComboBox *)GetDlgItem(IDC_CB_CCD_FRAMESPEED))->AddString(_T("6.25fps"));
	((CComboBox *)GetDlgItem(IDC_CB_CCD_FRAMESPEED))->AddString(_T("3.13fps"));
	((CComboBox *)GetDlgItem(IDC_CB_CCD_FRAMESPEED))->AddString(_T("1.56fps"));
	((CComboBox *)GetDlgItem(IDC_CB_CCD_FRAMESPEED))->AddString(_T("0.78fps"));

	BYTE tmp;
	CameraGetCurrentParameterTeam(&tmp);
	m_param_team=(DS_PARAMETER_TEAM)tmp;
	theApp.m_CCD.m_param_team=m_param_team;
	switch (tmp)
	{
		case PARAMETER_TEAM_A:
			CheckDlgButton(IDC_RB_CCD_PARAM_A, BST_CHECKED);
			break;
		case PARAMETER_TEAM_B:
			CheckDlgButton(IDC_RB_CCD_PARAM_B, BST_CHECKED);
			break;
		case PARAMETER_TEAM_C:
			CheckDlgButton(IDC_RB_CCD_PARAM_C, BST_CHECKED);
			break;
		case PARAMETER_TEAM_D:
			CheckDlgButton(IDC_RB_CCD_PARAM_D, BST_CHECKED);
			break;
		default:
			tmp = PARAMETER_TEAM_A;
			CheckDlgButton(IDC_RB_CCD_PARAM_A, BST_CHECKED);
			break;
	}

	updateDlg();
	
	Csettings *settings=Csettings::getInstance();

#ifdef XMLDOM
	settings->get_image_attr_dom(m_path2save,m_image_type);
#else
	settings->get_image_attr(m_path2save,m_image_type);
#endif
	
	SetDlgItemText(IDC_ED_PATH2SAVE,m_path2save.c_str());
	switch(m_image_type)
	{
		case FILE_JPG:
			CheckDlgButton(IDC_RB_CCD_IMAGE_JPG,BST_CHECKED);
				break;
		case FILE_BMP:
			CheckDlgButton(IDC_RB_CCD_IMAGE_BMP,BST_CHECKED);
			break;
		case FILE_RAW:
			CheckDlgButton(IDC_RB_CCD_IMAGE_RAW,BST_CHECKED);
			break;
		default:
			CheckDlgButton(IDC_RB_CCD_IMAGE_JPG,BST_CHECKED);
			break;
	}

	return TRUE;// return TRUE  unless you set the focus to a control
}