Skip to content

Commit

Permalink
file manager
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Nov 20, 2019
1 parent 8fa52ea commit 3e13dff
Show file tree
Hide file tree
Showing 9 changed files with 595 additions and 254 deletions.
710 changes: 475 additions & 235 deletions modular-psu-firmware.eez-project

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/eez/gui/action_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void action_show_sys_settings_encoder() {
}

void action_show_sys_info() {
showPage(PAGE_ID_SYS_INFO);
pushPage(PAGE_ID_SYS_INFO);
}

void action_show_main_help_page() {
Expand Down Expand Up @@ -1128,6 +1128,14 @@ void action_show_recordings_view() {
showPage(PAGE_ID_RECORDINGS_VIEW);
}

void action_show_file_manager() {
showPage(PAGE_ID_FILE_MANAGER);
}

void action_file_select() {
showPage(PAGE_ID_FILE_MANAGER);
}

} // namespace gui
} // namespace eez

Expand Down
5 changes: 5 additions & 0 deletions src/eez/index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <eez/modules/psu/gui/page_ch_settings_protection.h>
#include <eez/modules/psu/gui/page_ch_settings_trigger.h>
#include <eez/modules/psu/gui/page_event_queue.h>
#include <eez/modules/psu/gui/page_file_manager.h>
#include <eez/modules/psu/gui/page_self_test_result.h>
#include <eez/modules/psu/gui/page_sys_settings.h>
#include <eez/modules/psu/gui/page_user_profiles.h>
Expand Down Expand Up @@ -221,6 +222,7 @@ static SysSettingsSerialPage g_SysSettingsSerialPage;
static SysSettingsTrackingPage g_sysSettingsTrackingPage;
static SysSettingsCouplingPage g_sysSettingsCouplingPage;
static UserProfilesPage g_UserProfilesPage;
static FileManagerPage g_FileManagerPage;

Page *getPageFromId(int pageId) {
Page *page = nullptr;
Expand Down Expand Up @@ -304,6 +306,9 @@ Page *getPageFromId(int pageId) {
case PAGE_ID_USER_PROFILE_SETTINGS:
page = &g_UserProfilesPage;
break;
case PAGE_ID_FILE_MANAGER:
page = &g_FileManagerPage;
break;
}

if (page) {
Expand Down
13 changes: 7 additions & 6 deletions src/eez/modules/psu/gui/animations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ static const Rect g_settingsRectTop = { 0, -168, 480, 168 };
static const Rect g_settingsRectLeft = { -480, 0, 480, 240 };
static const Rect g_settingsRectRight = { 480, 0, 480, 240 };

static const Rect g_settingsRectNoChannels = { 0, 0, 480, 240 };

namespace eez {
namespace psu {
Expand Down Expand Up @@ -240,23 +241,23 @@ void animateHideSysSettings() {
animateRects(BUFFER_NEW, i);
}

void animateSettingsSlideLeft() {
void animateSettingsSlideLeft(bool noChannels) {
int i = 0;

g_animRects[i++] = { BUFFER_OLD, g_settingsRect, g_settingsRectLeft, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_NEW, g_settingsRectRight, g_settingsRect, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_OLD, noChannels ? g_settingsRectNoChannels : g_settingsRect, g_settingsRectLeft, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_NEW, g_settingsRectRight, noChannels ? g_settingsRectNoChannels : g_settingsRect, 0, OPACITY_SOLID, POSITION_TOP_LEFT };

g_animRects[i++] = { BUFFER_OLD, g_statusLineRect, g_statusLineRectLeft, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_NEW, g_statusLineRectRight, g_statusLineRect, 0, OPACITY_SOLID, POSITION_TOP_LEFT };

animateRects(BUFFER_NEW, i);
}

void animateSettingsSlideRight() {
void animateSettingsSlideRight(bool noChannels) {
int i = 0;

g_animRects[i++] = { BUFFER_OLD, g_settingsRect, g_settingsRectRight, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_NEW, g_settingsRectLeft, g_settingsRect, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_OLD, noChannels ? g_settingsRectNoChannels : g_settingsRect, g_settingsRectRight, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_NEW, g_settingsRectLeft, noChannels ? g_settingsRectNoChannels : g_settingsRect, 0, OPACITY_SOLID, POSITION_TOP_LEFT };

g_animRects[i++] = { BUFFER_OLD, g_statusLineRect, g_statusLineRectRight, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
g_animRects[i++] = { BUFFER_NEW, g_statusLineRectLeft, g_statusLineRect, 0, OPACITY_SOLID, POSITION_TOP_LEFT };
Expand Down
4 changes: 2 additions & 2 deletions src/eez/modules/psu/gui/animations.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ void animateFromMinViewToMaxView(int maxChannelIndexBefore);
void animateFromMicroViewToMaxView();
void animateShowSysSettings();
void animateHideSysSettings();
void animateSettingsSlideLeft();
void animateSettingsSlideRight();
void animateSettingsSlideLeft(bool noChannels);
void animateSettingsSlideRight(bool noChannels);
void animateSlideUp();
void animateSlideDown();
void animateSlideLeft();
Expand Down
20 changes: 20 additions & 0 deletions src/eez/modules/psu/gui/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4444,6 +4444,26 @@ void data_dlog_value_cursor(data::DataOperationEnum operation, data::Cursor &cur
#endif
}

void data_files(data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) {
#if OPTION_SD_CARD
#endif
}

void data_file_name(data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) {
#if OPTION_SD_CARD
#endif
}

void data_file_size(data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) {
#if OPTION_SD_CARD
#endif
}

void data_file_date(data::DataOperationEnum operation, data::Cursor &cursor, data::Value &value) {
#if OPTION_SD_CARD
#endif
}

} // namespace gui
} // namespace eez

Expand Down
32 changes: 32 additions & 0 deletions src/eez/modules/psu/gui/page_file_manager.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* EEZ Modular Firmware
* Copyright (C) 2015-present, Envox d.o.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/

#if OPTION_DISPLAY

#include <eez/modules/psu/gui/page_file_manager.h>

namespace eez {
namespace psu {
namespace gui {


}
}
} // namespace eez::psu::gui

#endif
34 changes: 34 additions & 0 deletions src/eez/modules/psu/gui/page_file_manager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* EEZ Modular Firmware
* Copyright (C) 2015-present, Envox d.o.o.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include <eez/gui/page.h>
using namespace eez::gui;

namespace eez {
namespace psu {
namespace gui {

class FileManagerPage : public Page {
public:
};

} // namespace gui
} // namespace psu
} // namespace eez
21 changes: 11 additions & 10 deletions src/eez/modules/psu/gui/psu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ bool isSysSettingsSubPage(int pageId) {
pageId == PAGE_ID_SYS_SETTINGS_CAL ||
pageId == PAGE_ID_SYS_SETTINGS_TRIGGER ||
pageId == PAGE_ID_SYS_SETTINGS_DISPLAY ||
pageId == PAGE_ID_SYS_SETTINGS_SOUND;
pageId == PAGE_ID_SYS_SETTINGS_SOUND ||
pageId == PAGE_ID_SYS_INFO;
}

bool isChSettingsSubPage(int pageId) {
Expand Down Expand Up @@ -340,12 +341,12 @@ void PsuAppContext::onPageChanged(int previousPageId, int activePageId) {
animateSlideDown();
} else if (activePageId == PAGE_ID_USER_PROFILES) {
animateSlideDown();
} else if (activePageId == PAGE_ID_SYS_INFO) {
animateSlideDown();
} else if (activePageId == PAGE_ID_SYS_SETTINGS_TRACKING) {
animateSlideDown();
} else if (activePageId == PAGE_ID_RECORDINGS_VIEW) {
animateSlideDown();
} else if (activePageId == PAGE_ID_FILE_MANAGER) {
animateSlideDown();
}
} else if (previousPageId == PAGE_ID_USER_PROFILES) {
if (activePageId == PAGE_ID_USER_PROFILE_0_SETTINGS) {
Expand All @@ -367,10 +368,6 @@ void PsuAppContext::onPageChanged(int previousPageId, int activePageId) {
} else if (activePageId == PAGE_ID_USER_PROFILES) {
animateSlideUp();
}
} else if (previousPageId == PAGE_ID_SYS_INFO) {
if (activePageId == PAGE_ID_MAIN) {
animateSlideUp();
}
} else if (previousPageId == PAGE_ID_SYS_SETTINGS_TRACKING) {
if (activePageId == PAGE_ID_MAIN) {
animateSlideUp();
Expand All @@ -387,21 +384,21 @@ void PsuAppContext::onPageChanged(int previousPageId, int activePageId) {
if (activePageId == PAGE_ID_MAIN) {
animateHideSysSettings();
} else if (isSysSettingsSubPage(activePageId)) {
animateSettingsSlideLeft();
animateSettingsSlideLeft(activePageId == PAGE_ID_SYS_INFO);
}
} else if (previousPageId == PAGE_ID_SYS_SETTINGS_TRIGGER) {
if (activePageId == PAGE_ID_MAIN) {
animateHideSysSettings();
} else if (activePageId == PAGE_ID_CH_SETTINGS_TRIGGER) {
animateSlideUp();
} else if (activePageId == PAGE_ID_SYS_SETTINGS) {
animateSettingsSlideRight();
animateSettingsSlideRight(false);
}
} else if (isSysSettingsSubPage(previousPageId)) {
if (activePageId == PAGE_ID_MAIN) {
animateHideSysSettings();
} else if (activePageId == PAGE_ID_SYS_SETTINGS) {
animateSettingsSlideRight();
animateSettingsSlideRight(previousPageId == PAGE_ID_SYS_INFO);
}
} else if (previousPageId == PAGE_ID_CH_SETTINGS) {
if (activePageId == PAGE_ID_MAIN) {
Expand Down Expand Up @@ -433,6 +430,10 @@ void PsuAppContext::onPageChanged(int previousPageId, int activePageId) {
if (activePageId == PAGE_ID_MAIN) {
animateSlideUp();
}
} else if (previousPageId == PAGE_ID_FILE_MANAGER) {
if (activePageId == PAGE_ID_MAIN) {
animateSlideUp();
}
}
}

Expand Down

0 comments on commit 3e13dff

Please sign in to comment.