Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved some things around to better organize an model API package.
- Loading branch information
Showing
10 changed files
with
188 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/com/willwinder/universalgcodesender/connection/ConnectionFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
Copywrite 2015 Will Winder | ||
This file is part of Universal Gcode Sender (UGS). | ||
UGS is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
UGS is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with UGS. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.willwinder.universalgcodesender.connection; | ||
|
||
/** | ||
* | ||
* @author wwinder | ||
*/ | ||
public class ConnectionFactory { | ||
static public Connection getConnectionFor(String address, int baud) { | ||
return new JSSCConnection(); | ||
|
||
/* | ||
if (JSSCConnection.supports(address, baud)) { | ||
return new JSSCConnection(); | ||
} | ||
return null; | ||
*/ | ||
} | ||
} |
16 changes: 0 additions & 16 deletions
16
src/com/willwinder/universalgcodesender/listeners/ControlStateListener.java
This file was deleted.
Oops, something went wrong.
29 changes: 27 additions & 2 deletions
29
...r/universalgcodesender/MainWindowAPI.java → ...niversalgcodesender/model/BackendAPI.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/com/willwinder/universalgcodesender/model/BackendAPIReadOnly.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/** | ||
* Read only API used by front ends to interface with the model. | ||
*/ | ||
|
||
/* | ||
Copywrite 2015 Will Winder | ||
This file is part of Universal Gcode Sender (UGS). | ||
UGS is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
UGS is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with UGS. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.willwinder.universalgcodesender.model; | ||
|
||
import com.willwinder.universalgcodesender.Settings; | ||
import com.willwinder.universalgcodesender.Utils; | ||
import com.willwinder.universalgcodesender.pendantui.SystemStateBean; | ||
import java.io.File; | ||
|
||
/** | ||
* | ||
* @author wwinder | ||
*/ | ||
public interface BackendAPIReadOnly { | ||
// Config options | ||
public File getFile(); | ||
|
||
// Controller status | ||
public boolean isConnected(); | ||
public boolean isSending(); | ||
public boolean isPaused(); | ||
public boolean canPause(); | ||
public boolean canCancel(); | ||
public boolean canSend(); | ||
public Utils.ControlState getControlState(); | ||
|
||
// Send status | ||
public long getNumRows(); | ||
public long getNumSentRows(); | ||
public long getNumRemainingRows(); | ||
|
||
public long getSendDuration(); | ||
public long getSendRemainingDuration(); | ||
public String getPauseResumeText(); | ||
|
||
// Bulk status getter. | ||
public void updateSystemState(SystemStateBean systemStateBean); | ||
|
||
// Shouldn't be needed often. | ||
public Settings getSettings(); | ||
} |
29 changes: 29 additions & 0 deletions
29
src/com/willwinder/universalgcodesender/model/ControlStateListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Copywrite 2015 Will Winder | ||
This file is part of Universal Gcode Sender (UGS). | ||
UGS is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
UGS is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with UGS. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package com.willwinder.universalgcodesender.model; | ||
|
||
import com.willwinder.universalgcodesender.Utils.ControlState; | ||
|
||
/** | ||
* | ||
* @author wwinder | ||
*/ | ||
public interface ControlStateListener { | ||
public void ControlStateChanged(ControlState newState); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters