Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load media on start #94

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Load media on start #94

wants to merge 5 commits into from

Conversation

amjadsaadeh
Copy link
Contributor

Previously loaded media were loaded again by starting the Biotracker in old Biotracker. This behaviour has been ported to new Biotracker.

jutanke and others added 5 commits April 21, 2016 11:28
This is necessary, because on windows the linker will optimize out all unused, unmarked symbols. Only symbols with declspec(dllexport) will survive in the DLL.
And dllexport must only be set when actually building the DLL. When just using the headers, you'll need to leave it out (or use dllimport as an optimization).
@nebw
Copy link
Member

nebw commented Apr 26, 2016

Instead of manually concatenating and splitting a string with all the filenames in the case of an ImageStream you can directly store an std::vector<std::string> in the settings. This is how it was done in the old codebase. The code is simpler and also doesn't break if there's a ";" in a filename.

You can see the old implementation here:
https://maserati.mi.fu-berlin.de/redmine/projects/biotracker/repository/revisions/master/entry/source/gui/BioTracker.cpp#L250
https://maserati.mi.fu-berlin.de/redmine/projects/biotracker/repository/revisions/master/entry/source/gui/BioTracker.cpp#L389

@amjadsaadeh
Copy link
Contributor Author

Trying to read a std::vector<std::string> directly from settings, similar to https://maserati.mi.fu-berlin.de/redmine/projects/biotracker/repository/revisions/master/entry/source/gui/BioTracker.cpp#L389, results in following compiler error:
http://pastebin.com/ZkgHJcPw

Correspoding code:

...
boost::optional<std::vector<std::string>> filenamesStrOpt = m_settings.maybeGetValueOfParam<std::vector<std::string>>
                (PictureParam::PICTURE_FILES);

        if (!filenamesStrOpt) {
            m_settings.setParam<uint8_t>(GuiParam::MEDIA_TYPE, static_cast<uint8_t>(GuiParam::MediaType::NoMedia));
            return;
        }

        std::vector<boost::filesystem::path> filenames;
        for (std::string filenameStr : *filenamesStrOpt) {
            filenames.push_back(boost::filesystem::path(filenameStr));
        }
        try {
            loadPictures(std::move(filenames));
        } catch (file_not_found e) {
            m_settings.setParam<uint8_t>(GuiParam::MEDIA_TYPE, static_cast<uint8_t>(GuiParam::MediaType::NoMedia));
            Q_EMIT notifyGUI(e.what(), MessageType::FAIL);
        }
...

I don't know what this mean, maybe a deserializer is missing.

@walachey
Copy link
Member

Likely obsolete or requiring major rework in the Biotracker3. @hmoenck?
Is that feature still wanted?

@hmoenck
Copy link
Contributor

hmoenck commented Sep 19, 2017

@walachey Yup, the new tree structure is somewhat more complex than the old vector structure. I was striving to serialize these to/from CSV manually. This is only halfway done yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants