I'm curious of how to proper organise a folder structure for xx
Consider I'm developing a driver class for some DeviceA made by Manufacturer.
I assume, that I will use this DeviceA in several more Projects and I probably will get another one DeviceB, which use the same manufacturer-specific enumerated definitions of something - let`s say the volume levels will be defined as:
classdef enumVolumeLevels < uint8
So I will write some kine of driver class including everything manufacturer-specific either as constants or as enumerations.
So my Folderstructure will look like:
Now if I'm going to write a setter and getter method, which both checks If the provided Value fits to the manufacturer-defined levels
function value = get.Volume(obj)
value = Manufacturer.enumVolumeLevels(50);
Now I'm goind to test my class from the root folder of this project.
... and works fine if I define an object of this class and assign or read the property Volume
test = Manufacturer.DeviceA();
test.Volume = 50;
Following the initial Idea of writing this driver class to use it in several Application specific projects I will include it into root folder of ProjectA, which looks like:
But if I write MyFunc.m as follows:
test = Drivers.Manufacturer.DeviceA();
test.Volume = 50;
... it will fail after the 2nd line because from the setter point of view the enumeration class Manufacturer.enumVolumeLevels is not defined.
So my question is:
--> Is there a solution for organizing my namespace folders to avoid such visibility Problem?
Perhaps I'll need to chanhe the folder structure of my Manufacturer-package or the way I use the enumeration class in my class DeviceA, but I'm completely stuck right now and have no Idea, what should be the best practice in this case,