Plot Windows Move Realtime

This commit is contained in:
mwalker33 2020-04-12 20:24:56 +10:00
commit 7fa8587dd2
7 changed files with 26 additions and 45 deletions

View file

@ -1,40 +1,7 @@
/*****************************************************************************
* WARNING
*
* THIS CODE IS CREATED FOR EXPERIMENTATION AND EDUCATIONAL USE ONLY.
*
* USAGE OF THIS CODE IN OTHER WAYS MAY INFRINGE UPON THE INTELLECTUAL
* PROPERTY OF OTHER PARTIES, SUCH AS INSIDE SECURE AND HID GLOBAL,
* AND MAY EXPOSE YOU TO AN INFRINGEMENT ACTION FROM THOSE PARTIES.
*
* THIS CODE SHOULD NEVER BE USED TO INFRINGE PATENTS OR INTELLECTUAL PROPERTY RIGHTS.
*
*****************************************************************************
*
* This file is part of loclass. It is a reconstructon of the cipher engine
* used in iClass, and RFID techology.
*
* The implementation is based on the work performed by
* Flavio D. Garcia, Gerhard de Koning Gans, Roel Verdult and
* Milosch Meriac in the paper "Dismantling IClass".
*
* Copyright (C) 2014 Martin Holst Swende
*
* This is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation, or, at your option, any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with loclass. If not, see <http://www.gnu.org/licenses/>.
*
*
****************************************************************************/
//-----------------------------------------------------------------------------
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Preferences Functions
//-----------------------------------------------------------------------------
@ -56,7 +23,8 @@
#include <string.h>
#include "cmdparser.h"
#include <ctype.h>
//#include "proxgui.h"
extern void SetWindowsPosition (void);
static int CmdHelp(const char *Cmd);
// Load all settings into memory (struct)
@ -477,7 +445,7 @@ static int CmdPrefSet (const char *Cmd)
// Need to work out how to change live....
// calling data plot seems to work
//plotwidget->MoveWindows ();
SetWindowsPosition();
showPlotPosState ();
break;
case prefOVERLAY:
@ -500,6 +468,7 @@ static int CmdPrefSet (const char *Cmd)
if (y != -99999) session.window_overlay_ypos = y;
if (h != -99999) session.window_overlay_hsize = h;
if (w != -99999) session.window_overlay_wsize = w;
SetWindowsPosition();
showOverlayPosState ();
// Need to work out how to change live....
break;

View file

@ -1,7 +1,4 @@
//-----------------------------------------------------------------------------
// Copyright (C) 2009 Michael Gernoth <michael at gernoth.net>
// Copyright (C) 2010 iZsh <izsh at fail0verflow.com>
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.

View file

@ -54,6 +54,9 @@ extern "C" void MainGraphics(void) {
gui->MainLoop();
}
extern "C" void SetWindowsPosition (void) {
gui->SetWindowsPosition ();
}
extern "C" void InitGraphics(int argc, char **argv, char *script_cmds_file, char *script_cmd, bool stayInCommandLoop) {
#ifdef Q_WS_X11

View file

@ -24,6 +24,7 @@ void ShowGraphWindow(void);
void HideGraphWindow(void);
void RepaintGraphWindow(void);
void MainGraphics(void);
void SetWindowsPosition (void);
void InitGraphics(int argc, char **argv, char *script_cmds_file, char *script_cmd, bool stayInCommandLoop);
void ExitGraphics(void);
#ifndef MAX_GRAPH_TRACE_LEN

View file

@ -128,7 +128,10 @@ ProxGuiQT::~ProxGuiQT(void) {
plotapp = NULL;
}
}
void ProxGuiQT::SetWindowsPosition (void)
{
plotwidget->SetWindowsPosition ();
}
//--------------------
void ProxWidget::applyOperation() {
//printf("ApplyOperation()");
@ -258,6 +261,13 @@ void ProxWidget::showEvent(QShowEvent *event) {
controlWidget->show();
plot->show();
}
void ProxWidget::SetWindowsPosition(void) {
printf ("Settings windows Pos\n");
if (session.preferences_loaded) {
setGeometry (session.window_plot_xpos,session.window_plot_ypos,session.window_plot_wsize,session.window_plot_hsize);
controlWidget->setGeometry (session.window_overlay_xpos,session.window_overlay_ypos,session.window_overlay_wsize,session.window_overlay_hsize);
}
}
//----------- Plotting

View file

@ -88,6 +88,7 @@ class ProxWidget : public QWidget {
void vchange_askedge(int v);
void vchange_dthr_up(int v);
void vchange_dthr_down(int v);
void SetWindowsPosition(void);
};
class WorkerThread : public QThread {
@ -121,7 +122,7 @@ class ProxGuiQT : public QObject {
void HideGraphWindow(void);
void MainLoop(void);
void Exit(void);
void SetWindowsPosition (void);
private slots:
void _ShowGraphWindow(void);
void _RepaintGraphWindow(void);

View file

@ -914,7 +914,7 @@ int main(int argc, char *argv[]) {
showBanner();
#ifdef USE_PREFERENCE_FILE
// Save settings if not load from settings json file.
// Save settings if not loaded from settings json file.
// Doing this here will ensure other checks and updates are saved to over rule default
// e.g. Linux color use check
if (!session.preferences_loaded) {