no message

This commit is contained in:
2024-10-14 12:14:01 +03:00
parent 3a29898d5f
commit 452c4c7268
466 changed files with 1255 additions and 1100 deletions

View File

@@ -0,0 +1,54 @@
package _VisualDVM.Passes.All;
import _VisualDVM.Global;
import _VisualDVM.GlobalData.Compiler.Compiler;
import _VisualDVM.GlobalData.Compiler.CompilerType;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.Machine.MachineType;
import _VisualDVM.GlobalData.User.User;
import Common.Passes.AddObjectPass;
public class AddMachine extends AddObjectPass<Machine> {
public AddMachine() {
super(Machine.class);
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (super.canStart(args)) {
if (target.type.equals(MachineType.Local) && Global.mainModule.getDb().machines.LocalMachineExists()) {
Log.Writeln_("Локальная машина уже добавлена.");
return false;
}
return true;
}
return false;
}
@Override
protected void performDone() throws Exception {
super.performDone();
getDb().Insert(new Compiler(
target,
"gfortran",
CompilerType.gnu,
"gfortran",
"--version",
"--help"
));
getDb().Insert(new Compiler(
target,
"gcc",
CompilerType.gnu,
"gcc",
"--version",
"--help"
));
getDb().Insert(new Compiler(
target,
"g++",
CompilerType.gnu,
"g++",
"--version",
"--help"
));
if (target.type.equals(MachineType.Local))
getDb().Insert(new User(target, "этот пользователь", ""));
}
}