|
|
|
|
% Upload Data - Johannes Ziegmann, Johannes.Ziegmann@thi.de
|
|
|
|
|
|
|
|
|
|
restoredefaultpath;
|
|
|
|
|
clear; close all; clc;
|
|
|
|
|
% Additional UPLOAD try Again !!! -> Delete Afterwards !!!
|
|
|
|
|
W_Entry = []; % 110 161
|
|
|
|
|
|
|
|
|
|
fprintf('=============== START UPLOADING ===============\n')
|
|
|
|
|
|
|
|
|
|
folder = 'C:\Users\ziegmann\Desktop\Dissertation\10_Software\getFeatures\FeatureData\';
|
|
|
|
|
matF = dir([folder, '*.mat']);
|
|
|
|
|
|
|
|
|
|
options = weboptions('Timeout', 3000);
|
|
|
|
|
URL = 'https://driver-observer.thi.de/retrieve_arbitrary_sql.php?auth=Qnb7jfeGZM&';
|
|
|
|
|
SQL_var = 'sql=SELECT%20DISTINCT%20`setup_id`%20FROM%20`computeddata`'; %
|
|
|
|
|
data_id = webread([URL SQL_var], options);
|
|
|
|
|
id_str = sprintf('%05d_Features_SetupID.mat,',data_id.setup_id);
|
|
|
|
|
|
|
|
|
|
for i = 1:length(matF)
|
|
|
|
|
if isempty(strfind(id_str,matF(i).name)) || any(str2double(matF(i).name(1:5)) == W_Entry)
|
|
|
|
|
try
|
|
|
|
|
load([matF(i).folder, '\', matF(i).name])
|
|
|
|
|
% if i == 1
|
|
|
|
|
% % Update All - Be careful
|
|
|
|
|
% % - Hierbei werden alle bestehenden Daten in der Tabelle gel<EFBFBD>scht!
|
|
|
|
|
% % recreate_computeddata_table(Tinp)
|
|
|
|
|
% end
|
|
|
|
|
|
|
|
|
|
fprintf('Upload ID: %s (%6.2f%%)\n',matF(i).name(1:5),i/length(matF)*100)
|
|
|
|
|
% Upload DATA ...
|
|
|
|
|
|
|
|
|
|
% Tabellen-Metadaten (Tinp.Properties.UserData)
|
|
|
|
|
% Aktuell ein bisschen Gefriemel wegen duration-Feld. Code muss aktuell bei gr<EFBFBD><EFBFBD>eren <EFBFBD>nderungen angepasst werden.
|
|
|
|
|
upload_computed_data(Tinp)
|
|
|
|
|
% Passiert beim Hochladen mit upload_computed_data automatisch
|
|
|
|
|
|
|
|
|
|
% Spalten-Beschreibungen und Einheiten
|
|
|
|
|
update_descriptions(Tinp)
|
|
|
|
|
% (Wird auf dem Server under /static_uploads/computed-columns.json gespeichert)
|
|
|
|
|
catch
|
|
|
|
|
fprintf('|->XXX ID: %s (%6.2f%%) FAILED !!! XXXXXXXXXXXX\n',matF(i).name(1:5),i/length(matF)*100)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
fprintf(' - > ID: %s (%6.2f%%) already exists in DB\n',matF(i).name(1:5),i/length(matF)*100)
|
|
|
|
|
end
|
|
|
|
|
end
|