Compare commits

...

6 Commits

Author SHA1 Message Date
pouya a58c3eb725 . 2 years ago
pouya 2bfc32174a . 2 years ago
pouya 62d3623265 + 2 years ago
pouya 8a8dfbc9b5 + 2 years ago
pouya 024bb3f499 + working on json 2 years ago
pouya 787e5661de + 2 years ago
  1. 1
      logic/include/viewModel/BaseViewModel.h
  2. 16
      logic/include/viewModel/image/ImageViewModel.h
  3. 28
      logic/include/viewModel/markerMode/MarkerModeViewModel.h
  4. 11
      logic/include/viewModel/utils/UsJson.h
  5. 5
      logic/logic.pro
  6. 2
      logic/src/viewModel/image/ImageViewModel.cpp
  7. 27
      logic/src/viewModel/markerMode/MarkerModeViewModel.cpp
  8. 2
      ui

1
logic/include/viewModel/BaseViewModel.h

@ -16,6 +16,7 @@
#include "viewModel/utils/UsList.h"
#include "viewModel/utils/UsImage.h"
#include "viewModel/utils/UsButtonDoubleText.h"
#include "viewModel/utils/UsJson.h"
#define SINGLETON(NAME) \

16
logic/include/viewModel/image/ImageViewModel.h

@ -77,16 +77,22 @@ private:
US_PROPERTY_VIEW_ONLY(bool, cModeEnable, true)
public:
ColorImageProvider* imageProviderB;
ColorImageProvider* imageProviderM;
ColorImageProvider* imageProviderAnnot;
//for single image to QML
ColorImageProvider* imageProviderPictures;
// ##1 we use this for bodyMoark
// make new class that has inherited from QQuickImageProvider instead
// of imageProvider, send images regard to the name
ColorImageProvider* imageProvider;
US_SONO_IMAGE_MONITOR_RESOLUTION(SonoImage)
US_MOUSE (mouse)
US_NOTIF(mousePressed)
US_NOTIF(mouseRealeased)
// US_SONO_IMAGE_MONITOR_RESOLUTION(SonoImage)
// US_MOUSE (mouse)
// US_NOTIF(mousePressed)
// US_NOTIF(mouseRealeased)
US_PROPERTY (int, widthOfScene, 100)
US_PROPERTY (int, heightOfScene, 100)

28
logic/include/viewModel/markerMode/MarkerModeViewModel.h

@ -9,15 +9,39 @@ class MarkerModeViewModel : public BaseViewModel
US_VIEW_MODEL(MarkerModeViewModel)
SINGLETON(MarkerModeViewModel)
US_PROPERTY_VIEW_ONLY(bool, isMarkerModeActive, true)
//=======JoySticks=======
US_JOYSTICK_NUMBER(BodyMarkAngle, "Angle", "", "", true, true, 0)
US_JOYSTICK_NUMBER(BodyMark, "BodyMark", "", "", true, true, 0)
US_JOYSTICK_NUMBER(JoystickBodyMark, "BodyMark", "", "", true, true, 0)
US_JOYSTICK_NUMBER(PointerAngle, "Angle", "", "", true, true, 0)
US_JOYSTICK_NUMBER(IndicatorSize, "Indicator Size", "", "", true, true, 0)
US_JOYSTICK_PUSH (PointerDeleteLast,"Delete Last",true,true,0)
US_JOYSTICK_PUSH (PointerDeleteAll,"Delete All",true,true,0)
US_SPIN_BOX (Page,"Page",QList<QString>({"Low", "Norm", "High"}),"@","#",true,true,1)
US_JOYSTICK_NUMBER(TextSize, "Text Size", "", "", true, true, 0)
US_JOYSTICK_PUSH (DeleteGrab,"Delete Grab",true,true,0)
US_JOYSTICK_NUMBER(GrabWord, "Grab Word", "", "", true, true, 0)
US_JOYSTICK_PUSH (DeleteLast,"Delete Last",true,true,0)
US_JOYSTICK_PUSH (DeleteAll,"Delete All",true,true,0)
//=======JoySticks=======
US_JSON(BodyMark,"","")
US_JSON(BodyPart,"","")
US_PROPERTY (int,PointerState,0)
US_PROPERTY (int,PointerStyle,0)
US_PROPERTY (bool,Close,false)
US_PROPERTY (bool,CloseAndSave,false)
US_PROPERTY (bool,AorB,false)
US_PROPERTY (bool,Layers,false)
US_PROPERTY (bool,Visible,false)
};
#endif

11
logic/include/viewModel/utils/UsJson.h

@ -0,0 +1,11 @@
#ifndef USJSON_H
#define USJSON_H
#include "AutoProperty.h"
#define US_JSON(NAME, \
JSON, \
VALUE) \
US_PROPERTY(QString, NAME, VALUE) \
US_PROPERTY(QString, NAME ## Json, JSON)
#endif // USJSON_H

5
logic/logic.pro

@ -9,9 +9,10 @@ TARGET = logic
DEFINES += QT_DEPRECATED_WARNINGS \
QT_QPA_EGLFS_HIDECURSOR
SOURCES += $$files(src/*.cpp, true) \
SOURCES += $$files(src/*.cpp, true)
HEADERS += $$files(include/*.h, true)
HEADERS += $$files(include/*.h, true) \
include/viewModel/utils/UsJson.h
RESOURCES += \
logic.qrc

2
logic/src/viewModel/image/ImageViewModel.cpp

@ -14,11 +14,13 @@ ImageViewModel::ImageViewModel()
imageProviderAnnot = new ColorImageProvider();
imageProvider = new ColorImageProvider();
imageProviderPictures = new ColorImageProvider();
//================= for testing imageProviderSingleFromCPP ================
QPixmap pixMap(200,200);
pixMap.fill (Qt::red);
imageProvider->setPic (pixMap,100,100);
imageProviderPictures->setPic (pixMap,100,100);
//=========================================================================
_activeImageB = _image1;

27
logic/src/viewModel/markerMode/MarkerModeViewModel.cpp

@ -1,6 +1,10 @@
#include <QJsonArray>
#include <QJsonObject>
#include <QJsonDocument>
#include <QDebug>
#include "viewModel/markerMode/MarkerModeViewModel.h"
#include "viewModel/UsmMimic.h"
SINGLETON_DEF(MarkerModeViewModel)
@ -10,6 +14,27 @@ MarkerModeViewModel::MarkerModeViewModel()
}
void MarkerModeViewModel::init()
{
//==================BodyMark================
QJsonObject mainObj;
QJsonArray jsonArrayLeg = {"foot1","foot2","foot3"};
mainObj.insert ("Leg",jsonArrayLeg);
QJsonArray jsonArrayHand = {"Hand1","Hand2","Hand3","Hand4"};
mainObj.insert ("Hand",jsonArrayHand);
QJsonDocument jsonDoc;
jsonDoc.setObject (mainObj);
QString answer = jsonDoc.toJson();
BodyMarkJson (answer);
//==============BodyParts=====================
BodyPartJson (answer);
//================================
// connect (this,&MarkerModeViewModel::BodyMarkChanged,[=](){
// qDebug() << this->BodyMark() << "k";
// });
// qDebug() << "Hi";
}
void MarkerModeViewModel::setInitialValue()
{

2
ui

@ -1 +1 @@
Subproject commit d0bf556c101384b62f4d595d03043cad148eb1d7
Subproject commit 0ba107bf0ee447a564aec019c7053075f060f5a0
Loading…
Cancel
Save