WICHTIG: Der Betrieb von goMatlab.de wird privat finanziert fortgesetzt. - Mehr Infos...

Mein MATLAB Forum - goMatlab.de

Mein MATLAB Forum

 
Gast > Registrieren       Autologin?   

Partner:




Forum
      Option
[Erweitert]
  • Diese Seite per Mail weiterempfehlen
     


Gehe zu:  
Neues Thema eröffnen Neue Antwort erstellen

GUI Deployment auf targethardware

 

julianhr
Forum-Anfänger

Forum-Anfänger


Beiträge: 11
Anmeldedatum: 21.04.22
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 29.04.2022, 14:14     Titel: GUI Deployment auf targethardware
  Antworten mit Zitat      
Hallo zusammen,

ich habe testweise eine total simple GUI mit blinkender Lampe gebaut. Darum geht es aber garnicht direkt.
Ich möchte die Appdesigner Datei auf eine Targethardware (Raspberry Pi) deploy'n. Leider sagt man mir den Fehler, dass app1 (name der appdesingerdatei) nicht für deployment zur verfügung steht.

Ich komme nicht weiter. Gibt es denn garkeine Möglichkeit eine grafische Oberfläche auf eine Hardware zu spielen, sodass Matlab dort standalone läuft??

Sonstige Rechenoperationen und Funktionen kann ich erfolgreich auf die HArdware deploy'n. Alles getestet und ich bin auch relativ fit was das Ganze angeht.

Alle Toolboxen die ich benötige sind vorhanden.
Private Nachricht senden Benutzer-Profile anzeigen


Harald
Forum-Meister

Forum-Meister


Beiträge: 24.448
Anmeldedatum: 26.03.09
Wohnort: Nähe München
Version: ab 2017b
     Beitrag Verfasst am: 29.04.2022, 20:05     Titel:
  Antworten mit Zitat      
Hallo,

wie gehst du beim Deployment vor?
Bitte die Fehlermeldung im Original kopieren, nicht übersetzen.

Damit MATLAB irgendwo läuft, musst du entweder MATLAB selbst oder zumindest die MATLAB Runtime installieren. Die Frage ist wie im letzten Thread gesagt, ob dafür die Systemanforderungen erfüllt sind.
Die Alternative ist Code-Generierung. So hast du vermutlich die "sonstige Rechenoperationen und Funktionen" deploy-ed? Da habe ich wiederum Zweifel, ob diese Vorgehensweise Apps unterstützt.

Ich weiß nicht, ob sich hier im Forum jemand finden wird, der sich mit der Kombination Raspberry Pi und GUIs / Apps auskennt. Eine Alternative kann sein, beim Technischen Support von MathWorks nachzufragen.

Grüße,
Harald
_________________

1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
Private Nachricht senden Benutzer-Profile anzeigen
 
julianhr
Themenstarter

Forum-Anfänger

Forum-Anfänger


Beiträge: 11
Anmeldedatum: 21.04.22
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 02.05.2022, 09:51     Titel:
  Antworten mit Zitat      
folgende funktion habe ich deployn wollen:
Code:

function testappdesignerdeployment
%UNTITLED2 Summary of this function goes here
%   Detailed explanation goes here
thisapp = app1;
pause(2);
thisapp.externalblinkstart();
end
 


welche die folgende app1 enthält (GUI aus Appdesigner):
Code:

classdef app1 < matlab.apps.AppBase

    % Properties that correspond to app components
    properties (Access = public)
        UIFigure              matlab.ui.Figure
        GridLayout            matlab.ui.container.GridLayout
        LeftPanel             matlab.ui.container.Panel
        StopButton            matlab.ui.control.Button
        WaittimesSlider       matlab.ui.control.Slider
        WaittimesSliderLabel  matlab.ui.control.Label
        StartButton           matlab.ui.control.Button
        OffButton             matlab.ui.control.Button
        OnButton              matlab.ui.control.Button
        RightPanel            matlab.ui.container.Panel
        Lamp                  matlab.ui.control.Lamp
        LampLabel             matlab.ui.control.Label
    end

    % Properties that correspond to apps with auto-reflow
    properties (Access = private)
        onePanelWidth = 576;
    end

   
    properties (Access = private)
        runloop; % Description
        blinkspeed = 0.5;
    end
   
    methods (Access = public)
       
        function runblink(app)
            while(app.runloop)
                app.Lamp.Enable = 'on';
                pause(app.blinkspeed);
                app.Lamp.Enable = 'off';
                pause(app.blinkspeed);
            end
        end
       
        function externalblinkstart(app)
            app.WaittimesSlider.Value = app.blinkspeed;
            app.runloop = true;
            app.runblink();
        end
    end

    % Callbacks that handle component events
    methods (Access = private)

        % Button pushed function: OnButton
        function OnButtonPushed(app, event)
            app.Lamp.Enable = 'on';
        end

        % Button pushed function: OffButton
        function OffButtonPushed(app, event)
            app.Lamp.Enable = 'off';
        end

        % Button pushed function: StartButton
        function StartButtonPushed(app, event)
            app.WaittimesSlider.Value = app.blinkspeed;
            app.runloop = true;
            app.runblink();
        end

        % Button pushed function: StopButton
        function StopButtonPushed(app, event)
            app.runloop = false;
        end

        % Value changing function: WaittimesSlider
        function WaittimesSliderValueChanging(app, event)
            changingValue = event.Value;
            app.blinkspeed = changingValue;
        end

        % Changes arrangement of the app based on UIFigure width
        function updateAppLayout(app, event)
            currentFigureWidth = app.UIFigure.Position(3);
            if(currentFigureWidth <= app.onePanelWidth)
                % Change to a 2x1 grid
                app.GridLayout.RowHeight = {480, 480};
                app.GridLayout.ColumnWidth = {'1x'};
                app.RightPanel.Layout.Row = 2;
                app.RightPanel.Layout.Column = 1;
            else
                % Change to a 1x2 grid
                app.GridLayout.RowHeight = {'1x'};
                app.GridLayout.ColumnWidth = {357, '1x'};
                app.RightPanel.Layout.Row = 1;
                app.RightPanel.Layout.Column = 2;
            end
        end
    end

    % Component initialization
    methods (Access = private)

        % Create UIFigure and components
        function createComponents(app)

            % Create UIFigure and hide until all components are created
            app.UIFigure = uifigure('Visible', 'off');
            app.UIFigure.AutoResizeChildren = 'off';
            app.UIFigure.Position = [100 100 579 480];
            app.UIFigure.Name = 'MATLAB App';
            app.UIFigure.SizeChangedFcn = createCallbackFcn(app, @updateAppLayout, true);

            % Create GridLayout
            app.GridLayout = uigridlayout(app.UIFigure);
            app.GridLayout.ColumnWidth = {357, '1x'};
            app.GridLayout.RowHeight = {'1x'};
            app.GridLayout.ColumnSpacing = 0;
            app.GridLayout.RowSpacing = 0;
            app.GridLayout.Padding = [0 0 0 0];
            app.GridLayout.Scrollable = 'on';

            % Create LeftPanel
            app.LeftPanel = uipanel(app.GridLayout);
            app.LeftPanel.Layout.Row = 1;
            app.LeftPanel.Layout.Column = 1;

            % Create OnButton
            app.OnButton = uibutton(app.LeftPanel, 'push');
            app.OnButton.ButtonPushedFcn = createCallbackFcn(app, @OnButtonPushed, true);
            app.OnButton.Position = [131 360 100 22];
            app.OnButton.Text = 'On';

            % Create OffButton
            app.OffButton = uibutton(app.LeftPanel, 'push');
            app.OffButton.ButtonPushedFcn = createCallbackFcn(app, @OffButtonPushed, true);
            app.OffButton.Position = [131 293 100 22];
            app.OffButton.Text = 'Off';

            % Create StartButton
            app.StartButton = uibutton(app.LeftPanel, 'push');
            app.StartButton.ButtonPushedFcn = createCallbackFcn(app, @StartButtonPushed, true);
            app.StartButton.Position = [130 116 100 22];
            app.StartButton.Text = 'Start';

            % Create WaittimesSliderLabel
            app.WaittimesSliderLabel = uilabel(app.LeftPanel);
            app.WaittimesSliderLabel.HorizontalAlignment = 'right';
            app.WaittimesSliderLabel.Position = [60 49 69 22];
            app.WaittimesSliderLabel.Text = 'Waittime (s)';

            % Create WaittimesSlider
            app.WaittimesSlider = uislider(app.LeftPanel);
            app.WaittimesSlider.Limits = [0.01 1];
            app.WaittimesSlider.ValueChangingFcn = createCallbackFcn(app, @WaittimesSliderValueChanging, true);
            app.WaittimesSlider.Position = [150 68 164 3];
            app.WaittimesSlider.Value = 1;

            % Create StopButton
            app.StopButton = uibutton(app.LeftPanel, 'push');
            app.StopButton.ButtonPushedFcn = createCallbackFcn(app, @StopButtonPushed, true);
            app.StopButton.Position = [291 116 50 22];
            app.StopButton.Text = 'Stop';

            % Create RightPanel
            app.RightPanel = uipanel(app.GridLayout);
            app.RightPanel.Layout.Row = 1;
            app.RightPanel.Layout.Column = 2;

            % Create LampLabel
            app.LampLabel = uilabel(app.RightPanel);
            app.LampLabel.HorizontalAlignment = 'right';
            app.LampLabel.Position = [76 229 36 22];
            app.LampLabel.Text = 'Lamp';

            % Create Lamp
            app.Lamp = uilamp(app.RightPanel);
            app.Lamp.Position = [127 229 20 20];

            % Show the figure after all components are created
            app.UIFigure.Visible = 'on';
        end
    end

    % App creation and deletion
    methods (Access = public)

        % Construct app
        function app = app1

            % Create UIFigure and components
            createComponents(app)

            % Register the app with App Designer
            registerApp(app, app.UIFigure)

            if nargout == 0
                clear app
            end
        end

        % Code that executes before app deletion
        function delete(app)

            % Delete UIFigure when app is deleted
            delete(app.UIFigure)
        end
    end
end
 


Die App funktioniert einwandfrei auf dem Computer.

Beim Deployn mit folgender Funktion entsteht folgende Fehlermeldung:
Code:

function deployFunctionToPi(functionToDeploy)
%UNTITLED3 Summary of this function goes here
%   Detailed explanation goes here
board = targetHardware('Raspberry Pi');
deploy(board,functionToDeploy);
end
 

Code:

Function 'app1' is not supported for code generation. Consider adding coder.extrinsic('app1') at the top of the function to bypass code generation.
 
Private Nachricht senden Benutzer-Profile anzeigen
 
Harald
Forum-Meister

Forum-Meister


Beiträge: 24.448
Anmeldedatum: 26.03.09
Wohnort: Nähe München
Version: ab 2017b
     Beitrag Verfasst am: 02.05.2022, 10:46     Titel:
  Antworten mit Zitat      
Hallo,

aus Apps kann anscheinend kein Code generiert werden.
Eine Installation von MATLAB oder MATLAB Runtime wird wohl an den Systemanforderungen scheitern.

Wenn es "nur" darum geht, das auf den Touch Screen zu bekommen, wäre eine Möglichkeit vielleicht noch eine Web App. Dazu bräuchtest du aber immer noch einen PC, der mit der Hardware verbunden ist und als Server fungiert. Ich habe auch keine Ahnung, ob es für den Touch Screen Web Browser gibt und ob diese Web Browser wiederum kompatibel mit Web Apps sind.

Mein Vorschlag wäre an der Stelle wirklich, beim Technischen Support von MathWorks nachzufragen.

Grüße,
Harald
_________________

1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
Private Nachricht senden Benutzer-Profile anzeigen
 
julianhr
Themenstarter

Forum-Anfänger

Forum-Anfänger


Beiträge: 11
Anmeldedatum: 21.04.22
Wohnort: ---
Version: ---
     Beitrag Verfasst am: 02.05.2022, 14:47     Titel:
  Antworten mit Zitat      
Hallo Harald,

vielen Dank für deine zuverlässigen und schnellen Antworten.

Wenn ich mir die Systemanforderungen von Matlab unter Linux ansehe, sollte das eigentlich kein Problem sein, da der Raspberry Pi in der mir vorliegenden neusten Version 64-bit Systeme unterstützt.

Mal sehen wo ich mit meinem Projekt hinkommen werde.
Private Nachricht senden Benutzer-Profile anzeigen
 
Harald
Forum-Meister

Forum-Meister


Beiträge: 24.448
Anmeldedatum: 26.03.09
Wohnort: Nähe München
Version: ab 2017b
     Beitrag Verfasst am: 02.05.2022, 14:58     Titel:
  Antworten mit Zitat      
Hallo,

die Bedenken habe ich dabei, dass als Prozessor Intel oder AMD angegeben wird. Aber klar: man kann sicher einfach mal versuchen, das zu installieren, und schauen, was passiert.

Grüße,
Harald
_________________

1.) Ask MATLAB Documentation
2.) Search gomatlab.de, google.de or MATLAB Answers
3.) Ask Technical Support of MathWorks
4.) Go mad, your problem is unsolvable ;)
Private Nachricht senden Benutzer-Profile anzeigen
 
Neues Thema eröffnen Neue Antwort erstellen



Einstellungen und Berechtigungen
Beiträge der letzten Zeit anzeigen:

Du kannst Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.
Du kannst Dateien in diesem Forum posten
Du kannst Dateien in diesem Forum herunterladen
.





 Impressum  | Nutzungsbedingungen  | Datenschutz | FAQ | goMatlab RSS Button RSS

Hosted by:


Copyright © 2007 - 2024 goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks

MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.