Commit 315a9246 authored by Ferdinand Fischer's avatar Ferdinand Fischer
Browse files

Removed inferiourClass quantity.Operator

Removed exportData as property and added a converter for this class
Fixed integration for empty objects.
Fixed name of integrated quantities.
parent e5c16392
classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete < handle & matlab.mixin.Copyable
classdef (InferiorClasses = {?quantity.Symbolic}) Discrete < handle & matlab.mixin.Copyable
properties (SetAccess = protected)
% Discrete evaluation of the continuous quantity
valueDiscrete double;
......@@ -27,10 +27,6 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
% ID of the figure handle in which the handle is plotted
figureID double = 1;
% TODO@ff vermutlich ist es schoener einen converter auf dieses
% Objekt zu schreiben, als es hier als Eigenschaft dran zu haengen.
exportData export.Data;
% Name of this object
name char;
end
......@@ -175,23 +171,6 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
function doNotCopy = get.doNotCopy(obj)
doNotCopy = obj.doNotCopyPropertiesName();
end
function exportData = get.exportData(obj)
if isempty(obj.exportData)
if obj.nargin == 1
obj.exportData = export.dd(...
'M', [obj.grid{:}, obj.valueDiscrete], ...
'header', {'t', 'y1', 'y2'}, ...
'filename', 'plot', ...
'basepath', '.' ... % TODO changed basepath to '.'
);
elseif obj.nargin == 2
obj.exportData = export.ddd();
else
error('Not yet implemented')
end
exportData = obj.exportData;
end
end
function set.gridName(obj, name)
if ~iscell(name)
name = {name};
......@@ -219,9 +198,27 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
valueDiscrete = obj.valueDiscrete;
end
%--------------
% --- casts ---
%--------------
%-------------------
% --- converters ---
%-------------------
function exportData = exportData(obj, varargin)
% make the object names:
if obj.nargin == 1
headers = cell(1, numel(obj) + 1);
headers{1} = obj(1).gridName{1};
for i= 1:numel(obj) %TODO use easier to read headers
headers{i+1} = [obj(i).name '' num2str(i)];
end
exportData = export.dd(...
'M', [obj.grid{:}, obj.valueDiscrete], ...
'header', headers, varargin{:});
elseif obj.nargin == 2
error('Not yet implemented')
else
error('Not yet implemented')
end
end
function d = double(obj)
d = obj.on();
end
......@@ -1640,7 +1637,11 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
% array of strings.
% INT(obj, a, b)
% INT(obj, gridName, a, b)
if isempty(obj)
I = obj.copy();
return
end
intGridName = obj(1).gridName;
[a, b] = obj.getBoundaryValues;
......@@ -1699,6 +1700,7 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
I(kObj).valueDiscrete = J;
I(kObj).gridName = grdName;
I(kObj).grid = newGrid;
I(kObj).name = ['int(' obj(kObj).name ')'];
end
end
......@@ -2117,7 +2119,6 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
cpObj = copyElement@matlab.mixin.Copyable(obj);
% #TODO insert code here if some properties should not be
% copied.
[cpObj.exportData] = deal(export.Data.empty);
end
end % methods (Access = protected)
......@@ -2125,7 +2126,7 @@ classdef (InferiorClasses = {?quantity.Symbolic, ?quantity.Operator}) Discrete
methods ( Static, Access = protected )
function doNotCopy = doNotCopyPropertiesName()
% #DEPRECATED
doNotCopy = {'valueContinuous', 'valueDiscrete', 'exportData', 'derivatives'};
doNotCopy = {'valueContinuous', 'valueDiscrete', 'derivatives'};
end
end % methods ( Static, Access = protected )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment